/*
 * Default Theme — app.css
 * Simple, responsive baseline for the CMS frontend. Plain CSS, no build step.
 */

:root {
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-bg: #ffffff;
    --color-surface: #f9fafb;
    --color-border: #e5e7eb;
    /* Primary accent follows the theme option (--tncms-primary, set inline in
       the master layout from theme_option('primary_color')). */
    --color-accent: var(--tncms-primary, #2563eb);
    --container: 64rem;
    /* Minimum breathing room a mega panel keeps from each viewport edge; its width
       is always clamped to calc(100vw - 2 * this) so a panel can never cause
       horizontal scrolling (never a 100vw width). */
    --mega-gutter: 1.5rem;
}

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

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

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1rem;
}

.site-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text);
}

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

.site-tagline {
    margin: 0.1rem 0 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lang-switcher__link {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-muted);
}

.lang-switcher__link:hover {
    text-decoration: none;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.lang-switcher__link.is-active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* POST-form locale switch (session/cookie storefront locale): the form must not
   disturb the flex row, and the submit button reuses the link styling. */
.lang-switcher__form {
    display: contents;
}

button.lang-switcher__link {
    background: transparent;
    cursor: pointer;
    font: inherit;
}

/* Menus
   Desktop: top-level items sit in a row; each parent's children live in an
   absolutely-positioned dropdown. Absolute positioning keeps the panel out of
   flow, so opening it never shifts the layout. The panel reveals via keyboard
   focus (:focus-within, always), JS hover intent (.is-open), or — when JS is
   absent — plain :hover. app.js adds `js` to <html> to switch off the hover
   fallback once the intent-based version is live.
   Mobile (<768px): the nav collapses behind a hamburger and submenus become
   inline accordions driven by their <button> (never hover). */
.menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu__item {
    position: relative;
}

.menu__link {
    display: inline-block;
    padding-block: 0.35rem;
    color: var(--color-text);
    font-weight: 500;
}

.menu__link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.menu__link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Active item, and any ancestor of the active item. */
.menu__item.is-active > .menu__link {
    color: var(--color-accent);
}

.menu__item.is-active > .menu__link[aria-current="page"] {
    box-shadow: inset 0 -2px 0 0 var(--color-accent);
}

/* Dropdown toggle: a real <button>, so it is keyboard- and AT-operable. */
.menu__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    margin-left: 0.1rem;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    line-height: 1;
}

.menu__toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.menu__toggle-icon {
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.18rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--transition-fast) var(--ease-out);
}

.menu__item.is-open > .menu__toggle .menu__toggle-icon,
.menu__toggle[aria-expanded="true"] .menu__toggle-icon {
    margin-top: 0.12rem;
    transform: rotate(-135deg);
}

.menu__sub {
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    .menu__sub {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        z-index: 50;
        min-width: 12rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.4rem;
        background: var(--color-bg);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(0.4rem);
        transition:
            opacity var(--transition) var(--ease-out),
            transform var(--transition) var(--ease-out),
            visibility var(--transition);
    }

    /* Invisible bridge so the pointer can cross the gap to the dropdown. */
    .menu__item.has-children::after {
        content: "";
        position: absolute;
        left: 0;
        top: 100%;
        width: 100%;
        height: 0.6rem;
    }

    .menu__sub .menu__link {
        display: block;
        padding: 0.4rem 0.6rem;
        border-radius: var(--radius-sm);
        color: var(--color-text);
    }

    .menu__sub .menu__link:hover,
    .menu__sub .menu__item.is-active > .menu__link {
        background: var(--color-tint);
        color: var(--color-accent);
    }

    /* Open: keyboard focus (always) and JS hover intent. */
    .menu__item.has-children:focus-within > .menu__sub,
    .menu__item.has-children.is-open > .menu__sub {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* No-JS fallback: reveal on hover. app.js removes this path by adding `js`. */
    html:not(.js) .menu__item.has-children:hover > .menu__sub {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Hamburger toggle — hidden on desktop, shown on small screens. */
.site-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    cursor: pointer;
}

.site-nav__toggle:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.site-nav__toggle-bars,
.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: currentColor;
    transition: transform var(--transition-fast) var(--ease-out),
        opacity var(--transition-fast) var(--ease-out);
}

.site-nav__toggle-bars {
    position: relative;
}

.site-nav__toggle-bars::before,
.site-nav__toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.site-nav__toggle-bars::before {
    top: -6px;
}

.site-nav__toggle-bars::after {
    top: 6px;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bars {
    background: transparent;
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bars::before {
    transform: translateY(6px) rotate(45deg);
}

.site-nav__toggle[aria-expanded="true"] .site-nav__toggle-bars::after {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 767.98px) {
    .site-nav__toggle {
        display: inline-flex;
    }

    /* Lock background scroll while the mobile drawer is open (set by app.js). */
    body.menu-open {
        overflow: hidden;
    }

    .site-nav {
        display: none;
        order: 10;
        flex-basis: 100%;
    }

    .site-nav.is-open {
        display: block;
    }

    .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .menu__item {
        border-bottom: 1px solid var(--color-border);
    }

    .menu__item.has-children {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .menu__link {
        /* Full-height, comfortably tappable row (>= 44px touch target). */
        display: flex;
        align-items: center;
        min-height: 44px;
        padding-block: 0.75rem;
    }

    .menu__toggle {
        /* Square >= 44px touch target for the accordion control. */
        min-width: 44px;
        min-height: 44px;
        padding: 0.75rem;
    }

    .menu__sub {
        grid-column: 1 / -1;
        display: none;
        padding-left: 1rem;
    }

    .menu__item.is-open > .menu__sub {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .menu__sub,
    .menu__toggle-icon,
    .site-nav__toggle-bars,
    .site-nav__toggle-bars::before,
    .site-nav__toggle-bars::after {
        transition: none;
    }
}

/* Mega menu (Phase 11B)
   A mega panel reuses the .menu__sub open mechanism from 11A (keyboard focus,
   JS hover intent, no-JS hover), so ARIA/animation behave identically. It adds
   a multi-column grid whose track count comes from the inline --mega-cols set
   per item. On mobile it degrades to a single stacked column inside the parent
   accordion (no horizontal overflow). */
.menu__label {
    vertical-align: middle;
}

.menu__icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

.menu__badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--color-accent-contrast);
    background: var(--color-accent);
    border-radius: var(--radius-pill);
    vertical-align: middle;
}

.menu__mega-grid {
    display: grid;
    grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu__mega-col {
    min-width: 0;
}

.menu__mega-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-block: 0.3rem;
    color: var(--color-heading);
    font-weight: 600;
}

.menu__mega-heading:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.menu__mega-desc {
    margin: 0.1rem 0 0.5rem;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.menu__mega-list,
.menu__mega-sublist {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu__mega-sublist {
    padding-left: 0.75rem;
}

.menu__mega-item > .menu__link {
    display: block;
    padding: 0.3rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

.menu__mega-item > .menu__link:hover,
.menu__mega-item > .menu__link[aria-current="page"] {
    background: var(--color-tint);
    color: var(--color-accent);
}

/* Widget-area mega panel (Phase 11C): the core widget renderer emits .tn-widget
   blocks; lay them out in the same column grid as children-based mega so both
   sources look consistent. Collapses to a single column on mobile. */
.menu__mega-widgets {
    display: grid;
    grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

.menu__mega-widgets .tn-widget {
    min-width: 0;
}

.menu__mega-widgets .tn-widget__title {
    margin: 0 0 0.5rem;
    color: var(--color-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.menu__mega-widgets .tn-widget__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Dynamic mega panel (Phase 11D): post cards pre-resolved in core. Uses the same
   column grid as the children/widget sources so every mega source looks
   consistent; collapses to one column on mobile. */
.menu__mega-cards {
    display: grid;
    grid-template-columns: repeat(var(--mega-cols, 4), minmax(0, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu__mega-card {
    min-width: 0;
}

.menu__mega-card-link {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

.menu__mega-card-link:hover,
.menu__mega-card-link[aria-current="page"] {
    background: var(--color-tint);
    text-decoration: none;
}

.menu__mega-card-media {
    display: block;
    overflow: hidden;
    border-radius: var(--radius-sm);
    aspect-ratio: 16 / 9;
    background: var(--color-tint);
}

.menu__mega-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu__mega-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.menu__mega-card-cat {
    color: var(--color-accent);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.menu__mega-card-title {
    color: var(--color-heading);
    font-weight: 600;
    line-height: 1.3;
}

.menu__mega-card-excerpt {
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.menu__mega-card-date {
    color: var(--color-muted);
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    /* Wide and full mega panels anchor to the content container
       (.site-header__inner is the page container) instead of their trigger, so a
       panel is balanced and on-screen no matter where its item sits in the nav
       (nav items float to the right of the brand, which previously pushed panels
       off the right edge). The container becomes the positioning context and the
       wide/full mega item opts out of being one. Content-width mega and classic
       dropdowns stay anchored under their own trigger. */
    .site-header__inner {
        position: relative;
    }

    .menu__item--mega:has(> .menu__mega--wide),
    .menu__item--mega:has(> .menu__mega--full) {
        position: static;
    }

    .menu__mega {
        padding: 1.25rem;
        /* Clamped to the viewport minus a gutter each side — never 100vw, so the
           panel can never widen the page or trigger horizontal scrolling. */
        width: min(48rem, calc(100vw - 2 * var(--mega-gutter)));
    }

    .menu__mega--content {
        width: min(32rem, calc(100vw - 2 * var(--mega-gutter)));
    }

    /* Wide: aligned to the container's left edge, viewport-clamped. */
    .menu__mega--wide {
        left: 0;
        right: auto;
        width: min(48rem, calc(100vw - 2 * var(--mega-gutter)));
    }

    /* Full: spans the content container, viewport-clamped. */
    .menu__mega--full {
        left: 0;
        right: 0;
        width: auto;
        max-width: calc(100vw - 2 * var(--mega-gutter));
    }

    /* Container-anchored panels drop from the bottom of the nav row (100% is the
       container height; minus its block padding) so there is no dead gap for the
       pointer to cross between the trigger and the panel. */
    .menu__item--mega:has(> .menu__mega--wide) > .menu__mega,
    .menu__item--mega:has(> .menu__mega--full) > .menu__mega {
        top: calc(100% - 1rem);
    }

    /* Trigger-anchored panels (classic dropdowns and content-width mega) flip to
       open leftward at the row's end so they never spill past the right edge.
       Container-anchored wide/full panels manage their own bounds and are excluded. */
    .menu > .menu__item:last-child:not(:has(> .menu__mega--wide)):not(:has(> .menu__mega--full)) > .menu__sub {
        left: auto;
        right: 0;
    }
}

@media (max-width: 767.98px) {
    /* Degrade the grid to a single stacked column inside the accordion. */
    .menu__mega {
        width: auto;
        max-width: none;
        padding-left: 1rem;
    }

    .menu__mega-grid,
    .menu__mega-widgets,
    .menu__mega-cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* Visually-hidden but available to assistive tech. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Main */
.site-main {
    padding-block: 2.5rem 3.5rem;
}

/* Entries (page / post) */
.entry-title {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.entry-meta,
.post-list__date {
    color: var(--color-muted);
    font-size: 0.9rem;
}

.entry-excerpt {
    font-size: 1.1rem;
    color: var(--color-muted);
}

.featured-image {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    margin: 1.25rem 0;
}

.entry-content {
    font-size: 1.05rem;
}

/* Editor HTML output (TinyMCE content) */
.entry-content img {
    max-width: 100%;
    height: auto;
}

.entry-content h2,
.entry-content h3 {
    line-height: 1.25;
    margin: 1.8rem 0 0.6rem;
}

.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.25rem 0;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.65rem;
    text-align: left;
}

.entry-content blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 1rem;
    border-left: 4px solid var(--color-border);
    color: var(--color-muted);
}

.entry-content pre {
    background: var(--color-surface);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow: auto;
}

.entry-content code {
    background: var(--color-surface);
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.95em;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

/* Figure + caption (Insert Media "Add caption") */
.cms-image {
    margin: 1.5rem 0;
}

.cms-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.cms-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-muted);
    text-align: center;
}

/* Archive */
.archive-title {
    font-size: 1.8rem;
    margin: 0 0 1.5rem;
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.post-list__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.post-list__link {
    font-size: 1.15rem;
    font-weight: 600;
}

/* Archive pagination (term archives). Rendered via
 * theme::partials.pagination from $posts->links(). */
.tn-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-top: 2rem;
}

.tn-pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.tn-pagination__link:hover {
    border-color: var(--color-accent, #2563eb);
}

.tn-pagination__link.is-active {
    background: var(--color-accent, #2563eb);
    border-color: var(--color-accent, #2563eb);
    color: #fff;
    font-weight: 600;
}

.tn-pagination__link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.tn-pagination__ellipsis {
    padding: 0 0.4rem;
    opacity: 0.7;
}

/* Content layout system (Phase 8A)
 * Reusable archive/post layout primitives, driven by Theme Options
 * (archive_layout / post_layout / sidebar_width). The same primitives are meant
 * to be reused by future page types (Docs, Ecommerce, …) — do not duplicate. */
.tn-content-layout {
    display: grid;
    gap: var(--space-xl, 2.5rem);
    align-items: start;
}

.tn-content-layout--full-width {
    grid-template-columns: minmax(0, 1fr);
}

.tn-content-layout--left-sidebar {
    grid-template-columns: var(--tn-sidebar-width, 320px) minmax(0, 1fr);
}

.tn-content-layout--right-sidebar {
    grid-template-columns: minmax(0, 1fr) var(--tn-sidebar-width, 320px);
}

.tn-content-main {
    min-width: 0;
}

.tn-content-sidebar {
    min-width: 0;
}

/* Mobile: every layout collapses to a single column. */
@media (max-width: 768px) {
    .tn-content-layout--full-width,
    .tn-content-layout--left-sidebar,
    .tn-content-layout--right-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Footer */
.section--cta {
    position: relative;
    z-index: 2;
    margin-bottom: -110px;
}

.section--cta .section__inner {
    /*box-shadow: 0 28px 80px rgba(15, 23, 42, .12); */
    
}
.section--cta .section__inner {
    position: relative;
    overflow: visible;
}

.section--cta .section__inner::after {
    content: "";
    position: absolute;

    left: 10%;
    right: 10%;
    bottom: -35px;

    height: 70px;

    background: rgba(59,95,226,.25);

    filter: blur(40px);

    z-index: -1;
}
.site-footer {
    padding-top: clamp(160px, 14vw, 220px);
}
.site-footer {
    margin-top: 0;
    padding: clamp(72px, 8vw, 120px) 0 48px;
    background: #f8fafc;
    border-top: 1px solid rgba(15, 23, 42, .06);
}

.site-footer__inner {
    display: block;
    max-width: var(--container, 64rem);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.site-footer__top {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(0, 2fr);
    gap: clamp(48px, 7vw, 96px);
    align-items: start;
}

.footer-brand {
    max-width: 360px;
}

.footer-brand__name {
    display: inline-flex;
    margin-bottom: 24px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}

.footer-brand__desc {
    margin: 0 0 24px;
    color: #475569;
    line-height: 1.8;
}

.site-social,
.footer-cols,
.footer-col__links,
.menu--footer {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.site-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding-inline: 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--color-accent, #2563eb);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 56px);
}

.footer-col__title {
    margin: 0 0 20px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
}

.footer-col__links {
    display: grid;
    gap: 12px;
}

.footer-col__links a {
    color: #64748b;
    text-decoration: none;
}

.footer-col__links a:hover {
    color: var(--color-accent, #2563eb);
}

.site-footer__meta {
    margin-top: 56px;
}

.site-footer__copy {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
}

@media (max-width: 1024px) {
    .site-footer__top {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .section--cta {
        margin-bottom: -72px;
    }

    .site-footer {
        padding-top: 128px;
    }
}

@media (max-width: 640px) {
    .site-footer {
        padding-block: 56px 36px;
    }

    .footer-cols {
        grid-template-columns: 1fr;
    }

    .site-footer__meta {
        margin-top: 36px;
    }
}

/* Widgets (Widget Foundation theme integration)
 * Styles the markup emitted by Core widgets (.tn-widget + BEM children) plus the
 * theme containers that wrap a rendered widget region in the sidebar and footer.
 * Token-driven (surface / border / radius / shadow / spacing) so the same rules
 * work in both light and dark mode. Core widgets render their own HTML, so there
 * are no per-widget Blade views — the theme only contributes these styles. */
.tn-sidebar-widgets {
    display: grid;
    gap: var(--space-lg, 1.5rem);
}

.tn-widget {
    background: var(--color-surface, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-lg, 1rem);
    padding: var(--space-lg, 1.5rem);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.06));
    color: var(--color-text, #0f172a);
}

.tn-widget__title {
    margin: 0 0 var(--space-sm, 0.75rem);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-heading, #0b1220);
}

.tn-widget__body {
    color: var(--color-muted, #64748b);
    line-height: 1.65;
}

.tn-widget__body a {
    color: var(--color-accent, #2563eb);
    text-decoration: none;
}

.tn-widget__body a:hover {
    text-decoration: underline;
}

.tn-widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-xs, 0.5rem);
}

.tn-widget__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2xs, 0.25rem) var(--space-sm, 0.75rem);
}

.tn-widget__item a {
    color: var(--color-text, #0f172a);
    text-decoration: none;
    transition: color var(--transition-fast, 120ms) var(--ease-out, ease);
}

.tn-widget__item a:hover {
    color: var(--color-accent, #2563eb);
}

.tn-widget__date,
.tn-widget__count {
    flex-shrink: 0;
    color: var(--color-muted, #64748b);
    font-size: 0.85rem;
}

.tn-widget__count {
    background: var(--color-surface-2, #f1f5f9);
    border-radius: var(--radius-pill, 999px);
    padding: 0 var(--space-xs, 0.5rem);
}

/* Footer widget regions — rendered below the menu-driven footer columns. The
 * column count is data-driven so 1–4 configured regions stay balanced. Widgets
 * inside the footer drop the card chrome and inherit the footer's own surface. */
.tn-footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 56px);
    margin-top: var(--space-xl, 2.5rem);
    padding-top: var(--space-xl, 2.5rem);
    border-top: 1px solid var(--color-border, #e2e8f0);
}

.tn-footer-widgets[data-columns="1"] { grid-template-columns: minmax(0, 1fr); }
.tn-footer-widgets[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tn-footer-widgets[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.tn-footer-widgets .tn-widget {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

@media (max-width: 768px) {
    .tn-footer-widgets,
    .tn-footer-widgets[data-columns="2"],
    .tn-footer-widgets[data-columns="3"] {
        grid-template-columns: minmax(0, 1fr);
    }
}
