@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Barlow+Condensed:wght@400;500;600;700&family=Libre+Caslon+Text:ital@0;1&display=swap');

/* ============================================================
   OFFICINA GOTICA — foglio di stile
   Palette, tipografia e layout della home e della sezione Classici.
   ============================================================ */

/* ---------------------------------------------------------- Base */
:root {
  --ink: #070707;
  --paper: #f0e9df;
  --oxide: #a92a1d;
  --blood: #3a1512;
  --line: #302d29;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Barlow Condensed", sans-serif;
}

body.locked {
  overflow: hidden;
}

button, input {
  font: inherit;
}

button {
  color: inherit;
}

/* ---------------------------------------------------------- Header e navigazione */
.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  padding: 0 3.5vw;
  border-bottom: 1px solid var(--line);
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  background: rgba(7, 7, 7, .86);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--paper);
  text-decoration: none;
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: 19px;
  letter-spacing: -.04em;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 38px;
}

.site-header nav a {
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .2em;
}

.menu-button {
  display: none;
  background: none;
  border: 0;
}

/* ---------------------------------------------------------- Hero */
.hero {
  min-height: 850px;
  height: 100vh;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 60px 58% 1fr;
  padding-top: 76px;
}

.hero:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.issue-rail {
  border-right: 1px solid var(--line);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 12px;
  z-index: 2;
}

.hero-copy {
  padding: 7vh 2vw 130px 2.7vw;
  position: relative;
  z-index: 3;
  align-self: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--oxide);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 22px;
}

.hero h1 {
  margin: 0;
  text-transform: uppercase;
  font-family: "Archivo Black";
  letter-spacing: -.075em;
  line-height: .78;
  font-size: clamp(90px, 12vw, 180px);
}

.dek {
  color: #aaa39a;
  max-width: 440px;
  font-size: 18px;
  line-height: 1.35;
  margin: 28px 0 0;
}

.hero-actions {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-top: 30px;
}

.primary {
  border: 0;
  background: var(--oxide);
  padding: 17px 26px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
  cursor: pointer;
}

.text-link {
  color: var(--paper);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 13px;
  border-bottom: 2px solid var(--oxide);
  padding: 8px 0;
}

.hero-art {
  position: absolute;
  z-index: 1;
  right: -2%;
  top: 76px;
  bottom: 49px;
  width: 51%;
  background: linear-gradient(90deg, var(--ink), transparent 30%), url('hero-production.png') center/cover no-repeat;
  filter: contrast(1.15);
}

.red-orbit {
  width: 72vh;
  height: 72vh;
  border: clamp(45px, 7vw, 100px) solid rgba(169, 42, 29, .48);
  border-radius: 50%;
  position: absolute;
  left: -18%;
  top: 5%;
  mix-blend-mode: screen;
}

.latest-strip {
  height: 50px;
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 0;
  z-index: 4;
  background: #070707;
  border: 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 160px 2fr 1fr 1fr 1fr 50px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  padding: 0 2vw;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 12px;
}

.latest-strip .label {
  color: var(--oxide);
}

.latest-strip strong {
  font-size: 18px;
  letter-spacing: .03em;
}

/* ---------------------------------------------------------- Sezioni e archivio racconti */
.section {
  padding: 110px 6vw;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}

.section-head h2, .mailing h2 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  letter-spacing: -.055em;
  font-size: clamp(62px, 8vw, 120px);
  line-height: .85;
  margin: 0;
}

.section-head > p {
  color: #8e8880;
  font-family: "Libre Caslon Text";
  max-width: 420px;
  line-height: 1.6;
}

.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: 30px 0;
}

.filters button {
  border: 1px solid var(--line);
  background: transparent;
  color: #a9a39c;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 9px 15px;
  cursor: pointer;
}

.filters button.active, .filters button:hover {
  border-color: var(--oxide);
  color: var(--paper);
  background: var(--blood);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
}

.story-card {
  min-height: 350px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}

.story-card:after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 0;
  background: var(--oxide);
  transition: .3s;
}

.story-card:hover:after, .story-card:focus:after {
  height: 7px;
}

.card-meta, .story-card footer {
  display: flex;
  justify-content: space-between;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  color: var(--oxide);
}

.story-card h3 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: 34px;
  line-height: .93;
  letter-spacing: -.045em;
  margin: 48px 0 22px;
}

.story-card > p {
  color: #938d85;
  font-family: "Libre Caslon Text";
  line-height: 1.6;
}

.story-card footer {
  margin-top: auto;
  color: #bbb4ab;
}

.loading {
  padding: 30px;
  color: #938d85;
}

/* ---------------------------------------------------------- Manifesto */
.manifesto {
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 50px;
}

.manifesto blockquote {
  grid-column: 1 / -1;
  margin: 0;
  font-family: "Archivo Black";
  text-transform: uppercase;
  letter-spacing: -.055em;
  line-height: .93;
  font-size: clamp(55px, 8.6vw, 138px);
}

.manifesto-copy {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  font-family: "Libre Caslon Text";
  line-height: 1.7;
}

/* ---------------------------------------------------------- Lettere ai lettori (mailing) */
.mailing {
  background: var(--blood);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 8vw;
  align-items: end;
}

.mailing form {
  max-width: 560px;
}

.mailing form > p {
  font-family: "Libre Caslon Text";
  line-height: 1.6;
  color: #c9bdb2;
  font-size: 17px;
}

.mailing label {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
}

.email-row {
  display: flex;
  margin-top: 10px;
}

.email-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid #76504b;
  padding: 16px;
  color: white;
  outline: none;
}

.email-row button {
  background: var(--paper);
  color: var(--ink);
  border: 0;
  padding: 0 20px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  cursor: pointer;
}

.mailing small {
  display: block;
  color: #b49690;
  margin-top: 14px;
}

/* ---------------------------------------------------------- Footer */
footer {
  padding: 38px 6vw;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  color: #77716b;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
}

footer > a:last-child {
  color: #aaa39a;
  text-decoration: none;
}

/* ---------------------------------------------------------- Lettore (dialog overlay) */
dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  overflow: auto;
}

dialog::backdrop {
  background: #000;
}

.reader-close {
  position: fixed;
  right: 32px;
  top: 26px;
  z-index: 2;
  border: 1px solid #bbb1a5;
  background: var(--paper);
  padding: 12px 18px;
  text-transform: uppercase;
  letter-spacing: .15em;
  cursor: pointer;
}

dialog article {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0;
}

dialog h2 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: clamp(54px, 8vw, 98px);
  letter-spacing: -.06em;
  line-height: .88;
  margin: 0;
}

.byline {
  color: var(--oxide);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.prose {
  font-family: "Libre Caslon Text";
  font-size: 18px;
  line-height: 1.9;
  margin-top: 70px;
}

/* ---------------------------------------------------------- Responsive (≤ 900px) */
@media (max-width: 900px) {
  .site-header {
    height: 64px;
  }
  .menu-button {
    display: block;
    margin-left: auto;
    width: 40px;
    height: 40px;
  }
  .menu-button span {
    display: block;
    height: 1px;
    background: var(--paper);
    margin: 8px;
  }
  .site-header nav {
    position: fixed;
    inset: 64px 0 0;
    background: var(--ink);
    display: none;
    flex-direction: column;
    padding: 50px 7vw;
    gap: 28px;
  }
  .site-header nav.open {
    display: flex;
  }
  .site-header nav a {
    font-size: 24px;
  }
  .hero {
    height: auto;
    min-height: 800px;
    grid-template-columns: 0 1fr;
  }
  .issue-rail {
    display: none;
  }
  .hero-copy {
    padding: 110px 6vw 160px;
  }
  .hero h1 {
    font-size: clamp(72px, 20vw, 125px);
  }
  .hero-art {
    opacity: .47;
    width: 78%;
    top: 64px;
  }
  .latest-strip {
    left: 0;
    grid-template-columns: 1fr 35px;
    height: 70px;
  }
  .latest-strip span:not(.label), .latest-strip strong {
    display: none;
  }
  .section {
    padding: 80px 6vw;
  }
  .section-head {
    display: block;
  }
  .section-head > p {
    margin-top: 30px;
  }
  .story-grid {
    grid-template-columns: 1fr;
  }
  .manifesto {
    display: block;
  }
  .manifesto-copy {
    display: block;
    margin-top: 50px;
  }
  .mailing {
    grid-template-columns: 1fr;
  }
  .email-row {
    display: block;
  }
  .email-row button {
    width: 100%;
    padding: 16px;
  }
  footer {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---------------------------------------------------------- Accessibilità: riduzione del movimento */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Selettori bilingui (pulsanti Leggi / Read, selettore lingua)
   ============================================================ */
.story-card {
  cursor: default;
}

.story-card footer {
  display: block;
}

.story-alt-title {
  margin: -14px 0 18px !important;
  color: var(--oxide) !important;
  font-family: "Barlow Condensed", sans-serif !important;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 13px;
  line-height: 1.3 !important;
}

.language-links, .latest-language-links, .hero-language-links, .language-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.language-links button, .latest-language-links button, .language-switch button {
  border: 1px solid var(--oxide);
  background: transparent;
  color: inherit;
  padding: 9px 14px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.language-links button:hover, .latest-language-links button:hover, .language-switch button:hover, .language-switch button.active {
  background: var(--oxide);
  color: var(--paper);
}

.story-card .language-links {
  margin-top: auto;
}

.story-card .language-links button {
  color: var(--paper);
}

.hero-language-links .secondary {
  border: 1px solid var(--oxide);
  background: transparent;
  color: var(--paper);
  padding: 16px 25px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 700;
  cursor: pointer;
}

.hero-language-links .secondary:hover {
  background: var(--blood);
}

.latest-strip {
  grid-template-columns: 160px minmax(180px, 2fr) 1fr 1fr 1fr auto;
  cursor: default;
}

.latest-strip > div:last-child {
  justify-self: end;
}

.latest-language-links {
  flex-wrap: nowrap;
}

.latest-language-links button {
  padding: 7px 10px;
  color: var(--paper);
}

.language-switch {
  margin-top: 28px;
}

.classic-reading .language-switch {
  margin: 25px 0 0;
}

.classic-story-card .language-links {
  margin-top: auto;
}

.classic-story-card .language-links a, .classic-reading .language-switch a {
  display: inline-block;
  border: 1px solid var(--oxide);
  color: inherit;
  text-decoration: none;
  padding: 9px 14px;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 12px;
  font-weight: 700;
}

.classic-story-card .language-links a:hover, .classic-reading .language-switch a:hover, .classic-reading .language-switch a.active {
  background: var(--oxide);
  color: var(--paper);
}

@media (max-width: 900px) {
  .latest-strip {
    grid-template-columns: 1fr auto;
    padding: 0 6vw;
  }
  .latest-strip .label {
    display: block;
  }
  .latest-strip > div:last-child {
    display: flex;
  }
  .latest-language-links button {
    padding: 8px;
  }
  .hero-language-links {
    align-items: flex-start;
    flex-direction: column;
  }
  .story-alt-title {
    margin-top: -10px !important;
  }
  .language-switch {
    gap: 8px;
  }
}

/* ============================================================
   Sezione Classici (indice autori, scheda autore, lettura)
   ============================================================ */
.static-header {
  position: fixed;
}

.static-header .current {
  color: var(--oxide);
}

.classic-main {
  padding-top: 76px;
}

.classic-hero {
  min-height: 64vh;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background: linear-gradient(115deg, #070707 50%, #260c0a);
}

.classic-hero h1, .author-hero h1 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: clamp(88px, 15vw, 210px);
  line-height: .78;
  letter-spacing: -.075em;
  margin: 0;
}

.classic-hero > p:last-child {
  max-width: 640px;
  color: #aaa39a;
  font-family: "Libre Caslon Text";
  font-size: 19px;
  line-height: 1.7;
  margin: 42px 0 0;
}

.author-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--line);
  margin-top: 30px;
}

.author-card {
  min-height: 330px;
  padding: 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: .25s;
}

.author-card:hover {
  background: var(--blood);
}

.author-card > span {
  color: var(--oxide);
  letter-spacing: .15em;
}

.author-card h3 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: 38px;
  line-height: .92;
  margin: 54px 0 20px;
}

.author-card p {
  color: #938d85;
  font-family: "Libre Caslon Text";
  line-height: 1.6;
}

.author-card b {
  margin-top: auto;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
}

.classic-footer {
  display: block;
  padding: 0;
}

.classic-footer > .brand {
  display: block;
  padding: 32px 6vw;
}

.rights-note {
  padding: 30px 6vw;
  background: #141211;
  color: #a49d94;
  font-family: "Libre Caslon Text";
  line-height: 1.7;
}

.rights-note a {
  color: #d6cfc5;
}

.author-hero {
  padding-top: 150px;
  padding-bottom: 70px;
  background: linear-gradient(115deg, #070707 55%, #260c0a);
}

.author-hero .back-link {
  margin-bottom: 80px;
}

.back-link {
  display: inline-block;
  color: #b7afa5;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: 12px;
}

.author-profile {
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 70px;
}

.author-profile h2 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: 38px;
  letter-spacing: -.04em;
  margin: 35px 0 5px;
}

.author-profile h2:first-child {
  margin-top: 0;
}

.author-profile p, .author-profile ul {
  font-family: "Libre Caslon Text";
  line-height: 1.75;
}

.author-profile a {
  color: #8f2119;
}

.classic-story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 30px;
}

.classic-story-card {
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.classic-story-card span {
  color: var(--oxide);
}

.classic-story-card h3 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: 30px;
}

.classic-story-card b {
  margin-top: auto;
}

.empty-classics {
  border: 1px solid var(--line);
  padding: 35px;
  color: #aaa39a;
  font-family: "Libre Caslon Text";
  line-height: 1.7;
}

.classic-reading {
  padding: 145px 24px 100px;
  background: var(--paper);
  color: var(--ink);
}

.classic-reading > article {
  width: min(760px, 100%);
  margin: auto;
}

.classic-reading h1 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  font-size: clamp(58px, 9vw, 108px);
  line-height: .88;
  letter-spacing: -.06em;
  margin: 45px 0 12px;
}

.classic-reading .prose h2 {
  font-family: "Archivo Black";
  text-transform: uppercase;
  margin-top: 60px;
}

.classic-reading .prose ul {
  padding-left: 24px;
}

@media (max-width: 900px) {
  .classic-main {
    padding-top: 64px;
  }
  .static-header nav {
    position: static;
    display: flex;
    background: none;
    padding: 0;
    margin-left: auto;
  }
  .static-header nav a:not(.current) {
    display: none;
  }
  .classic-hero {
    min-height: 540px;
  }
  .author-grid, .classic-story-grid {
    grid-template-columns: 1fr;
  }
  .author-profile {
    display: block;
  }
  .author-hero {
    padding-top: 120px;
  }
  .author-hero .back-link {
    margin-bottom: 55px;
  }
  .classic-footer > .brand {
    padding: 28px 6vw;
  }
}

/* ---------------------------------------------------------- Note legali (icona + modale) */
.footer-links {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}

.legal-link {
  display: inline-flex;
  align-items: center;
  color: #aaa39a;
  transition: color .2s ease;
}

.legal-link:hover,
.legal-link:focus-visible {
  color: var(--oxide);
}

/* Il footer dei Classici è a blocco: metto la nota in alto e allineo icona a destra. */
.classic-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.classic-footer > .rights-note {
  flex: 1 1 100%;
}

.classic-footer > .legal-link {
  margin-left: auto;
  padding-right: 6vw;
}

/* Modale delle note legali: usa lo stile generico dei dialog e riempie con l'iframe. */
.legal-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: var(--paper);
}
