/* Venti d'Autore — mobile-first stylesheet. */

:root {
  --paper: #f3f1ee;
  --paper-2: #e9e6e1;
  --surface: #ffffff;
  --ink: #1c1a19;
  --ink-2: #57524e;
  --muted: #8a847e;
  --line: #e2ddd7;
  --brand: #7a1712;
  --brand-2: #9e2219;
  --brand-ink: #fff5f2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 26, 25, .06), 0 8px 24px rgba(28, 26, 25, .06);
  --shadow-hover: 0 2px 4px rgba(28, 26, 25, .08), 0 18px 40px rgba(28, 26, 25, .12);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand);
}
.eyebrow--light { color: #ffb8ad; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem;
  border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .95rem/1 var(--font-body); text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { background: var(--brand-2); }
.btn--ghost { border-color: rgba(28, 26, 25, .25); color: var(--ink); background: rgba(255, 255, 255, .4); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--light { background: #fff; color: var(--brand); }

/* nav */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  transition: background-color .25s, box-shadow .25s, backdrop-filter .25s;
}
.nav.is-scrolled, .page-detail .nav {
  background: rgba(243, 241, 238, .78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.nav__inner {
  max-width: var(--max); height: 100%; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav__brand {
  display: flex; align-items: center; gap: .6rem; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem;
}
.nav__brand img { width: 36px; height: 36px; object-fit: contain; }
.nav__brand span { display: none; }
.nav__links { display: flex; align-items: center; gap: .25rem; }
.nav__links a {
  padding: .55rem .7rem; border-radius: 999px; white-space: nowrap;
  font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.nav__links a:hover { color: var(--ink); background: rgba(28, 26, 25, .06); }
.nav__icon { display: inline-flex; }

/* hero */
.hero {
  position: relative; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: calc(var(--nav-h) + 2rem) var(--gutter) 5rem;
  background:
    radial-gradient(60% 50% at 50% 42%, rgba(255, 255, 255, .85), transparent 70%),
    radial-gradient(90% 70% at 100% 0%, rgba(122, 23, 18, .10), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(122, 23, 18, .08), transparent 60%),
    var(--paper-2);
  overflow: hidden;
}
/* paper grain */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero__logo { width: min(88vw, 760px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero__tagline {
  margin: 1.25rem 0 1.75rem;
  font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2);
  animation: rise .9s .12s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__actions {
  display: flex; flex-direction: column; gap: .75rem; width: 100%; max-width: 320px;
  animation: rise .9s .22s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__scroll {
  position: absolute; bottom: 1.25rem; left: 50%; translate: -50% 0;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--ink-2); animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* about */
.about { padding: 4.5rem var(--gutter); background: var(--surface); }
.about__inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 1.5rem; }
.about__title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 2.8rem); line-height: 1.12; letter-spacing: -.01em;
}
.about__text { color: var(--ink-2); font-size: 1.05rem; }
.about__text p { margin: 0 0 1rem; }
.about__text a { color: var(--brand); text-underline-offset: 3px; }
.stats {
  margin: .5rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem;
}
.stats div { padding: 1rem .75rem; border-radius: var(--radius-sm); background: var(--paper); }
.stats dt { font-size: .72rem; line-height: 1.3; color: var(--muted); }
.stats dd { margin: .2rem 0 0; font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; line-height: 1; color: var(--brand); }

/* featured */
.featured { padding: 0 var(--gutter); margin: 3rem auto 0; max-width: var(--max); }
.featured__card {
  display: grid; overflow: hidden; text-decoration: none; color: #fff;
  border-radius: var(--radius); background: var(--brand); box-shadow: var(--shadow);
  transition: box-shadow .3s, transform .3s;
}
.featured__card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.featured__media { background: #1c1a19; display: grid; place-items: center; }
.featured__media img { width: 100%; max-height: 70vh; object-fit: contain; }
.featured__body { padding: 1.75rem 1.5rem 2rem; display: flex; flex-direction: column; align-items: flex-start; }
.featured__title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.6rem, 5.5vw, 2.6rem); line-height: 1.1;
}
.featured__meta { margin: .75rem 0 0; font-size: .9rem; color: #ffd9d2; }
.featured__text { margin: 1rem 0 1.5rem; color: rgba(255, 255, 255, .88); }

/* events */
.events { max-width: var(--max); margin: 0 auto; padding: 4.5rem var(--gutter) 5rem; }
.events__head { margin-bottom: 2rem; }
.events__title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3rem); line-height: 1.1;
}
.years {
  display: flex; gap: .5rem; margin: 1.25rem calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) .25rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.years::-webkit-scrollbar { display: none; }
.years a {
  flex: none; padding: .5rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .88rem; font-weight: 500; text-decoration: none; color: var(--ink-2);
  transition: border-color .2s, color .2s, background-color .2s;
}
.years a:hover { border-color: var(--brand); color: var(--brand); }

.year { margin-top: 2.5rem; }
.year__label {
  display: flex; align-items: center; gap: 1rem; margin: 0 0 1.25rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: var(--brand);
}
.year__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); }

.card { height: 100%; }
.card__link {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  transition: box-shadow .3s, transform .3s;
}
.card__link:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card__media {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 4 / 5; display: grid; place-items: center; background: var(--paper-2);
}
/* blurred copy of the poster fills the frame so any aspect ratio fits */
.card__media::before {
  content: ""; position: absolute; inset: -20px; z-index: -1;
  background: var(--bg) center / cover; filter: blur(22px) saturate(1.1); opacity: .55;
}
.card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.card__link:hover .card__media img { transform: scale(1.03); }
.card__body { padding: 1.1rem 1.15rem 1.35rem; display: flex; flex-direction: column; gap: .35rem; }
.card__date { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.card__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.card__place { margin: 0; font-size: .85rem; color: var(--muted); }
.card__excerpt {
  margin: .35rem 0 0; font-size: .92rem; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.events__empty { text-align: center; color: var(--muted); }

/* detail */
.detail { max-width: var(--max); margin: 0 auto; padding: calc(var(--nav-h) + 1.5rem) var(--gutter) 4rem; }
.detail__back {
  display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 1rem;
  font-size: .92rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
}
.detail__back:hover { color: var(--brand); }
.detail__grid { display: grid; gap: 2rem; }
.detail__poster { margin: 0; }
.detail__poster img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.detail__date { font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.detail__title {
  margin: .5rem 0 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 7vw, 3rem); line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere;
}
.detail__place { display: flex; align-items: center; gap: .4rem; margin: 1rem 0 0; color: var(--ink-2); }
.detail__place svg { flex: none; color: var(--brand); }
.detail__text {
  margin: 1.5rem 0 2rem; font-size: 1.05rem; color: var(--ink-2);
  text-align: justify; -webkit-hyphens: auto; hyphens: auto;
}
.detail__text p { margin: 0 0 1rem; }

.pager { display: grid; gap: 1rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.pager__link {
  display: flex; flex-direction: column; gap: .25rem; padding: 1rem 1.15rem; text-decoration: none;
  border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .2s;
}
.pager__link:hover { box-shadow: var(--shadow-hover); }
.pager__link span { font-size: .8rem; color: var(--muted); }
.pager__link strong { font-family: var(--font-display); font-weight: 600; }

/* footer */
.footer { background: var(--ink); color: #d8d3ce; padding: 3rem var(--gutter) 1.5rem; }
.footer__inner { max-width: var(--max); margin: 0 auto; display: grid; gap: 2rem; }
.footer__brand img { width: 168px; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: var(--paper); }
.footer__brand p { margin: 1rem 0 0; max-width: 36ch; font-size: .92rem; color: #a9a29c; }
.footer__links { display: flex; flex-direction: column; gap: .6rem; }
.footer__links a { color: #fff; text-decoration: none; overflow-wrap: anywhere; }
.footer__links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__copy { max-width: var(--max); margin: 2.5rem auto 0; padding-top: 1.25rem; border-top: 1px solid #34302d; font-size: .82rem; color: #8a837d; }

@media (max-width: 359px) {
  .nav__links a { padding: .5rem .5rem; }
  .nav__links a[href$="#chi-siamo"] { display: none; }
}

/* ≥ 600px: two-column cards */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .nav__brand span { display: inline; }
  .hero__actions { flex-direction: row; justify-content: center; max-width: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager__link--next { text-align: right; grid-column: 2; }
  .footer__inner { grid-template-columns: 1fr auto; align-items: end; }
}

/* ≥ 700px: featured card side by side */
@media (min-width: 700px) {
  .featured__card { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .featured__media img { height: 100%; max-height: 680px; object-fit: cover; object-position: top; }
  .featured__body { justify-content: center; padding: 2rem; }
}

/* ≥ 700px: poster floats right and the text wraps around and below it */
@media (min-width: 700px) {
  .detail__grid { display: flow-root; }
  .detail__poster { float: right; width: min(42%, 440px); margin: .35rem 0 1.5rem 2.5rem; }
  .detail__poster--wide { width: min(55%, 560px); }
}

/* ≥ 900px: wide layouts */
@media (min-width: 900px) {
  :root { --gutter: 32px; --nav-h: 72px; }
  .nav__links { gap: .5rem; }
  .about { padding: 6rem var(--gutter); }
  .about__inner { grid-template-columns: 1fr 1fr; column-gap: 4rem; align-items: start; }
  .about__inner .eyebrow { grid-column: 1 / -1; margin-bottom: 0; }
  .stats { grid-column: 2; }
  .featured { margin-top: 5rem; }
  .featured__body { padding: 3rem; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
