/* ============================================================
   Festival delle Alpi — foglio di stile
   Palette:
     --ink        #10201B  (verde abete quasi nero, header/footer)
     --paper      #F3F1E7  (crema chiaro, sfondo pagina)
     --paper-dim  #E9E5D6  (righe alterne tabella)
     --gold       #D4A657  (accento primario)
     --pine       #3A5A48  (verde secondario, testo su chiaro)
     --rust       #B24B3E  (colore osservazioni)
     --line       #D8D2BE  (linee sottili)
   Font:
     "Fraunces"     — titoli, date, nome evento
     "IBM Plex Sans"— corpo testo, tabelle, interfaccia
   ============================================================ */

:root {
  --ink: #000;
  --ink-soft: #17281f;
  --paper: #ffffff;
  --paper-dim: #e9e5d6;
  --red: #BC362C;
  --blue: #12398A;
  --line: #d8d2be;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, Segoe UI, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1, h2, h3, .brand-name, .day-date {
  font-family: "Aptos", Georgia, serif;
  margin: 0;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 115px;
  background: var(--ink);
  border-bottom: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
}

.brand img {
  height: 95px;
  width: auto;
  flex-shrink: 0;
}

.brand-name {
  color: var(--paper);
  font-size: 1.25rem;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-center {
  flex: 2 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.header-center img {
  height: 95px;
  width: auto;
  flex-shrink: 0;
}

.header-center .brand-name {
  display: inline-block;
}

/* Selettore lingua */

.lang-switcher {
  position: relative;
  flex: 1 1 0;
  display: flex;
  justify-content: flex-end;
}

.lang-current {
  background: transparent;
  border: 1px solid var(--red);
  color: var(--paper);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-current::after {
  content: "";
  border: solid var(--red);
  border-width: 0 1.5px 1.5px 0;
  padding: 3px;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.lang-switcher.open .lang-current::after {
  transform: rotate(-135deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--ink-soft);
  border: 1px solid var(--red);
  border-radius: 2px;
  min-width: 130px;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: none;
  overflow: hidden;
}

.lang-switcher.open .lang-list {
  display: block;
}

.lang-list button {
  width: 100%;
  background: none;
  border: none;
  color: var(--paper);
  text-align: left;
  padding: 9px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.lang-list button:hover,
.lang-list button:focus-visible {
  background: rgba(212, 166, 87, 0.15);
}

.lang-list button[aria-selected="true"] {
  color: var(--red);
}

/* ---------- Layout generale ---------- */

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 20px 8px;
}

.page-intro {
  text-align: center;
  margin-bottom: 44px;
}

.page-intro h1 {
  font-size: 2rem;
  color: var(--blue);
}

.page-intro p {
  max-width: 60ch;
  margin: 10px auto 0;
  color: #000000;
}

section {
  margin-bottom: 64px;
}

section > h2 {
  font-size: 1.5rem;
  color: var(--blue);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 24px;
}

/* ---------- Programma / tabelle giorno ---------- */

.day-block {
  margin-bottom: 40px;
}

.day-date {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 14px;
}

.program-table {
  width: 100%;
  border-collapse: collapse;
}

.program-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
  color: var(--red);
  padding: 0 12px 8px;
  border-bottom: 1px solid black;
}

.program-table tbody td {
  padding: 12px;
  vertical-align: top;
  border-bottom: 1px solid black;
}

.col-time {
  width: 90px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: black;
  font-weight: 400;
}

.col-activity {
  width: 46%;
}

.col-obs {
  color: #000000;
  font-weight: 400;
}

.link-place,
.link-poster {
  color: black;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.link-place:hover,
.link-poster:hover {
  color: var(--blue)
}

/* ---------- Mappa ---------- */

.map-wrap {
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-wrap iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

.map-note {
  font-size: 0.85rem;
  color: #6b6552;
  margin-top: 10px;
}

/* ---------- Sponsor ---------- */

.sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.sponsor-grid img {
  height: 56px;
  width: auto;
  opacity: 0.75;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.sponsor-grid a:hover img,
.sponsor-grid a:focus-visible img {
  filter: grayscale(0);
  opacity: 1;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 22px 20px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* ---------- Pagina locandina ---------- */

.poster-page main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.poster-page img.poster {
  max-width: 460px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(16, 32, 27, 0.25);
}

.back-link {
  display: inline-block;
  margin-top: 26px;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

#primo{
  padding-top: 70px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .header-center {
    display: none;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  main {
    padding: 32px 14px 4px;
  }

  .program-table thead {
    display: none;
  }

  .program-table tbody tr {
    display: block;
    padding: 12px 0;
  }

  .program-table tbody td {
    display: block;
    border-bottom: none;
    padding: 3px 4px;
  }

  .program-table tbody tr:nth-child(even) {
    background: none;
  }

  .program-table tbody tr {
    border-bottom: 1px solid var(--line);
  }

  .col-time::before,
  .col-activity::before,
  .col-obs::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 108px;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #6b6552;
    font-weight: 400;
  }

  .col-obs::before {
    color: #6b6552;
  }
}
