/**
 * Single Apartment Styles - Using CSS Variables from front.css
 */

/* Styles for single apartment page */
.apb-single-apartment {
    margin-bottom: var(--apb-spacing-xxl);
}

/* Hero Section - Custom Variables */
:root {
    --apb-hero-height-desktop: 40vh; /* 40% of viewport height */
    --apb-hero-height-mobile: 30vh;  /* 30% of viewport height on mobile */
}

.apb-apartment-header {
    background-size: cover;
    background-position: center;
    background-color: var(--apb-gray-100);
    height: var(--apb-hero-height-desktop);
    min-height: 300px; /* Minimum height to ensure content visibility */
    margin-bottom: var(--apb-spacing-xl);
    position: relative;
    display: flex;
    align-items: center; /* Vertically center the content */
}

.apb-apartment-header:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
}

.apb-apartment-header .container {
    position: relative;
    z-index: 1;
    color: var(--apb-white);
    width: 100%;
    max-width: var(--apb-max-width-container);
    margin: 0 auto;
    padding: 0 var(--apb-spacing-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.apb-apartment-title {
    margin: 0 auto;
    font-size: calc(var(--apb-font-size-xxlarge) * 1.5); /* Increased font size */
    color: var(--apb-white) !important;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    font-weight: var(--apb-font-weight-bold);
    text-align: center;
    max-width: 800px;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.apb-price {
    font-size: var(--apb-font-size-xlarge);
    margin-top: var(--apb-spacing-sm);
    font-weight: bold;
}

.apb-apartment-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--apb-spacing-xl);
}

.apb-main-content {
    grid-column: 1;
}

.apb-booking-sidebar {
    grid-column: 2;
}

/* Property Type info */
.apb-property-info {
    margin-bottom: var(--apb-spacing-lg);
    padding: var(--apb-spacing-md);
    background-color: var(--apb-primary-light);
    border-radius: var(--apb-border-radius-md);
}

.apb-property-type {
    display: flex;
    align-items: center;
}

.apb-property-type-label {
    font-weight: 600;
    margin-right: var(--apb-spacing-xs);
}

.apb-property-type-value {
    background-color: var(--apb-primary);
    color: var(--apb-white);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: var(--apb-font-size-small);
}

/* Gallery styles */
.apb-gallery {
    margin-bottom: var(--apb-spacing-lg);
    grid-column: 1 / -1;
}

.apb-gallery-main {
    margin-bottom: var(--apb-spacing-sm);
    border-radius: var(--apb-border-radius-md);
    overflow: hidden;
}

.apb-main-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.apb-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--apb-spacing-sm);
}

.apb-gallery-thumb {
    cursor: pointer;
    border-radius: var(--apb-border-radius-sm);
    overflow: hidden;
    height: var(--apb-gallery-thumb-height);
}

.apb-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--apb-transition-speed) var(--apb-transition-easing);
}

.apb-gallery-thumb img:hover {
    opacity: 0.8;
}

/* Amenity icons */
.apb-amenities-highlight {
    margin-bottom: var(--apb-spacing-lg);
}

.apb-amenity-icons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apb-spacing-xs);
    margin-top: var(--apb-spacing-xs);
}

.apb-amenity-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
}

.apb-amenity-icon-item img {
    width: var(--apb-icon-size-md);
    height: var(--apb-icon-size-md);
    margin-bottom: var(--apb-spacing-xs);
    object-fit: contain;
}

.apb-amenity-icon-label {
    font-size: var(--apb-font-size-small);
    color: var(--apb-gray-700);
}

/* Amenities list */
.apb-amenities {
    margin-bottom: var(--apb-spacing-lg);
}

.apb-amenities h3, .apb-description > h3:first-child {
    border-bottom: 1px solid var(--apb-gray-300);
    padding-bottom: var(--apb-spacing-sm);
    margin-bottom: var(--apb-spacing-lg);
    font-size: var(--apb-font-size-xlarge);
    font-weight: var(--apb-font-weight-bold);
}

.apb-amenities-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apb-spacing-sm);
}

.apb-amenity {
    display: flex;
    align-items: center;
    gap: var(--apb-spacing-xs);
    margin-right: var(--apb-spacing-md);
    margin-bottom: var(--apb-spacing-sm);
}

.apb-amenity-small-icon {
    width: var(--apb-icon-size-sm);
    height: var(--apb-icon-size-sm);
    object-fit: contain;
}

/* Booking widget */
.apb-booking-widget, .apb-calendar-widget, .apb-additional-fees, .apb-booking-summary {
    background-color: transparent;
    margin-bottom: var(--apb-spacing-lg);
    padding: 0;
}

.apb-fee-item {
    display: flex;
    justify-content: space-between;
    margin: 0 0 8px 0;
    padding: 0;
}

/* Booking Summary Styles */
.apb-summary-details {
    margin-top: 0;
}

.apb-summary-row {
    display: flex;
    justify-content: space-between;
    margin: 0 0 8px 0;
    padding: 0;
    border-bottom: none;
}

.apb-summary-divider {
    margin: var(--apb-spacing-sm) 0;
    border-top: none;
}

.apb-summary-total {
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin: 0;
    border-top: none;
    font-weight: var(--apb-font-weight-bold);
    font-size: var(--apb-font-size-large);
}

/* Button styling moved to global button system in front.css */
.apb-book-now-btn {
    display: block;
    width: 100%;
    margin-top: var(--apb-spacing-lg);
}

/* Customer info form */
.apb-customer-info {
    margin: var(--apb-spacing-md) 0;
}

.apb-customer-info h4 {
    margin-top: 0;
    margin-bottom: var(--apb-spacing-md);
    color: var(--apb-gray-700);
}

.apb-form-row {
    margin-bottom: var(--apb-spacing-md);
}

.apb-form-row label {
    display: block;
    margin-bottom: var(--apb-spacing-xxs);
    font-weight: 500;
}

.apb-input {
    width: 100%;
    padding: var(--apb-spacing-xs) var(--apb-spacing-sm);
    border: 1px solid var(--apb-gray-300);
    border-radius: var(--apb-border-radius-sm);
}

.apb-message {
    margin-top: var(--apb-spacing-md);
    padding: var(--apb-spacing-sm) var(--apb-spacing-md);
    border-radius: var(--apb-border-radius-sm);
}

.apb-success {
    background-color: var(--apb-success);
    color: var(--apb-success-text);
    border: 1px solid var(--apb-success-border);
}

.apb-error {
    background-color: var(--apb-error);
    color: var(--apb-error-text);
    border: 1px solid var(--apb-error-border);
}

/* Video container styles */
.apb-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.apb-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--apb-border-radius-md);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .apb-apartment-content {
        grid-template-columns: 1fr;
    }

    .apb-main-content,
    .apb-booking-sidebar,
    .apb-gallery {
        grid-column: 1;
    }

    .apb-gallery-main {
        height: 300px;
    }

    .apb-main-image {
        height: 100%;
    }
    
    /* Adjust hero height for medium screens */
    .apb-apartment-header {
        height: 35vh;
    }
    
    .apb-apartment-title {
        font-size: calc(var(--apb-font-size-xxlarge) * 0.9);
    }
}

@media (max-width: 768px) {
    /* Adjust hero height for smaller screens */
    .apb-apartment-header {
        height: var(--apb-hero-height-mobile);
    }
    
    .apb-apartment-title {
        font-size: calc(var(--apb-font-size-xxlarge) * 0.8);
    }
}

@media (max-width: 576px) {
    .apb-amenity-icons {
        justify-content: center;
    }

    .apb-gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Further adjust for very small screens */
    .apb-apartment-header {
        min-height: 220px;
    }
}

/* Description - Gutenberg content styling */
.apb-description {
    margin-bottom: var(--apb-spacing-xl);
}

/* Base Gutenberg content styles */
.apb-description .wp-block-paragraph,
.apb-description p {
    font-size: var(--apb-font-size-normal);
    line-height: 1.6;
    margin-bottom: var(--apb-spacing-lg);
    color: var(--apb-gray-700);
}

/* Headings within Gutenberg content */
.apb-description h1 {
    font-size: calc(var(--apb-font-size-xlarge) * 1.2);
    margin-top: var(--apb-spacing-xl);
    margin-bottom: var(--apb-spacing-lg);
    font-weight: var(--apb-font-weight-bold);
}

.apb-description h2 {
    font-size: var(--apb-font-size-xlarge);
    margin-top: var(--apb-spacing-lg);
    margin-bottom: var(--apb-spacing-md);
    font-weight: var(--apb-font-weight-bold);
}

.apb-description h3:not(:first-child) {
    font-size: calc(var(--apb-font-size-large) * 1.1);
    margin-top: var(--apb-spacing-lg);
    margin-bottom: var(--apb-spacing-md);
    font-weight: var(--apb-font-weight-bold);
}

.apb-description h4 {
    font-size: var(--apb-font-size-large);
    margin-top: var(--apb-spacing-md);
    margin-bottom: var(--apb-spacing-sm);
    font-weight: var(--apb-font-weight-semibold);
}

.apb-description h5, .apb-description h6 {
    font-size: var(--apb-font-size-normal);
    margin-top: var(--apb-spacing-md);
    margin-bottom: var(--apb-spacing-sm);
    font-weight: var(--apb-font-weight-bold);
}

/* Lists within Gutenberg content */
.apb-description ul, .apb-description ol {
    margin: 0 0 var(--apb-spacing-md) var(--apb-spacing-lg);
    padding: 0;
}

.apb-description ul li, .apb-description ol li {
    margin-bottom: var(--apb-spacing-xs);
    line-height: 1.6;
}

/* Blockquotes */
.apb-description blockquote {
    border-left: 4px solid var(--apb-primary);
    padding-left: var(--apb-spacing-md);
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: var(--apb-gray-600);
}

/* Images and media */
.apb-description img,
.apb-description figure {
    max-width: 100%;
    height: auto;
    border-radius: var(--apb-border-radius-md);
    margin: var(--apb-spacing-md) 0;
}

.apb-description figure figcaption {
    font-size: var(--apb-font-size-small);
    text-align: center;
    color: var(--apb-gray-600);
    margin-top: var(--apb-spacing-xs);
}

/* Tables */
.apb-description table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--apb-spacing-md) 0;
}

.apb-description th, .apb-description td {
    border: 1px solid var(--apb-gray-300);
    padding: var(--apb-spacing-sm);
    text-align: left;
}

.apb-description th {
    background-color: var(--apb-gray-100);
    font-weight: var(--apb-font-weight-semibold);
}

/* Code blocks */
.apb-description pre {
    background-color: var(--apb-gray-100);
    padding: var(--apb-spacing-md);
    border-radius: var(--apb-border-radius-md);
    overflow-x: auto;
    margin: var(--apb-spacing-md) 0;
    font-family: monospace;
}

.apb-description code {
    background-color: var(--apb-gray-100);
    padding: 2px var(--apb-spacing-xxs);
    border-radius: var(--apb-border-radius-sm);
    font-family: monospace;
    font-size: 0.9em;
}

/* Buttons */
.apb-description .wp-block-button__link {
    display: inline-block;
    background-color: var(--apb-primary);
    color: var(--apb-white);
    padding: var(--apb-spacing-sm) var(--apb-spacing-lg);
    border-radius: var(--apb-border-radius-lg);
    text-decoration: none;
    transition: all var(--apb-transition-speed) var(--apb-transition-easing);
}

.apb-description .wp-block-button__link:hover {
    background-color: var(--apb-primary-hover);
    transform: translateY(-2px);
}

/* Columns */
.apb-description .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: var(--apb-spacing-lg);
    margin: var(--apb-spacing-lg) 0;
}

.apb-description .wp-block-column {
    flex: 1 1 300px;
}

/* Media queries for responsive behavior */
@media (max-width: 768px) {
    .apb-description h1 {
        font-size: var(--apb-font-size-xlarge);
    }
    
    .apb-description h2 {
        font-size: calc(var(--apb-font-size-large) * 1.1);
    }
    
    .apb-description h3:not(:first-child) {
        font-size: var(--apb-font-size-large);
    }
    
    .apb-description .wp-block-columns {
        flex-direction: column;
    }
    
    .apb-description .wp-block-column {
        flex: 1 1 100%;
    }
}

@media (max-width: 576px) {
    .apb-description p,
    .apb-description ul li,
    .apb-description ol li {
        font-size: var(--apb-font-size-small);
    }
    
    .apb-description h1, .apb-description h2 {
        font-size: var(--apb-font-size-large);
    }
    
    .apb-description h3:not(:first-child), .apb-description h4 {
        font-size: var(--apb-font-size-normal);
    }
}