/* ==========================================================================
   1. GLOBAL STYLES & VARIABLES
   ========================================================================== */
:root {
    --navy-dark: #001a33;
    --navy-card-bg: #1c2d42; /* Dark navy card background */
    --text-light: #ffffff;
    --text-muted: #a5badec;
    --accent-gold: #fcd34d;
    --border-color: #2b3e56;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--navy-dark);
    color: var(--text-light);
    line-height: 1.5;
    padding-top: 0;
    min-height: 100vh;
}

/* Brightened background artwork pseudo-element */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('images/living-room.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Lets artwork colors come through clearly without hiding under dark navy */
    opacity: 0.30; 
    filter: brightness(1.3) contrast(1.1);
    
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================================
   2. HIDDEN SEO NAVIGATION & LOGO CARD ENGINE
   ========================================================================== */
.seo-hidden-nav {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* White Logo Card with Centered Layout */
.logo-card {
    background-color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px !important;
    border: 1px solid rgba(28, 45, 66, 0.1);
    height: 100%;
}

.logo-card .brand-logo-wrapper {
    width: 100%;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 0 auto;
}

.logo-card .brand-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: scale(1.15);
    display: block;
    margin: auto;
}

.logo-card .subtitle {
    color: var(--navy-card-bg) !important;
    font-size: 8.5pt !important;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 10px;
    margin-bottom: 0;
}

/* ==========================================================================
   3. CONTAINER & RESPONSIVE GRID LAYOUT
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 20px 40px 20px;
}

.master-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* ==========================================================================
   4. CARD ARCHITECTURE & THEME
   ========================================================================== */
.navy-card {
    background-color: var(--navy-card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.navy-card h3 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 11.5pt;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 8px 0;
}

.navy-card p {
    font-size: 10.5pt;
    opacity: 0.9;
    margin-bottom: 12px;
}

.navy-card p:last-child {
    margin-bottom: 0;
}

.subtitle {
    color: var(--text-muted);
    font-size: 8.5pt;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 12px 0;
}

/* Inline Rate Badge */
.rate-badge {
    display: inline-block;
    background-color: rgba(28, 45, 66, 0.95);
    border: 1px solid var(--border-color);
    color: var(--accent-gold);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 8.5pt;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 8px;
    width: fit-content;
}

.card-bullet-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.card-bullet-list li {
    font-size: 10pt;
    color: #ffffff;
    opacity: 0.9;
    margin-bottom: 10px;
    padding-left: 16px;
    position: relative;
}

.card-bullet-list li::before {
    content: "•";
    color: var(--accent-gold);
    font-size: 14pt;
    position: absolute;
    left: 0;
    top: -2px;
}

.card-bullet-list li strong {
    color: var(--accent-gold);
}

.icon-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.icon-row svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    flex-shrink: 0;
    margin-top: 2px;
}

.icon-row a {
    color: var(--accent-gold) !important;
    position: relative;
    z-index: 15;
}

.icon-row a:hover {
    text-decoration: underline;
}

/* Clickable Navy Link Cards */
a.navy-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    transition: border-color 0.2s ease;
}

a.navy-card:hover {
    border-color: var(--accent-gold);
}

a.navy-card:hover h3 {
    color: var(--accent-gold);
}

/* ==========================================================================
   5. ACTION FORM STYLES
   ========================================================================== */
.action-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.form-group input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 10px;
    color: #ffffff;
    font-size: 9.5pt;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent-gold);
}

.submit-btn {
    background-color: var(--accent-gold);
    color: #1c2d42;
    border: none;
    border-radius: 4px;
    padding: 10px;
    font-weight: 700;
    font-size: 9.5pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 6px;
    transition: opacity 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   6. BACKGROUND TEASER SLIDER ENGINE DEFINITIONS
   ========================================================================== */
.reveal-card {
    cursor: pointer;
}

.reveal-card .card-text-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.reveal-card .card-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    
    visibility: visible;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

@media (hover: hover) {
    .reveal-card:hover .card-slider {
        opacity: 0.35;
    }
}

.reveal-card.active-tap .card-slider {
    opacity: 0.35;
}

/* ==========================================================================
   7. EMBEDDED IFRAME MEDIA WRAPPERS
   ========================================================================== */
.media-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.media-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   8. SITE FOOTER
   ========================================================================== */
footer {
    border-top: none;
    padding: 30px 20px;
    text-align: center;
    margin-top: 40px;
}

footer p {
    font-size: 9pt;
    color: var(--text-muted);
}

/* ==========================================================================
   9. MOBILE RESPONSIVENESS MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
    .master-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .master-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .navy-card {
        min-height: auto;
        padding: 24px;
    }

    /* Mobile: stack images/maps visibly instead of hover-only overlay */
    .navy-card.room-card .room-image-wrapper,
    #gallery-card .room-image-wrapper {
        position: static;
        opacity: 1;
        visibility: visible;
        height: auto;
        min-height: 220px;
    }

    .navy-card.room-card .room-image-wrapper img,
    #gallery-card .room-image-wrapper img {
        height: auto;
        min-height: 220px;
        aspect-ratio: 16 / 9;
    }

    .navy-card.room-card .room-image-wrapper iframe,
    #gallery-card .room-image-wrapper iframe {
        position: static;
        height: 260px;
        min-height: 260px;
        pointer-events: auto;
    }

    /* Prevent crowded flex rows on narrow screens */
    .room-nav-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .navy-card .card-text-content > div {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    html, body {
        overflow-x: hidden;
    }

    /* Readable base + prevent iOS auto-zoom on form focus */
    body {
        font-size: 16px;
    }

    .form-group input {
        font-size: 16px;
    }
}

/* Walkability Card Custom Spacing */
#walkability .card-bullet-list li {
    margin-bottom: 8px;
}

/* --- HOVER / TOUCH IMAGE OVERLAY FEATURE --- */

/* 1. Ensure the card acts as the relative container */
.navy-card.room-card {
    position: relative;
    overflow: hidden;
}

/* 2. Initially hide the image wrapper and overlay it on the card */
.navy-card.room-card .room-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    background-color: #111827; /* Dark background behind photo */
}

/* 3. Make the image cover the card completely */
.navy-card.room-card .room-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 4. Reveal image on Hover (Desktop) or Active/Touch (Mobile) */
.navy-card.room-card:hover .room-image-wrapper,
.navy-card.room-card:active .room-image-wrapper,
.navy-card.room-card:focus-within .room-image-wrapper {
    opacity: 1;
    visibility: visible;
}

/* Enable smooth hover overlays for iframe card contents */
.navy-card.room-card .room-image-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Prevents map scroll-jacking until active */
}

.navy-card.room-card:hover .room-image-wrapper iframe,
.navy-card.room-card:active .room-image-wrapper iframe {
    pointer-events: auto; /* Allows interaction when hovered/tapped */
}

.main-viewer {
    width: 100%;
    aspect-ratio: 16 / 9; /* Automatically scales height based on width */
    height: auto;
    object-fit: cover;
    display: block;
}

/* Enable hover overlay for the property views gallery card on index.html */
#gallery-card {
    position: relative;
    overflow: hidden;
}

#gallery-card .room-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
    background-color: #111827;
}

#gallery-card .room-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#gallery-card:hover .room-image-wrapper,
#gallery-card:active .room-image-wrapper,
#gallery-card:focus-within .room-image-wrapper {
    opacity: 1;
    visibility: visible;
}