/* ------------------------------------------------------------------
   Northern Tales — layout
   Site header, nav, main grid, footer.
   ------------------------------------------------------------------ */

/* --- Site header --- */

.site-header {
    border-bottom: 1px solid var(--rule);
    background: var(--bg-header);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header-inner {
    max-width: 78rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}
.site-brand {
    display: inline-flex;
    flex-direction: column;
    color: var(--fg);
    text-decoration: none;
    line-height: 1.1;
}
.site-brand:hover { color: var(--accent); }
.site-name {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.site-tagline {
    color: var(--fg-muted);
    font-size: 0.92rem;
    font-style: italic;
    margin-top: 0.15rem;
}

.site-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.98rem;
}
.site-nav-list a {
    color: var(--fg);
    text-decoration: none;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
}
.site-nav-list a:hover,
.site-nav-list a:focus-visible {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.site-nav-list .nav-modern {
    color: var(--fg-muted);
    font-style: italic;
}

.lang-switcher {
    justify-self: end;
    font-size: 0.95rem;
}
.lang-switcher-link {
    color: var(--fg-muted);
    text-decoration: none;
    border: 1px solid var(--rule-strong);
    padding: 0.3rem 0.7rem;
    border-radius: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.lang-switcher-link:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 780px) {
    .site-header-inner {
        grid-template-columns: 1fr auto;
        gap: 0.75rem;
    }
    .site-nav-list { grid-column: 1 / -1; }
}

/* --- Main page grid --- */

.page {
    max-width: 78rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* --- Overview pages --- */

.overview { max-width: calc(var(--measure) + 3.4rem); }
.overview-head { margin-bottom: 1.5rem; }
.overview-title { margin-bottom: 0.5rem; }
.overview-lead {
    color: var(--fg-muted);
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
}
.overview-body > * + * { margin-top: var(--step); }
.overview-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 1.25rem;
}
@media (min-width: 48rem) {
    .overview-grid { grid-template-columns: 1fr 1fr; }
}
.overview-item {
    border-left: 2px solid var(--rule-strong);
    padding: 0.5rem 0 0.5rem 1rem;
    transition: border-color 0.2s ease, padding-left 0.2s ease;
}
.overview-item:hover {
    border-left-color: var(--bronze);
    padding-left: 1.25rem;
}
.overview-item-title {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}
.overview-item-title a { color: var(--fg); text-decoration: none; }
.overview-item-title a:hover { color: var(--accent); }
.overview-item-meta {
    color: var(--fg-muted);
    font-size: 0.92rem;
    font-style: italic;
    margin: 0 0 0.4rem;
}
.overview-item-short { margin: 0; color: var(--fg); }

/* --- Category hub --- */

.cat-hub {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 1rem;
}
@media (min-width: 40rem) {
    .cat-hub { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64rem) {
    .cat-hub { grid-template-columns: 1fr 1fr 1fr; }
}
.cat-card {
    display: block;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--rule-strong);
    border-radius: 3px;
    text-decoration: none;
    color: var(--fg);
    background: var(--bg-raised);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.cat-card:hover {
    border-color: var(--bronze);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}
.cat-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: var(--accent);
}
.cat-card-count {
    font-size: 0.88rem;
    color: var(--fg-muted);
    margin: 0 0 0.5rem;
}
.cat-card-desc {
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* --- Footer --- */

.site-footer {
    border-top: 1px solid var(--rule);
    margin-top: 4rem;
    background: var(--bg-raised);
}
.site-footer-inner {
    max-width: 78rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.footer-head {
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    color: var(--accent);
}
.footer-note {
    color: var(--fg-muted);
    font-size: 0.95rem;
    margin: 0;
    max-width: 50rem;
}
.site-footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    display: grid;
    gap: 0.3rem;
}
.site-footer-nav a {
    color: var(--fg-muted);
    text-decoration: none;
}
.site-footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-footer-meta {
    grid-column: 1 / -1;
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--rule);
    color: var(--fg-muted);
    font-size: 0.9rem;
}
.site-footer-meta [lang="non"] { font-style: italic; }

@media (max-width: 720px) {
    .site-footer-inner { grid-template-columns: 1fr; }
}
