/* ===================== */
/* Variables & Reset */
/* ===================== */
:root {
    /* Colors */
    --color-primary: #2f4f3a;
    --color-primary-lighter: #2f5f3a;
    --color-primary-light: #90ee90;
    --color-background: #f9f9f9;
    --color-text: #333;
    --color-text-light: #f4f9f4;
    --color-link: #cfe8cf;
    --color-jd-blue: #3da9fc;
    --color-jd-orange: #ffb703;

    /* Typography */
    --font-family-base: 'Quicksand', Arial, sans-serif;
    --font-family-handwriting: 'Caveat', cursive;

    --font-size-h1: 2.4rem;
    --font-size-h2: 1.8rem;
    --font-size-h3: 1.4rem;
    --font-size-base: 1rem;
    --font-size-small: 0.9rem;
}

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

body {
    font-family: var(--font-family-base);
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    scroll-behavior: smooth; /* smooth scroll for anchor links & scrollTopBtn */
}

/* ===================== */
/* Header */
/* ===================== */
.site-header {
    position: relative;
    width: 100%;
    background-image: url('../images/header_bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--color-text-light);
    border-radius: 0 0 12px 12px;
    z-index: 1000;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}

.site-header__inner {
    position: relative;
    max-width: 1200px;
    margin:0 auto;
    padding:2rem;
    text-align:center;
    z-index:1;
}

.site-header__title { font-size: var(--font-size-h1); }
.site-header__subtitle {
    font-family: var(--font-family-handwriting);
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0.25rem 0 1rem;
    color: rgba(244,249,244,0.95);
}
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  display: none;
}

/* ===================== */
/* Navigation */
.main-nav {
    display: flex;
    justify-content:center;
    gap:1.5rem;
    transition: margin 0.2s ease;
}
.main-nav__link {
    color:white;
    text-decoration:none;
    font-weight:600;
    padding:0.3rem 0.6rem;
    border-radius:4px;
    transition: background 0.3s;
}
.main-nav__link:hover { background: rgba(61,169,252,0.2); }
.main-nav__link.is-active { background: rgba(61,169,252,0.4); }
.mobile-nav-toggle {
    display:none;
    background: var(--color-jd-blue);
    color:white;
    border:none;
    padding:0.5rem 1rem;
    font-size:1rem;
    border-radius:4px;
    cursor:pointer;
}

/* ===================== */
/* Layout */
.layout {
    position: relative;
    max-width:1200px;
    margin: 2rem auto 4rem auto;
    padding:2rem;
    display:flex;
    gap:2rem;
    border-radius:8px;
    box-shadow:0 8px 20px rgba(0,0,0,0.1);
    background-image: url('../images/main_bg.png');
    background-size: cover;
    background-position: center;
}
.layout::before {
    content:"";
    position:absolute;
    inset:0;
    background: rgba(255,255,255,0.92);
    border-radius:8px;
    z-index:0;
}
.layout__main { flex:2; position:relative; z-index:1; }
.layout__sidebar {
    flex:1;
    background:#f4f9f4;
    padding:2rem;
    border-radius:8px;
    box-shadow:5px 5px 20px rgba(0,0,0,0.12);
    position:sticky;
    top:2rem;
    z-index:1;
}

/* ===================== */
/* Content Sections */
.content-section { margin-bottom:2rem; }
.content-section h2 { font-size: var(--font-size-h2); margin-bottom:0.5rem; }
.content-section h3 { font-size: var(--font-size-h3); margin-bottom:0.5rem; }
.content-section p { margin-bottom:1rem; line-height:1.5; }
.content-section a {
    color: var(--color-jd-blue);
    text-decoration:none;
    font-weight:500;
    border-radius:5px;
    transition: background 0.3s, transform 0.2s;
}
.content-section a:hover { background-color: rgba(61,169,252,0.2); transform:translateX(2px); }
.content-section a.is-active, .content-section a:focus {
    background-color: var(--color-jd-blue);
    color:white;
    outline:2px solid var(--color-jd-blue);
    outline-offset:2px;
}
.content-section blockquote {
    font-style: italic;
    color: var(--color-primary);
    border-left:3px solid var(--color-jd-blue);
    padding-left:0.75rem;
    margin:1rem 0;
    line-height:1.5;
    font-size:0.95rem;
}
.content-image { display:block; margin:1rem auto 0; max-width:100%; }

/* ===================== */
/* Sidebar */
.sidebar-section { margin-bottom:2rem; }
.sidebar-section__title { margin-bottom:1rem; border-left:4px solid var(--color-jd-orange); padding-left:0.5rem; }
.sidebar-section a { color: var(--color-primary-lighter); text-decoration:none; }
.sidebar-section a:hover { text-decoration:underline; }
.sidebar-section blockquote {
    font-style:italic;
    color: var(--color-primary);
    border-left:3px solid var(--color-jd-orange);
    padding-left:0.75rem;
    margin:1rem 0;
    line-height:1.5;
    font-size:0.95rem;
}
.contact-card { text-align:center; margin-bottom:1.5rem; }
.contact-card__image { width:90%; border-radius:8px; margin:0 auto 0.75rem; display:block; }
.contact-card__name { font-weight:600; }
.contact-details p { margin-bottom:1rem; line-height:1.4; }
.contact-details a { color: var(--color-primary-lighter); text-decoration:none; }
.contact-details a:hover { text-decoration:underline; }

/* Sidebar lists */
.sidebar-list { list-style:none; padding-left:0; margin-bottom:1rem; }
.sidebar-list li { margin-bottom:1rem; line-height:1.4; }
.sidebar-list strong { color: var(--color-primary); }
.sidebar-list-sub { font-style:italic; font-size:0.9rem; color:var(--color-text); }
.sidebar-note { font-size:0.95rem; margin-bottom:0.5rem; }
.sidebar-date { font-size:0.85rem; color: var(--color-primary-lighter); }
.sidebar-text { font-size:0.95rem; line-height:1.5; color: var(--color-primary); margin-bottom:1rem; }
.sidebar-text .author { display:block; font-size:0.85rem; font-style:italic; color: var(--color-primary-lighter); margin-top:0.5rem; text-align:right; }
.sidebar-text p { margin-bottom:1rem; }
.sidebar-text em { font-style:italic; }

/* ===================== */
/* Footer */
.site-footer { background: var(--color-primary); color: var(--color-text-light); padding:2.5rem 2rem 2rem; border-radius:12px 12px 0 0; }
.site-footer__inner { max-width:1200px; margin:0 auto; text-align:center; }
.site-footer__legal { max-width:1000px; margin:0 auto 1.25rem; font-size: var(--font-size-small); line-height:1.6; color:rgba(244,249,244,0.95); }
.site-footer__legal a { color: var(--color-link); text-decoration:none; }
.site-footer__legal a:hover { text-decoration:underline; }
.footer-logos { display:flex; justify-content:center; gap:16px; margin-top:1.5rem; }
.footer-logos__img { height:50px; background:white; padding:4px; border-radius:8px; }

/* ===================== */
/* Scroll to top button */
#scrollTopBtn {
    position:fixed;
    bottom:2rem;
    right:2rem;
    z-index:100;
    background-color: var(--color-jd-blue);
    color:white;
    border:none;
    border-radius:50%;
    width:45px;
    height:45px;
    font-size:1.5rem;
    cursor:pointer;
    box-shadow:0 4px 12px rgba(0,0,0,0.3);
    opacity:0;
    pointer-events:none;
    transition: opacity 0.3s ease, transform 0.2s ease;
}
#scrollTopBtn.show { opacity:0.33; pointer-events:auto; }
#scrollTopBtn:hover { transform:translateY(-2px); opacity:1; }

/* ===================== */
/* Map wrapper */
.map-wrapper {
    position:relative;
    width:100%;
    padding-bottom:56.25%;
    overflow:hidden;
    border-radius:12px;
    box-shadow:0 8px 20px rgba(0,0,0,0.1);
    margin:1rem 0;
}
.map-wrapper iframe {
    position:absolute;
    top:0; left:0;
    width:100%; height:100%;
    border:0;
    border-radius:12px;
}

/* ===================== */
/* Responsive: Tablets & Phones */
/* ===================== */

/* Tablet */
@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
        padding: 1.5rem;
    }

    .layout__sidebar {
        position: relative;
        top: auto;
        box-shadow: none;
        margin-top: 2rem;
    }

    .site-header__title { font-size: 2rem; }
    .site-header__subtitle { font-size: 1.3rem; }
}

/* Mobile */
@media (max-width: 768px) {
    body { font-size: 0.95rem; }

    .layout {
        padding: 1rem;
        gap: 1rem;
    }

    .layout__main, .layout__sidebar {
        flex: 1 1 100%;
        width: 100%;
    }

    .main-nav {
        position: relative; /* changed from absolute */
        top: auto;          /* remove absolute positioning */
        left: auto;
        width: 100%;
        overflow: hidden;
        max-height: 0; 
        opacity: 0;
        padding: 0 0;
        display: flex;      /* always flex for proper layout */
        flex-direction: column;
        gap: 0;
        border-radius: 0 0 12px 12px;
        transition: max-height 0.19s ease, opacity 0.15s ease, padding 0.15s ease; 
        z-index: 999;
        will-change: height, opacity;
    }
    .main-nav.is-open {
        max-height: 500px;      /* big enough for all links */
        opacity: 1;
        padding: 1rem 0;
    }

    .main-nav__link:first-child {
        margin-top: 1.1rem;
    }
    .main-nav__link {
        display: block;
        padding: 0.75rem 1rem;
        text-align: center;
    }

    .mobile-nav-toggle {
        display: inline-block;
        margin-top: 1rem;
    }

    .site-header {
        overflow: visible;
    }

    .site-header__inner {
        padding: 1rem;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .site-header__title { font-size: 1.8rem; }
    .site-header__subtitle { font-size: 1.1rem; }
}

/* Small phones */
@media (max-width: 480px) {
    .layout {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .layout__sidebar {
        padding: 1rem;
    }

    .site-header__title { font-size: 1.5rem; }
    .site-header__subtitle { font-size: 1rem; }

    #scrollTopBtn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        bottom: 1rem;
        right: 1rem;
    }
}

