:root {
  --bg: #000;
  --text: #818181;
  --text-light: #fff;
  --text-soft: #a09b9a;
  --nav-active: #dbdbdb;
  --nav-hover: rgba(229, 228, 233, 0.15);
  --accent: #82594e;
  --info-hover: #27bdbd;
  --tile-gap: 18px;
  /* Margine laterale dei testi in About e Contact: 0 come nell'originale. */
  --page-edge: 0px;
  --font: "Raleway", sans-serif;
}

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

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

body {
  margin: 0;
  padding-top: 78px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 500;
  line-height: 34px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:has(.nav-toggle:checked),
body:has(.lightbox:target) {
  overflow: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus-visible,
.nav-toggle:focus-visible + .hamburger {
  outline: 2px solid var(--text-light);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.icon-defs {
  display: none;
}

.icon {
  display: block;
  flex: none;
  width: auto;
  height: 1em;
  fill: currentColor;
}

.skip-link {
  position: absolute;
  top: 0;
  left: -999px;
  z-index: 1000;
  padding: 0 1rem;
  background: var(--text-light);
  color: var(--bg);
}

.skip-link:focus {
  top: 1rem;
  left: 1rem;
}

/* Header: parte a 78px dall'alto e resta agganciato in cima allo scroll. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  background: var(--bg);
}

.logo,
.nav-toggle,
.hamburger,
.socials {
  display: none;
}

.nav-panel {
  height: 100%;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 39px;
  height: 100%;
}

.site-nav a {
  padding: 15px;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 3px;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
}

.site-nav a:hover {
  background-color: var(--nav-hover);
}

.site-nav a[aria-current="page"] {
  color: var(--nav-active);
}

/* Home */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 63px 10px 26px;
}

.hero-figure {
  width: min(1024px, 100%);
  margin: 0;
  animation: fade-in 1.25s ease both;
}

.hero-figure img {
  width: 100%;
  transition: transform 0.3s ease;
}

.hero-figure:hover img {
  transform: scale(0.9);
}

.hero-social {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 70px;
  margin: -30px 0 0;
  padding: 0;
  list-style: none;
  animation: fade-up 1.25s ease 0.6s both;
}

.hero-social a {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
  transition: color 0.3s ease;
}

.hero-social a:hover {
  color: var(--text-light);
}

.hero-social .icon {
  width: 29px;
  margin-right: 11px;
  font-size: 23px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
}

/* About */
.page-subtitle {
  margin-top: 41px;
  padding-inline: 10px;
  color: var(--text-light);
  font-size: 36px;
  line-height: 32px;
  text-align: center;
}

.about-copy {
  margin-top: 145px;
  padding-inline: var(--page-edge);
}

.eyebrow {
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.eyebrow + .eyebrow {
  margin-top: 14px;
}

.about-copy h1 {
  margin-top: 19px;
  font-size: 28px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 10px;
  text-transform: uppercase;
}

.about-copy p:not(.eyebrow) {
  margin-top: 19px;
}

.about-copy p.about-contact {
  margin-top: 12px;
  padding-top: 34px;
}

.photos {
  margin-top: 15px;
  container-type: inline-size;
}

.photos h2 {
  margin-bottom: 14px;
  padding-inline: var(--page-edge);
}

/* Griglia: ogni foto occupa 1, 2 o 3 righe, come le tessere dell'originale. */
.photo-grid {
  --cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc(((100cqw - (var(--cols) + 1) * var(--tile-gap)) / var(--cols) - var(--tile-gap)) / 2);
  gap: var(--tile-gap);
  padding-inline: var(--tile-gap);
}

.tile {
  display: block;
  overflow: hidden;
  background: #3f424a;
  scroll-margin-top: 90px;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-1 {
  grid-row: span 1;
}

.tile-2 {
  grid-row: span 2;
}

.tile-3 {
  grid-row: span 3;
}

.presskit {
  margin-top: 19px;
  padding: 0 var(--page-edge) 19px;
}

.presskit h2,
.presskit p {
  color: var(--text);
  font-size: 28px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.presskit h2 + h2 {
  margin-top: 19px;
}

.presskit p {
  margin-top: 71px;
}

.presskit a {
  color: var(--accent);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  background: rgba(30, 30, 30, 0.87);
  color: #ccc;
}

.lightbox:target {
  display: grid;
}

.lightbox img {
  position: relative;
  width: auto;
  max-width: 100vw;
  height: auto;
  max-height: 100dvh;
  object-fit: contain;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.lightbox-count {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 14px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: rgba(30, 30, 30, 0.6);
  color: #ccc;
  font-size: 24px;
  line-height: 1;
  transition: color 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--text-light);
}

.lightbox-close {
  top: 0;
  right: 0;
  font-size: 34px;
}

.lightbox-prev,
.lightbox-next {
  top: calc(50% - 22px);
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

/* Events */
.wrap {
  width: min(1210px, 100% - 20px);
  margin-inline: auto;
}

.events {
  padding: 117px 0 18px;
}

.section-title {
  color: var(--text-light);
  font-size: 28px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
}

.muted-note {
  margin: 71px 0 120px;
  padding: 50px;
  color: var(--text-soft);
  font-size: 16px;
}

.event-list {
  margin-top: 71px;
}

.event {
  position: relative;
  margin-bottom: 8px;
  border: 1px solid var(--text);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.event:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
}

.event-link {
  display: flex;
  gap: 5px;
  padding: 40px 0 45px;
}

/* Tutto il riquadro porta al dettaglio, come nell'originale. */
.event-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.event-date {
  flex: 0 0 98px;
  padding-inline: 12px;
  text-align: right;
}

.event-date .day {
  display: block;
  font-size: 28px;
  font-weight: 600;
  line-height: 33.6px;
}

.event-date .month {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 22px;
}

.event-main {
  flex: 1;
  min-width: 0;
  padding-inline: 12px;
  border-left: 1px dotted var(--accent);
}

.event-main h3 {
  font-size: 28px;
  font-weight: 600;
  line-height: 33.6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.event-info {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 22px;
  transition: color 0.3s ease;
}

.event:hover .event-info {
  color: var(--accent);
}

.btn-info {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 10px 0 9px 99px;
  padding: 8px 20px;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  font-weight: 400;
  line-height: 18px;
  text-transform: uppercase;
  vertical-align: top;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-info:hover {
  background: var(--info-hover);
  color: var(--text-light);
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 34px;
  height: 48px;
  font-size: 16px;
}

/* Compare solo dopo aver iniziato a scorrere, senza JavaScript. */
@supports (animation-timeline: scroll()) {
  .to-top {
    visibility: hidden;
    animation: to-top-reveal linear both;
    animation-timeline: scroll(root);
    animation-range: 0 120px;
  }
}

@keyframes to-top-reveal {
  from {
    visibility: hidden;
    opacity: 0;
  }
  to {
    visibility: visible;
    opacity: 1;
  }
}

/* Event detail */
.event-detail {
  width: min(1200px, 100% - 30px);
  margin: 186px auto 0;
  padding-bottom: 60px;
}

.event-detail h1 {
  max-width: 588px;
  font-size: 28px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 10px;
  text-transform: uppercase;
}

.event-facts {
  margin: 20px 0 0 -10px;
  border-collapse: collapse;
  color: var(--text-light);
  font-size: 16px;
  line-height: 26px;
}

.event-facts td {
  padding: 0 0 5px;
}

.event-facts .event-icon {
  width: 30px;
  font-size: 16px;
}

.event-facts .icon {
  margin-inline: auto;
}

.event-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1090px, 100%);
  margin-top: 45px;
}

.back-btn {
  display: inline-block;
  padding: 5px 40px;
  border: 1px solid var(--accent);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.back-btn:hover {
  background: var(--accent);
  color: var(--text-light);
}

.share {
  display: flex;
  font-size: 25px;
}

.share a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 25px;
}

/* Shop */
.shop {
  padding: 117px 10px 60px;
  color: var(--text-light);
  text-align: center;
}

.shop p {
  margin-top: 32px;
}

/* Contact */
.contact {
  padding: 126px var(--page-edge) 60px;
}

.contact h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.contact h2 {
  margin: 19px 0 14px;
  font-size: 22px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 4px;
}

.contact p + p {
  margin-top: 12px;
}

@media (min-width: 1400px) {
  .photo-grid {
    --cols: 3;
  }
}

/* Sotto questa larghezza il menu diventa hamburger con pannello a tutto schermo. */
@media (max-width: 1130px) {
  body {
    padding-top: 0;
  }

  .site-header {
    position: fixed;
    inset: 0 0 auto;
    height: 60px;
  }

  .logo {
    position: absolute;
    top: 0;
    left: 15px;
    display: block;
    padding: 5px;
  }

  .logo img {
    width: 114px;
    height: 50px;
    object-fit: contain;
  }

  .nav-toggle {
    position: absolute;
    top: 0;
    right: 27px;
    display: block;
    width: 40px;
    height: 40px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
  }

  .hamburger {
    position: absolute;
    top: 8px;
    right: 37px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 40px;
    cursor: pointer;
  }

  .hamburger span,
  .hamburger span::before,
  .hamburger span::after {
    display: block;
    width: 30px;
    height: 4px;
    background: var(--text-light);
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .hamburger span {
    position: relative;
  }

  .hamburger span::before,
  .hamburger span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .hamburger span::before {
    top: -8px;
  }

  .hamburger span::after {
    top: 8px;
  }

  .nav-toggle:checked + .hamburger span {
    background: transparent;
  }

  .nav-toggle:checked + .hamburger span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle:checked + .hamburger span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .nav-panel {
    position: fixed;
    inset: 60px 0 0;
    display: none;
    height: auto;
    padding: 28px 20px;
    overflow-y: auto;
    background: var(--bg);
  }

  .nav-toggle:checked ~ .nav-panel {
    display: block;
  }

  .site-nav {
    display: block;
    height: auto;
  }

  .site-nav a {
    display: block;
    width: fit-content;
    padding: 6px 0;
    font-size: 36px;
    font-weight: 500;
    line-height: 36px;
  }

  .site-nav a:hover {
    background-color: transparent;
  }

  .site-nav a[aria-current="page"] {
    color: var(--text-light);
  }

  .socials {
    display: flex;
    align-items: center;
    gap: 27px;
    margin-top: 47px;
    font-size: 18px;
  }

  .socials a {
    color: var(--text-light);
  }

  .home-hero {
    padding-top: 124px;
  }

  .page-subtitle {
    margin-top: 247px;
  }

  .events,
  .shop {
    padding-top: 139px;
  }

  .contact {
    padding-top: 129px;
  }

  .event-detail {
    margin-top: 129px;
  }

  .to-top {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-social {
    gap: 0 27px;
    margin-top: 20px;
  }

  .hero-social a {
    font-size: 18px;
    line-height: 43.2px;
  }

  .event-link {
    display: block;
    padding: 40px 12px;
  }

  .event-date {
    display: flex;
    align-items: baseline;
    gap: 11px;
    padding: 0;
    text-align: left;
  }

  .event-date .month {
    margin-top: 0;
  }

  .event-main {
    margin-top: 4px;
    padding: 0;
    border-left: 0;
  }

  .btn-info {
    margin: 4px 0 20px 12px;
  }

  .event-detail h1 {
    max-width: none;
  }

  .event-actions {
    flex-direction: column;
    gap: 54px;
    margin-top: 30px;
  }

  .back-btn {
    padding-block: 0;
    line-height: 31px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-figure,
  .hero-social {
    animation: none;
  }

  .site-nav a,
  .hero-figure img,
  .hero-social a,
  .event,
  .event-info,
  .btn-info,
  .back-btn {
    transition: none;
  }
}
