/* Печатные страницы A4. Используются и в предпросмотре, и при печати. */
@page { size: A4 portrait; margin: 0; }

.page {
  --red: #c8423b; --green: #2f6f55; --gold: #e9a93a; --ink: #2b2a33; --cream: #fffaf2;
  position: relative; box-sizing: border-box;
  width: 210mm; height: 297mm; overflow: hidden;
  background: var(--cream); color: var(--ink);
  font-family: 'Nunito', 'Segoe UI', Arial, sans-serif; font-size: 10.5pt; line-height: 1.35;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  /* «Зефирные» буквы: на светлом фоне — белая обводка и розовая подложка, на тёмном — розовая подложка */
  --mm: 0 .04em 0 #fff, 0 -.04em 0 #fff, .04em 0 0 #fff, -.04em 0 0 #fff, .03em .03em 0 #fff, -.03em -.03em 0 #fff, .03em -.03em 0 #fff, -.03em .03em 0 #fff, 0 .1em 0 #f1c9c4, 0 .16em .25em rgba(200, 66, 59, .25);
  --mm-dark: 0 .07em 0 #f3c6cf, 0 .14em .3em rgba(0, 0, 0, .35);
  break-after: page; page-break-after: always;
}
.page *, .page *::before, .page *::after { box-sizing: border-box; }
.page h1, .page h2, .page h3, .page h4 { font-family: 'Nunito', sans-serif; font-weight: 900; margin: 0; }

.snow { position: absolute; inset: 0; pointer-events: none; color: #9cc3e0; }
.flake { position: absolute; transform: translate(-50%, -50%); }

/* Обложка */
.page--cover { background: radial-gradient(circle at 50% 35%, #2d5b8a 0%, #1b3454 60%, #12243b 100%); color: #fff; }
.page--cover .snow { color: #fff; }
.cover-inner { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20mm; }
.cover-kicker { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 24pt; line-height: 1.1; letter-spacing: .5px; color: #ffe2a6; margin-bottom: 10mm; text-shadow: var(--mm-dark); }
.cover-kicker span { display: block; font-size: 40pt; color: #fff; }
/* Кольца — рамками, а не тенью: так их видит и генератор PDF */
.cover-photo { width: 99mm; height: 99mm; border-radius: 50%; overflow: hidden; border: 2mm solid var(--gold); background: #e8f1f8; display: flex; align-items: center; justify-content: center; font-size: 60pt; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; border: 4mm solid #fff; border-radius: 50%; }
.cover-name { font-size: 56pt; margin-top: 11mm; color: #fff; line-height: 1.1; text-shadow: var(--mm-dark); }
.cover-sub { font-size: 15pt; margin-top: 5mm; color: #d8e7f5; }
.cover-year { font-family: 'Nunito', sans-serif; font-size: 34pt; margin-top: 13mm; color: var(--gold); font-weight: 900; text-shadow: var(--mm-dark); }

/* Памятка */
.page--memo { padding: 16mm 16mm; font-size: 10pt; }
.page--memo h2 { font-size: 26pt; color: var(--red); margin-bottom: 4mm; text-shadow: var(--mm); }
.page--memo h3 { font-size: 13pt; color: var(--green); margin: 6mm 0 2.5mm; }
.page--memo h4 { font-size: 9.5pt; margin: 0 0 1mm; break-inside: avoid; }
.memo-steps { padding-left: 6mm; margin: 0; }
.memo-steps li { margin-bottom: 1.5mm; }
.shop { columns: 2; column-gap: 8mm; font-size: 9pt; }
.shop ul { margin: 0 0 3mm; padding-left: 4mm; }
.shop li { margin-bottom: .6mm; break-inside: avoid; }
.muted { color: #8a8794; }
.overview { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin-top: 4mm; }
.overview td { padding: 1.3mm 2mm; border-bottom: .2mm solid #eadfcf; vertical-align: top; }
.overview td.num { font-weight: 800; color: var(--red); width: 7mm; }
.overview b { color: var(--green); font-size: 7pt; text-transform: uppercase; }
.overview i { color: #8a8794; }

/* Письмо */
.page--letter { background: #f4ede0; }
.letter { position: relative; margin: 30mm 25mm; padding: 16mm 18mm; background: #fffdf8; border-radius: 4mm; border: .6mm dashed var(--gold); font-size: 13pt; line-height: 1.55; }
.letter-head { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 21pt; text-shadow: var(--mm); color: var(--red); margin-bottom: 8mm; }
.letter p { margin: 0 0 4mm; }

/* Карточки 2×3 */
.page--cards { background: #fff; }
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; }
.card { position: relative; padding: 7mm 8mm 6mm; border-right: .3mm dashed #b9b3a7; border-bottom: .3mm dashed #b9b3a7; display: flex; flex-direction: column; overflow: hidden; }
.card:nth-child(2n) { border-right: none; }
.card:nth-child(n+5) { border-bottom: none; }
.card::before { content: ''; position: absolute; inset: 3mm; border-radius: 4mm; background: var(--tint); z-index: 0; }
.card > * { position: relative; z-index: 1; }
.card--kind { --tint: #fbe3ea; --accent: #c2456d; }
.card--craft { --tint: #fdf0cf; --accent: #b77a10; }
.card--science { --tint: #dcecfb; --accent: #2e6fae; }
.card--books { --tint: #ebe3fa; --accent: #6a4bb0; }
.card--family { --tint: #fde4d2; --accent: #c4592c; }
.card--active { --tint: #daf1e1; --accent: #2f7d4f; }
.card--blank::before { display: none; }
.card--spare::before { background: none; border: .6mm dashed var(--accent); opacity: .7; }
.card--spare .card-num { font-size: 18pt; }
.card-top { display: flex; align-items: center; gap: 3mm; margin-bottom: 2.5mm; }
.card-num { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 26pt; line-height: 1; color: #fff; background: var(--accent); min-width: 15mm; height: 15mm; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 1.5mm; }
.card-date { font-weight: 700; font-size: 10pt; line-height: 1.15; flex: 1; }
.card-date small { font-weight: 400; color: #777; }
.card-icon { font-size: 18pt; }
.card-story { font-style: italic; font-size: 9.5pt; color: #555; margin-bottom: 2mm; }
.card h3 { font-size: 15.5pt; color: var(--accent); margin-bottom: 2mm; line-height: 1.2; }
.card p { margin: 0 0 2.5mm; font-size: 11.5pt; line-height: 1.4; }
.card-mat { font-size: 9pt; color: #555; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 8.3pt; color: #666; padding-top: 1.5mm; }
.card-gift { font-size: 8.5pt; font-weight: 700; color: var(--accent); margin-top: 1mm; }

/* Номерки 4×6 */
.page--tags { background: #fff; padding: 12mm 10mm; }
.tags-title { text-align: center; font-size: 10pt; color: #777; margin-bottom: 6mm; }
.tags-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5mm 4mm; justify-items: center; }
.tag { width: 40mm; height: 40mm; border-radius: 50%; border: .3mm dashed #b9b3a7; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.tag span { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 30pt; line-height: 1; }
.tag small { font-size: 8pt; margin-top: 1mm; }
.tag--0 { background: #c8423b; } .tag--1 { background: #2f6f55; } .tag--2 { background: #2e6fae; } .tag--3 { background: #d08a17; }

/* Диплом */
.page--diploma { background: linear-gradient(160deg, #fff7e3, #fde7c2); }
.diploma { position: relative; margin: 18mm; height: calc(100% - 36mm); border: 2.5mm double var(--gold); border-radius: 6mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14mm; }
.diploma-title { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 58pt; line-height: 1.1; color: var(--red); text-shadow: var(--mm); }
.diploma-sub { font-size: 15pt; margin: 2mm 0 10mm; color: var(--green); }
.diploma-photo { width: 64mm; height: 64mm; border-radius: 50%; overflow: hidden; border: 1mm solid var(--gold); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 40pt; }
.diploma-photo img { width: 100%; height: 100%; object-fit: cover; border: 2.5mm solid #fff; border-radius: 50%; }
.diploma-name { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 40pt; color: var(--red); text-shadow: var(--mm); margin: 8mm 0 4mm; }
.diploma p { font-size: 13pt; max-width: 140mm; }
.diploma-sign { display: flex; gap: 25mm; margin-top: 18mm; font-style: italic; font-size: 12pt; }
.diploma-sign span { border-top: .3mm solid var(--ink); padding-top: 2mm; min-width: 45mm; }
