/*
  Roses (pages/roses.html, written by scripts/rose-outlines/page.py; public/roses.js): a
  photograph of every rose the farm grows, an outline over each bloom, and the varieties' names.
  Loaded on that page only (src/farmPages.ts), and everything here is under its own class: the
  design is the mock Jeff had made of the page (2026-11-15: "I want to bias towards taking what
  they have in the mocks and using that design system instead of ours"), its colors, buttons and
  spacing "for this page only for now", in the site's own header and footer ("Let's keep our
  header and footer"). Where the mock has Newsreader or Inter, Farm Serif, at the mock's weight
  and style ("I want to stay on Ovo, but let's make our own Ovo italic or make any of the fonts
  that are missing"): Ovo itself at 400, and faces made from it for the rest
  (scripts/fonts/). The browser draws no bold or italic of its own (font-synthesis).

  On a phone (under 750 px, as the site turns): the words, a strip of every rose's color from
  the top of the bunch to the bottom, the photograph across the page, the index of names as an
  accordion of their families, and the florists' buttons one under the other. From 750 px: the
  words beside each other, the families' ribbon, the photograph with the index beside it in
  columns of families, and the florists' words beside their buttons. The photograph is tall
  (1000 by 2281), so it stays in view as the index scrolls only on a screen tall enough to show
  it whole under the header (below).

  There is one way to light a bloom: a soft white glow around it, with none on the bloom itself,
  so its own colors show as they are, and no hard line anywhere. The glow is its own layer
  under the outlines (pages/roses.html, farm-roses-glow): the script copies the lit blooms into
  it, filled white only for the filter to read their shapes; the filter draws the halo and
  leaves every lit bloom out of it, so the fill never shows. The layer fades in when a variety
  lights up, once, and goes out at once. Sizes are
  in the outlines' units, 1000 across the photograph, which is shown about 300 to 530 px wide:
  about 2 to a px. With it, a ring on the bloom, a thin line from it, and a card with the
  variety's number, family and name, placed by the script (Jeff: "I do like the way that the
  mock shows which rose is picked, so let's use that, but I think we can still have the
  glow"). Without the script none of this shows.
*/

@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/farm-serif-300.70ffe8656a87.woff2') format('woff2');
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/farm-serif-300-italic.793895c92ea4.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

/* Ovo itself, the site's face, the one file both name. */
@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/ovo-latin.f15f985cf428.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/farm-serif-400-italic.381c6d338e0b.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/farm-serif-500.437172e2e41e.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Farm Serif';
  src: url('/assets/farm-serif-600.64f3179b5a6f.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

/* The page's background fills the main part, between the site's header and footer. */
.site-main:has(> .farm-roses) {
  background: #f6f3ed;
}

.farm-roses {
  --roses-paper: #f6f3ed;
  --roses-ink: #22281e;
  --roses-accent: #4f5d44;
  --roses-line: #dcd5c8;
  --roses-line-light: #e7e1d6;
  --roses-muted: #67665c;
  --roses-muted-2: #4a4a42;
  --roses-separator: #b9b1a3;
  --roses-card: #fffdf9;
  --roses-picked: #eae3d6;
  --roses-backing: #6b4a33;
  --roses-font: 'Farm Serif', 'Ovo fallback', 'Ovo fallback DejaVu', serif;
  max-width: 1328px;
  margin: 0 auto;
  padding: 0 20px;
  background: var(--roses-paper);
  color: var(--roses-ink);
  font-family: var(--roses-font);
  font-size: 16px;
  font-weight: 400;
  font-synthesis: none;
  line-height: normal;
  letter-spacing: normal;
}

.farm-roses h1,
.farm-roses h2,
.farm-roses h3,
.farm-roses p {
  margin: 0;
  color: inherit;
  letter-spacing: normal;
}

.farm-roses a {
  color: var(--roses-ink);
  text-decoration: none;
}

.farm-roses a:hover {
  color: var(--roses-accent);
}

.farm-roses a:focus-visible,
.farm-roses button:focus-visible,
.farm-roses summary:focus-visible {
  outline: 2px solid var(--roses-ink);
  outline-offset: 2px;
}

.farm-roses-italic {
  font-style: italic;
}

/* The small tracked capitals: the way to the page, and the headings over the ribbon and the
   florists' words. */
.farm-roses-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: normal;
  text-transform: uppercase;
}

.farm-roses .farm-roses-label {
  letter-spacing: 0.16em;
}

/* The words at the top. */
.farm-roses-hero {
  padding: 40px 0 28px;
}

.farm-roses .farm-roses-crumbs {
  margin-bottom: 14px;
  color: var(--roses-muted);
}

.farm-roses .farm-roses-crumbs a {
  color: inherit;
}

.farm-roses .farm-roses-crumbs a:hover {
  color: var(--roses-accent);
}

.farm-roses-crumb-line {
  margin: 0 8px;
  color: var(--roses-separator);
}

.farm-roses .farm-roses-hero h1 {
  margin-bottom: 20px;
  font-size: 56px;
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

/* The families' ribbon: on a phone one strip of every rose's color, each the same width, top of
   the bunch to bottom; each family's stretch still links to it. */
.farm-roses-ribbon {
  padding-bottom: 0;
}

.farm-roses-ribbon-head {
  margin-bottom: 10px;
}

.farm-roses-bands {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 3px;
  list-style: none;
}

/* A family's share of the ribbon, by how many roses it has (page.py keeps it to 1 to 6). */
.farm-roses-bands li {
  flex: 1 1 0;
  min-width: 0;
}

.farm-roses-bands li[data-count='2'] {
  flex-grow: 2;
}

.farm-roses-bands li[data-count='3'] {
  flex-grow: 3;
}

.farm-roses-bands li[data-count='4'] {
  flex-grow: 4;
}

.farm-roses-bands li[data-count='5'] {
  flex-grow: 5;
}

.farm-roses-bands li[data-count='6'] {
  flex-grow: 6;
}

.farm-roses-bands a {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.farm-roses-band {
  display: flex;
  height: 36px;
  overflow: hidden;
}

/* No width of its own (an SVG's would be its height), so only the family's name sets how
   narrow its stretch can be. */
.farm-roses-chip {
  display: block;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  height: 100%;
}

/* The lit rose's own stretch of the ribbon. */
.farm-roses-chip.farm-roses-lit {
  outline: 2px solid var(--roses-ink);
  outline-offset: -2px;
}

/* Its words are the link's on a phone, for a screen reader, where the strip has no room. */
.farm-roses-band-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.farm-roses .farm-roses-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--roses-muted);
  font-size: 12px;
}

/* The photograph, across the page on a phone, and the index under it. */
.farm-roses-browse {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 28px;
}

.farm-roses-figure {
  margin: 0 -20px;
}

.farm-roses-photo {
  position: relative;
  overflow: clip;
  background: var(--roses-backing);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.farm-roses-photo picture img {
  height: auto;
}

/* A tap on a bloom answers at once: no wait for a second tap to zoom (Safari waits about a third
   of a second for one otherwise). Pinching to look closer still works. */
.farm-roses-outlines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.farm-roses-outlines path {
  fill: transparent;
}

.farm-roses-on .farm-roses-outlines path {
  cursor: pointer;
}

/* The halo begins right at the bloom's edge, brightest there, and fades by about 30 units out:
   15 px at most. Its layer is drawn once per variety lit and faded as a whole, so a phone
   doesn't redraw the filter on every frame of the fade. */
.farm-roses-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.farm-roses-glow path {
  fill: white;
}

.farm-roses-glow.farm-roses-glow-on {
  opacity: 1;
}

/* The pin, the line from it and the card, placed by the script (roses.js): the ring at the
   bloom's middle, the card above the bloom or below it, wherever it has room in the
   photograph, and the line between them. */
.farm-roses-stem,
.farm-roses-pin,
.farm-roses-card {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.farm-roses-stem {
  width: 1px;
  background: var(--roses-card);
}

.farm-roses-pin {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--roses-card);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgb(255 253 249 / 0.28);
}

.farm-roses .farm-roses-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 16px);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--roses-card);
  box-shadow: 0 8px 24px rgb(34 40 30 / 0.22);
}

.farm-roses-stem.farm-roses-shown,
.farm-roses-pin.farm-roses-shown,
.farm-roses .farm-roses-card.farm-roses-shown {
  opacity: 1;
}

.farm-roses-card-swatch {
  width: 26px;
  height: 26px;
}

/* Its line is the variety's (page.py's edge(), copied over by the script), drawn inside the
   circle so none of it is cut off. */
.farm-roses-card-swatch circle {
  stroke-width: 0.1;
}

.farm-roses-card-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.farm-roses-card-label {
  color: var(--roses-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.farm-roses-card-name {
  font-size: 17px;
  line-height: 1.15;
}

/* The index: on a phone an accordion of the families, one open at a time (roses.js). */
.farm-roses-index {
  padding-top: 40px;
}

.farm-roses .farm-roses-index h2 {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 12px;
  font-size: 28px;
  font-weight: 400;
}

.farm-roses-families {
  border-top: 1px solid var(--roses-ink);
}

.farm-roses-family {
  border-bottom: 1px solid var(--roses-line);
}

.farm-roses-family summary {
  display: grid;
  /* The dots' column is as wide as five of them (page.py, dots): 72 px. */
  grid-template-columns: 72px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
}

.farm-roses-family summary::-webkit-details-marker {
  display: none;
}

/* Holds the gradients of the roses that change color across their petals (page.py); takes no
   room. */
.farm-roses-gradients {
  position: absolute;
}

.farm-roses-dots {
  width: auto;
  height: 24px;
}

.farm-roses-dot-ring {
  fill: var(--roses-paper);
}

.farm-roses-dots circle:not(.farm-roses-dot-ring) {
  stroke-width: 1;
}

.farm-roses-family-name {
  font-size: 19px;
}

.farm-roses-count {
  color: var(--roses-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.farm-roses-chevron {
  width: 18px;
  height: 18px;
}

.farm-roses-family[open] .farm-roses-chevron {
  transform: rotate(180deg);
}

/* The family's bar and heading are for the columns from 750 px. */
.farm-roses-bar,
.farm-roses-family-head {
  display: none;
}

.farm-roses-family ul {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.farm-roses-family button {
  display: grid;
  grid-template-columns: 28px 16px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--roses-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.farm-roses-no {
  color: var(--roses-muted-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.farm-roses-swatch {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

/* Its line is the variety's own color a shade darker (page.py's edge()), drawn inside the
   circle so none of it is cut off. */
.farm-roses-swatch circle {
  stroke-width: 0.16;
}

.farm-roses-variety {
  font-size: 17px;
  line-height: 1.25;
}

/* The lit variety's row: the one picked, or the one a mouse is over. */
.farm-roses-family button.farm-roses-lit {
  background: var(--roses-picked);
}

.farm-roses-family button.farm-roses-lit .farm-roses-no {
  color: var(--roses-ink);
  font-weight: 600;
}

.farm-roses-family button.farm-roses-lit .farm-roses-swatch {
  box-shadow:
    0 0 0 2px var(--roses-picked),
    0 0 0 3.5px var(--roses-ink);
}

/* For florists, at the foot of the page. */
.farm-roses-florists {
  margin-top: 48px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--roses-ink);
}

.farm-roses .farm-roses-florists .farm-roses-label {
  margin-bottom: 10px;
  color: var(--roses-muted);
}

.farm-roses .farm-roses-florists h2 {
  margin-bottom: 24px;
  font-size: 30px;
  font-weight: 300;
  line-height: 1.15;
}

.farm-roses .farm-roses-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.farm-roses .farm-roses-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid var(--roses-ink);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.farm-roses .farm-roses-pill:hover {
  border-color: var(--roses-accent);
}

.farm-roses .farm-roses-pill-dark {
  background: var(--roses-ink);
  color: var(--roses-paper);
}

.farm-roses .farm-roses-pill-dark:hover {
  background: var(--roses-accent);
  color: var(--roses-paper);
}

/* The glow fades in as a bloom lights up, and goes at once as it goes out. */
@media (prefers-reduced-motion: no-preference) {
  .farm-roses-glow.farm-roses-glow-on {
    transition: opacity 0.22s ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  .farm-roses-stem,
  .farm-roses-pin,
  .farm-roses-card {
    transition: none;
  }
}

@media (min-width: 750px) {
  .farm-roses {
    padding: 0 32px;
  }

  .farm-roses-label {
    font-size: 12px;
  }

  .farm-roses-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 32px 72px;
    padding: 80px 0 48px;
  }

  .farm-roses-heading {
    flex: 999 1 560px;
    min-width: 0;
  }

  .farm-roses .farm-roses-crumbs {
    margin-bottom: 20px;
  }

  .farm-roses-crumb-line {
    margin: 0 10px;
  }

  .farm-roses .farm-roses-hero h1 {
    margin: 0;
    font-size: 104px;
    line-height: 0.95;
  }

  /* The ribbon: each family's colors over its name, linking to it in the index. */
  .farm-roses-ribbon {
    padding-bottom: 72px;
  }

  .farm-roses-ribbon-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--roses-line);
  }

  .farm-roses-bands {
    gap: 6px;
    overflow: visible;
    border-radius: 0;
  }

  /* A family's stretch is never narrower than the longest word of its name, so a short one
     (Lavender, two roses) keeps its name whole on a narrower screen. */
  .farm-roses-bands li {
    min-width: auto;
  }

  .farm-roses-band {
    height: 64px;
    border-radius: 3px;
  }

  .farm-roses-band-name {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    overflow-wrap: normal;
    color: var(--roses-muted-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .farm-roses-bands a:hover .farm-roses-band-name {
    color: var(--roses-accent);
  }

  .farm-roses .farm-roses-ends {
    display: none;
  }

  /* The photograph beside the index. */
  .farm-roses-browse {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 56px 40px;
    padding-top: 56px;
    border-top: 1px solid var(--roses-line);
  }

  .farm-roses-figure {
    margin: 0;
  }

  .farm-roses-photo {
    border-radius: 4px;
  }

  .farm-roses-pin {
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    box-shadow: 0 0 0 6px rgb(255 253 249 / 0.28);
  }

  .farm-roses .farm-roses-card {
    gap: 14px;
    padding: 12px 16px;
  }

  .farm-roses-card-swatch {
    width: 30px;
    height: 30px;
  }

  .farm-roses-card-words {
    gap: 3px;
  }

  .farm-roses-card-label {
    font-size: 11px;
  }

  .farm-roses-card-name {
    font-size: 20px;
  }

  .farm-roses-index {
    padding-top: 0;
  }

  .farm-roses .farm-roses-index h2 {
    display: block;
    min-height: 0;
    margin-bottom: 0;
    padding-bottom: 20px;
    font-size: 36px;
    letter-spacing: -0.01em;
  }

  /* The families in columns at least 250 px wide, all open, each under its own heading. */
  .farm-roses-families {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 44px 40px;
    border-top: 0;
  }

  .farm-roses-family {
    border-bottom: 0;
  }

  .farm-roses-family summary {
    display: none;
  }

  .farm-roses-bar {
    display: block;
    width: 100%;
    height: 6px;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 3px;
  }

  .farm-roses-family-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--roses-line);
  }

  .farm-roses .farm-roses-family-head h3 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: normal;
    text-transform: uppercase;
  }

  .farm-roses-family ul {
    margin: 0;
  }

  .farm-roses-family li {
    border-bottom: 1px solid var(--roses-line-light);
  }

  .farm-roses-family button {
    padding: 8px 10px;
  }

  .farm-roses-no {
    color: var(--roses-muted);
  }

  .farm-roses-variety {
    font-size: 18px;
  }

  .farm-roses-florists {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 32px 72px;
    margin-top: 96px;
    padding: 56px 0;
  }

  .farm-roses-florists-words {
    flex: 999 1 520px;
    min-width: 0;
  }

  .farm-roses .farm-roses-florists .farm-roses-label {
    margin-bottom: 12px;
  }

  .farm-roses .farm-roses-florists h2 {
    margin: 0;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.015em;
  }

  .farm-roses .farm-roses-actions {
    flex: 1 1 280px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .farm-roses .farm-roses-pill {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  .farm-roses {
    padding: 0 56px;
  }

  .farm-roses-browse {
    column-gap: 72px;
  }
}

/*
  The photograph stays in view as the index scrolls past it only where it fits whole under the
  header, with its caption: it is 2.28 times as tall as it is wide, and its width is the
  page's. From 1328 px it is 532 px wide, about 1390 px with the header and caption; from 1024
  px its width is 47% of the screen's less 86 px, so it fits a screen a little taller than it is
  wide; from 750 px, less 48 px, so one about 15% taller than wide (a tablet held upright).
*/
@media (min-width: 1328px) and (min-height: 1400px),
  (min-width: 1024px) and (max-width: 1327px) and (max-aspect-ratio: 16/17),
  (min-width: 750px) and (max-width: 1023px) and (max-aspect-ratio: 87/100) {
  .farm-roses-figure {
    position: sticky;
    top: calc(var(--header-height, 0px) + 24px);
  }
}
