/* Styles for /pizza. The page has its own look (a late-'90s pizzeria menu), so nothing here is shared with styles.css. */

/* Colors, light then dark: a media query rather than the light-dark() function, so pre-2024 browsers keep the palette */
:root {
    color-scheme: light dark;
    --cloth: #ffffff;
    --check: rgb(200 16 46 / 0.5);
    --paper: #fffaee;
    --ink: #2a1a12;
    --muted: #6b5a4c;
    --red: #b0141e;
    --banner: #b0141e; /* white text sits on this in both modes */
    --green: #0b6e3a;
    --rule: #dccbaa;
    --zebra: #fbf0d9;
    --newsprint: #fff1b3;
    --link: #0000ee;
    --visited: #551a8b;
    --button: #c0c0c0;
    --button-ink: #000000;
    --hi: #ffffff;
    --lo: #808080;
    --flag: linear-gradient(90deg, #008c45 0 33.3%, #f4f5f0 0 66.6%, #cd212a 0);
}

@media (prefers-color-scheme: dark) {
    :root {
        --cloth: #160c0c;
        --check: rgb(150 14 34 / 0.55);
        --paper: #1e1a15;
        --ink: #f3e9d8;
        --muted: #b9ab97;
        --red: #ff7b6b;
        --green: #5fd08f;
        --rule: #3f372d;
        --zebra: #26211b;
        --newsprint: #2e2816;
        --link: #8ab4ff;
        --visited: #c9a7ff;
        --button: #3a3a3a;
        --button-ink: #f0f0f0;
        --hi: #5a5a5a;
        --lo: #1a1a1a;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Gingham tablecloth: two half-transparent stripe sets overlap into a darker square */
body {
    background-color: var(--cloth);
    background-image:
        linear-gradient(90deg, var(--check) 50%, transparent 0),
        linear-gradient(var(--check) 50%, transparent 0);
    background-size: 44px 44px;
    color: var(--ink);
    font: 17px/1.55 "Times New Roman", Times, Georgia, serif;
    padding: 32px 16px 48px;
}

a { color: var(--link); }
a:visited { color: var(--visited); }

.menu {
    max-width: 720px;
    margin: 0 auto;
    background: var(--paper);
    border: 6px double var(--red);
    outline: 3px solid var(--green);
    outline-offset: 3px;
    box-shadow: 10px 10px 0 rgb(0 0 0 / 0.35);
    position: relative;
}

.flag { height: 10px; background: var(--flag); }

/* ---------- Masthead ---------- */
header { text-align: center; padding: 24px 16px 8px; }

/* Sticker slapped on the menu's corner, over the border */
.stamp {
    position: absolute;
    top: -22px;
    right: -28px;
    z-index: 1;
    width: 72px;
    height: 72px;
    background: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px double var(--red);
    border-radius: 50%;
    color: var(--red);
    font: 900 11px/1.15 "Arial Black", Impact, sans-serif;
    text-align: center;
    transform: rotate(-14deg);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.pie { width: 56px; height: 56px; flex: none; animation: spin 6s linear infinite; }

h1 {
    font: italic 700 clamp(30px, 7vw, 50px)/1.05 Georgia, "Times New Roman", serif;
    color: var(--red);
    text-shadow: 2px 2px 0 var(--paper), 4px 4px 0 var(--green);
}

h1 small { display: block; font: inherit; }

/* Dark mode: the title becomes a neon sign hung on the wall */
@media screen and (prefers-color-scheme: dark) {
    h1 {
        position: relative;
        margin-top: 16px;
        padding: 14px 28px 12px;
        background: #1a1210;
        border: 3px solid #5a4636;
        border-radius: 14px;
        box-shadow: inset 0 0 0 2px #2b201b;
        font-size: clamp(30px, 6.5vw, 44px);
        line-height: 1;
        color: transparent;
        -webkit-text-stroke: 1.5px #ff6b6b;
        text-shadow: 0 0 10px rgb(255 59 59 / 0.7);
    }

    h1::before, h1::after {
        content: "";
        position: absolute;
        top: -19px;
        height: 16px;
        border-left: 2px dotted var(--muted);
    }
    h1::before { left: 22%; }
    h1::after { right: 22%; }

    h1 small {
        margin: 8px -0.4em 0 0;
        font: normal 700 clamp(12px, 2.6vw, 16px)/1 Verdana, Geneva, sans-serif;
        letter-spacing: 0.4em;
        text-transform: uppercase;
        color: #8affb8;
        -webkit-text-stroke: 0;
        text-shadow: 0 0 6px rgb(61 220 132 / 0.8);
    }
}

.tagline {
    margin-top: 10px;
    font: 700 13px/1.4 Verdana, Geneva, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
}

/* Each item keeps its own bullet, so a wrapped line never ends in one */
.tagline span { white-space: nowrap; }
.tagline span + span::before { content: "\2022\A0"; }

/* ---------- Marquee ---------- */
.marquee b { font: inherit; }

.marquee {
    margin: 16px 0 0;
    overflow: hidden;
    white-space: nowrap;
    background: var(--banner);
    color: #fff;
    font: 700 14px/30px Verdana, Geneva, sans-serif;
    border-block: 2px solid var(--green);
}

/* The message appears three times and the track scrolls exactly one copy, so it loops seamlessly; three copies
   keep the bar full even when the message is shorter than the bar */
.marquee > span {
    display: inline-block;
    animation: scroll 9s linear infinite;
}

/* ---------- Nav buttons ---------- */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--rule);
}

nav a, nav a:visited, nav button {
    font: 12px/1 Verdana, Geneva, sans-serif;
    color: var(--button-ink);
    text-decoration: none;
    background: var(--button);
    padding: 7px 12px;
    border: 2px solid;
    border-color: var(--hi) var(--lo) var(--lo) var(--hi);
}

/* Print is an action, not a section link: red so it reads as its own thing */
nav button {
    cursor: pointer;
    background: var(--banner);
    color: #fff;
    font-weight: 700;
    border-color: #e8707a #6e0a12 #6e0a12 #e8707a;
}
nav button:active { border-color: #6e0a12 #e8707a #e8707a #6e0a12; }
nav a:active { border-color: var(--lo) var(--hi) var(--hi) var(--lo); }

/* ---------- Dough calculator (shown by pizza.js; useless without it) ---------- */
.calc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 14px;
    font: 700 14px/1.4 Verdana, Geneva, sans-serif;
    color: var(--green);
}

.calc[hidden] { display: none; }

.calc input {
    width: 3.2em;
    padding: 3px 4px;
    font: 700 16px/1.2 "Courier New", Courier, monospace;
    text-align: center;
    color: var(--ink);
    background: var(--paper);
    border: 2px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}

.calc span { font-weight: 400; color: var(--muted); }

.calc .warn { flex-basis: 100%; font-weight: 700; color: var(--red); }
.calc .warn[hidden] { display: none; }

/* ---------- Content ---------- */
main { padding: 8px 32px 24px; }

section { padding-top: 28px; scroll-margin-top: 16px; }

h2 {
    font: 900 22px/1.2 "Arial Black", Impact, "Helvetica Neue", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--red);
    padding-bottom: 6px;
    margin-bottom: 14px;
    border-bottom: 4px solid;
    border-image: var(--flag) 1;
}

h2 small {
    font: italic 400 16px Georgia, serif;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}

h3 {
    font: 700 15px/1.3 Verdana, Geneva, sans-serif;
    color: var(--green);
    margin: 18px 0 8px;
}

p + p, p + ol, p + ul, ol + p, ul + p, table + p { margin-top: 12px; }
table + ol { margin-top: 16px; }

ol, ul { padding-left: 24px; }
li + li { margin-top: 8px; }
li::marker { color: var(--red); font-weight: 700; }
ul { list-style: square; }

.note { font-size: 15px; color: var(--muted); font-style: italic; }

/* Old-school bordered tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    border: 2px solid;
    border-color: var(--hi) var(--lo) var(--lo) var(--hi);
    font-size: 16px;
}

th, td {
    padding: 5px 8px;
    text-align: left;
    border: 1px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}

th {
    background: var(--banner);
    color: #fff;
    font: 700 13px Verdana, Geneva, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tbody tr:nth-child(even) td { background: var(--zebra); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; }

.schedule td:first-child { white-space: nowrap; font-weight: 700; color: var(--green); }

.new {
    display: inline-block;
    font: 700 11px/1 Verdana, Geneva, sans-serif;
    color: #fff;
    background: var(--banner);
    padding: 3px 5px;
    margin-left: 8px;
    vertical-align: 2px;
    animation: blink 1.2s linear 4; /* 4.8s, then it stays lit: blinking must stop within 5s */
}

/* ---------- Coupon: clipped from the Sunday circular ---------- */
.coupon {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 500px;
    margin: 12px auto 36px;
    padding: 16px 18px 12px;
    background: var(--newsprint);
    border: 3px dashed var(--red);
    outline: 2px solid var(--newsprint);
    transform: rotate(-1.2deg);
    box-shadow: 6px 6px 0 rgb(0 0 0 / 0.18);
}

.coupon .clip {
    position: absolute;
    top: -14px;
    left: 18px;
    padding: 0 6px;
    background: var(--paper);
    color: var(--red);
    font: 700 13px Verdana, Geneva, sans-serif;
}

.burst {
    flex: none;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    background: var(--banner);
    clip-path: polygon(50.0% 0.0%, 56.1% 11.5%, 65.5% 2.4%, 67.7% 15.3%, 79.4% 9.5%, 77.6% 22.4%, 90.5% 20.6%, 84.7% 32.3%, 97.6% 34.5%, 88.5% 43.9%, 100.0% 50.0%, 88.5% 56.1%, 97.6% 65.5%, 84.7% 67.7%, 90.5% 79.4%, 77.6% 77.6%, 79.4% 90.5%, 67.7% 84.7%, 65.5% 97.6%, 56.1% 88.5%, 50.0% 100.0%, 43.9% 88.5%, 34.5% 97.6%, 32.3% 84.7%, 20.6% 90.5%, 22.4% 77.6%, 9.5% 79.4%, 15.3% 67.7%, 2.4% 65.5%, 11.5% 56.1%, 0.0% 50.0%, 11.5% 43.9%, 2.4% 34.5%, 15.3% 32.3%, 9.5% 20.6%, 22.4% 22.4%, 20.6% 9.5%, 32.3% 15.3%, 34.5% 2.4%, 43.9% 11.5%);
    transform: rotate(-12deg);
    color: #ffe066;
    font: 900 18px/1 "Arial Black", Impact, sans-serif;
}

.coupon-body { flex: 1; text-align: left; }

.coupon .kicker {
    font: 700 11px Verdana, Geneva, sans-serif;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green);
}

.coupon .deal {
    font: 900 26px/1.05 "Arial Black", Impact, sans-serif;
    color: var(--red);
}

.coupon .fine {
    margin-top: 6px;
    font: 11px/1.4 Verdana, Geneva, sans-serif;
    color: var(--muted);
}

.coupon .code {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 8px;
    font: 700 11px "Courier New", Courier, monospace;
    color: var(--ink);
}

.barcode {
    width: 88px;
    height: 22px;
    background: repeating-linear-gradient(90deg,
        var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px,
        var(--ink) 8px 11px, transparent 11px 12px, var(--ink) 12px 13px, transparent 13px 16px);
}

/* ---------- Neon OPEN sign, hung on the corner opposite the sticker ---------- */
.neon {
    position: absolute;
    top: -26px;
    left: -24px;
    z-index: 1;
    padding: 7px 14px 6px;
    text-align: center;
    background: #1a1210;
    border: 3px solid #5a4636;
    border-radius: 10px;
    box-shadow: inset 0 0 0 2px #2b201b, 5px 5px 0 rgb(0 0 0 / 0.3);
    transform: rotate(-5deg);
}

.neon b {
    display: block;
    font: 900 24px/1 "Arial Black", Impact, sans-serif;
    letter-spacing: 0.1em;
    color: #fff;
    text-shadow: 0 0 3px #fff, 0 0 8px #ff3b3b, 0 0 18px #ff3b3b, 0 0 32px #ff1a1a;
    animation: flicker 7s infinite;
}

.neon small {
    display: block;
    margin-top: 4px;
    font: 700 8px/1 Verdana, Geneva, sans-serif;
    letter-spacing: 0.35em;
    color: #dfffea;
    text-shadow: 0 0 4px #3ddc84, 0 0 10px #3ddc84;
}

/* ---------- Hall of Pies: snapshots taped above the coupon ---------- */
/* Sits between the recipe and the coupon; wraps as more pies get added over the years */
.pies { padding: 24px 24px 28px; border-top: 1px solid var(--rule); }

.pies h2 {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    text-align: center;
    font: italic 700 20px/1.2 Georgia, "Times New Roman", serif;
    color: var(--red);
}

.pies h2::before, .pies h2::after { content: " \2605 "; color: var(--green); font-style: normal; font-size: 14px; }

.shelf {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 18px;
}

.polaroid {
    position: relative;
    padding: 8px 8px 24px;
    background: #fdfdf8;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 4px 5px 0 rgb(0 0 0 / 0.15);
    transform: rotate(-3deg);
}
.polaroid:nth-child(2) { transform: rotate(2deg); margin-top: 8px; }
.polaroid:nth-child(3) { transform: rotate(-1.5deg); }

/* The GIFs are 180x240 64-colour dithers; drawn at 135x180 with pixelated scaling so the dots stay crisp */
.polaroid img {
    display: block;
    width: 135px;
    height: 180px;
    background: #222;
    image-rendering: pixelated;
}

/* A strip of yellowed tape over the top edge */
.polaroid::before {
    content: "";
    position: absolute;
    top: -9px;
    left: 50%;
    width: 64px;
    height: 18px;
    margin-left: -32px;
    background: rgb(255 236 150 / 0.65);
    border-left: 1px dashed rgb(0 0 0 / 0.08);
    border-right: 1px dashed rgb(0 0 0 / 0.08);
    transform: rotate(-4deg);
    box-shadow: 0 1px 1px rgb(0 0 0 / 0.08);
}

/* ---------- PizzaCam: a nav button that opens a little popup window ---------- */
nav .cam-button {
    background: #000;
    color: #39ff14;
    font: 700 12px/1 "Courier New", Courier, monospace;
    border-color: #666 #000 #000 #666;
}
nav .cam-button::before { content: "\25CF\A0"; color: #ff3b3b; animation: blink 1.6s steps(1) infinite; }
nav .cam-button:active { border-color: #000 #666 #666 #000; }
nav .cam-button[hidden] { display: none; }

dialog.cam {
    width: min(92vw, 380px);
    margin: auto; /* the universal reset above zeroes it, which pins the dialog to the corner */
    padding: 0;
    background: #c0c0c0;
    color: #000;
    border: 2px solid;
    border-color: #fff #404040 #404040 #fff;
    box-shadow: 1px 1px 0 #000, 6px 6px 0 rgb(0 0 0 / 0.35);
    text-align: center;
}
dialog.cam::backdrop { background: rgb(0 0 0 / 0.55); }

.cam-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px 3px 8px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    font: 700 12px/1.3 Verdana, Geneva, sans-serif;
    text-align: left;
}

.cam-close {
    width: 18px;
    height: 16px;
    padding: 0;
    background: #c0c0c0;
    color: #000;
    border: 1px solid;
    border-color: #fff #404040 #404040 #fff;
    font: 700 11px/1 Verdana, Geneva, sans-serif;
    cursor: pointer;
}
.cam-close:active { border-color: #404040 #fff #fff #404040; }

.cam-screen {
    position: relative;
    width: 320px;
    max-width: 100%;
    aspect-ratio: 4 / 3;
    margin: 26px auto 22px; /* room for the bezel, which sits outside the box */
    background: #000;
    border: 2px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
    outline: 6px solid #d8d2c4;
    outline-offset: 2px;
    box-shadow: 0 0 0 8px #cfc8b8, 6px 8px 0 8px rgb(0 0 0 / 0.25);
}

/* Portrait phone clips, cropped to the 4:3 screen */
.cam video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cam .live, .cam .cam-time {
    position: absolute;
    z-index: 1;
    font: 700 10px/1 "Courier New", Courier, monospace;
    color: #fff;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.cam .live { top: 8px; left: 10px; color: #ff3b3b; animation: blink 1.6s steps(1) infinite; }
.cam .cam-time { right: 10px; bottom: 8px; letter-spacing: 0.02em; }

.cam-caption {
    padding: 0 12px 12px;
    font: 700 11px/1.5 Verdana, Geneva, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- Footer ---------- */
footer {
    text-align: center;
    padding: 20px 16px 24px;
    border-top: 1px solid var(--rule);
    font-size: 15px;
}

/* Live count from /api/counter (an SVG), framed in a sunken bevel */
.counter {
    display: inline-block;
    vertical-align: middle;
    margin: 6px 0 12px;
    background: #000;
    border: 2px solid;
    border-color: var(--lo) var(--hi) var(--hi) var(--lo);
}

.badges, .updated { font: 11px/1.6 Verdana, Geneva, sans-serif; color: var(--muted); }
.updated { margin-top: 8px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scroll { to { transform: translateX(-33.333%); } }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@keyframes flicker {
    0%, 93%, 95%, 100% { opacity: 1; }
    94% { opacity: 0.35; }
    96.5% { opacity: 0.7; }
}

/* Until the side gutter is wider than the stamp's overhang (~30px), tuck it in so it can't push the page sideways */
@media (max-width: 800px) {
    .stamp { right: -12px; }
    .neon { left: -10px; }
}

@media (max-width: 560px) {
    body { padding: 24px 10px 40px; }
    main { padding: 4px 16px 20px; }
    nav { padding: 14px 12px; }
    table { font-size: 15px; }
    th, td { padding: 5px 6px; }
    th { font-size: 11px; letter-spacing: 0.02em; }
    .schedule td:first-child { white-space: normal; width: 42%; }
    .pie { display: none; }
    .tagline { font-size: 11px; letter-spacing: 0.1em; }
    .stamp { top: -18px; right: -10px; width: 56px; height: 56px; font-size: 10px; }
    .neon { top: -16px; left: -6px; padding: 5px 9px 4px; }
    .neon b { font-size: 16px; }
    .neon small { font-size: 7px; }
    .pies { padding: 18px 10px 6px; }
    .shelf { gap: 10px 8px; } /* three pies fit on a 360px phone; a fourth wraps */
    .polaroid { padding: 6px 6px 18px; }
    .polaroid::before { width: 44px; height: 14px; margin-left: -22px; top: -7px; }
    .polaroid img { width: 84px; height: 112px; }
    .cam-screen { width: 256px; }
    .coupon { flex-direction: column; text-align: center; margin: 12px 24px 32px; gap: 8px; }
    .coupon-body { text-align: center; }
    .coupon .code { justify-content: center; }
    .coupon .deal { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .pie, .new, .neon b, .cam .live, nav .cam-button::before { animation: none; }
    .marquee { text-align: center; white-space: normal; padding: 0 12px; }
    .marquee > span { animation: none; }
    .marquee .again { display: none; }
}
.print-only { display: none; }

/* Printed copy: just the recipe, black on white, nothing broken across pages */
@media print {
    :root { color-scheme: light; }
    body { background: #fff; padding: 0; font-size: 11pt; }
    .menu { max-width: none; border: 0; outline: 0; box-shadow: none; background: #fff; }
    .flag, .stamp, .neon, .pie, .pies, .marquee, nav, .coupon, .new { display: none; }
    header { padding: 0 0 4pt; }
    h1 { font-size: 26pt; text-shadow: none; }
    main { padding: 0; }
    section { padding-top: 14pt; }
    h2, h3 { break-after: avoid; }
    li, tr, table { break-inside: avoid; }
    a, a:visited { color: inherit; text-decoration: none; }
    th { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    footer { border: 0; padding: 12pt 0 0; }
    footer > :not(.print-only, .updated) { display: none; }
    .calc { display: none; }
    .print-only { display: block; color: var(--muted); }
}
