/* =========================================================
   Barra, programma (timeline), footer
   ========================================================= */

/* ---------- Barra superiore ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: .7rem clamp(1rem, 4vw, 3rem);
  background: var(--night);   /* scura e piena: Safari su iPhone colora le sue barre con questo colore */
  border-bottom: 1px solid rgba(207,168,98,.3);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.6);
}
.brand { flex: 0 0 auto; display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand .crest { width: 44px; height: 44px; }
.brand .crest::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff8ea; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text small {
  font-size: .58rem; font-weight: 700; letter-spacing: .38em; text-transform: uppercase; color: var(--gold);
}
.brand-text em {
  font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.45rem; letter-spacing: .01em;
  color: var(--gold-2); margin-top: .15rem;
}
.brand:hover .crest svg { animation-duration: 1.6s; }
.days { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.days::-webkit-scrollbar { display: none; }
.days a {
  position: relative; flex: 0 0 auto;
  padding: .45rem .7rem; border-radius: 10px;
  font-size: .8rem; font-weight: 600; color: rgba(247,239,225,.6); text-decoration: none; white-space: nowrap;
  transition: color .3s, background .3s;
}
.days a b { font-family: var(--serif); font-weight: 500; font-size: 1rem; color: var(--cream); margin-right: .2rem; transition: color .3s; }
.days a::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 1.5px;
  background: var(--gold); transform: scaleX(0); transition: transform .45s var(--ease);
}
.days a:hover, .days a.active { color: var(--gold-2); background: rgba(207,168,98,.14); }
.days a:hover b, .days a.active b { color: var(--gold-2); }
.days a.active::after { transform: scaleX(1); }
.days a.done { opacity: .5; }

/* ---------- Sezione carta ---------- */
.paper {
  position: relative; z-index: 2;
  padding: clamp(4rem, 9vw, 7rem) 1.25rem clamp(5rem, 10vw, 8rem);
  background:
    radial-gradient(50% 30% at 0% 10%, rgba(155,43,56,.06), transparent 70%),
    radial-gradient(50% 30% at 100% 55%, rgba(36,90,72,.07), transparent 70%),
    radial-gradient(rgba(207,168,98,.16) 1px, transparent 1.4px) 0 0 / 28px 28px,
    var(--paper);
}
.section-head { text-align: center; margin-bottom: clamp(3rem, 7vw, 5rem); }
.section-head h2 {
  font-family: var(--serif); font-weight: 350; font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  letter-spacing: -.015em; line-height: 1.05; margin-top: .8rem; color: var(--ink);
}
.section-head h2 em { font-style: italic; color: var(--wine); }

.ornament { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.4rem; color: var(--gold); }
.ornament span { width: 70px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament span:last-child { transform: scaleX(-1); }
.ornament svg { width: 22px; height: 22px; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Timeline ---------- */
.timeline { max-width: 980px; margin: 0 auto; }
.month {
  display: flex; align-items: center; gap: 1.2rem; margin: 0 0 2.2rem;
  font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.6rem; color: var(--wine);
}
.month::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.month small { font-family: var(--sans); font-style: normal; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.month:not(:first-child) { margin-top: 3.5rem; }

.day {
  display: grid; grid-template-columns: 130px 56px 1fr; align-items: start;
  scroll-margin-top: 90px;
  opacity: 0; transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.day.in { opacity: 1; transform: none; }

.when { text-align: right; padding-top: 1.2rem; }
.when .num { display: block; font-family: var(--serif); font-weight: 300; font-size: 4rem; line-height: .9; color: var(--wine); font-variation-settings: "opsz" 144; }
.when .wd { display: block; margin-top: .4rem; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--muted); text-transform: capitalize; }

.rail { position: relative; align-self: stretch; }
.rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: linear-gradient(var(--line), var(--line)); }
.day:last-child .rail::before { bottom: auto; height: 2.6rem; }
.node {
  position: absolute; left: 50%; top: 2.1rem; width: 13px; height: 13px; margin-left: -6.5px;
  border-radius: 50%; background: var(--paper); border: 1.5px solid var(--gold);
}
.day.next .node, .day.today .node { background: var(--gold); box-shadow: 0 0 0 5px rgba(207,168,98,.22); }
.day.next .node::after, .day.today .node::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--gold);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.day.done .node { background: var(--gold); border-color: var(--gold); opacity: .5; }

/* ---------- Card ---------- */
.card {
  position: relative; margin-bottom: 2.4rem;
  padding: 1.6rem 1.8rem 1.4rem;
  background: #fffdf9; border: 1px solid rgba(207,168,98,.3); border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 30px 60px -34px rgba(70,40,20,.35);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), border-color .6s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(207,168,98,.65); box-shadow: 0 40px 70px -34px rgba(70,40,20,.45); }
.day.done .card { opacity: .62; }

.card-top { display: flex; align-items: center; gap: 1.1rem; }
.icon {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--wine); background: linear-gradient(180deg, #fff8ea, #f4e7cd);
  border: 1px solid rgba(207,168,98,.55);
  box-shadow: 0 8px 18px -10px rgba(122,29,42,.45);
  transition: transform .8s var(--ease);
}
.icon svg { width: 26px; height: 26px; }
.card:hover .icon { transform: rotate(-12deg) scale(1.06); }
.card-top .label { font-size: .7rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); }
.card h3 { font-family: var(--serif); font-weight: 450; font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.15; color: var(--ink); margin-top: .15rem; }

.tag {
  margin-left: auto; align-self: flex-start; flex: 0 0 auto;
  padding: .3rem .7rem; border-radius: 999px;
  font-size: .64rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--wine); border: 1px solid rgba(122,29,42,.3);
}
.tag.today { color: var(--night); background: var(--gold-2); border-color: var(--gold); }
.tag.done { color: var(--muted); border-color: rgba(0,0,0,.12); }

.items { list-style: none; margin-top: 1.2rem; }
.items li {
  display: grid; grid-template-columns: 58px 1fr; gap: .4rem; align-items: baseline;
  padding: .8rem 0; border-top: 1px solid rgba(207,168,98,.22);
  font-size: 1rem; line-height: 1.55; color: #33403f;
}
.items .t { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold); }
.items .dot { width: 7px; height: 7px; margin-left: 4px; transform: rotate(45deg); border: 1.5px solid var(--gold); align-self: center; }
.items .tbd { margin-left: .4rem; font-family: var(--serif); font-style: italic; color: var(--muted); }

/* compleanni: icona bordeaux */
.day.bday .icon { color: var(--gold-2); background: linear-gradient(180deg, var(--wine-2), var(--wine)); border-color: var(--wine); }

/* ---------- Natale: card speciale ---------- */
.day.feature .card {
  color: var(--cream); overflow: hidden;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(207,168,98,.22), transparent 55%),
    linear-gradient(150deg, var(--wine-2), var(--wine) 55%, #5c1320);
  border-color: rgba(236,213,160,.5);
  box-shadow: 0 40px 80px -36px rgba(122,29,42,.7);
}
.day.feature .card::before { /* fiocco filigrana */
  content: ""; position: absolute; right: -60px; bottom: -70px; width: 280px; height: 280px; opacity: .1;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ecd5a0' stroke-width='.6' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17 20.7 7'/%3E%3Cpath d='m9.5 3.5 2.5 2 2.5-2M9.5 20.5l2.5-2 2.5 2M3.7 10.4l3.3-.6-1-3.1M20.3 13.6l-3.3.6 1 3.1M3.7 13.6l3.3.6-1 3.1M20.3 10.4l-3.3-.6 1-3.1'/%3E%3C/svg%3E");
  animation: spin 60s linear infinite;
}
.day.feature .card h3 { color: #fff7e8; font-size: clamp(2rem, 4vw, 2.6rem); }
.day.feature .icon { color: var(--wine); background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold-2); }
.day.feature .label { color: var(--gold-2); }
.day.feature .tag { color: var(--gold-2); border-color: rgba(236,213,160,.45); }
.day.feature .items { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.day.feature .items li { color: rgba(255,247,232,.92); border-top-color: rgba(236,213,160,.22); }
.day.feature .items .dot { border-color: var(--gold-2); }
.day.feature .when .num { color: var(--wine); }

/* ---------- Footer ---------- */
.footer {
  position: relative; overflow: hidden;
  padding: 150px 1.5rem 4.5rem; text-align: center; color: var(--cream);
  background:
    radial-gradient(70% 60% at 50% 110%, rgba(236,170,90,.22), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night) 60%, #08151d);
}
.footer::before {
  content: ""; position: absolute; left: -5%; right: -5%; top: -1px; height: 70px;
  background: var(--paper); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.footer .garland { top: 72px; }
.footer > p, .footer > .ornament { position: relative; z-index: 2; }
.footer-script { font-family: var(--script); font-size: clamp(3.6rem, 10vw, 6rem); line-height: 1.1; color: var(--gold-2); }
.footer-line { margin-top: .4rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: rgba(247,239,225,.78); }
.ornament.light { color: var(--gold-2); }
.footer-hint { margin-top: 2rem; font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(247,239,225,.4); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .bar { gap: 1rem; }
  .brand .crest { width: 38px; height: 38px; }
  .brand-text em { font-size: 1.2rem; }
  .brand-text small { font-size: .5rem; }
  .day { grid-template-columns: 1fr; }
  .rail { display: none; }
  .when { text-align: left; padding: 0 0 .7rem .3rem; display: flex; align-items: baseline; gap: .7rem; }
  .when .num { font-size: 2.6rem; }
  .when .wd { margin: 0; }
  .card { padding: 1.3rem 1.2rem 1.1rem; margin-bottom: 2rem; }
  .icon { width: 46px; height: 46px; }
  .day.feature .items { grid-template-columns: 1fr; }
  .items li { grid-template-columns: 50px 1fr; font-size: .96rem; }
}

/* =========================================================
   Più contrasto nelle card
   ========================================================= */
.card {
  background: #ffffff;
  border-color: rgba(176,135,62,.5);
  box-shadow: 0 1px 2px rgba(60,35,15,.06), 0 32px 60px -30px rgba(70,40,20,.42);
}
.card:hover { border-color: rgba(176,135,62,.85); }
.card-top .label { color: #8f6a26; }
.card h3 { color: #121c1b; font-weight: 520; }
.items li { color: #1d2827; font-weight: 500; border-top-color: rgba(176,135,62,.32); }
.items .t { color: #8f6a26; font-weight: 500; }
.items .dot { border-color: #b08a3e; }
.items .tbd { color: #5c615b; }
.when .wd { color: #4b524c; }
.day.done .card { opacity: .72; }
.tag { color: #7a1d2a; border-color: rgba(122,29,42,.45); }
.day.feature .items li { color: #fff; border-top-color: rgba(236,213,160,.3); }
.day.feature .label { color: #f6e2b4; }

/* ---------- Pulsante "Aggiungi al calendario" ---------- */
.card-foot {
  display: flex; justify-content: flex-end;
  margin-top: .3rem; padding-top: 1rem;
  border-top: 1px solid rgba(176,135,62,.32);
}
.cal-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .6rem 1.05rem; border-radius: 999px;
  font-size: .82rem; font-weight: 700; letter-spacing: .02em; text-decoration: none;
  color: var(--wine); background: #fbf2e1; border: 1px solid rgba(176,135,62,.55);
  transition: background .35s var(--ease), color .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.cal-btn svg { width: 17px; height: 17px; }
.cal-btn:hover { color: var(--cream); background: var(--wine); border-color: var(--wine); transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(122,29,42,.6); }
.cal-btn:active { transform: scale(.97); }
.day.feature .card-foot { border-top-color: rgba(236,213,160,.3); }
.day.feature .cal-btn { color: var(--night); background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold-2); }
.day.feature .cal-btn:hover { color: var(--night); background: #fff3d6; }
.cal-all { margin-top: 1.8rem; }

@media (max-width: 760px) {
  .card-foot { justify-content: stretch; }
  .card-foot .cal-btn { width: 100%; justify-content: center; padding: .75rem 1rem; }
}
