/* Flowers page: occasion strip, kind row and the ledger of stubs. Grouped: layout, type, colour, motion. */

/* ---------- LAYOUT ---------- */

main > * + * { margin-block-start: clamp(1.5rem, 3.5vh, 2.5rem); }
main > section { inline-size: 100%; }
main > section > * { margin-block: 0; }
main > section > * + * { margin-block-start: 0.9rem; }

/* Opening ticket: trimmed hard, so the day's picture sits whole in the opening window. */
main > .ticket { padding: clamp(1.1rem, 0.6rem + 1vw, 1.5rem); gap: 0.75rem; }

/* Ask row: the question and its four toggles on one line; on a phone the toggles drop under it. */
.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; }
.ask > p { flex: none; margin: 0; }

/* Occasion strip: four equal toggles in one row. */
.occasions { flex: 1 1 20rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.6rem; }
.occasions > button { min-block-size: 3rem; }

/* Today: the listing's heading and sentence on the left, the day's ticket beside them on a desk screen. */
.today { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--worktop); }
.today > div > p { margin: 0; line-height: 1.5; max-inline-size: 40rem; }
@media (min-width: 64rem) {
  .today { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .today:has(> .stub[hidden]) { grid-template-columns: minmax(0, 1fr); }
}

/* Kind row: chips that wrap onto as many lines as they need, inside the content width. */
.kinds { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kinds > button { flex: 0 1 auto; white-space: nowrap; min-block-size: 2.75rem; padding-inline: 1rem; }

/* Ledger: stubs of two decided sizes. */
.stub > div { display: flex; flex-direction: column; gap: 0.6rem; }
.stub > div > p { margin: 0; }

/* The day's stub: a shallow ticket, square picture with name and price beside it. */
.stub[data-cut="large"] { flex-direction: column; gap: 1.25rem; }
.stub[data-cut="large"] > img { flex: none; inline-size: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
@media (min-width: 40rem) {
  .stub[data-cut="large"] { flex-direction: row; align-items: center; }
  .stub[data-cut="large"] > img { inline-size: min(18rem, 48%); }
  .stub[data-cut="large"] > div { flex: 1 1 0; min-inline-size: 0; }
}

/* The five smaller stubs: one card width, one square picture, caption under its own picture. */
main > section > .rack { --per-row: 1; align-items: stretch; justify-content: center; }
@media (min-width: 40rem) { main > section > .rack { --per-row: 2; } }
@media (min-width: 64rem) { main > section > .rack { --per-row: 3; } }
.stub[data-cut="medium"] {
  flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--worktop)) / var(--per-row) - 0.01rem);
  min-inline-size: 0;
  flex-direction: column;
  align-items: stretch;
}
.stub[data-cut="medium"] > img { flex: none; inline-size: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.stub[data-cut="medium"] > div { flex: 1 1 auto; }

/* Note: the listing's own caption line, set under the rack. */
.note { font-family: var(--bitter); font-size: 0.95rem; }

/* Rack: set a worktop below the kind row; hidden by the script when all its stubs are narrowed away. */
main > section > .rack { margin-block-start: var(--worktop); }

/* ---------- TYPE ---------- */

.ask > p { font-family: var(--jost); font-size: 1.0625rem; font-weight: 500; }
main h2 { font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem); }
.stub[data-cut="large"] .pricetag > span { font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.75rem); }
.stub[data-cut="large"] > div > p:last-child { font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); }
.stub > div > p:last-child { line-height: 1.5; }
.occasions > button, .kinds > button { font-size: 1rem; }

/* ---------- COLOUR ---------- */

/* A pressed toggle reverses to magenta with pale strokes and a heavier inner stroke. */
.occasions > .action[aria-pressed="true"],
.kinds > .action[aria-pressed="true"] {
  background: var(--magenta);
  color: var(--blush);
  outline-color: var(--blush);
  box-shadow: inset 0 0 0 var(--seam) var(--magenta), inset 0 0 0 calc(var(--seam) + var(--twine)) var(--blush);
}
.occasions > .action:focus-visible { outline-color: var(--magenta); }
.occasions > .action[aria-pressed="true"]:focus-visible { outline-color: var(--magenta); }

/* A stub that suits the chosen occasion: its inner stroke thickens to 2px. Nothing else changes. */
.stub[aria-current="true"] {
  box-shadow: inset 0 0 0 var(--seam) var(--blush), inset 0 0 0 calc(var(--seam) + var(--twine)) var(--magenta);
}

/* ---------- MOTION ---------- */

.stub, .occasions > button, .kinds > button { transition: box-shadow 200ms ease-out; }
