/*
Theme Name:   Sera
Theme URI:    https://www.ilraccontodellasera.it
Author:       Davide Bertolino
Author URI:   https://www.davidebertolino.it
Description:  Il Racconto della Sera. Tema classico e leggero per leggere racconti: carta, inchiostro, una colonna sola. Nessuna risorsa esterna, nessun cookie. Pensato per DB Lettore.
Version:      0.2.0
Requires at least: 6.5
Requires PHP: 8.0
License:      GPL v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  sera
*/

:root {
    --carta:   #FAF7F0;
    --inchiostro: #1D1B18;
    --grigio:  #6B665F;
    --linea:   #E4DED3;
    --blu:     #2F4560;   /* l'ora blu: l'unico colore */
    --f-testo: "Newsreader", Georgia, "Times New Roman", serif;
    --colonna: 38rem;

    /* DB Lettore usa questi colori */
    --dblt-bg: var(--carta);
    --dblt-fg: var(--inchiostro);
    --dblt-muted: var(--grigio);
    --dblt-line: var(--linea);
    --dblt-accent: var(--blu);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--carta); color: var(--inchiostro);
    font-family: var(--f-testo); font-size: 1.125rem; line-height: 1.7;
    font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
a { color: var(--blu); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blu); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 1rem; left: 1rem; z-index: 1000; width: auto; height: auto; clip: auto; padding: .6rem 1rem; background: var(--inchiostro); color: var(--carta); }

.colonna { max-width: var(--colonna); margin: 0 auto; padding: 0 1.4rem; }

/* testata */
.testata { padding: 3rem 0 2.5rem; text-align: center; }
.testata__nome { font-size: clamp(2rem, 1.6rem + 2vw, 2.9rem); font-style: italic; margin: 0; letter-spacing: -.01em; }
.testata__nome a { color: var(--inchiostro); text-decoration: none; }
.testata__motto { margin: .3rem 0 0; color: var(--grigio); font-size: 1rem; }
.menu { list-style: none; margin: 1.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.6rem; font-size: .95rem; }
.menu a { color: var(--grigio); text-decoration: none; }
.menu a:hover, .menu .current-menu-item a { color: var(--inchiostro); }

.filetto { width: 3rem; height: 1px; background: var(--inchiostro); border: 0; margin: 0 auto 3rem; opacity: .5; }

/* il racconto della sera, in home */
.stasera { margin-bottom: 4rem; text-align: center; }
.occhiello { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--blu); margin: 0 0 .9rem; }
.stasera__titolo { font-size: clamp(2.1rem, 1.6rem + 2.4vw, 3.2rem); margin-bottom: .6rem; }
.stasera__titolo a, .voce__titolo a { color: inherit; text-decoration: none; }
.apertura { font-style: italic; font-size: 1.25rem; line-height: 1.55; color: #3a3631; margin: 0 auto 1.2rem; max-width: 32rem; }
.info { color: var(--grigio); font-size: .92rem; margin: 0; }
.info .sep { margin: 0 .45em; }
.leggi { display: inline-block; margin-top: 1.4rem; padding: .7em 1.6em; border: 1px solid var(--inchiostro); border-radius: 999px; color: var(--inchiostro); text-decoration: none; font-size: 1rem; }
.leggi:hover { background: var(--inchiostro); color: var(--carta); }

/* elenco */
.sezione__titolo { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--grigio); text-align: center; margin: 0 0 2rem; }
.elenco { list-style: none; margin: 0; padding: 0; }
.voce { padding: 1.6rem 0; border-top: 1px solid var(--linea); }
.voce:last-child { border-bottom: 1px solid var(--linea); }
.voce__titolo { font-size: 1.6rem; margin-bottom: .3rem; }
.voce__serie { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blu); margin: 0 0 .3rem; }
.voce .apertura { font-size: 1.05rem; margin: 0 0 .5rem; max-width: none; }

/* il racconto */
.racconto__testa { text-align: center; margin-bottom: 2.5rem; }
.racconto__titolo { font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.3rem); }
.racconto__testa .apertura { margin-top: .8rem; }
.racconto .dblt-toolbar { justify-content: center; }
.racconto .dblt-text p:first-of-type::first-letter { float: left; font-size: 3.6em; line-height: .85; padding: .06em .08em 0 0; }
.racconto__fine { text-align: center; margin: 3rem 0 0; color: var(--grigio); letter-spacing: .4em; }
.pagina__titolo { font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem); text-align: center; margin-bottom: 2rem; }
.contenuto p { margin: 0 0 1.1em; }
.contenuto blockquote { margin: 1.5em 0; padding-left: 1.2em; border-left: 2px solid var(--linea); font-style: italic; }

/* archivi, paginazione, ricerca */
.archivio__testa { text-align: center; margin-bottom: 2.5rem; }
.archivio__descrizione { color: #3a3631; }
.nav-links { display: flex; justify-content: space-between; margin: 2.5rem 0 0; font-size: .95rem; }
.cerca { display: flex; gap: .5rem; margin: 0 0 2rem; }
.cerca input[type="search"] { flex: 1; font: inherit; font-size: 1rem; padding: .55em .8em; border: 1px solid var(--linea); background: #fff; color: var(--inchiostro); border-radius: 4px; }
.cerca button { font: inherit; font-size: .95rem; padding: .55em 1.1em; border: 1px solid var(--inchiostro); background: transparent; color: var(--inchiostro); border-radius: 4px; cursor: pointer; }
.vuoto { text-align: center; color: var(--grigio); font-style: italic; }

/* serie (DB Lettore) */
.dblt-serie-panel { text-align: center; }
.dblt-serie-panel__azioni { justify-content: center; margin-top: 1.2rem; }
.dblt-btn-link { display: inline-block; padding: .6em 1.4em; border: 1px solid var(--inchiostro); border-radius: 999px; color: var(--inchiostro); text-decoration: none; }
.dblt-btn-link:not(.dblt-btn-link--ghost) { background: var(--inchiostro); color: var(--carta); }
.dblt-serie-elenco { list-style: none; margin: 0; padding: 0; }
.dblt-serie-elenco a { display: block; padding: 1.2rem 0; border-top: 1px solid var(--linea); color: var(--inchiostro); text-decoration: none; }
.dblt-serie-elenco__nome { display: block; font-size: 1.5rem; }
.dblt-serie-elenco__info { display: block; font-size: .85rem; color: var(--blu); }
.dblt-serie-elenco__sinossi { display: block; color: var(--grigio); margin-top: .3rem; }

/* piede */
.piede { margin-top: 5rem; padding: 2.5rem 0 3rem; border-top: 1px solid var(--linea); text-align: center; color: var(--grigio); font-size: .9rem; }
.piede .menu { margin: 0 0 1rem; }
.piede p { margin: .2rem 0; }

/* il lettore cambia i colori di tutta la pagina */
.dblt-has-reader .testata__nome a, .dblt-has-reader .racconto__titolo { color: var(--dblt-fg); }
.dblt-has-reader .apertura { color: var(--dblt-fg); opacity: .85; }
.dblt-has-reader .info, .dblt-has-reader .menu a, .dblt-has-reader .testata__motto, .dblt-has-reader .piede { color: var(--dblt-muted); }
.dblt-has-reader .piede, .dblt-has-reader .voce { border-color: var(--dblt-line); }
.dblt-has-reader .filetto { background: var(--dblt-fg); }
.dblt-has-reader a { color: var(--dblt-accent); }

@media print {
    body { background: #fff; font-size: 12pt; }
    .menu, .piede, .leggi { display: none; }
}

/* =========================================================================
   L'immagine della home: la lampada accesa, il titolo sul muro
   ====================================================================== */
.hero { position: relative; margin: 0 0 3rem; }
.hero__img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: cover; object-position: 70% center; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 18%; background: linear-gradient(to bottom, rgba(250,247,240,0), var(--carta)); pointer-events: none; }
.hero__testo { position: absolute; left: 6%; top: 50%; transform: translateY(-55%); max-width: 38%; z-index: 1; }
.hero .testata__nome { font-size: clamp(2.2rem, 1.2rem + 3.4vw, 4.4rem); line-height: 1.05; text-shadow: 0 0 24px rgba(250,247,240,.7); }
.hero .testata__motto { font-size: clamp(1rem, .9rem + .4vw, 1.25rem); color: #3a3631; margin-top: .6rem; font-style: italic; }
.hero .menu { justify-content: flex-start; margin-top: 1.6rem; }
.hero .menu a { color: #3a3631; }
.hero .menu a:hover { color: var(--inchiostro); }
.hero + .filetto { display: none; }

@media (max-width: 760px) {
    .hero__img { max-height: none; object-position: 75% center; aspect-ratio: 4 / 3; }
    .hero::after { display: none; }
    .hero__testo { position: static; transform: none; max-width: none; text-align: center; padding: 1.8rem 1.4rem 0; }
    .hero .menu { justify-content: center; }
}
