/* ==========================================================================
   biscottiricci.it — foglio di stile condiviso
   Palette e identità visiva ereditate dal sito originale:
   crema #FFFFCC, marrone #663300, ocra #CC6600, capsule dorate.
   ========================================================================== */

:root {
  --cream: #ffffcc;
  --brown: #663300;
  --brown-deep: #512800;
  --ochre: #cc6600;
  --gold: #f1c05a;
  --gold-light: #fffbd5;
  --gold-deep: #fed55f;

  --wrap: 44rem;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Verdana, sans-serif;
  --font-quote: Georgia, "Times New Roman", serif;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Intestazione ---------- */

.site-header {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1rem var(--gutter) 0;
  text-align: center;
}

.logo {
  display: block;
  line-height: 0;
}

.logo img {
  display: block;
  width: 688px;
  margin-inline: auto;
}

/* Striscia con i due Gattopardo e i biscotti */
.strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 4vw, 2rem);
  margin: 1rem 0 1.25rem;
}

.strip img {
  flex: 0 1 auto;
  min-width: 0;
  display: block;
}

/* ---------- Bottoni a capsula (menu e scelta lingua) ---------- */

.main-nav ul,
.lang-choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  min-height: 2.75rem;
  padding: 0.4rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--gold-light) 0%, var(--gold-deep) 100%);
  color: var(--brown-deep);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

a.pill:hover {
  background: linear-gradient(to bottom, #fff3a8 0%, #f7bd3a 100%);
  border-color: var(--ochre);
}

a.pill:active {
  background: #f1b52e;
}

.pill[aria-current="page"] {
  background: var(--brown);
  border-color: var(--brown);
  color: var(--cream);
}

/* ---------- Contenuto ---------- */

main {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1.75rem var(--gutter) 2.5rem;
}

main > * + * {
  margin-top: 1.25rem;
}

main p {
  margin-block: 0;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

main p + p {
  margin-top: 1rem;
}

main a {
  text-decoration-color: var(--ochre);
  text-underline-offset: 0.2em;
}

main a:hover {
  color: var(--ochre);
}

main strong {
  font-weight: 700;
}

.video-link {
  font-weight: 600;
}

/* Gallerie di miniature (le versioni grandi si aprono dal link) */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: center;
  justify-items: center;
  margin-block: 1.75rem;
  padding: 0;
  list-style: none;
}

.gallery li {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 10.5rem;
  aspect-ratio: 1;
  border: 2px solid var(--brown);
  background: var(--cream);
  transition: border-color 0.15s;
}

.gallery li:has(a:hover) {
  border-color: var(--ochre);
}

.gallery a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.gallery img {
  display: block;
  width: auto;
  max-width: calc(100% - 0.5rem);
  max-height: calc(100% - 0.5rem);
  height: auto;
}

/* Brano citato dal romanzo */
.excerpt {
  margin: 2rem 0;
}

.excerpt blockquote {
  margin: 0;
  font-family: var(--font-quote);
  font-size: 1.125rem;
  line-height: 1.6;
}

.excerpt blockquote::before,
.excerpt blockquote::after {
  content: "";
  display: block;
  width: 34px;
  height: 30px;
  background: url("images/apici_a.bmp") no-repeat center / contain;
}

.excerpt blockquote::before {
  margin-bottom: 0.5rem;
}

.excerpt blockquote::after {
  margin: 0.5rem 0 0 auto;
  background-image: url("images/apici_b.bmp");
}

.excerpt figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  text-align: right;
}

/* ---------- Pagina iniziale ---------- */

.landing {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 1rem var(--gutter) 2rem;
  text-align: center;
}

.landing .hero {
  margin: 1.5rem 0 0;
}

.landing .hero img {
  display: block;
  width: 600px;
  margin-inline: auto;
}

.epigraph {
  display: grid;
  gap: 0.25rem;
  margin: 1.75rem 0 2rem;
}

.epigraph img {
  display: block;
  width: 460px;
}

.epigraph img:first-child {
  justify-self: start;
}

.epigraph img:last-child {
  justify-self: end;
}

.lang-choice {
  gap: clamp(1rem, 6vw, 2.5rem);
}

.lang-choice a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.lang-choice a:hover .pill {
  background: linear-gradient(to bottom, #fff3a8 0%, #f7bd3a 100%);
  border-color: var(--ochre);
}

.lang-choice img {
  display: block;
}

/* ---------- Piè di pagina ---------- */

.footer-nav {
  background: var(--brown);
  color: var(--cream);
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.5rem var(--gutter);
  list-style: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.footer-nav li + li::before {
  content: "\25AA";
  margin-inline: 0.35rem;
}

.footer-nav a,
.footer-nav span {
  display: inline-block;
  padding: 0.5rem 0.4rem;
  color: var(--cream);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav a:focus-visible {
  outline-color: var(--gold-deep);
}

.footer-nav [aria-current="page"]::before {
  content: "[";
}

.footer-nav [aria-current="page"]::after {
  content: "]";
}

.copyright {
  max-width: var(--wrap);
  margin: 1.25rem auto 0;
  padding-inline: var(--gutter);
  font-size: 0.8125rem;
  text-align: center;
}

.copyright a {
  text-decoration-color: var(--ochre);
}

.social {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0 1.75rem;
  list-style: none;
}

.social a {
  display: block;
  padding: 7px;
  line-height: 0;
}

.social img {
  display: block;
}

/* ---------- Schermi piccoli ---------- */

@media (max-width: 34em) {
  body {
    font-size: 1rem;
  }

  .main-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-nav li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 0.25rem);
  }

  .pill {
    width: 100%;
    min-width: 0;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 0.5rem;
  }

  .epigraph img:first-child,
  .epigraph img:last-child {
    justify-self: center;
  }

  .lang-choice {
    gap: 0.75rem;
  }

  .lang-choice .pill {
    min-width: 6.25rem;
    padding-inline: 0.75rem;
  }
}

/* ---------- Preferenze utente e stampa ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .main-nav,
  .footer-nav,
  .social {
    display: none;
  }
}
