/* Shared site chrome — header, primary navigation.
 *
 * Every page with a navbar links this file, so the header and the nav look and
 * behave identically everywhere.  Page-local <style> blocks must NOT redefine
 * `header`, `header h1/p` or `nav` rules — that is exactly how the navbar
 * drifted apart between pages before.
 *
 * The <nav> markup itself is generated: run `scripts/sync_site_nav.py` in the
 * swiss-law repo (`--check` in CI/health check) to rewrite it from the single
 * canonical link list.
 */

header {
    background: var(--red, #D52B1E);
    color: #fff;
    padding: 2rem 1.5rem;
    text-align: center;
}
header h1 { font-size: 1.8rem; margin: 0 0 0.3rem; line-height: 1.25; }
header p  { opacity: 0.9; font-size: 1rem; margin: 0; line-height: 1.6; }
/* line-height is stated here rather than inherited from each page's own
 * body rule — api.html has no such rule, which made its red band shorter. */
header a  { color: #fff; }

nav {
    background: var(--dark, #1a1a1a);
    line-height: 1.6;
    padding: 0.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 1.5rem;
}
nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    margin: 0;
    padding: 0.15rem 0;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
nav a:hover { color: #fff; }
nav a[aria-current="page"] {
    color: #fff;
    font-weight: 600;
    border-bottom-color: var(--red, #D52B1E);
}

@media (max-width: 640px) {
    header { padding: 1.5rem 1rem; }
    header h1 { font-size: 1.4rem; }
    header p { font-size: 0.9rem; }
    nav { gap: 0.15rem 1rem; padding: 0.5rem 0.75rem; }
    nav a { font-size: 0.82rem; }
}

/* Footer tools row — the pages deliberately kept out of the five-item navbar.
 * Generated by scripts/sync_site_nav.py; do not hand-edit the markup. */
.site-tools {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}
.site-tools a[aria-current="page"] { font-weight: 600; }

/* Footer licence / attribution line.  Generated by scripts/sync_site_nav.py;
 * do not hand-edit the markup. */
.site-credit {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
    opacity: 0.75;
    line-height: 1.5;
}

/* Footer created by the sync for a page that had none (api.html).  Pages with
 * their own <footer> keep their own styling — this class is never added there. */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #e5e5e5;
}
.site-footer a { color: var(--red, #D52B1E); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
