/* BitbusterShop - stile pubblico.
   I colori del marchio arrivano dal layout come variabili CSS (--primary, --tint, --stitch, --ink).
   Elemento distintivo: il bordo "cucito" a puntini dei biglietti, preso dalla cornice del logo Cake Academy. */

@font-face {
    font-family: "Young Serif";
    src: url("/fonts/YoungSerif-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #7A2A5E;
    --primary-dark: #5C1E46;
    --tint: #FBEAF2;
    --stitch: #E46AA6;
    --ink: #2B1F27;
    --paper: #FFFFFF;
    --muted: color-mix(in srgb, var(--ink) 68%, var(--paper));
    --line: color-mix(in srgb, var(--ink) 14%, var(--paper));
    --warn: #A3460B;
    --full: #8A8389;

    --serif: "Young Serif", Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius-lg: 22px;
    --radius: 14px;
    --wrap: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
}

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

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.15;
    margin: 0 0 .5em;
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

a { color: var(--primary); text-underline-offset: .18em; }
a:hover { color: var(--primary-dark); }

:focus-visible {
    outline: 3px solid var(--stitch);
    outline-offset: 3px;
    border-radius: 6px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 680px; }

.skip {
    position: absolute; left: -9999px; top: .5rem;
    background: var(--ink); color: var(--paper); padding: .5rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { left: .5rem; }

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

/* ---------- testata e piede ---------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 76px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem;
}
.brand img { height: 56px; width: auto; }
.brand__name { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.brand { text-decoration: none; }

.site-nav { display: flex; gap: .25rem 1.25rem; flex-wrap: wrap; }
.site-nav a {
    color: var(--ink); text-decoration: none; font-weight: 600;
    padding: .35rem 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--primary); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--stitch); }

.site-footer { background: var(--tint); margin-top: 4rem; padding: 2.5rem 0 2rem; font-size: .95rem; }
.site-footer__inner { display: grid; gap: 1rem 2rem; grid-template-columns: 1fr auto; align-items: start; }
.site-footer__name { font-family: var(--serif); font-size: 1.25rem; margin-bottom: .25rem; }
.site-footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; text-align: right; }
.site-footer__legal { grid-column: 1 / -1; color: var(--muted); margin: 1rem 0 0; font-size: .85rem; }

/* ---------- elementi comuni ---------- */

.button {
    display: inline-block;
    background: var(--primary);
    color: var(--paper);
    font-weight: 700;
    text-decoration: none;
    padding: .85rem 1.5rem;
    border-radius: 999px;
    border: 2px solid var(--primary);
    line-height: 1.2;
}
.button:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--paper); }
.button--ghost { background: transparent; color: var(--primary); }
.button--ghost:hover { background: var(--tint); color: var(--primary-dark); }

.lead { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.empty { color: var(--muted); max-width: 60ch; }
.notice {
    background: color-mix(in srgb, var(--warn) 9%, var(--paper));
    border-left: 4px solid var(--warn);
    padding: .75rem 1rem; border-radius: 0 10px 10px 0; max-width: 60ch;
}
.hint { color: var(--muted); font-size: .95rem; max-width: 46ch; }
.back { margin: 1.5rem 0 1rem; font-weight: 600; }
.back a { text-decoration: none; }
.back a::before { content: "‹ "; }

.section { padding: 3rem 0 1rem; }
.section--tint { background: var(--tint); padding-bottom: 3rem; }
.section__title { margin-bottom: 1.25rem; }

.seats { font-weight: 600; color: var(--primary); }
.seats--low { color: var(--warn); }
.seats--full { color: var(--full); }

/* ---------- locandine: mostrate intere, mai ritagliate ---------- */

.poster {
    margin: 0;
    background: var(--tint);
    border-radius: var(--radius);
    padding: .6rem;
    aspect-ratio: 1.414 / 1;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.poster img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.poster--hero { border-radius: var(--radius-lg); padding: .9rem; }

/* ---------- biglietti delle date (bordo cucito) ---------- */

.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }

.ticket {
    display: grid;
    grid-template-columns: 4.25rem 1fr auto;
    align-items: center;
    gap: .9rem;
    background: var(--paper);
    border: 2px dotted var(--stitch);
    border-radius: var(--radius);
    padding: .7rem .9rem .7rem .7rem;
}
.ticket--full { border-color: var(--line); border-style: solid; }

.ticket__date {
    display: grid; justify-items: center; line-height: 1;
    background: var(--tint); border-radius: 10px; padding: .45rem 0 .5rem;
}
.ticket__weekday, .ticket__month { font-size: .8rem; color: var(--muted); }
.ticket__day { font-family: var(--serif); font-size: 1.9rem; color: var(--primary); margin: .15rem 0 .1rem; }
.ticket--full .ticket__day { color: var(--full); }

.ticket__body { display: grid; gap: .2rem; min-width: 0; }
.ticket__title { font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.3; }
a.ticket__title:hover { color: var(--primary); text-decoration: underline; }

.ticket__meter { display: block; height: 5px; background: var(--tint); border-radius: 99px; overflow: hidden; max-width: 180px; }
.ticket__meter > span { display: block; height: 100%; background: var(--stitch); }
.ticket--full .ticket__meter > span { background: var(--full); }

.ticket__action { font-weight: 700; white-space: nowrap; }

.tickets--row { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tickets--row .ticket { grid-template-columns: 4.25rem 1fr; }

/* ---------- home ---------- */

.intro { background: var(--tint); padding: 3rem 0 3.25rem; }
.intro__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: start; }
.intro__text { padding-top: 1rem; }
.intro__text h1 { max-width: 16ch; color: var(--primary-dark); }
.intro__dates-title { font-size: 1.25rem; margin-bottom: .75rem; }
.intro__more { margin: .9rem 0 0; font-weight: 600; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2rem 1.5rem; }
.course-card__link { text-decoration: none; color: inherit; display: grid; gap: .8rem; }
.course-card__link:hover .course-card__title { color: var(--primary); text-decoration: underline; }
.course-card__title { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.course-card__price { font-weight: 700; font-size: 1.1rem; margin: .35rem 0 .2rem; }
.course-card__next { font-size: .95rem; color: var(--muted); margin: 0; }
.course-card__next strong { color: var(--ink); font-weight: 600; }

/* ---------- pagina corso / prodotto ---------- */

.course__top { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5rem; align-items: start; }
.course__title { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.5rem); }

.facts { margin: 0 0 1.5rem; display: grid; gap: .5rem; }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.price { margin-bottom: 1rem; }
.price__now { font-family: var(--serif); font-size: 2.2rem; color: var(--primary); margin: 0; }
.price__was { font-family: var(--sans); font-size: 1.1rem; color: var(--muted); margin-left: .5rem; }
.price__note { font-weight: 600; margin: .25rem 0 0; }

.deadline { font-weight: 600; color: var(--warn); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 .75rem; }

.course__dates { margin-top: 3rem; }
.course__dates-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.course__dates-head h2 { margin: 0; }
.link-strong { font-weight: 700; }

.course__text, .course__more { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 3rem; }
.prose { max-width: 62ch; }
.prose ul, .prose ol { padding-left: 1.25rem; }

.teacher__body { display: flex; gap: 1rem; align-items: flex-start; }
.teacher__img { border-radius: 50%; object-fit: cover; flex: none; }
.teacher__name { font-family: var(--serif); font-size: 1.15rem; margin-bottom: .25rem; }

/* ---------- calendario ---------- */

.calendar__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.calendar__head h1 { margin: 0; }
.calendar__nav { display: flex; gap: .5rem; flex-wrap: wrap; }
.calendar__nav .button { padding: .55rem 1.1rem; }

.month { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.month th { font-weight: 600; color: var(--muted); font-size: .9rem; text-align: left; padding: 0 .4rem; }
.month td {
    vertical-align: top; height: 7.5rem; padding: .4rem;
    border-radius: 10px; background: color-mix(in srgb, var(--tint) 45%, var(--paper));
}
.month td.month__has { background: var(--paper); border: 2px dotted var(--stitch); }
.month td.month__out { background: transparent; color: var(--line); }
.month__num { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: .25rem; }
.month__entry {
    display: grid; gap: .1rem; text-decoration: none; color: var(--ink);
    font-size: .85rem; line-height: 1.25; padding: .3rem .35rem; border-radius: 8px; margin-bottom: .3rem;
    background: var(--tint);
}
.month__entry:hover { background: color-mix(in srgb, var(--stitch) 22%, var(--paper)); }
.month__entry--full { background: transparent; color: var(--full); }
.month__title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.month .seats { font-size: .8rem; }

.agenda { display: none; }

/* ---------- schermi stretti ---------- */

@media (max-width: 860px) {
    .intro__inner, .course__top, .course__text, .course__more { grid-template-columns: 1fr; }
    .intro { padding-top: 2rem; }
    .intro__text { padding-top: 0; }
    .month { display: none; }
    .agenda { display: grid; }
    .site-footer__inner { grid-template-columns: 1fr; }
    .site-footer__links { text-align: left; }
}

@media (max-width: 520px) {
    body { font-size: 1rem; }
    .brand img { height: 46px; }
    .ticket { grid-template-columns: 3.75rem 1fr; }
    .ticket__action { grid-column: 2; }
    .facts div { grid-template-columns: 6.5rem 1fr; }
    .actions .button { width: 100%; text-align: center; }
}
