/* ============================================================
   ICIAP 2027 — stylesheet
   Design tokens inherited from the AImageLab group site
   (aimagelab.unimore.it, "aimagelab-theme"): same palette,
   typeface, radii, 1.5px borders and flat (shadow-free) surfaces.
   Hex values are fallbacks; the oklab/oklch declarations that
   follow are the exact source tokens.
   ============================================================ */

:root {
    --color-base-100: #ffffff;
    --color-base-200: #f8f8f8;
    --color-base-200: oklch(98% 0 0);
    --color-base-300: #d7d7d7;
    --color-base-300: oklch(88% 0 0);
    --color-base-content: #18181b;
    --color-base-content: oklch(21% 0.006 285.885);

    --color-primary: #94001f;
    --color-primary: oklab(42.107% 0.15764 0.06234);
    --color-primary-content: #fafafa;
    --color-secondary: #bf0004;
    --color-secondary: oklch(50.542% 0.20712 28.8);
    --color-accent: #fa0068;
    --color-accent: oklch(63.016% 0.25215 9.207);
    --color-neutral: #404040;
    --color-neutral: oklch(37% 0 0);

    --color-red-legacy: #F04E22;

    --simple-gradient: linear-gradient(135deg, var(--color-base-100), var(--color-base-200));
    --reddish-gradient: linear-gradient(135deg, var(--color-primary) 70%, var(--color-red-legacy));

    --radius-box: 0.8rem;
    --radius-field: 0.8rem;
    --border: 1.5px;

    --measure: 1120px;
    --gutter: 1.5rem;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-feature-settings: 'liga' 1, 'calt' 1, 'ss04' 1;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-base-content);
    background: var(--color-base-100);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-primary); text-underline-offset: 2px; }
a:hover { color: var(--color-secondary); }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; margin: 0 0 0.5em; }

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
    border-radius: 4px;
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-primary);
    color: var(--color-primary-content);
    padding: 0.6rem 1rem;
    z-index: 100;
    border-radius: 0 0 var(--radius-field) 0;
}
.skip-link:focus { left: 0; color: var(--color-primary-content); }

/* ── Draft banner ─────────────────────────────────────────── */

.draft-banner {
    background: var(--color-base-content);
    color: #fff;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    text-align: center;
    padding: 0.5rem var(--gutter);
}
.draft-banner strong { font-weight: 600; }

/* ── Header / navigation ──────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: var(--border) solid var(--color-base-300);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    line-height: 1.15;
}
.brand:hover { color: inherit; }
.brand-mark {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-primary);
}
.brand-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-neutral);
}

.nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    padding: 0.5rem;
    border: var(--border) solid var(--color-base-300);
    border-radius: var(--radius-field);
    cursor: pointer;
    line-height: 0;
}
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-base-content);
    border-radius: 2px;
    content: '';
    position: relative;
}
.nav-toggle-label span::before { top: -6px; position: absolute; }
.nav-toggle-label span::after  { top: 6px;  position: absolute; }

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-field);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-base-content);
}
.site-nav a:hover { background: var(--color-base-200); color: var(--color-primary); }
.site-nav a[aria-current="page"] {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-base-200);
}

@media (max-width: 900px) {
    .nav-toggle-label { display: block; }
    .site-nav {
        display: none;
        width: 100%;
        order: 3;
        padding-bottom: 0.75rem;
    }
    .nav-toggle:checked ~ .site-nav { display: block; }
    .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav a { padding: 0.7rem 0.75rem; }
    .header-inner { flex-wrap: wrap; }
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
    background: var(--simple-gradient);
    border-bottom: var(--border) solid var(--color-base-300);
    padding: clamp(3rem, 8vw, 5.5rem) 0;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    inset-inline-end: -12%;
    top: -40%;
    width: 46rem;
    height: 46rem;
    background: var(--reddish-gradient);
    opacity: 0.06;
    border-radius: 50%;
    pointer-events: none;
}
.hero .container { position: relative; }

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
    border: var(--border) solid var(--color-primary);
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 6.5vw, 4.25rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    margin-bottom: 0.25em;
}
.hero h1 .hero-year {
    background: var(--reddish-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-title {
    font-size: clamp(1.0625rem, 2.2vw, 1.375rem);
    font-weight: 600;
    color: var(--color-neutral);
    margin: 0 0 1.5rem;
    max-width: 46ch;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
    font-size: 1.0625rem;
    font-weight: 500;
}
.hero-facts li { display: flex; align-items: baseline; gap: 0.5rem; }
.hero-facts .label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-neutral);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    border-radius: var(--radius-field);
    border: var(--border) solid transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary {
    background: var(--color-primary);
    color: var(--color-primary-content);
}
.btn-primary:hover { background: var(--color-secondary); color: var(--color-primary-content); }
.btn-ghost {
    border-color: var(--color-base-300);
    color: var(--color-base-content);
    background: var(--color-base-100);
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn[aria-disabled="true"] {
    background: var(--color-base-200);
    color: var(--color-neutral);
    border-color: var(--color-base-300);
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Sections ─────────────────────────────────────────────── */

.section { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--color-base-200); border-block: var(--border) solid var(--color-base-300); }

.section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.section h3 { font-size: 1.25rem; font-weight: 600; margin-top: 2rem; }
.section-lead {
    font-size: 1.0625rem;
    color: var(--color-neutral);
    max-width: 70ch;
    margin-top: -0.25rem;
    margin-bottom: 2rem;
}

.prose { max-width: 72ch; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em 1.5rem; padding: 0; }
.prose li { margin-bottom: 0.35em; }
.prose a { text-decoration: underline; }

/* ── Cards & grids ────────────────────────────────────────── */

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
    background: var(--color-base-100);
    border: var(--border) solid var(--color-base-300);
    border-radius: var(--radius-box);
    padding: 1.5rem;
}
.card h3 { margin-top: 0; font-size: 1.125rem; }
.card p:last-child { margin-bottom: 0; }
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.card-link:hover { border-color: var(--color-primary); color: inherit; }
.card-link .more { color: var(--color-primary); font-weight: 600; font-size: 0.9375rem; }

/* ── Topic chips ──────────────────────────────────────────── */

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.chips li {
    border: var(--border) solid var(--color-base-300);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9375rem;
    background: var(--color-base-100);
}

/* ── Key dates ────────────────────────────────────────────── */

.dates { list-style: none; margin: 0; padding: 0; }
.dates li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.85rem 0;
    border-bottom: var(--border) solid var(--color-base-300);
}
.dates li:first-child { border-top: var(--border) solid var(--color-base-300); }
.dates .what { font-weight: 500; }
.dates .when {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}
.dates .when.tba { color: var(--color-neutral); font-weight: 500; }

/* ── Definition-style people/fee lists ────────────────────── */

.roles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.role {
    border: var(--border) solid var(--color-base-300);
    border-radius: var(--radius-box);
    padding: 1.25rem 1.5rem;
}
.role h3 {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--color-primary);
}
.role ul { list-style: none; margin: 0; padding: 0; }
.role li { padding: 0.15rem 0; }
.role .tba { color: var(--color-neutral); font-style: italic; }

/* ── Tables ───────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border: var(--border) solid var(--color-base-300); border-radius: var(--radius-box); }
table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.8rem 1rem; border-bottom: var(--border) solid var(--color-base-300); }
thead th { background: var(--color-base-200); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Callout ──────────────────────────────────────────────── */

.callout {
    border: var(--border) solid var(--color-base-300);
    border-left: 4px solid var(--color-red-legacy);
    border-radius: var(--radius-box);
    background: var(--color-base-200);
    padding: 1.1rem 1.35rem;
    margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--color-primary); }

/* ── Page header (interior pages) ─────────────────────────── */

.page-header {
    background: var(--simple-gradient);
    border-bottom: var(--border) solid var(--color-base-300);
    padding: clamp(2.25rem, 5vw, 3.5rem) 0;
}
.page-header h1 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.35rem;
}
.page-header p { margin: 0; color: var(--color-neutral); font-size: 1.0625rem; max-width: 65ch; }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
    background: var(--color-base-content);
    color: #e7e7ea;
    padding: 3rem 0 2rem;
    font-size: 0.9375rem;
}
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { color: var(--color-red-legacy); }
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding-bottom: 2rem;
    border-bottom: var(--border) solid rgba(255, 255, 255, 0.15);
}
.footer-grid h2 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b9b9bf;
    margin: 0 0 0.75rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.35rem; }
.footer-brand strong { font-size: 1.125rem; color: #fff; display: block; margin-bottom: 0.25rem; }
.footer-bottom {
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    color: #b9b9bf;
    font-size: 0.8125rem;
}

@media print {
    .site-header, .draft-banner, .hero-actions { display: none; }
    body { color: #000; }
}

/* ── Utilities ────────────────────────────────────────────── */

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
