/* =============================================
   HORTIMED — common.css (REDESIGNED)
   Shared across all pages.
   All original selectors preserved.
   Only visual / aesthetic values changed.
============================================= */

/*------------------------------------*\
  #Variables
\*------------------------------------*/
:root {
    --clr-forest:       #1a3a2a;
    --clr-forest-mid:   #2d5c40;
    --clr-forest-light: #4a8c62;
    --clr-sage:         #8ab89a;
    --clr-sage-pale:    #e8f3ec;
    --clr-cream:        #faf8f3;
    --clr-cream-dark:   #f0ece2;
    --clr-gold:         #c8a96e;
    --clr-gold-light:   #e8d5a8;
    --clr-text:         #1c2b22;
    --clr-text-mid:     #3d5247;
    --clr-text-light:   #6b8c7a;
    --clr-white:        #ffffff;
    --clr-border:       rgba(26,58,42,0.12);

    /* Keep original var names intact for cross-file compatibility */
    --primary-color:        #2d5c40;
    --primary-light-color:  #e8f3ec;
    --text-color:           #1c2b22;
    --text-color-light:     #6b8c7a;
    --h2-color:             #1a3a2a;
    --bg-color:             #faf8f3;
    --bg-color-dark:        #1a3a2a;
    --white-color:          #ffffff;
    --light-gray-accent:    #b8c8be;
    --divider-border-color: rgba(26,58,42,0.2);
    --navbar:               #e8f3ec;
    --page2-color:          #f0f7f2;

    --shadow-sm:  0 1px 3px rgba(26,58,42,0.08), 0 1px 2px rgba(26,58,42,0.06);
    --shadow-md:  0 4px 16px rgba(26,58,42,0.10), 0 2px 6px rgba(26,58,42,0.07);
    --shadow-lg:  0 12px 40px rgba(26,58,42,0.14), 0 4px 12px rgba(26,58,42,0.08);
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);

    --max-content-width:        1200px;
    --main-topic-content-width: 1200px;
}

/*------------------------------------*\
  #Base Styles
\*------------------------------------*/
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--clr-cream);
    color: var(--clr-text);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    min-height: 100vh;
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.7;
}

/*------------------------------------*\
  #Layout
\*------------------------------------*/
.container {
    margin: 0 auto;
    max-width: var(--max-content-width);
    padding: 0 1.5rem;
}

/*------------------------------------*\
  #Typography
\*------------------------------------*/
h1, h2, h3 {
    line-height: 1.2;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--clr-forest);
}

h1 {
    color: var(--clr-forest);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-align: center;
}

h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.9rem);
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

p, p1, p2 {
    font-family: 'DM Sans', 'Segoe UI', sans-serif;
    color: var(--clr-text-mid);
}

.section-tagline {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    text-align: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--clr-forest);
}

.section-description {
    font-size: 1.02rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--clr-text-mid);
}

/* ── Utility: section chip label ── */
.section-chip {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--clr-gold);
    background: rgba(200,169,110,0.12);
    border: 1px solid rgba(200,169,110,0.3);
    border-radius: 50px;
    padding: 0.28rem 0.85rem;
    margin-bottom: 1rem;
}

/* ── Utility: section divider ── */
.section-divider {
    width: 48px;
    height: 3px;
    background: linear-gradient(90deg, var(--clr-forest-light), var(--clr-gold));
    border-radius: 2px;
    margin: 0 auto 1.5rem;
}

/*------------------------------------*\
  #Header & Navigation  (REDESIGNED)
\*------------------------------------*/

/* ── Wrapper ── */
header {
    background: rgba(250,248,243,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--clr-border);
    box-shadow: 0 1px 0 var(--clr-border), var(--shadow-sm);
    padding: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition);
}

/* Slight elevation when page is scrolled — toggled via JS adding .scrolled */
header.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(250,248,243,1);
}

/* ── Inner container ── */
.nav-container {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: var(--main-topic-content-width);
    /* Symmetric horizontal padding; vertical centres logo optically */
    padding: 0 2rem;
    height: 72px;          /* fixed height = perfectly consistent across pages */
    position: relative;
    gap: 2rem;
}

/* ── Logo ── */
.logo {
    color: var(--clr-forest);
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;         /* never let the logo compress */
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    height: 52px;           /* slightly tighter so it sits comfortably in 72px bar */
    width: auto;
    transition: opacity var(--transition), transform var(--transition);
}
.logo:hover img {
    opacity: 0.82;
    transform: scale(1.03);
}

/* ── Mobile toggle — hidden by default ── */
.mobile-menu-toggle {
    display: none !important;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--clr-forest);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ── Desktop nav ── */
/*
   The header is a two-row flex column:
     Row 1 (72px): logo  +  nav links
     Row 2 (0px → auto): the inline dropdown strip, hidden by default
   This keeps the dropdown *inside* the header bar visually.
*/
header {
    display: flex;
    flex-direction: column;
    /* override the fixed height set above — let row 2 expand naturally */
}

.main-nav {
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: static;       /* ← key: removes the relative anchor so dropdown
                               is positioned relative to the whole header */
    display: flex;
    align-items: stretch;
}

/* ── Nav link ── */
.nav-link {
    color: var(--clr-text-mid);
    display: flex;
    align-items: center;
    gap: 0.28rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.015em;
    line-height: 1;
    padding: 0 0.9rem;
    text-decoration: none;
    border-radius: 0;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition);
    position: relative;
}

/* Gold underline slides in on hover (plain links only) */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.9rem;
    right: 0.9rem;
    height: 2px;
    background: var(--clr-gold);
    border-radius: 1px 1px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition);
}

.nav-link:hover {
    color: var(--clr-forest);
    background: rgba(26,58,42,0.05);
}
.nav-link:hover::after { transform: scaleX(1); }

/* ── Active page indicator ── */
.nav-link.active-link {
    color: var(--clr-forest);
    font-weight: 600;
}
.nav-link.active-link:not(.dropdown > .nav-link)::after {
    transform: scaleX(1);
    background: var(--clr-forest-light);
}
.dropdown > .nav-link.active-link {
    color: var(--clr-forest);
    font-weight: 600;
}
.dropdown > .nav-link.active-link::before {
    color: var(--clr-forest);
}
.dropdown-link.active-link {
    background: var(--clr-sage-pale);
    color: var(--clr-forest);
    font-weight: 500;
}
.dropdown-link.active-link::before { transform: scaleY(1); }

/* ── Chevron on dropdown triggers (desktop CSS-only) ── */
.dropdown-toggle-btn { display: none; }

.dropdown > .nav-link::before {
    content: '▾';
    font-size: 0.65rem;
    line-height: 1;
    color: var(--clr-text-light);
    order: 1;
    transition: transform var(--transition), color var(--transition);
    margin-left: 0.1rem;
}

.dropdown > .nav-link::after { display: none; }

/* Active trigger chevron rotation — JS adds .active via mouseenter */
.dropdown:hover > .nav-link,
.dropdown.open > .nav-link {
    color: var(--clr-forest);
    background: rgba(26,58,42,0.05);
}
.dropdown:hover > .nav-link::before,
.dropdown.open > .nav-link::before {
    transform: rotate(180deg);
    color: var(--clr-forest);
}

/* ── DESKTOP INLINE DROPDOWN STRIP ──────────────────────────────────────────
   The dropdown-menu is NOT absolutely positioned on desktop.
   Instead it lives as a second row of the <header> flex column.
   It spans the full header width and reveals a centred list of links.
   Triggered by :hover on the parent .nav-item.dropdown.
──────────────────────────────────────────────────────────────────────────── */
.dropdown {
    position: static;
}

.dropdown-menu {
    /* Reset any absolute positioning */
    position: fixed;
    /* Pin it directly under the nav bar */
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;

    /* Layout: centred horizontal row of links */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    list-style: none;
    padding: 0;
    margin: 0;

    /* Appearance: same cream background as the navbar */
    background: var(--clr-white);
    border-top: 2px solid var(--clr-forest-light);
    border-bottom: 1px solid var(--clr-border);
    box-shadow: 0 6px 24px rgba(26,58,42,0.10);

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    z-index: 999;
    min-width: unset;
    border-radius: 0;
    overflow: visible;

    transition:
        opacity var(--transition),
        visibility 0s linear 0.28s,
        transform var(--transition);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition:
        opacity var(--transition),
        visibility 0s linear 0s,
        transform var(--transition);
}

/* ── Dropdown link items — horizontal pills ── */
.dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.4rem;
    color: var(--clr-text-mid);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    border-right: 1px solid var(--clr-border);
    border-bottom: none;
    position: relative;
    transition: background var(--transition), color var(--transition);
}

/* Bottom gold bar on hover — mirrors the top-level nav-link underline */
.dropdown-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.4rem;
    right: 1.4rem;
    height: 2px;
    background: var(--clr-gold);
    border-radius: 1px 1px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition);
}

.dropdown-link::before { display: none; }  /* no left-bar accent on desktop */

.dropdown-link:hover {
    background: var(--clr-sage-pale);
    color: var(--clr-forest);
    font-weight: 500;
    padding-left: 1.4rem;  /* no shift — links are horizontal here */
}
.dropdown-link:hover::after { transform: scaleX(1); }

.dropdown-menu li:last-child .dropdown-link { border-right: none; }

/*------------------------------------*\
  #Footer Styles
\*------------------------------------*/
.footer {
    color: var(--clr-white);
    margin-top: auto;
    width: 100%;
}

.footer-top {
    background: var(--clr-forest);
    gap: 1rem;
    padding: 4rem 0 3rem;
}

.footer-top-container {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    justify-content: flex-start;
    margin-left: auto;
    margin-right: auto;
    max-width: var(--max-content-width);
    padding: 0 1.5rem;
}

.footer-top-content {
    flex: 2;
    max-width: 680px;
    min-width: 280px;
    text-align: left;
}

.footer-top-content h1 {
    color: var(--clr-gold);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: left;
}

.footer-top-content p {
    line-height: 1.75;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.68);
}

.logo_image1 {
    margin: 0;
    max-width: 64px;
    height: auto;
    filter: brightness(1.05);
}

.logo_image2 {
    margin: 0;
    max-width: 64px;
    height: auto;
    filter: brightness(1.05);
}

.logo-placeholder {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.contact {
    display: flex;
    flex: 1;
    flex-direction: column;
    max-width: 320px;
    min-width: 240px;
    text-align: left;
}

.contact-content { gap: 1rem; }

.contact-content h1 {
    color: var(--clr-gold);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: left;
}

.contact-content p {
    padding-top: 0;
    font-size: 0.8rem;
    line-height: 1.75;
    color: rgba(255,255,255,0.68);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: auto;
}

.social-logos {
    height: 36px;
    width: 36px;
    border-radius: 8px;
    transition: transform var(--transition), filter var(--transition);
    filter: grayscale(20%);
}
.social-logos:hover {
    transform: scale(1.15) translateY(-2px);
    filter: grayscale(0%);
}

.footer-bottom {
    background: rgba(10,20,14,1);
    padding: 1.5rem 0;
    width: 100%;
}

.footer-bottom .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.footer-bottom h1 {
    color: rgba(255,255,255,0.38);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0;
}

.footer-bottom img {
    display: block;
    margin: 0 auto;
    max-width: 88px;
    filter: brightness(0.85) grayscale(20%);
    transition: filter var(--transition);
}
.footer-bottom img:hover { filter: brightness(1) grayscale(0%); }

.copyright {
    font-size: 0.72rem;
    margin-top: 0;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-family: 'DM Sans', sans-serif;
}

/* info-block shared style (used on sub-pages) */
.info-cover-image-content h1 { font-size: 2.4rem; }

th, td { padding: 1rem 1.25rem; }

.info-container {
    padding: 4rem 0 0;
    flex-direction: row;
    align-items: center;
}

/*------------------------------------*\
  #Mobile Navigation (max 768px)
\*------------------------------------*/
@media (max-width: 768px) {

    /* Nav container */
    .nav-container {
        padding: 0 1.25rem;
        height: 64px;
        gap: 1rem;
    }

    .logo img { height: 44px; }

    /* ── Hamburger button ── */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        padding: 0;
        background: none;
        border: 1.5px solid var(--clr-border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        z-index: 1005;
        flex-shrink: 0;
        transition: border-color var(--transition), background var(--transition);
    }

    .mobile-menu-toggle:hover {
        border-color: var(--clr-forest-light);
        background: var(--clr-sage-pale);
    }

    .hamburger-line {
        display: block;
        width: 18px;
        height: 1.5px;
        background: var(--clr-forest);
        border-radius: 2px;
        transition: all 0.3s ease-in-out;
    }

    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    /* ── Dropdown chevron toggle button (mobile only) ── */
    .dropdown-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: none;
        border: 1.5px solid var(--clr-border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        padding: 0;
        margin-right: 0.75rem;
        color: var(--clr-text-light);
        font-size: 0.75rem;
        transition: transform 0.3s ease, background var(--transition),
                    color var(--transition), border-color var(--transition);
        flex-shrink: 0;
    }

    .dropdown.active .dropdown-toggle-btn {
        transform: rotate(180deg);
        background: var(--clr-sage-pale);
        color: var(--clr-forest);
        border-color: var(--clr-forest-light);
    }

    /* ── Slide-in panel ── */
    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 88vw;
        height: 100vh;
        background: var(--clr-white);
        border-left: 1px solid var(--clr-border);
        box-shadow: -8px 0 32px rgba(26,58,42,0.12);
        transform: translateX(100%);
        transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
        z-index: 1001;
        overflow-y: auto;           /* panel scrolls; children are contained */
        overflow-x: hidden;         /* ← prevents any child from bleeding out */
        padding: 80px 0 2rem;
        display: flex;
        align-items: flex-start;
        flex-direction: column;     /* stack children vertically */
    }

    .main-nav.active { transform: translateX(0); }

    /* ── Nav list ── */
    .main-nav ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
        position: static;
        box-shadow: none;
        background: transparent;
    }

    /* Each nav item is a flex row: link + toggle button */
    .main-nav .nav-item {
        display: flex;
        align-items: center;
        flex-wrap: wrap;            /* lets sub-menu wrap below on its own row */
        width: 100%;
        border-bottom: 1px solid var(--clr-border);
        position: static;           /* CRITICAL: kills any absolute/fixed leakage */
    }

    .main-nav .nav-item:last-child { border-bottom: none; }

    /* Suppress desktop-only pseudo-elements */
    .main-nav .dropdown > .nav-link::before { display: none; }
    .main-nav .nav-link::after             { display: none; }

    /* Nav link in panel */
    .nav-link {
        display: flex;
        align-items: center;
        flex-grow: 1;
        padding: 0.95rem 1.25rem;
        color: var(--clr-text);
        font-size: 0.92rem;
        font-weight: 500;
        background: none;
        border-radius: 0;
        white-space: normal;
        gap: 0;
        transition: background var(--transition), color var(--transition);
    }

    .nav-link:hover {
        background: var(--clr-sage-pale);
        color: var(--clr-forest);
    }

    /* ── Mobile sub-menu ─────────────────────────────────────────────────────
       CRITICAL FIXES:
       • position: static   — no longer fixed/absolute; stays inside the panel
       • width: 100%        — fills the panel width, never overflows
       • max-width: 100%    — hard cap
       • overflow: hidden   — clips during animation
    ─────────────────────────────────────────────────────────────────────────*/
    .main-nav .nav-item.dropdown .dropdown-menu { display: none; }
    .main-nav .nav-item.dropdown.active .dropdown-menu { display: flex; }

    .dropdown .dropdown-menu {
        /* Layout — must be static, column, full width */
        position: static !important;    /* override the fixed positioning from desktop */
        display: flex;
        flex-direction: column;
        flex-basis: 100%;               /* forces wrap below the link row */
        width: 100%;
        max-width: 100%;
        min-width: unset;

        /* Appearance */
        background: var(--clr-sage-pale);
        border: none;
        border-top: 1px solid var(--clr-border);
        border-radius: 0;
        box-shadow: none;

        /* Animation */
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        transform: none !important;     /* override desktop transform */
        visibility: visible;
        transition: max-height 0.35s ease, opacity 0.3s ease;
    }

    .dropdown.active .dropdown-menu {
        max-height: 600px;
        opacity: 1;
        padding: 0.4rem 0;
    }

    /* Sub-menu links */
    .dropdown-link {
        display: block;
        width: 100%;
        padding: 0.75rem 1.25rem 0.75rem 2rem;
        color: var(--clr-text-mid);
        font-size: 0.85rem;
        font-weight: 400;
        border-right: none;
        border-bottom: 1px solid rgba(26,58,42,0.07);
        white-space: normal;
        position: static;
        background: none;
        transition: background var(--transition), color var(--transition),
                    padding-left var(--transition);
    }

    /* Hide desktop-only pseudo-elements */
    .dropdown-link::before { display: none; }
    .dropdown-link::after  { display: none; }

    .dropdown-link:hover {
        background: rgba(26,58,42,0.06);
        color: var(--clr-forest);
        padding-left: 2.25rem;
        font-weight: 500;
    }

    .dropdown-link:last-child { border-bottom: none; }

    /* ── General mobile layout ── */
    .footer-top .container { flex-direction: column; gap: 2rem; text-align: center; }
    .footer-content, .contact { text-align: center; }
    .social-links { justify-content: center; width: 100%; }
    th, td { padding: 0.75rem 0.9rem; }
    .info-container { padding: 3rem 1rem 0; flex-direction: column; align-items: center; }
}

/*------------------------------------*\
  #Footer Responsive Styles
\*------------------------------------*/
@media (max-width: 992px) {
    .footer-top-container { justify-content: center; gap: 3rem; }
    .footer-top-content, .contact { flex: 1 1 45%; min-width: 280px; }
    .contact .contact-content p { padding-top: 0; }
    .social-links { justify-content: flex-start; margin-top: 1.25rem; }
}

@media (max-width: 768px) {
    .footer-top { padding: 2.5rem 0; }
    .footer-top-container { flex-direction: column; align-items: center; gap: 2rem; padding: 0 1.25rem; }
    .footer-top-content, .contact { flex: 1 1 100%; max-width: none; text-align: center; }
    .footer-top-content h1, .contact h1 { text-align: center; margin-bottom: 0.5rem; }
    .footer-top-content p, .contact p { font-size: 0.82rem; line-height: 1.65; }
    .logo-placeholder { flex-direction: row; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
    .logo_image1, .logo_image2 { max-width: 58px; height: auto; margin: 0; }
    .contact-content p { padding-top: 0; margin-top: 0.75rem; }
    .social-links { justify-content: center; margin-top: 1.25rem; width: 100%; }
    .social-logos { height: 34px; width: 34px; }
    .footer-bottom { padding: 1.25rem 0; }
    .footer-bottom h1 { margin-bottom: 0.6rem; }
    .footer-bottom img { max-width: 80px; }
    .copyright { margin-top: 0.6rem; padding: 0 1rem; }
}