/* Sito pubblico – nessuna compilazione necessaria */

/* Colori e caratteri: vedi theme.css */

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.6 var(--sans);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4vw + 1rem, 2.8rem); }
h2 { font-size: clamp(1.3rem, 1.5vw + 1rem, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* Header: sempre in cima e su una sola riga. Sul computer le voci stanno nella barra; sul telefono in un menu a
   scomparsa (.site-menu è un popover) che si apre dal pulsante con l'impronta */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.site-header__inner { display: flex; align-items: center; gap: 12px 20px; min-height: 64px; padding-block: 8px; }
.site-header__actions { display: flex; align-items: center; gap: 10px; }
/* Il popover chiuso è nascosto dal browser: sul computer lo si mostra come una normale riga di voci nella barra */
.site-menu {
    display: flex; align-items: center; gap: 4px 16px; margin: 0 0 0 auto; padding: 0;
    position: static; inset: auto; width: auto; overflow: visible; border: 0; background: none; color: inherit;
}
.site-menu a { color: var(--ink); text-decoration: none; padding: 6px 2px; }
.site-menu a.active { color: var(--accent); }
@media (hover: hover) { .site-menu a:hover { color: var(--accent); } }
.menu-toggle {
    display: none; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.menu-toggle__paw { fill: var(--accent); }
.menu-toggle:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
@media (hover: hover) { .menu-toggle:hover { border-color: var(--accent); } }
@media (max-width: 760px) {
    .brand__name { font-size: 1.35rem; }
    .site-header__actions { margin-left: auto; }
    .menu-toggle { display: inline-grid; }
    /* Il menu sta nello strato più alto della pagina: fisso sotto la barra, largo quanto lo schermo */
    .site-menu {
        position: fixed; inset: 72px 16px auto 16px; margin: 0; padding: 8px;
        display: none; flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
    }
    .site-menu:popover-open { display: flex; }
    .site-menu a { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
    .site-menu a.active { background: var(--accent-soft); }
    @media (hover: hover) { .site-menu a:not(.active):hover { background: var(--hover); color: var(--ink); } }
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand__mark { display: block; height: 44px; width: auto; }
.brand__name { font-family: var(--brand); font-weight: 800; font-size: 1.6rem; letter-spacing: -.01em; line-height: 1; }

.site-main { flex: 1; padding-block: 32px 48px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .9rem; color: var(--ink-soft); }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 8px 24px; flex-wrap: wrap; padding-block: 20px; }
.site-footer p { margin: 0; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

/* Bottoni */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 2px solid var(--accent);
    background: var(--accent); color: var(--accent-ink); font: 600 1rem/1 var(--sans);
    text-decoration: none; cursor: pointer;
}
/* Solo con il mouse: sul telefono l'hover resta sul pulsante dopo il tocco */
@media (hover: hover) { .button:hover { filter: brightness(1.08); } }
.button--ghost { background: transparent; color: var(--accent); }
.button--small { min-height: 36px; padding: 6px 16px; font-size: .95rem; }

/* ---------- Homepage e «Come funziona» ---------- */
/* I disegni dei gatti hanno i contorni blu scuri: stanno sempre su un fondo chiaro, anche nei temi scuri */
:root { --shelf-wood: #c98b4f; }  /* --cat-disc, il fondo dei gatti, sta in theme.css: lo usa anche l'app */
@media (prefers-color-scheme: dark) { :root { --shelf-wood: #8a5a32; } }

.eyebrow { margin: 0; font: 800 .78rem/1.2 var(--sans); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.cat-disc { background: var(--cat-disc); border-radius: 28px; padding: 18px; }
.cat-disc img { display: block; width: 100%; height: auto; }

/* Pagine di errore (404, 500, 503): disegno dei gatti al centro, poi codice, titolo, testo e azioni */
.error-page { display: grid; justify-items: center; gap: 14px; text-align: center; padding-block: 8px 24px; }
.error-page__art { width: min(420px, 100%); padding: 22px 18px 12px; }
.error-page__art svg { display: block; width: 100%; height: auto; }
.error-page h1 { margin: 0; }
.error-page .lead { margin: 0; }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }

.home-hero { margin-top: -32px; padding-block: 48px 30px; }
.home-hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; }
.home-hero__text { display: grid; gap: 20px; min-width: 0; }
.home-hero__text p { margin: 0; }
.home-hero h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); font-weight: 900; line-height: 1.1; margin: 0; }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero__art { position: relative; }
.home-hero__art .cat-disc { padding: 26px 18px 10px; }

.home-section { padding-block: 56px; }
.home-section--tight { padding-block: 10px 40px; }
.home-band { background: var(--hover); }
.home-title { display: grid; gap: 8px; max-width: 46rem; margin-bottom: 28px; }
.home-title h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 900; margin: 0; }
.home-title p { margin: 0; }

/* Le funzioni come libri su due mensole */
.shelf { display: grid; gap: 92px; padding-top: 70px; }
.shelf__row { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; padding-bottom: 16px; }
.shelf__row::after { content: ""; position: absolute; left: -8px; right: -8px; bottom: 0; height: 16px; border-radius: 4px; background: var(--shelf-wood); box-shadow: 0 8px 0 -3px rgb(0 0 0 / .12); }
.book {
    position: relative; display: grid; gap: 8px; align-content: start; min-width: 0;
    padding: 18px 16px 18px 30px; border-radius: 6px 10px 10px 6px; color: var(--spine-ink);
    background: var(--c); box-shadow: inset 10px 0 0 rgb(0 0 0 / .18), inset -2px 0 0 rgb(255 255 255 / .1);
}
.book::before { content: ""; position: absolute; left: 30px; right: 16px; top: 10px; height: 4px; border-radius: 2px; background: rgb(255 255 255 / .35); }
.book h3 { margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--spine-ink); }
.book p { margin: 0; font-size: .93rem; line-height: 1.5; color: var(--spine-ink); opacity: .9; }
.book--tall { min-height: 250px; }
.book--mid { min-height: 216px; }
.book--low { min-height: 186px; }
.book__cat { position: absolute; right: 6px; top: -76px; width: 104px; height: auto; }
.book__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgb(255 255 255 / .16); color: var(--spine-ink); }
.book__icon svg { width: 24px; height: 24px; }

/* Perché è gratis */
.free { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; padding: 20px 22px; border: 1.5px dashed var(--line); border-radius: 18px; background: var(--surface); }
.free p { margin: 0; color: var(--ink-soft); }
.free b { color: var(--ink); }
.free__tag { font: 900 1.5rem/1 var(--serif); color: var(--accent); padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }

/* Schermate dell'app in una cornice */
.home-look { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 28px; align-items: end; }
.home-look figure { margin: 0; display: grid; gap: 14px; }
.browser { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 22px 46px rgb(35 54 86 / .18); background: var(--surface); }
.browser img { display: block; width: 100%; }
.browser__bar { display: flex; gap: 6px; padding: 9px 12px; background: var(--hover); border-bottom: 1px solid var(--line); }
.browser__bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.phone { width: 100%; max-width: 230px; border: 9px solid #233656; border-radius: 30px; overflow: hidden; box-shadow: 0 22px 46px rgb(35 54 86 / .22); background: #233656; }
.phone img { display: block; width: 100%; border-radius: 20px; }

/* Primi passi (sequenza vera: numerati) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; counter-reset: passo; }
.steps li { display: grid; gap: 10px; align-content: start; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); counter-increment: passo; }
.steps li::before {
    content: counter(passo); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--accent); color: var(--accent-ink); font: 900 1.2rem/1 var(--serif);
}
.steps h3, .steps p { margin: 0; }
.steps p { color: var(--ink-soft); font-size: .97rem; }

/* Anteprima della giornata dei gatti */
.teaser { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 30px; align-items: center; padding: 28px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); }
.teaser__text { display: grid; gap: 16px; min-width: 0; }
.teaser__text p, .teaser h2 { margin: 0; }
.teaser h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 900; }
.teaser__hours { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.teaser__hours li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.teaser__hours time { font: 900 1rem/1 var(--serif); color: var(--accent); font-variant-numeric: tabular-nums; }
.teaser__hours span { color: var(--ink-soft); }
.teaser__hours strong { color: var(--ink); }

.home-close__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.home-close__text { display: grid; gap: 18px; }
.home-close__text h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 900; margin: 0; }
.home-close__text p { margin: 0; }

/* La giornata, ora per ora */
.day { position: relative; display: grid; }
.day::before { content: ""; position: absolute; left: 80px; top: 10px; bottom: 10px; width: 4px; border-radius: 2px; background: repeating-linear-gradient(var(--line) 0 10px, transparent 10px 18px); }
.hour { position: relative; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 20px; padding-block: 22px; }
.hour__time { position: relative; z-index: 1; align-self: start; justify-self: start; margin-left: 38px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 900 1.05rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.hour__card { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.hour__story { display: grid; gap: 8px; min-width: 0; }
.hour__story h2 { font-size: 1.35rem; font-weight: 900; margin: 0; }
.hour__story p { margin: 0; }
.hour__fun { font-style: italic; color: var(--ink-soft); }
.hour__art { background: var(--cat-disc); border-radius: 18px; padding: 10px; }
.hour__art img { display: block; width: 100%; height: auto; }
.hour__shot { width: 150px; }
.hour__shot--wide { width: 260px; }
.hour__shot img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 18px 40px rgb(35 54 86 / .16); }

.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.more article { display: grid; gap: 6px; align-content: start; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.more h3, .more p { margin: 0; }
.more h3 { font-size: 1.05rem; font-weight: 800; }
.more p { color: var(--ink-soft); font-size: .93rem; }

@media (max-width: 860px) {
    .home-hero__grid, .home-close__grid, .home-look, .teaser, .free { grid-template-columns: 1fr; }
    .shelf__row { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
    .shelf { gap: 80px; }
    .book--tall, .book--mid, .book--low { min-height: 0; }
    .steps, .more { grid-template-columns: 1fr 1fr; }
    .home-look .phone { justify-self: center; }
    .teaser .cat-disc { max-width: 320px; }
    .hour { grid-template-columns: 1fr; gap: 10px; }
    .hour__time { margin-left: 0; }
    .day::before { display: none; }
    .hour__card { grid-template-columns: 110px minmax(0, 1fr); }
    .hour__shot, .hour__shot--wide { grid-column: 1 / -1; width: 100%; max-width: 300px; }
}
@media (max-width: 560px) {
    .shelf__row, .steps, .more { grid-template-columns: 1fr; }
    .book__cat { width: 80px; top: -52px; }
    .hour__card { grid-template-columns: 1fr; }
    .hour__art { max-width: 200px; }
    .home-section { padding-block: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
    .wiggle { animation: wiggle 5s ease-in-out infinite; transform-origin: 50% 90%; }
    @keyframes wiggle { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-3deg); } 96% { transform: rotate(3deg); } }
}

/* Card dei consigli */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-block: 16px 32px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card__link { color: inherit; text-decoration: none; display: block; }
.card__link:hover .card__title { color: var(--accent); }
.card__covers { display: flex; gap: 6px; height: 90px; margin-bottom: 12px; }
.card__covers img, .card__covers .cover-placeholder { width: 60px; height: 90px; object-fit: cover; border-radius: 4px; }
.card__title { margin: 0 0 4px; }
.card__meta { margin: 0; font-size: .9rem; color: var(--ink-soft); }

.cover-placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font: 700 1.6rem var(--serif);
}

/* Filtri a chip */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; }
.chip:hover { border-color: var(--accent); }
.chip--active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Pagina del consiglio */
.article-head { margin-bottom: 24px; }
.breadcrumb { margin-bottom: 8px; font-size: .9rem; }
.book-list { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 20px; }
.book-item { display: grid; grid-template-columns: 96px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.book-item__cover { width: 96px; height: 144px; object-fit: cover; border-radius: 4px; box-shadow: var(--shadow); }
.book-item__title { font-size: 1.2rem; margin-bottom: 4px; }
.book-item__body p:last-child { margin-bottom: 0; }

@media (max-width: 480px) {
    .book-item { grid-template-columns: 72px 1fr; }
    .book-item__cover { width: 72px; height: 108px; }
}

/* Testi lunghi */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.empty { padding: 32px; text-align: center; color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty--cat { display: grid; justify-items: center; gap: 12px; }
.empty--cat .cat-disc { width: min(260px, 100%); padding: 10px; border-radius: 18px; }
.empty--cat p { margin: 0; max-width: 46ch; }

/* Consigli di lettura: titolo con il disegno dei gatti accanto */
.page-hero { display: grid; grid-template-columns: 1fr minmax(180px, 320px); gap: 24px; align-items: center; margin-bottom: 8px; }
.page-hero > * { min-width: 0; }
.page-hero .cat-disc { padding: 12px 12px 4px; }
@media (max-width: 640px) {
    .page-hero { grid-template-columns: 1fr 120px; gap: 12px; }
    .page-hero .cat-disc { padding: 6px 6px 2px; border-radius: 18px; }
}

/* Profilo di un lettore: il gatto scelto al posto della foto, e in fondo il rimando a tutti i consigli */
.reader-head { display: flex; gap: 18px; align-items: center; }
.reader-head > div { min-width: 0; }
.reader-head h1 { margin: 0; }
.reader-head .lead { margin: 4px 0 0; }
.reader-head__cat { flex: none; width: 96px; height: 96px; }
/* Gatto con gli accessori: livelli sovrapposti nel cerchio (partials/cat) */
.cat-stack { position: relative; display: inline-block; aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.cat-stack img { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 480px) { .reader-head__cat { width: 72px; height: 72px; } }
.more-box { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 16px; margin-block: 8px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.more-box .cat-disc { flex: none; width: 150px; padding: 8px; border-radius: 16px; }
.more-box__title { margin: 0 0 8px; font-weight: 700; }

/* Paginazione */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-block: 24px; }
.pagination__item { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; }
.pagination__item.is-disabled { color: var(--ink-soft); opacity: .6; }

/* Moduli */
.form { display: grid; gap: 16px; margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--paper); color: var(--ink); font: inherit;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .9rem; margin: 0; }
.field--check { grid-template-columns: auto 1fr; align-items: start; column-gap: 10px; }
.field--check input { width: 20px; height: 20px; margin-top: 3px; }
.field--check label { font-weight: 400; }
.field--check .field__error { grid-column: 1 / -1; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 12px 16px; border-radius: 8px; }
.notice--success { background: var(--success-soft); color: var(--success); }

/* Spazi pubblicitari: discreti, etichettati, mai a ridosso di pulsanti */
.ad-slot { margin-block: 32px; padding-top: 4px; border-top: 1px solid var(--line); min-height: 0; }
.ad-slot__label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.book-list__ad .ad-slot { margin-block: 0; }

/* Segnalazioni */
.report-link { margin-top: 24px; text-align: right; }
.report-link a { color: var(--ink-soft); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 600; margin-bottom: 6px; }
.radio { display: flex; align-items: center; gap: 10px; font-weight: 400 !important; padding: 4px 0; }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); }
