/* Main Stylesheet */
@import 'reset.css';
@import 'themes.css';

/* Base Layout */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-image: url('/img/body-bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding-top: 180px;
    /* Offset for fixed header on desktop */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

header {
    background-color: var(--color-surface);
    padding: var(--spacing-md) var(--spacing-md) 0 var(--spacing-md);
}

nav {
    background-color: var(--color-surface);
    border-bottom: 4px solid var(--color-accent);
    border-top: 4px solid var(--color-accent);
    padding: var(--spacing-sm) 0;
}

main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: var(--spacing-md);
    background-color: var(--color-background);
}

section {
    background-color: var(--color-background);
    padding: var(--spacing-md);
    padding-top: 0;
}

p {
    margin-bottom: var(--spacing-sm);
}

footer {
    background-color: var(--color-surface);
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Utility Classes for Layout */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-sidebar {
    display: grid;
    gap: var(--spacing-lg);
}

/* Mobile Layout for Room Grid (Default) */
.room-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Ensure Text First on Mobile */
.room-grid .room-desc {
    order: 1;
}

.room-grid .room-gallery {
    order: 2;
}

@media (min-width: 768px) {

    /* Floated layout for Rooms on Desktop */
    .room-grid {
        display: block;
    }

    .room-grid::after {
        content: "";
        display: table;
        clear: both;
    }

    .room-grid .room-gallery {
        float: right;
        width: fit-content;
        max-width: 50%;
        margin-left: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
    }
}

.flex {
    display: flex;
    gap: var(--spacing-md);
}

.flex-center {
    justify-content: center;
    align-items: center;
    display: flex;
}

.flex-between {
    justify-content: space-between;
    align-items: center;
    display: flex;
}

.add-border {
    border: 4px solid var(--color-accent);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: var(--color-secondary);
    color: var(--color-text-light);
}


/* Images */
.img-fluid {
    height: auto;
    width: 100%;
}

.w-100 {
    width: 100%;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Legacy Color mappings & Utilities */
.text-wf-green,
.text-mc-dark-green {
    color: var(--color-primary) !important;
}

.text-wf-brown,
.text-mc-brown,
.text-wd-brown {
    color: var(--color-secondary) !important;
}

.text-wf-black {
    color: var(--color-text) !important;
}

/* Spacing Utilities */
.mb-0 {
    margin: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Bootstrap mb-4 is roughly 1.5rem-2.25rem */
.mt-3 {
    margin-top: 1rem !important;
}

.ml-auto {
    margin-left: auto;
}

/* Header & Nav */

.contact-info {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    /* Large font */
    color: var(--color-secondary);
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.contact-info a {
    color: inherit;
    text-decoration: none;
}

.contact-info a:hover {
    color: var(--color-primary);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.main-header.nav-hidden {
    transform: translateY(-100%);
}

/* Base Mobile Nav Elements (Hidden on Desktop) */
.menu-checkbox,
.menu-icon {
    display: none;
}

.nav-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-list a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-heading);
}

.nav-list a:hover {
    text-decoration: underline;
}

/* Dropdown (Simple CSS Hover) */
.has-dropdown {
    position: relative;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-surface);
    border: 2px solid var(--color-accent);
    padding: var(--spacing-sm) var(--spacing-md);
    min-width: 200px;
    z-index: 100;
}

.has-dropdown:hover .dropdown {
    display: block;
}

.dropdown li {
    display: block;
    margin-bottom: var(--spacing-sm);
}

.dropdown a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-heading);
    /* Dark text on light background */
}

/* =========================================================================
   Section Sub-Navigation (Long pages)
   ========================================================================= */
.sticky-nav-container {
    position: sticky;
    bottom: 0px;
    background-color: var(--color-surface);
    border-top: 4px solid var(--color-accent);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
    z-index: 900;
    padding: var(--spacing-sm);
}

.sub-nav-list {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.sub-nav-list a {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: var(--color-background);
    color: var(--color-primary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: bold;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.sub-nav-list a:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

/* Scroll-Spy Active State */
.sub-nav-list a.active-section {
    background-color: var(--color-accent);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Mobile swipe setup for sub-nav */
@media (max-width: 767px) {
    .sub-nav-list {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 0.25rem;
        /* Room for scrollbar if forced */
    }

    /* Hide scrollbar for clean horizontal swipe */
    .sub-nav-list::-webkit-scrollbar {
        display: none;
    }

    .sub-nav-list {
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .sub-nav-list li {
        scroll-snap-align: start;
        flex: 0 0 auto;
    }
}

/* Mobile Responsive Navigation */
@media (max-width: 767px) {
    body {
        padding-top: 130px;
        /* Smaller offset for mobile header */
    }

    /* Hide Contact Info and its empty wrapper on Mobile */
    .contact-info,
    .header-right {
        display: none;
    }

    /* Scale logo to ensure it fits next to the hamburger toggle on very narrow screens (e.g. 320px) */
    .logo img {
        max-width: 220px;
    }

    /* Move borders to the main header on mobile */
    .main-header {
        border-bottom: 4px solid var(--color-accent);
        border-top: 4px solid var(--color-accent);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        /* Allows the absolute list to drop down below */
    }

    .header-top {
        width: auto;
        margin-bottom: 0;
    }

    /* Remove borders and bottom margin from nav on mobile */
    nav {
        border: none;
        margin-bottom: 0;
    }

    /* Style the Navigation Container */
    .main-navigation {
        display: flex;
        flex-direction: column;
        width: auto;
        /* Shrink to content instead of 100% width */
        position: static;
        /* Ensure it doesn't trap the absolute nav-list */
    }

    /* Show Hamburger Icon */
    .menu-icon {
        display: block;
        margin-left: auto;
        font-size: 2.5rem;
        /* Make it slightly larger and easier to tap */
        cursor: pointer;
        color: var(--color-primary);
        padding: var(--spacing-sm);
        user-select: none;
    }

    /* Style the Nav List for Mobile */
    .nav-list {
        position: absolute;
        top: 100%;
        /* Drop down directly below the header */
        left: 0;
        right: 0;
        width: 100vw;
        background-color: var(--color-surface);
        z-index: 1000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        /* Add a slight shadow to float it */
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        gap: 0;
        /* Removing gap to let margin handle spacing */
    }

    .nav-list li {
        width: 100%;
        text-align: center;
        border-top: 1px solid var(--color-accent);
        /* Optional separators */
    }

    .nav-list a {
        display: block;
        width: 100%;
        text-align: center;
        /* Ensure link text is explicitly centered */
        padding: var(--spacing-sm) 0;
    }

    /* Fix dropdown nested items centering */
    .dropdown li {
        border-top: none;
        /* Remove duplicate borders inside dropdowns */
    }

    /* Checkbox Hack - Show Nav when Checked */
    .menu-checkbox:checked~.nav-list {
        max-height: 1000px;
        /* Arbitrary large number to allow full expansion */
        transition: max-height 0.5s ease-in;
    }

    /* Mobile Dropdowns */
    .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--color-accent);
        border-bottom: 1px solid var(--color-accent);
        background-color: rgba(0, 0, 0, 0.02);
        /* Slight tint to distinguish submenu */
    }

    .has-dropdown:hover .dropdown {
        display: block;
    }
}

/* Testimonials */
.testimonial {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-accent);
    padding-bottom: var(--spacing-md);
}

/* Footer */
footer {
    background-color: var(--color-surface);
    color: var(--color-text);
    padding: var(--spacing-md) 0;
    text-align: center;
}

.footer-ctas {
    padding: var(--spacing-sm) var(--spacing-md);
}

.footer-bottom {
    padding: var(--spacing-sm) var(--spacing-md);
}


.footer-ctas article {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: var(--spacing-md);
    border: 4px solid var(--color-accent);
    padding: var(--spacing-md);
}

.footer-ctas a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
    font-family: var(--font-heading);
}

.footer-ctas a:hover {
    text-decoration: underline;
}

.site-footer {
    color: var(--color-text);
    padding: var(--spacing-md) 0;
    text-align: center;
}

/* Sticky Sub Navigation */

/* Content Images */
.alignleft {
    float: left;
    margin: 0 var(--spacing-sm) var(--spacing-sm) 0;
}

.justify-center {
    justify-content: center;
}

/* Scroll Offset for Anchor Links */
html {
    scroll-behavior: smooth;
}

:target {
    scroll-margin-top: 160px;
}






/* Responsive Sidebar Visibility */
#sidebar {
    display: none;
}

@media (min-width: 1024px) {
    #sidebar {
        display: block;
    }

    .grid-sidebar {
        grid-template-columns: 250px 1fr;
    }
}

/* Homepage CTA Cards */
.cta {
    background-color: var(--color-surface);
    border: 4px solid var(--color-accent);
    text-align: center;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.cta img {
    margin-bottom: 0;
    /* Ensure no bottom margin to allow title overlap */
}

.cta p {
    margin: 0 var(--spacing-md);
}

/* Stretched link pattern for CTA cards */
.cta .btn-read-more {
    position: static;
}

.cta .btn-read-more::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 11;
    /* Sits above .cta-title which is z-index 10 */
}

/* Trigger arrow animation when hovering over the *entire card* */
.cta:hover .btn-read-more::after {
    transform: translateX(4px);
}

.cta-title {
    background-color: var(--color-banner-overlay);
    width: 80%;
    max-width: 250px;
    margin: -2rem auto var(--spacing-md);
    padding: 0.25rem;
    position: relative;
    z-index: 10;
}

.cta-title h5 {
    color: var(--color-text-light);
    font-size: 1.4rem;
    margin: 0;
}

.cta-title h6 {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin: 0;
}


/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
}

.bento-card {
    background-color: var(--color-surface);
    border: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bento-card h2,
.bento-card h3 {
    margin-top: 0;
}

.bento-card img {
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        grid-auto-flow: dense;
    }

    .span-col-2 {
        grid-column: span 2;
    }

    .span-row-2 {
        grid-row: span 2;
    }

    .full-width {
        grid-column: 1 / -1;
    }
}

/* Bento Gallery Overrides */
.bento-card.p-0 {
    padding: 0;
}

.bento-card .gallery-label {
    height: 100%;
    /* Ensure label fills the card */
}

.bento-card .gallery-label img {
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    /* Remove radius since card has it, or keep it? Card has overflow hidden so 0 is fine */
    margin-bottom: 0;
    /* Override bento-card img margin */
}

/* Blog List Grid */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Blog Cards */
.blog-card {
    background-color: var(--color-surface);
    border: 4px solid var(--color-accent);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    text-align: left;
    height: 100%;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-card .post-title,
.blog-card h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    text-align: left;
    font-size: 1.5rem;
}

/* Make entire card clickable via pseudo-element overlay on the title link */
.blog-card .post-title a::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    /* Overlay covers card content but stays below 'Read more' */
}

.blog-card .post-date,
.blog-card h5 {
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    text-align: left;
    font-family: var(--font-primary);
    font-weight: normal;
}

.blog-card .post-excerpt,
.blog-card p {
    flex-grow: 1;
    /* Pushes the button to the bottom */
    margin-bottom: var(--spacing-md);
    text-align: left;
}

/* Featured Blog Post */
.blog-featured {
    grid-column: 1 / -1;
    /* Span full width of grid */
    background-color: var(--color-background);
    border: 4px solid var(--color-primary);
    /* Distinct border color */
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

/* Optional: Subtle background pattern or tint for featured */
.blog-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-primary);
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

.blog-featured .post-title,
.blog-featured h3 {
    font-size: 2.2rem;
    margin-bottom: var(--spacing-md);
}

.blog-featured .post-date,
.blog-featured h5 {
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-primary);
}

.blog-featured .post-excerpt,
.blog-featured p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Post Footer Styling */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
    /* Push to bottom of card */
    gap: var(--spacing-sm);
}

.post-footer .post-date,
.post-footer h5 {
    margin-bottom: 0;
    line-height: 1;
    color: var(--color-primary);
    font-style: italic;
    /* subtly deemphasize the date */
}

/* Read More Link Styling */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 2;
    /* Ensure 'Read more' can be distinctively clicked or tabbed to over the invisible card link */
}

.btn-read-more::after {
    content: '\2192';
    margin-left: 0.5rem;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.btn-read-more:hover {
    color: var(--color-secondary);
    text-decoration: none;
}

/* Trigger arrow animation when hovering over the *entire card*, not just the link */
.blog-card:hover .btn-read-more::after,
.btn-read-more:hover::after {
    transform: translateX(4px);
}