/* =============================================================================
 * nav.css — dropdown navigation. Loaded on every page.
 * Reuses the theme variables from style.css (--green, --green-dark, --white…).
 * On desktop: hover/focus reveals the dropdown. On mobile (the existing burger
 * menu): submenus render as an indented list, no JavaScript required.
 * ========================================================================== */

.main-nav .nav-item.has-children { position: relative; display: inline-flex; align-items: center; }

.main-nav .nav-parent { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.main-nav .nav-caret { font-size: .7em; transition: transform .2s ease; }

.main-nav .nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--white, #fff);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(6, 77, 59, 0.16);
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 60;
}

/* Reveal on hover or keyboard focus */
.main-nav .nav-item.has-children:hover > .nav-dropdown,
.main-nav .nav-item.has-children:focus-within > .nav-dropdown { display: flex; }
.main-nav .nav-item.has-children:hover > .nav-parent .nav-caret,
.main-nav .nav-item.has-children:focus-within > .nav-parent .nav-caret { transform: rotate(180deg); }

/* A little hover bridge so the menu doesn't vanish between parent and panel */
.main-nav .nav-dropdown::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }

.main-nav .nav-dropdown a {
    display: block;
    padding: 9px 12px;
    border-radius: 9px;
    font-weight: 700;
    font-size: .95rem;
    color: var(--green-dark, #064d3b);
    white-space: nowrap;
}
.main-nav .nav-dropdown a:hover { background: var(--green-soft, #e9fff6); color: var(--green, #0f8f63); }

/* -------- Mobile: submenu shown inline & indented (no JS needed) ---------- */
@media (max-width: 920px) {
    .main-nav .nav-item.has-children { display: block; width: 100%; }
    .main-nav .nav-parent { width: 100%; }
    .main-nav .nav-caret { display: none; }

    .main-nav .nav-dropdown {
        position: static;
        display: flex;
        box-shadow: none;
        padding: 2px 0 6px 14px;
        min-width: 0;
        border-left: 2px solid var(--green-soft, #e9fff6);
        margin-left: 2px;
    }
    .main-nav .nav-dropdown a { padding: 8px 6px; white-space: normal; }
}

/* =============================================================================
 * "In this section" — child links shown on a landing page (uses content.css
 * variables where available; safe standalone defaults here).
 * ========================================================================== */
.section-children { margin: 32px 0 8px; }
.section-children h2 { font-size: 1.3rem; margin: 0 0 14px; color: var(--green-dark, #064d3b); }
.section-children .child-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.section-children .child-card {
    display: block; padding: 16px 18px; border: 1px solid #e3e9e7; border-radius: 14px;
    background: #fff; transition: box-shadow .2s ease, transform .2s ease; color: inherit;
}
.section-children .child-card:hover { box-shadow: 0 12px 28px rgba(6,77,59,.12); transform: translateY(-2px); }
.section-children .child-card strong { display: block; color: var(--green-dark, #064d3b); font-size: 1.05rem; margin-bottom: 4px; }
.section-children .child-card span { color: #4d5156; font-size: .9rem; line-height: 1.5; }
