/* biome-ignore-all lint/style/noDescendingSpecificity: plan-column states layer over base table rules; source order is the cascade contract */
/* Pricing, set like a Field Notes edition (editorial.css). The hero makes the tier line literal,
   in the headline's order: the example garden now (Free), then the same beds through a season and
   through a day (Garden), from the hero captures' cutouts. The comparison leads with the rows where
   plans differ. Loaded only by pricing.html, after editorial.css. */

/* Hero ---------------------------------------------------------------- */

.price-hero {
  padding-block: clamp(7.5rem, 14vh, 9.5rem) clamp(3rem, 7vw, 5.5rem);
}

.price-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.price-hero h1 {
  margin-block: 1rem 1.25rem;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  max-inline-size: 11ch;
}

.price-hero h1 em {
  display: block;
  font-style: italic;
  color: var(--leaf-ink);
}

.price-hero-note {
  margin-block-start: 1.25rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 500;
  color: var(--fn-muted);
}

.price-diptych {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  align-items: stretch;
}

.price-panel-label {
  margin-block-end: 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fn-muted);
}

.price-panel-label span {
  margin-inline-end: 0.5rem;
  color: var(--moss);
}

.price-diptych figcaption {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--fn-muted);
}

/* Promises: Field Notes' numbered methods ------------------------------ */

.promises-title,
.faq-title {
  margin-block: 0 clamp(1.5rem, 3vw, 2.25rem);
}

.promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-inline-size: 40rem;
}

.promise-list li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.5rem 1.4rem;
  border-block-start: 1px solid var(--fn-line);
}

.promise-list .ed-num {
  grid-row: 1 / 3;
  padding-block-start: 0.45rem;
}

.promise-list h3 {
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.promise-list p:not(.ed-num) {
  margin-block-start: 0.6rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* Plans ------------------------------------------------------------------ */

.tier > p.plan-who {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 500;
  color: var(--fn-muted);
}

.plan-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.plan-list li {
  padding-block: 0.55rem;
  border-block-start: 1px solid var(--fn-line);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink);
}

.plan-list small {
  display: block;
  margin-block-start: 0.15rem;
  font-size: 0.8125rem;
  color: var(--fn-muted);
}

.tier > p.plan-price {
  margin-block-start: auto;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--fn-line);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--moss);
}

.plans-more {
  margin-block-start: 2.5rem;
  color: var(--fn-muted);
  max-inline-size: 44rem;
}

/* Comparison --------------------------------------------------------------- */

.compare-pick {
  display: none;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.compare-pick legend {
  float: left;
  margin-inline-end: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--fn-muted);
}

.compare-pick label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  margin-inline-end: 0.35rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--moss);
  cursor: pointer;
}

.compare-pick input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.compare-pick label:has(input:checked) {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--linen);
}

@media (forced-colors: active) {
  .compare-pick label:has(input:checked) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }
}

.compare-pick label:has(input:focus-visible) {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

.compare-table {
  inline-size: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.compare-table thead th {
  position: sticky;
  inset-block-start: 5.25rem;
  z-index: 1;
  padding: 0.9rem 1rem;
  background: var(--linen);
  border-block-end: 2px solid var(--moss);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--moss);
  text-align: start;
}

/* A fixed layout sizes columns from the first row, so the row-header width lives here too. */
.compare-table thead th:first-child {
  inline-size: 34%;
}

.compare-table th[scope="row"] {
  padding: 0.75rem 1rem 0.75rem 0;
  font-weight: 400;
  color: var(--ink);
  text-align: start;
  inline-size: 34%;
}

.compare-table td {
  padding: 0.75rem 1rem;
  color: var(--ink-2);
  vertical-align: top;
}

.compare-table tbody tr:not(.compare-group) {
  border-block-end: 1px solid var(--fn-line);
}

.compare-group th {
  padding: 2rem 0 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
  text-align: start;
}

/* Marks in place of words; the words stay for screen readers. */
.compare-table td[data-v] {
  font-size: 0;
}

.compare-table td[data-v]::before {
  font-size: 0.9375rem;
}

.compare-table td[data-v="yes"]::before {
  content: "";
  display: inline-block;
  inline-size: 1rem;
  block-size: 0.55rem;
  margin-block-start: 0.2rem;
  border-inline-start: 2px solid var(--leaf-ink);
  border-block-end: 2px solid var(--leaf-ink);
  transform: rotate(-45deg);
}

.compare-table td[data-v="no"]::before {
  content: "—" / "";
  color: var(--fn-muted);
}

/* Questions --------------------------------------------------------------- */

.faq-list {
  max-inline-size: 44rem;
}

.faq-list details {
  border-block-start: 1px solid var(--fn-line);
}

.faq-list details:last-child {
  border-block-end: 1px solid var(--fn-line);
}

.faq-list summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--moss);
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+" / "";
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--fn-clay);
}

.faq-list details[open] summary::after {
  content: "–" / "";
}

.faq-list details p {
  padding-block-end: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
}

/* Closing: the example garden at dawn, when early gardens hear the prices. */
.closing--garden h2 {
  max-inline-size: 16ch;
}

/* Narrow screens ------------------------------------------------------------ */

@media (max-width: 960px) {
  .price-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .price-diptych {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phones compare one plan at a time, chosen above the table, which stays in view. Browsers
   without :has() keep the whole table. */
@supports selector(:has(*)) {
  @media (max-width: 700px) {
    /* The header row leaves the flow here, so columns size from their content. */
    .compare-table {
      table-layout: auto;
    }

    .compare-pick {
      position: sticky;
      inset-block-start: 5.25rem;
      z-index: 2;
      display: block;
      padding-block: 0.6rem;
      background: var(--linen);
    }

    /* The header row stays for screen readers, naming the one plan shown. */
    .compare-table thead th {
      position: absolute;
      inline-size: 1px;
      block-size: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      white-space: nowrap;
    }

    .compare-table th[scope="row"] {
      inline-size: 55%;
    }

    .compare-wrap:has(input[value="free"]:checked)
      :is(td, thead th):not(:nth-child(2)):not(:first-child),
    .compare-wrap:has(input[value="garden"]:checked)
      :is(td, thead th):not(:nth-child(3)):not(:first-child),
    .compare-wrap:has(input[value="farm"]:checked)
      :is(td, thead th):not(:nth-child(4)):not(:first-child) {
      display: none;
    }
  }

  /* The site header is shorter on small phones. */
  @media (max-width: 640px) {
    .compare-pick {
      inset-block-start: 4.75rem;
    }
  }
}

/* Wide: the three plan names stay on one line. */
@media (min-width: 1200px) {
  .plan-columns .tier h3 {
    font-size: 1.75rem;
    white-space: nowrap;
  }
}

@media (min-width: 961px) {
  .plan-columns .tier > p.plan-who {
    min-block-size: 3.4em;
  }
}

/* The hero, in the headline's order: the garden now, its time, its light. */
.price-diptych--rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
}

.price-crop {
  border-radius: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(46, 74, 44, 0.08);
}

.price-cells {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.price-cell span {
  display: block;
  margin-block-start: 0.35rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-style: italic;
  font-weight: 500;
  color: var(--fn-muted);
}

.price-diptych--rows figcaption {
  grid-column: auto;
}

@media (max-width: 600px) {
  .price-cells {
    gap: 0.4rem;
  }
}

/* Each plan's picture says what it is. */
.tier-figure {
  margin: 0 0 1.25rem;
}

.tier-figure .tier-scene {
  margin: 0;
  border-radius: 0.75rem;
}

.tier-figure figcaption {
  margin-block-start: 0.5rem;
  font-size: 0.75rem;
  color: var(--fn-muted);
}

.tier-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  aspect-ratio: 1 / 0.5;
}

.tier-strip .garden-crop {
  aspect-ratio: auto;
  block-size: 100%;
}

.tier-strip .garden-crop + .garden-crop {
  box-shadow: -1px 0 0 rgba(251, 250, 243, 0.85);
}

/* The Garden plan is the one the page is named for. */
.plan-columns .tier:nth-child(2) .tier-num span {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--leaf-ink);
  color: var(--linen);
}

.plan-list .plan-soon-item {
  color: var(--fn-muted);
}

.plan-soon-item span {
  margin-inline-end: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fn-ochre-ink);
}

.plan-join {
  margin-inline-start: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--moss);
  text-underline-offset: 0.2em;
}

/* The table leads with what differs; what every plan has is one line per group. */
.compare-table .compare-every th,
.compare-table .compare-every td {
  padding-block: 0.9rem;
  vertical-align: top;
  color: var(--fn-muted);
}

.compare-table .compare-every th {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.compare-key {
  display: none;
}

@supports selector(:has(*)) {
  @media (max-width: 700px) {
    .compare-table .compare-every th,
    .compare-table .compare-every td {
      display: block;
      inline-size: auto;
    }

    /* The line for every plan shows whichever plan is picked. */

    .compare-wrap:has(input:checked)
      .compare-table
      .compare-every
      td:nth-child(2):not(:first-child) {
      display: block;
      padding-block-start: 0;
      padding-inline-start: 0;
    }

    .compare-table .compare-every th {
      padding-block-end: 0.3rem;
    }

    /* A value in words sits under its label, not in a narrow column beside it. */

    .compare-row--text th[scope="row"] {
      display: block;
      inline-size: auto;
      padding-block-end: 0.2rem;
      border-block-end: 0;
    }

    .compare-row--text td {
      padding-block-start: 0;
      padding-inline-start: 0;
      text-align: start;
    }

    .compare-wrap:has(input[value="free"]:checked) .compare-row--text td:nth-child(2),
    .compare-wrap:has(input[value="garden"]:checked) .compare-row--text td:nth-child(3),
    .compare-wrap:has(input[value="farm"]:checked) .compare-row--text td:nth-child(4) {
      display: block;
    }

    /* What the picked plan adds to the one before it. */

    .compare-key {
      display: block;
      margin-block: 0.5rem 0.25rem;
      font-size: 0.8125rem;
      color: var(--fn-muted);
    }

    .compare-key::before,
    .compare-table td.is-added::after {
      content: "";
      display: inline-block;
      inline-size: 0.5rem;
      block-size: 0.5rem;
      border-radius: 0 999px;
      background: var(--leaf-ink);
    }

    .compare-key::before {
      margin-inline-end: 0.45rem;
    }

    .compare-table td.is-added::after {
      margin-inline-start: 0.45rem;
    }
  }
}

/* Pricing: the day's light is left as the renderer lit it. */
.price-crop[data-hour] img {
  filter: none;
}

@media (min-width: 961px) {
  .price-hero-grid {
    align-items: center;
  }

  main:has(.price-hero) .ed-section {
    padding-block: clamp(3.5rem, 7vw, 5.5rem);
  }

  /* Pricing: the three cards' lists start on one line. */

  .plan-columns .plan-who {
    min-block-size: 3.4em;
  }
}

.plans-more a {
  white-space: nowrap;
}

@supports selector(:has(*)) {
  @media (max-width: 700px) {
    /* A row of words, and the line for every plan, run the full width. */

    .compare-table .compare-every,
    .compare-table .compare-row--text {
      display: block;
    }

    /* A tick sits at the right edge, with its leaf. */

    .compare-table td[data-v] {
      text-align: end;
      white-space: nowrap;
    }

    /* Words carry their leaf in front, so it never drops to a line of its own. */

    .compare-row--text td.is-added::after {
      display: none;
    }

    .compare-row--text td.is-added::before {
      content: "";
      display: inline-block;
      inline-size: 0.5rem;
      block-size: 0.5rem;
      margin-inline-end: 0.45rem;
      border-radius: 0 999px;
      background: var(--leaf-ink);
    }

    /* Phone: the table is a list. Each row runs the full width: a label with its tick at the right
   edge, or a label over its words. */

    .compare-table,
    .compare-table tbody {
      display: block;
    }

    .compare-table tbody tr {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 1rem;
    }

    .compare-table tbody tr.compare-every,
    .compare-table tbody tr.compare-row--text {
      flex-direction: column;
      gap: 0;
    }

    .compare-table tbody th[scope="row"] {
      flex: 1;
      inline-size: auto;
    }

    .compare-table tbody tr.compare-group th {
      flex: 1;
    }
  }
}

/* Pricing: the line for every plan is one sentence of names. */
.compare-table .compare-every td {
  font-size: 0.9375rem;
  line-height: 1.6;
}
