/* ============================================================
   STILE: MINIMALE
   Bianco, nero, molto spazio. Testo piccolo, nessun effetto.
   Le schede della home mostrano il titolo sotto l'immagine.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap");

:root {
    --fg: #111;
    --bg: #fff;
    --muted: #9a9a9a;
    --line: #e6e6e6;
    --gap: 1.5rem;
    --pad: 1.5rem;
    --max: 1280px;
}
@media (min-width: 1024px) { :root { --pad: 3rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    letter-spacing: .005em;
    color: var(--fg);
    background: var(--bg);
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
strong { font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4rem 0; }
[hidden] { display: none !important; }

main, .site-header, .site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding-left: var(--pad);
    padding-right: var(--pad);
}

/* ---------- menu ---------- */
.site-header { display: flex; justify-content: flex-start; padding-top: 2.5rem; padding-bottom: 5rem; }
.menu { display: flex; flex-wrap: wrap; gap: .25rem 2rem; font-size: 13px; }
.menu a { color: var(--muted); transition: color .15s; }
.menu a:first-child { color: var(--fg); font-weight: 500; margin-right: auto; }
.menu a:hover, .menu a.active { color: var(--fg); }

.site-footer { padding-top: 6rem; padding-bottom: 3rem; font-size: 12px; color: var(--muted); }

/* ---------- home ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0 0 3rem; font-size: 12px; }
.filters a { color: var(--muted); text-transform: lowercase; transition: color .15s; }
.filters a:hover { color: var(--fg); }
.filters a.active { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

.projects { display: grid; grid-template-columns: 1fr; gap: 3rem var(--gap); }
@media (min-width: 768px)  { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .projects { grid-template-columns: repeat(3, 1fr); } }
.card { display: block; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f3f3f3; transition: opacity .2s; }
.card:hover img { opacity: .85; }
.card-text { padding-top: .75rem; display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.card h2 { margin: 0; font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.card span { font-size: 11px; color: var(--muted); text-align: right; text-transform: lowercase; }

/* ---------- pagina ---------- */
.header-media figure { margin: 0 0 3rem; }
.header-media img { width: 100%; max-height: 70vh; object-fit: cover; }
.header-media figcaption { display: none; }
.page-title { margin: 0 0 3rem; font-size: 1.5rem; font-weight: 400; line-height: 1.2; letter-spacing: -.01em; }

.prose { max-width: 40rem; }
.prose a, .intro aside a, .table a { border-bottom: 1px solid var(--line); transition: border-color .15s; }
.prose a:hover, .intro aside a:hover, .table a:hover { border-color: var(--fg); }
.prose blockquote { margin: 2rem 0; font-size: 1.15rem; line-height: 1.5; }

.intro { display: grid; grid-template-columns: 1fr; gap: 3rem; margin: 0 0 5rem; }
@media (min-width: 900px) { .intro { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 6rem; } }
.intro > aside { display: flex; flex-direction: column; gap: 2rem; font-size: 12px; align-self: start; position: sticky; top: 2rem; }
.intro aside p { margin: 0 0 .35rem; display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; }
.intro aside p:not(:has(strong)) { display: block; }
.intro aside p strong { font-weight: 400; color: var(--muted); }
section.prose { margin: 0 0 3rem; }

h1, h2, h3, h4 { font-weight: 400; line-height: 1.3; }
main > h2 { font-size: 13px; font-weight: 500; margin: 5rem 0 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
main > h3 { font-size: 13px; color: var(--muted); margin: 3rem 0 1rem; }

/* ---------- media ---------- */
.media { margin: 0 0 var(--gap); }
.media img, .media video { width: 100%; height: auto; }
.media.image a { display: block; cursor: zoom-in; }
.media figcaption { padding-top: .5rem; font-size: 11px; color: var(--muted); }
.media .frame { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #f3f3f3; }
.media .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media audio { width: 100%; }
.media.missing div { padding: 2rem; border: 1px solid #e33; color: #e33; font-size: 12px; }

.row, .grid { display: grid; grid-template-columns: 1fr; gap: var(--gap); margin-bottom: var(--gap); }
@media (min-width: 768px) { .row, .grid { grid-template-columns: repeat(var(--cols), 1fr); } }
.row .media, .grid .media { margin: 0; }
@media (min-width: 768px) {
    .row .media.image a { height: 100%; }
    .row .media.image { display: flex; flex-direction: column; height: 100%; }
    .row .media.image a { flex: 1; min-height: 0; }
    .row .media.image img { height: 100%; object-fit: cover; }
}
.grid .media.image a { aspect-ratio: 1; }
.grid .media.image img { height: 100%; object-fit: cover; }

/* ---------- tabelle ---------- */
.table { overflow-x: auto; margin-bottom: 1rem; font-size: 12px; }
.table table { border-collapse: collapse; width: 100%; min-width: 600px; table-layout: fixed; }
.table td, .table th { text-align: left; vertical-align: top; padding: .7rem 1rem .7rem 0; border-bottom: 1px solid var(--line); font-weight: 300; }
.table td:first-child, .table th:first-child { width: 9rem; color: var(--muted); }
.table strong { font-weight: 400; }

.space { display: block; }

/* ---------- lightbox ---------- */
#lightbox {
    position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
    padding: 2rem; background: rgba(255, 255, 255, .97); cursor: zoom-out;
}
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
body.lock { overflow: hidden; }
