/* ============================================================
   Trenitalia BIGLIETTO — boarding-pass redesign
   Wider lockup, four-column gig grid, footer metadata strip
   plus paired action buttons (Storico past + Prossimi upcoming).
   ============================================================ */

/* Ticket-local palette (slightly different from --cream tokens used elsewhere;
   the ticket leans warmer/more faded so the redesigned vintage feel reads). */
.ticket {
  --t-paper:  #f0debb;
  --t-paper2: #e8d29a;
  --t-cream:  #fdf6e3;
  --t-ink:    #231914;
  --t-navy:   #1a3a6b;
  --t-red:    #b8141e;
}

/* Card root — overrides the default .card box so the ticket fills its column. */
.card.ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--t-ink);
  background: linear-gradient(180deg, var(--t-paper) 0%, var(--t-paper) 55%, var(--t-paper2) 100%);
  box-shadow:
    0 2px 6px rgba(40,30,20,.22),
    0 18px 36px rgba(40,30,20,.2),
    inset 0 0 60px rgba(140,90,30,.08);
  border-radius: 2px;
  overflow: hidden;
  padding: 0;
  color: var(--t-ink);
  font-family: var(--f-cutive);
}

/* Aging — foxing spots + yellowed edges */
.ticket::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
  background:
    radial-gradient(ellipse 220px 140px at 12% 30%, rgba(168,122,58,.18), transparent 70%),
    radial-gradient(ellipse 180px 120px at 88% 78%, rgba(168,122,58,.16), transparent 70%),
    radial-gradient(ellipse 90px 60px at 60% 8%,   rgba(120,80,30,.12), transparent 70%),
    radial-gradient(circle 6px at 22% 62%, rgba(120,70,20,.45), transparent 70%),
    radial-gradient(circle 4px at 30% 70%, rgba(120,70,20,.35), transparent 70%),
    radial-gradient(circle 5px at 78% 22%, rgba(140,90,30,.4),  transparent 70%),
    radial-gradient(circle 3px at 84% 30%, rgba(140,90,30,.5),  transparent 70%),
    radial-gradient(circle 7px at 48% 88%, rgba(120,70,20,.35), transparent 70%),
    radial-gradient(ellipse 200% 60px at 50% 0%,   rgba(168,122,58,.22), transparent 60%),
    radial-gradient(ellipse 200% 60px at 50% 100%, rgba(168,122,58,.22), transparent 60%),
    radial-gradient(ellipse 60px 200% at 0% 50%,   rgba(168,122,58,.18), transparent 60%),
    radial-gradient(ellipse 60px 200% at 100% 50%, rgba(168,122,58,.18), transparent 60%);
}
/* Paper grain — fine cross-hatched lines */
.ticket::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
  opacity: .6;
  background:
    repeating-linear-gradient( 7deg,  rgba(0,0,0,.015) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-83deg, rgba(0,0,0,.015) 0 1px, transparent 1px 4px);
}

/* All children stay above the aging layers. */
.ticket > * { position: relative; z-index: 3; }

/* ─── Red header band ─── */
.ticket__header {
  background: var(--t-red);
  color: var(--t-cream);
  padding: 8px 22px;
  font-size: 11px;
  letter-spacing: .32em;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--t-ink);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
  font-family: var(--f-cutive);
  text-transform: uppercase;
}
.ticket__header-pill {
  background: var(--t-paper);
  color: var(--t-ink);
  padding: 1px 10px;
  letter-spacing: .2em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Route lockup ─── */
/* Three horizontal lines (labels, cities-with-via, times). Within each
   line a flex with justify-content: space-between places left/right items.
   Cities sit on the same inline baseline so they align horizontally. */
.ticket__route {
  padding: 8px 22px 6px 36px;
  border-bottom: 1px solid var(--t-ink);
}
.ticket__route-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ticket__route-line > :last-child { text-align: right; }
.ticket__route-line--cities {
  align-items: center;
}
.ticket__route-label {
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--t-red);
  font-weight: 700;
  font-family: var(--f-cutive);
  text-transform: uppercase;
}
.ticket__route-city {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: var(--t-navy);
  line-height: .92;
  margin-top: 1px;
  letter-spacing: -.015em;
  text-shadow: .4px .3px 0 rgba(184,20,30,.18);
}
.ticket__route-cc {
  font-family: var(--f-cutive);
  font-size: 14px;
  color: var(--t-ink);
  letter-spacing: .15em;
}
.ticket__route-time {
  font-family: var(--f-cutive);
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  opacity: .8;
  letter-spacing: .04em;
  text-shadow: .4px .2px 0 rgba(184,20,30,.22);
}
.ticket__route-validity {
  font-family: var(--f-cutive);
  font-size: 9px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: .14em;
  color: var(--t-red);
  text-transform: uppercase;
  opacity: .75;
  text-align: right;
}

.ticket__route-via {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--t-ink);
}
/* The VIA cell holds the via stack — keep it centered both axes. */
.ticket__route-tcell--via > span,
.ticket__route-tcell--via > svg {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.ticket__route-via-label {
  font-size: 9px;
  letter-spacing: .25em;
  opacity: .55;
  font-family: var(--f-cutive);
}
.ticket__route-via-sea {
  font-size: 9px;
  letter-spacing: .18em;
  opacity: .55;
  font-style: italic;
  font-family: var(--f-cutive);
}

/* ─── Gig table ─── */
.ticket__gigs {
  padding: 8px 22px 10px;
  flex: 1;
}
.ticket__section-title {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 700;
  font-size: 26px;
  color: var(--t-navy);
  letter-spacing: 0;
  margin: 0;
  padding: 8px 22px 8px;
  text-align: center;
  text-shadow: .4px .3px 0 rgba(184,20,30,.18);
  border-bottom: 1px solid var(--t-ink);
}
.ticket__gigs-head,
.ticket__gig-row {
  display: grid;
  grid-template-columns: 90px 1.6fr 1fr;
  gap: 12px;
  align-items: baseline;
}
.ticket__gigs-head {
  padding-bottom: 8px;
  border-bottom: 1px dotted rgba(0,0,0,.4);
}
.ticket__gigs-head span {
  font-size: 9px;
  letter-spacing: .22em;
  color: var(--t-red);
  font-weight: 700;
  font-family: var(--f-cutive);
  text-transform: uppercase;
}

.ticket__gig-row {
  padding: 4px 0;
  border-bottom: 1px dotted rgba(0,0,0,.18);
}
.ticket__gig-row:last-child { border-bottom: none; }

.ticket__gig-date {
  font-family: var(--f-cutive);
  font-size: 13px;
  font-weight: 700;
  color: var(--t-red);
  letter-spacing: .04em;
  text-shadow: .4px .2px 0 rgba(184,20,30,.22);
}
.ticket__gig-venue {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 15px;
  color: var(--t-ink);
}
.ticket__gig-city { opacity: .6; }
.ticket__gig-type {
  font-family: var(--f-cutive);
  font-size: 12px;
  font-weight: 700;
  opacity: .85;
  letter-spacing: .04em;
  text-shadow: .4px .2px 0 rgba(184,20,30,.22);
  /* Long text truncates with … instead of growing the column. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ─── Footer — paired action buttons (Storico past + Prossimi upcoming) ─── */
.ticket__footer {
  border-top: 2px solid var(--t-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(232, 210, 154, .35);
}

.ticket__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  background: var(--t-red);
  color: var(--t-cream);
  padding: 10px 16px;
  font-family: var(--f-cutive);
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  flex: 1 1 auto;
  transition: filter var(--hover-ms) var(--ease), transform var(--hover-ms) var(--ease);
}
.ticket__btn .arrow { font-size: 14px; }
.ticket__btn:hover  { filter: brightness(1.1); }
.ticket__btn:active { transform: translateY(1px); }

/* ─── Decoration overlays ─── */
.ticket__postmark {
  position: absolute;
  width: 92px;
  height: 92px;
  opacity: .28;
  pointer-events: none;
  z-index: 4;
  top: 50%;
  right: 18px;
  transform: translateY(-55%) rotate(-14deg);
  /* Faded to watermark level so it doesn't obscure the STATO column. */
}

.ticket__hole-punch {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, #4a3a28 0%, #6a5238 60%, #856838 100%);
  box-shadow:
    inset 2px 2px 3px rgba(0,0,0,.6),
    inset -1px -1px 2px rgba(255,235,180,.4),
    0 1px 2px rgba(0,0,0,.25);
  z-index: 6;
  pointer-events: none;
}
.ticket__hole-punch--a { top: 56px; left: 12px; }
.ticket__hole-punch--b { top: 82px; left: 12px; }

.ticket__scribble {
  position: absolute;
  font-family: var(--f-stamp);
  color: var(--t-red);
  font-size: 14px;
  transform: rotate(-4deg);
  letter-spacing: .05em;
  pointer-events: none;
  z-index: 7;
  top: -16px;
  left: 220px;
}

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  .ticket__route { gap: 0 12px; padding: 14px 18px 12px; }
  .ticket__route-city { font-size: 38px; }
  .ticket__gigs { padding: 12px 18px; }
}
@media (max-width: 768px) {
  .card.ticket { font-size: 12px; }
  .ticket__header { padding: 6px 14px; font-size: 9.5px; letter-spacing: .22em; }
  .ticket__header-pill { font-size: 9px; letter-spacing: .12em; }
  /* Section title "Upcoming dates" is redundant on mobile (the gig grid below
     speaks for itself) and saves ~50px of scroll. */
  .ticket__section-title { display: none; }
  /* Route: same 4-row grid as desktop (label/city/time/validity), just
     smaller paddings + fonts. Cities still align on row 2 by construction. */
  .ticket__route {
    padding: 10px 12px 8px;
    gap: 0 8px;
  }
  .ticket__route-via svg { width: 50px; height: 14px; }
  .ticket__route-via-sea { display: none; } /* save space */
  .ticket__route-city { font-size: 22px; }
  .ticket__route-cc { font-size: 11px; }
  .ticket__route-time { font-size: 10px; }
  /* "Valido fino al" is fine decoration on desktop but eats precious
     vertical space on a phone — hide it. */
  .ticket__route-validity { display: none; }
  /* Gig grid: 2 cols, date + venue. Details + status flow on row 2 under venue.
     Smaller spacing so 4 gigs don't dominate the screen. */
  .ticket__gigs { padding: 8px 12px 10px; }
  .ticket__gigs-head {
    padding-bottom: 4px;
  }
  .ticket__gigs-head,
  .ticket__gig-row {
    grid-template-columns: 56px 1fr;
    grid-template-rows: auto auto;
    gap: 0 8px;
  }
  .ticket__gig-row { padding: 5px 0; }
  .ticket__gigs-head .ticket__gigs-head-set,
  .ticket__gig-type {
    grid-column: 2 / 3;
    text-align: left;
  }
  .ticket__gig-date { font-size: 12px; }
  .ticket__gig-venue { font-size: 14px; line-height: 1.15; }
  .ticket__gig-type { font-size: 11px; }
  /* Footer button — single full-width red button */
  .ticket__footer { padding: 8px 12px; gap: 6px; }
  .ticket__btn { flex: 1 1 100%; font-size: 10.5px; padding: 9px 12px; letter-spacing: .12em; }
  /* Decorative bits: postmark smaller, scribble + hole-punch hidden */
  .ticket__hole-punch { display: none; }
  .ticket__postmark { width: 60px; height: 60px; right: 6px; opacity: .2; }
  .ticket__scribble { display: none; }
}
