/* ============================================================
   La pagina del calendario — formato A5 (148 × 210 mm)
   Tutte le misure interne sono in cqw: la pagina si adatta
   dalla miniatura alla stampa mantenendo le stesse proporzioni.
   ============================================================ */

.sheet {
  container-type: size;
  position: relative;
  width: 100%;
  aspect-ratio: 148 / 210;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
  font-family: var(--serif);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset, 0 18px 40px -26px rgba(50, 25, 22, 0.5);
  --pad: 7.6cqw;

  /* La pagina porta con sé la propria palette: non eredita i colori
     del contesto in cui è inserita (fasce rosse, stampa, miniature). */
  --paper: #f6f1e7;
  --ink: #1c1a19;
  --ink-soft: #4a4441;
  --ink-faint: #857b74;
  --line: rgba(28, 26, 25, 0.16);
  --line-strong: rgba(28, 26, 25, 0.34);
  --burgundy: #961a1c;
  --burgundy-soft: #b03a37;
  --burgundy-deep: #6f1113;
  --brand: #961a1c;
}

.sheet__frame {
  position: absolute;
  inset: 3.6cqw;
  border: 0.13cqw solid var(--line);
  pointer-events: none;
}

.sheet__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--pad) calc(var(--pad) + 2.4cqw);
  z-index: 1;
}

/* filetto ornamentale in alto */
.sheet__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2cqw;
  padding-bottom: 2.2cqw;
  border-bottom: 0.13cqw solid var(--line-strong);
}

.sheet__brand {
  font-family: var(--sans);
  font-size: 2.32cqw;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.sheet__year {
  font-family: var(--sans);
  font-size: 2.32cqw;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}

/* testata: mese + numero del giorno */
.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2cqw;
  margin-top: 4.2cqw;
}

.sheet__month {
  font-family: var(--sans);
  font-size: 2.62cqw;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
  padding-top: 1.4cqw;
}

.sheet__daynum {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 25cqw;
  line-height: 0.78;
  letter-spacing: -0.055em;
  color: var(--burgundy);
  font-variant-numeric: lining-nums;
}

.sheet__weekday {
  font-family: var(--sans);
  font-size: 2.3cqw;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 3.4cqw;
  padding-top: 1.6cqw;
  border-top: 0.13cqw solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1cqw;
}

/* corpo: la citazione */
.sheet__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3cqw 0 2cqw;
}

.sheet__quote {
  font-family: var(--serif);
  font-size: 6.1cqw;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-align: left;
  color: var(--ink);
  text-wrap: pretty;
  margin: 0;
  position: relative;
}

.sheet__quote::before {
  content: '';
  display: block;
  width: 7cqw;
  height: 0.22cqw;
  background: var(--burgundy);
  margin-bottom: 3.6cqw;
}

.sheet__quote.is-long {
  font-size: 5.3cqw;
}

.sheet__quote.is-very-long {
  font-size: 4.6cqw;
  line-height: 1.36;
}

.sheet__quote.is-short {
  font-size: 6.9cqw;
}

.sheet__attrib {
  margin-top: 4.4cqw;
  display: flex;
  flex-direction: column;
  gap: 0.9cqw;
}

.sheet__author {
  font-family: var(--sans);
  font-size: 2.84cqw;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--burgundy);
}

.sheet__work {
  font-family: var(--serif);
  font-style: italic;
  font-size: 3.1cqw;
  color: var(--ink-soft);
  line-height: 1.35;
}

.sheet__work span {
  font-style: normal;
  font-family: var(--sans);
  font-size: 2.16cqw;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* piede */
.sheet__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2cqw;
  padding-top: 2.4cqw;
  border-top: 0.13cqw solid var(--line-strong);
  font-family: var(--sans);
  font-size: 2.08cqw;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sheet__foot strong {
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.16em;
}

/* --------------------- variante: pagina rossa --------------------- */

.sheet--burgundy {
  background: var(--brand);
  color: var(--paper);
  --line: rgba(246, 241, 231, 0.28);
  --line-strong: rgba(246, 241, 231, 0.5);
  --ink: var(--paper);
  --ink-soft: rgba(246, 241, 231, 0.8);
  --ink-faint: rgba(246, 241, 231, 0.6);
  --burgundy: var(--paper);
  --burgundy-soft: var(--paper);
  --burgundy-deep: var(--paper);
}

.sheet--burgundy .sheet__quote::before {
  background: rgba(246, 241, 231, 0.7);
}

/* --------------------- variante: copertina ----------------------- */

.sheet--cover {
  background:
    linear-gradient(160deg, var(--burgundy-soft) 0%, var(--brand) 42%, var(--burgundy-deep) 100%);
  color: var(--paper);
  --line: rgba(246, 241, 231, 0.3);
  --line-strong: rgba(246, 241, 231, 0.55);
  --ink: var(--paper);
  --ink-soft: rgba(246, 241, 231, 0.8);
  --ink-faint: rgba(246, 241, 231, 0.6);
  --burgundy: var(--paper);
}

.sheet--cover .sheet__brand,
.sheet--cover .sheet__year,
.sheet--cover .sheet__month,
.sheet--cover .sheet__daynum,
.sheet--cover .sheet__weekday,
.sheet--cover .sheet__author,
.sheet--cover .sheet__work,
.sheet--cover .sheet__foot,
.sheet--cover .sheet__quote {
  color: var(--paper);
}

.sheet--cover .sheet__inner {
  justify-content: space-between;
}

.sheet--cover .sheet__top,
.sheet--cover .sheet__weekday,
.sheet--cover .sheet__foot {
  border-color: rgba(246, 241, 231, 0.4);
  --line: rgba(246, 241, 231, 0.3);
  --line-strong: rgba(246, 241, 231, 0.55);
}

.sheet--cover .sheet__quote::before {
  background: rgba(246, 241, 231, 0.75);
}

.sheet--cover .sheet__quote {
  font-size: 7.4cqw;
  line-height: 1.22;
}

/* --------------------- anteprima in miniatura --------------------- */

.sheet--mini {
  box-shadow: none;
}

.sheet--mini .sheet__frame {
  inset: 2.4cqw;
  border-width: 0.2cqw;
}

/* ------------------------- variazioni ---------------------------- */

.sheet--plain {
  box-shadow: none;
}

.sheet--plain .sheet__frame {
  border-color: var(--paper-edge);
}

@media print {
  .sheet {
    box-shadow: none;
    border-radius: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
