:root {
    --ink: #1c1e21;
    --muted: #6b7280;
    --accent: #2563eb;
    --bg: #ffffff;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

.site-header {
    padding: 20px clamp(20px, 6vw, 80px);
    border-bottom: 1px solid var(--border);
}

.site-header-row { display: flex; align-items: center; gap: 24px; position: relative; }

.site-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
    display: inline-block;
    margin-right: auto;
}

.site-logo {
    display: block;
    max-height: 40px;
    width: auto;
}

.site-tagline {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/*
 * Site navigation (App\Core\MenuRenderer, render_menu() — Admin > Menus).
 * Dropdowns/mega menus open on :hover/:focus-within, no JS. The mobile
 * hamburger toggle is the same hidden-checkbox + label + sibling-combinator
 * technique used for the page-builder's tabs block (see the comment above
 * .block-tabs below) — #site-nav-toggle and .site-nav are siblings inside
 * .site-header-row, so ":checked ~ .site-nav" works regardless of the
 * <label> sitting between them in the markup.
 */
.site-nav-toggle-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.site-nav-toggle-label {
    display: none; cursor: pointer; padding: 6px; margin-left: auto;
    position: relative; width: 22px; height: 14px; flex-shrink: 0;
}
.site-nav-toggle-label span {
    position: absolute; left: 0; width: 22px; height: 2px; background: var(--ink); border-radius: 1px;
    transition: top .18s ease, transform .18s ease, opacity .12s ease;
}
.site-nav-toggle-label span:nth-child(1) { top: 0; }
.site-nav-toggle-label span:nth-child(2) { top: 6px; }
.site-nav-toggle-label span:nth-child(3) { top: 12px; }
/* Hamburger -> X: the two outer bars slide to center and rotate into a cross, the middle bar fades out — the only visual cue (open/closed) this toggle had was the menu itself appearing, nothing on the icon that triggered it. */
.site-nav-toggle-checkbox:checked ~ .site-nav-toggle-label span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.site-nav-toggle-checkbox:checked ~ .site-nav-toggle-label span:nth-child(2) { opacity: 0; }
.site-nav-toggle-checkbox:checked ~ .site-nav-toggle-label span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.menu { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; gap: 2px; }
.menu-item { position: relative; }
.menu-item > a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.menu-item > a:hover { color: var(--accent); }

.menu-dropdown {
    display: none; position: absolute; top: 100%; left: 0; z-index: 40; min-width: 200px;
    list-style: none; margin: 4px 0 0; padding: 6px; background: #fff;
    border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
}
.menu-item-has-children:hover > .menu-dropdown,
.menu-item-has-children:focus-within > .menu-dropdown { display: block; }
.menu-dropdown .menu-item > a { padding: 8px 10px; font-weight: 500; white-space: nowrap; }
.menu-dropdown .menu-item > a:hover { background: #f6f7f9; }
.menu-dropdown .menu-dropdown { top: -7px; left: 100%; margin: 0 0 0 4px; } /* third-level flyout, to the right */

/*
 * A mega panel anchored to its own <li> (like .menu-dropdown is) would get
 * cut off — or force the whole page to scroll horizontally — the moment its
 * trigger item sits anywhere but the far left, since a ~480px-wide panel
 * routinely runs past the viewport edge. Instead .menu-item-mega opts out
 * of .menu-item's own positioning context (position: static) so .menu-mega
 * anchors to .site-header-row instead — full header width, so it can never
 * extend past the header itself, which never overflows the viewport.
 */
.menu-item-mega { position: static; }
.menu-mega {
    display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
    padding: 24px; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 28px rgba(0, 0, 0, .1);
}
.menu-item-mega:hover > .menu-mega,
.menu-item-mega:focus-within > .menu-mega { display: grid; }
.menu-mega-col-title { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.menu-mega-col-title:hover { color: var(--accent); }
.menu-mega-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.menu-mega-col ul a { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.menu-mega-col ul a:hover { color: var(--accent); }

/*
 * Footer menu reuses the same .menu classes as a flat horizontal row —
 * nesting still works, but a dropdown/mega panel opening from the bottom
 * of the page is easy to clip, so keep footer menus single-level. The
 * `position: relative` here isn't optional, though: .menu-item-mega gives
 * up its own positioning context (see .menu-mega above), so without a
 * positioned ancestor somewhere a footer mega item's panel would anchor to
 * the whole document instead of the footer.
 */
.site-footer-nav { position: relative; }
.site-footer-nav .menu { justify-content: center; margin-bottom: 10px; }
.site-footer-nav .menu-item > a { font-weight: 500; font-size: 13px; color: var(--muted); }
.site-footer-nav .menu-item > a:hover { color: var(--accent); }

@media (max-width: 720px) {
    /*
     * .site-header-row needs flex-wrap: wrap for .site-nav's `order: 3;
     * width: 100%` to actually drop it onto its own full-width row below
     * the logo/hamburger — without it, flex's default nowrap keeps every
     * child (including the opened nav) squeezed onto one line instead,
     * which is what made the open mobile menu render inline next to the
     * hamburger icon instead of as a dropdown underneath it.
     */
    .site-header-row { flex-wrap: wrap; }
    .site-nav-toggle-label { display: flex; }
    .site-nav { display: none; width: 100%; order: 3; margin-top: 12px; }
    .site-nav-toggle-checkbox:checked ~ .site-nav { display: block; }

    .menu { flex-direction: column; gap: 0; }
    .menu-item > a { padding: 10px 4px; border-bottom: 1px solid var(--border); border-radius: 0; }
    .menu-dropdown, .menu-mega {
        display: block !important; position: static; box-shadow: none; border: none; border-radius: 0;
        margin: 0; padding: 0 0 0 16px; background: none;
    }
    .menu-mega { display: flex !important; flex-direction: column; gap: 14px; }
    .menu-dropdown .menu-item > a { border-bottom: 1px dashed var(--border); }
}

.site-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
}

.page-heading { font-size: 28px; margin-bottom: 4px; }
.lede { color: var(--muted); margin-top: 0; }

.post-summary {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
}
.post-summary h2 { margin: 0 0 6px; font-size: 22px; }
.post-summary a { color: var(--ink); text-decoration: none; }
.post-summary a:hover { color: var(--accent); }
.post-meta { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.read-more { color: var(--accent); font-size: 14px; text-decoration: none; }

.single-post h1, .single-page h1 { font-size: 32px; margin-bottom: 8px; }
.post-content { margin-top: 24px; font-size: 17px; }
.post-content img { max-width: 100%; height: auto; border-radius: 6px; }
.post-content h2 { font-size: 24px; margin-top: 32px; }
.post-content h3 { font-size: 20px; margin-top: 24px; }
.post-content pre { background: #f6f7f9; padding: 14px; border-radius: 6px; overflow-x: auto; }
.post-content blockquote { border-left: 3px solid var(--accent); margin: 0; padding-left: 16px; color: var(--muted); }

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 30px 20px;
    border-top: 1px solid var(--border);
}

.not-found { text-align: center; padding: 60px 0; }

/* "Full Width" custom page template (themes/default/templates/page-templates/full-width.php) */
.site-content.full-width { max-width: none; padding: 0; }
.hero-band { background: #f6f7f9; border-bottom: 1px solid var(--border); padding: 64px 20px; text-align: center; }
.hero-band-inner h1 { font-size: 36px; margin: 0; }
.full-width-content { max-width: 720px; margin: 0 auto; padding: 40px 20px; font-size: 17px; }
.full-width-content img { max-width: 100%; height: auto; border-radius: 6px; }

/* FAQ module (render_faq()) */
.cmspress-faq { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.cmspress-faq-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; }
.cmspress-faq-item summary { cursor: pointer; font-weight: 600; }
.cmspress-faq-answer { margin-top: 10px; color: var(--muted); }

/* Page builder blocks (App\Core\BlockRenderer, themes/default/templates/page.php) */
.block-heading { margin: 32px 0 12px; }
.block-text { margin: 16px 0; }
.block-text p:first-child { margin-top: 0; }
.block-image { margin: 24px 0; text-align: center; }
.block-image img { max-width: 100%; height: auto; border-radius: 6px; }
.block-image figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; }
.block-button {
    display: inline-block; margin: 16px 0; padding: 11px 22px; border-radius: 7px;
    font-weight: 600; text-decoration: none;
}
.block-button-primary { background: var(--accent); color: #fff; }
.block-button-secondary { background: none; border: 1px solid var(--border); color: var(--ink); }
.block-spacer-sm { height: 16px; }
.block-spacer-md { height: 32px; }
.block-spacer-lg { height: 64px; }
.block-html { margin: 16px 0; }
.block-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 24px 0; align-items: center; }
@media (max-width: 640px) {
    .block-columns { grid-template-columns: 1fr; }
}
.block-accordion { margin: 24px 0; display: flex; flex-direction: column; gap: 10px; }
.block-accordion-item { border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; }
.block-accordion-item summary { cursor: pointer; font-weight: 600; }
.block-accordion-content { margin-top: 10px; color: var(--muted); }
.block-accordion-content p:first-child { margin-top: 0; }

/*
 * Pure-CSS tabs (App\Core\BlockRenderer::tabs()) — this theme ships no
 * front-end JS, so tab switching is done with hidden radio inputs + labels,
 * matched to their panel purely by sibling position. Radios, the <nav> (not
 * a <div>, so it isn't counted among the :nth-of-type(div) panels), and the
 * panels must all be direct children of .block-tabs for this to work.
 * Capped at 8 tabs — see BlockSanitizer::MAX_TAB_ITEMS, kept in lockstep.
 */
.block-tabs { margin: 24px 0; }
.block-tabs-radio { position: absolute; opacity: 0; pointer-events: none; }
.block-tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.block-tabs-label { padding: 10px 16px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.block-tabs-panel { display: none; }
.block-tabs-radio:nth-of-type(1):checked ~ .block-tabs-panel:nth-of-type(1) { display: block; }
.block-tabs-radio:nth-of-type(2):checked ~ .block-tabs-panel:nth-of-type(2) { display: block; }
.block-tabs-radio:nth-of-type(3):checked ~ .block-tabs-panel:nth-of-type(3) { display: block; }
.block-tabs-radio:nth-of-type(4):checked ~ .block-tabs-panel:nth-of-type(4) { display: block; }
.block-tabs-radio:nth-of-type(5):checked ~ .block-tabs-panel:nth-of-type(5) { display: block; }
.block-tabs-radio:nth-of-type(6):checked ~ .block-tabs-panel:nth-of-type(6) { display: block; }
.block-tabs-radio:nth-of-type(7):checked ~ .block-tabs-panel:nth-of-type(7) { display: block; }
.block-tabs-radio:nth-of-type(8):checked ~ .block-tabs-panel:nth-of-type(8) { display: block; }
.block-tabs-radio:nth-of-type(1):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(1) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(2):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(2) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(3):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(3) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(4):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(4) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(5):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(5) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(6):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(6) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(7):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(7) { color: var(--ink); border-bottom-color: var(--accent); }
.block-tabs-radio:nth-of-type(8):checked ~ .block-tabs-nav .block-tabs-label:nth-of-type(8) { color: var(--ink); border-bottom-color: var(--accent); }

/*
 * Slider module (render_slider(), themes/default/assets/js/slider.js). The
 * track is a flex row of full-width slides; without JS the container's
 * overflow:hidden simply clips it down to slide 1 (a working static
 * fallback), and slider.js applies translateX to actually page through them.
 */
.cmspress-slider { position: relative; overflow: hidden; border-radius: 8px; margin: 24px 0; }
.cmspress-slider-track { display: flex; transition: transform .5s ease; }
.cmspress-slider-slide { flex: 0 0 100%; position: relative; aspect-ratio: 21 / 9; background: #f6f7f9; }
.cmspress-slider-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmspress-slider-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 28px clamp(20px, 5vw, 56px) 22px;
    background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
    color: #fff;
}
.cmspress-slider-caption h3 { margin: 0 0 6px; font-size: clamp(20px, 3vw, 30px); }
.cmspress-slider-caption p { margin: 0 0 12px; opacity: .9; }
.cmspress-slider-btn {
    display: inline-block; padding: 9px 18px; border-radius: 6px; background: var(--accent);
    color: #fff; text-decoration: none; font-weight: 600; font-size: 14px;
}
.cmspress-slider-prev, .cmspress-slider-next {
    position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%;
    border: none; background: rgba(0, 0, 0, .35); color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}
.cmspress-slider-prev:hover, .cmspress-slider-next:hover { background: rgba(0, 0, 0, .55); }
.cmspress-slider-prev { left: 14px; }
.cmspress-slider-next { right: 14px; }
.cmspress-slider-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 7px; }
.cmspress-slider-dot { width: 8px; height: 8px; padding: 0; border-radius: 50%; border: none; background: rgba(255, 255, 255, .5); cursor: pointer; }
.cmspress-slider-dot.active { background: #fff; }
@media (max-width: 640px) {
    .cmspress-slider-slide { aspect-ratio: 4 / 3; }
    .cmspress-slider-prev, .cmspress-slider-next { width: 32px; height: 32px; font-size: 13px; }
}

/* Testimonials module (render_testimonials()) */
.cmspress-testimonials { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.cmspress-testimonial { margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 8px; }
.cmspress-testimonial-rating { color: #f59e0b; letter-spacing: 2px; margin-bottom: 8px; }
.cmspress-testimonial blockquote { margin: 0 0 14px; font-style: italic; }
.cmspress-testimonial figcaption { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cmspress-testimonial-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cmspress-testimonial-role { color: var(--muted); font-size: 13px; }
