/* ============================================
   Custom CSS for Cave Rock Estates
   Extracted from inline styles in HTML files
   ============================================ */

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

.contact__form .form__submit { 
    margin-top: 0 !important; 
}

/* Make "Welcome to our community" section images the same size - landscape orientation */
.other-detail__item-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    max-height: none;
}
.other-detail__item-image a {
    display: block;
    width: 100%;
    height: 100%;
}
.other-detail__item-image img,
.other-detail__item-image picture,
.other-detail__item-image picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .other-detail__item-image {
        height: 56.25vw; /* 16:9 aspect ratio - 9/16 = 0.5625 */
        max-height: 400px;
    }
    @media print, screen and (min-width: 40em) {
        .other-detail__item-image {
            max-height: 500px;
        }
    }
}

/* Make overlay text links clickable */
.other-detail__link,
.image-grid__text-link,
.image-promo__link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.other-detail__link:hover,
.image-grid__text-link:hover,
.image-promo__link:hover {
    text-decoration: none;
}
.image-grid__text-link .image-grid__text {
    cursor: pointer;
}
.image-promo__overlay .image-promo__link h2 {
    cursor: pointer;
}

/* Ensure menu button is visible */
.header__open-off-canvas {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Header logo sizing and centering */
.header {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
.header__group {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}
.header__group-contents {
    padding-top: 0 !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
}
.header__group-logo,
.header__group-logo button {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}
.header__group-logo img {
    max-height: 59.85px !important; /* Reduced by another 10% from 66.5px to fit in black bar */
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Footer logo sizing */
.footer__hotels-logo img,
.footer__hotels-logo div img,
.footer__hotels-logo div {
    max-width: 49.5% !important; /* Increased by 10% from 45% */
    height: auto !important;
    display: block !important;
}

/* Background YouTube video: block interaction and crop chrome */
#youtube-player-desktop,
#youtube-player-mobile,
#video-container-desktop iframe,
#video-container-mobile iframe,
.slider__video iframe,
.slider__video-small iframe {
    pointer-events: none !important;
    opacity: 0;
    transition: opacity 0.6s ease;
    /* Slightly overscale so any control bar at the bottom is clipped */
    transform: scale(1.12);
    transform-origin: center center;
}

#youtube-player-desktop.video-ready,
#youtube-player-mobile.video-ready,
#video-container-desktop iframe.video-ready,
#video-container-mobile iframe.video-ready {
    opacity: 1;
}

.youtube-video-container {
    background: #000;
}

#video-container-desktop,
#video-container-mobile,
.slider__video,
.slider__video-small {
    overflow: hidden;
}

/* Target YouTube player elements (may not work due to CORS, but helps if possible) */
.ytp-watermark,
.ytp-logo,
.ytp-title,
.ytp-title-link,
.ytp-title-channel,
.ytp-chrome-top,
.ytp-chrome-bottom,
.ytp-chrome-bottom .ytp-watermark,
.ytp-share-button,
.ytp-watch-later-button,
.ytp-pause-overlay,
.ytp-cards-teaser,
.ytp-ce-element,
.ytp-suggested-action,
.ytp-pause-overlay-container,
.ytp-impression-link,
.ytp-impression-link-content,
.ytp-gradient-top,
.ytp-gradient-bottom {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
}

/* Prevent tap/hover from revealing YouTube controls */
#youtube-player-desktop,
#youtube-player-mobile {
    pointer-events: none !important;
}

/* Hide YouTube watermark/logo overlay */
.ytp-watermark,
.ytp-show-cards-title,
.ytp-cards-teaser,
.ytp-ce-element,
.ytp-title,
.ytp-chrome-top,
.ytp-chrome-bottom .ytp-watermark {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Highlighted value requirement box */
.value-highlight {
    background-color: #f6f6f6;
    border-left: 4px solid #0f0f0f;
    padding: 2rem;
    margin: 3rem 0;
    font-family: "aktiv-grotesk", sans-serif;
    font-size: 16px;
    line-height: 1.8;
}

.value-highlight p {
    margin: 0;
    font-weight: 500;
}

@media print, screen and (min-width: 40em) {
    .value-highlight {
        padding: 2.5rem;
        margin: 4rem 0;
    }
}

/* FAQ Accordion Styles - Smooth Grid-based Animation */
.faq-group {
    margin-bottom: 64px;
}

@media print, screen and (min-width: 40em) {
    .faq-group {
        margin-bottom: 130px;
    }
}

.faq-group h2 {
    font-family: "miller-banner", serif;
    font-weight: bold;
    font-size: 30px;
    margin-bottom: 30px;
}

@media print, screen and (min-width: 40em) {
    .faq-group h2 {
        font-size: 35px;
    }
}

.faq-item {
    border-top: 1px solid #e4e1dd;
}

.faq-header {
    cursor: pointer;
    background-color: #ffffff;
    padding: 1.25rem 3.5rem 1.25rem 1.5rem;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
    position: relative;
}

@media print, screen and (min-width: 40em) {
    .faq-header {
        padding-top: 1.5rem;
        padding-bottom: 1.25rem;
        padding-right: 3.5rem;
    }
}

.faq-header h3 {
    margin: 0;
    font-family: "miller-banner", serif;
    font-weight: bold;
    font-size: 20px;
    position: relative;
}

@media print, screen and (min-width: 40em) {
    .faq-header h3 {
        font-size: 25px;
    }
}

/* Circular border for icon */
.faq-header::after {
    content: "";
    position: absolute;
    top: 0.625rem;
    right: 1.125rem;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    border: 1px solid #0f0f0f;
}

@media print, screen and (min-width: 40em) {
    .faq-header::after {
        top: 1.5rem;
    }
}

/* Plus icon lines - centered vertically in circle */
.faq-header h3::before,
.faq-header h3::after {
    content: "";
    position: absolute;
    top: 0.28125rem; /* 4.5px - centers icon in circle on mobile */
    right: -1.8125rem; /* -29px */
    width: 14px;
    height: 2px;
    background-color: #0f0f0f;
    border-radius: 2px;
    transition: transform 0.2s ease-in-out;
    transform-origin: center center;
}

@media print, screen and (min-width: 40em) {
    .faq-header h3::before,
    .faq-header h3::after {
        top: 0.90625rem; /* 14.5px - centers icon in circle on desktop */
    }
}

/* Vertical line for plus icon (rotated 90deg from horizontal) */
.faq-header h3::before {
    transform: rotate(-90deg);
}

/* Active state - background color change only */
.faq-header.active {
    background-color: #f6f6f6;
}

/* Active state - minus icon (rotate vertical line to horizontal, hide the other) */
.faq-header.active h3::before {
    transform: rotate(0deg);
}

.faq-header.active h3::after {
    opacity: 0;
}

/* Use CSS Grid for smooth animation */
.faq-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out, background-color 0.2s ease;
    background-color: #ffffff;
    overflow: hidden;
}

.faq-body.active {
    grid-template-rows: 1fr;
    background-color: #f6f6f6;
    border-bottom: 2px solid #0f0f0f;
}

.faq-body-inner {
    min-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    opacity: 0;
    transition: opacity 0.25s ease 0.05s;
}

.faq-body.active .faq-body-inner {
    opacity: 1;
    padding-bottom: 1.5rem;
}

.faq-body-inner p,
.faq-body-inner li {
    font-family: "aktiv-grotesk", sans-serif;
    font-size: 14px;
    line-height: 24px;
}

.faq-body-inner p {
    margin-bottom: 1rem;
}

.faq-body-inner p:last-child {
    margin-bottom: 0;
}

/* Hero images - full screen on all devices */
.slider {
    width: 100%;
    overflow: hidden;
}

.slider__inner {
    width: 100%;
    height: 100vh;
    position: relative;
}

.slider__slide {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider__image {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.slider__image picture,
.slider__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Video containers - styled to match Virgin Limited Edition EXACTLY */
.slider__video,
.slider__video-small {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

/* Video iframe styles are inline in HTML to match Virgin site exactly */

/* Mobile: Show small video, hide desktop video */
.slider__video {
    display: none;
}

.slider__video-small {
    display: block;
}

/* Ensure hero images stay full screen on desktop (not just mobile) */
@media screen and (min-width: 40em) {
    /* Desktop: Show desktop video, hide mobile video */
    .slider__video {
        display: block !important;
    }
    
    .slider__video-small {
        display: none !important;
    }
    
    /* Keep hero images full screen - only override for video containers */
    .slider:not(.slider__video):not(.slider__video-small) .slider__inner,
    .slider:not(.slider__video):not(.slider__video-small) .slider__image {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
}

/* Map styling */
#cave-rock-map {
    height: 600px;
    width: 100%;
    border-radius: 16px;          
    overflow: hidden;
    background: #f5f1ed;         
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    opacity: 0;
    transition: opacity 1.4s ease;
}

/* Mobile Responsive Enhancements */
@media screen and (max-width: 768px) {
    /* Ensure touch targets are at least 44x44px */
    button, a.button, .header__open-off-canvas, .faq-header {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }
    
    /* Improve text readability on mobile */
    body {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
    
    /* Improve image loading on mobile */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* Better spacing for mobile */
    .intro__content p {
        font-size: 16px;
        line-height: 1.6;
    }
    
    /* Ensure buttons are touch-friendly */
    .button {
        padding: 1rem 1.5rem;
        font-size: 16px;
        touch-action: manipulation;
    }
    
    /* Video container mobile optimization */
    #video-container-mobile {
        display: block !important;
    }
    #video-container-desktop {
        display: none !important;
    }
    
    /* Map mobile optimization */
    #cave-rock-map {
        height: 400px;
    }
    
    /* Improve mobile menu interactions */
    .burger-menu a,
    .header__booking-mobile-popup a {
        min-height: 44px;
        display: flex;
        align-items: center;
        touch-action: manipulation;
    }
    
    /* Hero images - fill mobile screen with proper cropping */
    .slider__inner {
        min-height: 100vh;
        max-height: 100vh;
    }
    
    .slider__image {
        min-height: 100vh;
        max-height: 100vh;
    }
    
    /* Video containers - mobile optimization with better aspect ratio handling */
    .slider__video,
    .slider__video-small {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        background: #000;
        z-index: 1;
    }
    
    /* Video iframe styles handled by inline styles in HTML */
    
    /* Hero image overlays for video - full screen on mobile */
    #hero-image-overlay-mobile,
    #hero-image-overlay-desktop {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    /* Ensure video container maintains aspect ratio on mobile */
    .youtube-video-container {
        position: relative;
        width: 100%;
        padding-bottom: 0;
        display: block;
    }
    
    /* FAQ mobile optimizations */
    .faq-header {
        padding: 1.25rem 3rem 1.25rem 1.25rem;
    }
    
    .faq-group {
        margin-bottom: 48px;
    }
}

@media screen and (min-width: 40em) {
    /* Desktop: Show desktop video, hide mobile video */
    .slider__video {
        display: block;
    }
    
    .slider__video-small {
        display: none;
    }
    
    /* Keep regular hero images full screen on desktop (for meetings and working_with_us pages) */
    .slider:not(.slider__video):not(.slider__video-small) .slider__inner,
    .slider:not(.slider__video):not(.slider__video-small) .slider__image {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
    
}

/* Performance: Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ensure proper rendering on all devices */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   MOBILE OPTIMIZATION FIXES
   ============================================ */

/* Fix header bar background to pure black */
.header,
.header__group,
.header__inner {
    background-color: #000000 !important;
}

/* Fix burger menu, "Cave Rock Estates" title, and "Contractors" text to stay white on scroll (all screen sizes) */
.header__open-off-canvas,
.header__open-off-canvas svg,
.header__open-off-canvas svg line,
.header__open-off-canvas svg #TOP,
.header__open-off-canvas svg #MIDDLE,
.header__open-off-canvas svg #BOTTOM {
    color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

.header__property-logo,
.header__property-logo a,
.header__property-logo a:visited,
.header__property-logo a:hover {
    color: #ffffff !important;
}

.header__booking-cta {
    color: #ffffff !important;
}

/* Override any scroll-based color changes with higher specificity - all states */
.header.is-stuck .header__open-off-canvas,
.header.is-stuck .header__open-off-canvas svg,
.header.is-stuck .header__open-off-canvas svg line,
.header.is-stuck .header__open-off-canvas svg #TOP,
.header.is-stuck .header__open-off-canvas svg #MIDDLE,
.header.is-stuck .header__open-off-canvas svg #BOTTOM,
.header.is-at-top .header__open-off-canvas,
.header.is-at-top .header__open-off-canvas svg,
.header.is-at-top .header__open-off-canvas svg line,
.header.is-at-top .header__open-off-canvas svg #TOP,
.header.is-at-top .header__open-off-canvas svg #MIDDLE,
.header.is-at-top .header__open-off-canvas svg #BOTTOM,
.header .header__open-off-canvas,
.header .header__open-off-canvas svg,
.header .header__open-off-canvas svg line,
.header .header__open-off-canvas svg #TOP,
.header .header__open-off-canvas svg #MIDDLE,
.header .header__open-off-canvas svg #BOTTOM {
    color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

.header.is-stuck .header__property-logo,
.header.is-stuck .header__property-logo a,
.header.is-stuck .header__property-logo a:visited,
.header.is-stuck .header__property-logo a:hover,
.header.is-at-top .header__property-logo,
.header.is-at-top .header__property-logo a,
.header.is-at-top .header__property-logo a:visited,
.header.is-at-top .header__property-logo a:hover,
.header .header__property-logo,
.header .header__property-logo a,
.header .header__property-logo a:visited,
.header .header__property-logo a:hover {
    color: #ffffff !important;
}

.header.is-stuck .header__booking-cta,
.header.is-at-top .header__booking-cta,
.header .header__booking-cta {
    color: #ffffff !important;
}

/* Fix burger menu close button (X) alignment in circle on mobile */
@media screen and (max-width: 768px) {
    .burger-menu .close {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
    }
    
    .burger-menu .close::before,
    .burger-menu .close::after {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }
}

/* Fix logo above "where we are" centering on mobile */
@media screen and (max-width: 768px) {
    .map__stamp {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .map__stamp img {
        margin: 0 auto !important;
        display: block !important;
    }
}

/* Fix "Contact the GID" button - remove red animation and fix "|" character vertical alignment on mobile */
@media screen and (max-width: 768px) {
    .footer__newsletter-toggle button {
        display: inline-flex !important;
        align-items: center !important;
        vertical-align: middle !important;
        line-height: 1.5 !important;
        justify-content: center !important;
    }
    
    /* Remove red animation/hover effects */
    .footer__newsletter-toggle button:hover,
    .footer__newsletter-toggle button:focus,
    .footer__newsletter-toggle button:active {
        background-color: transparent !important;
        color: inherit !important;
        animation: none !important;
        transition: none !important;
    }
    
    /* Fix "|" character if it exists as a pseudo-element or text */
    .footer__newsletter-toggle button::before,
    .footer__newsletter-toggle button::after {
        display: inline-flex !important;
        align-items: center !important;
        vertical-align: middle !important;
        line-height: 1.5 !important;
    }
    
    /* If "|" is in the HTML as text, ensure proper alignment */
    .footer__newsletter-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Target any span or text node containing "|" */
    .footer__newsletter-toggle button span,
    .footer__newsletter-toggle button {
        vertical-align: middle !important;
        line-height: 1.5 !important;
    }
}

/* Fix footer logo centering on mobile */
@media screen and (max-width: 768px) {
    .footer__hotels-logo {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .footer__hotels-logo a,
    .footer__hotels-logo div {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .footer__hotels-logo img {
        margin: 0 auto !important;
        display: block !important;
    }
}

/* Fix accordion headings color (remove blue) and "+" icon alignment in meetings.html */
.faq-header {
    color: #0f0f0f !important;
}

.faq-header h3 {
    color: #0f0f0f !important;
}

/* Fix "+" and "-" icon alignment in circle on mobile */
@media screen and (max-width: 768px) {
    /* Circle position: top 0.625rem (10px), right 1.125rem (18px), width/height 31px */
    /* Circle center: 10px + 15.5px = 25.5px from top, 18px + 15.5px = 33.5px from right */
    /* H3 padding-top: 1.25rem (20px), so icon needs to be at 25.5px - 20px = 5.5px from h3 top */
    /* Icon line is 2px tall, so center is 1px from line top */
    /* Icon center should align with circle center: 5.5px - 1px = 4.5px from h3 top */
    /* Right position: circle center at 33.5px from right, icon is 14px wide, so center at 14px/2 = 7px from left edge */
    /* So icon left edge should be at 33.5px - 7px = 26.5px from right, which is -26.5px or -1.65625rem */
    .faq-header::after {
        top: 0.625rem !important;
        right: 1.125rem !important;
        width: 31px !important;
        height: 31px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .faq-header h3::before,
    .faq-header h3::after {
        top: 0.28125rem !important; /* 4.5px from h3 top - centers icon vertically in circle */
        right: -1.65625rem !important; /* -26.5px from h3 right - centers icon horizontally in circle */
        width: 14px !important;
        height: 2px !important;
        transform-origin: center center !important;
    }
    
    .faq-header h3::before {
        transform: rotate(-90deg) !important;
    }
    
    .faq-header.active h3::before {
        transform: rotate(0deg) !important;
    }
}

/* Google Maps error fix - ensure map container has proper dimensions */
#cave-rock-map {
    min-height: 400px !important;
    width: 100% !important;
}

@media screen and (max-width: 768px) {
    #cave-rock-map {
        min-height: 400px !important;
    }
}

