/* Homepage-only layout. Tokens, type, buttons, announcement bar, proof bar,
   reviews, final CTA and footer are all inherited from styles.css. */

/* Leaves room for the sticky offer bar, which only shows on narrow screens. */
body {
  padding-bottom: 4.4rem;
}

/* ---------- hero ---------- */

.home-hero {
  display: grid;
  background: var(--cream);
}

.home-hero-media {
  position: relative;
  background: var(--linen);
}

.home-hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.home-flag {
  position: absolute;
  left: var(--gutter);
  bottom: 1rem;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.home-flag b {
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: -0.02em;
}

/* ---------- hero offer ----------
   The discount and the free shipping are the two facts most likely to decide
   this, so they get their own block rather than being left to the copy. */

.offer {
  margin: 1.3rem 0 0;
  padding: 0.95rem 1.05rem 0.85rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.offer-lead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.6rem;
}

.offer .badge-off {
  font-size: 0.82rem;
  padding: 0.36rem 0.7rem;
}

.offer-plus {
  font-size: 0.95rem;
  font-weight: 600;
}

.offer-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: 0;
}

.offer-price .price {
  font-size: clamp(1.9rem, 6vw, 2.3rem);
}

.offer-ends {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.offer-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  background: var(--linen);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ---------- sticky offer bar (mobile) ---------- */

.offerbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.9rem calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(28, 22, 18, 0.12);
  animation: rise 0.22s ease;
}

.offerbar[hidden] {
  display: none;
}

.offerbar-text {
  flex: 1;
  min-width: 0;
}

.offerbar-text p {
  margin: 0;
  line-height: 1.3;
}

.offerbar-head {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.offerbar-head b {
  color: var(--terracotta-dark);
  font-weight: 700;
}

.offerbar-sub {
  font-size: 0.76rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.offerbar-sub s {
  opacity: 0.75;
}

.offerbar .cta {
  width: auto;
  min-width: 5.5rem;
  white-space: nowrap;
}

/* Repeats the offer at the closing CTA, where the decision is made again. */
.final-offer {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 auto 0.7rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(246, 239, 230, 0.14);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 600;
}

.final-offer b {
  color: var(--gold);
}

.home-hero-copy {
  padding: 1.6rem var(--gutter) 2.2rem;
}

.home-hero-actions {
  display: grid;
  gap: 0.6rem;
  margin: 1.4rem 0 1.2rem;
}

.home-hero-actions .cta {
  margin-top: 0;
}

/* ---------- shop ---------- */

.shop {
  padding: 2.6rem var(--gutter);
  background: var(--paper);
}

.cards {
  display: grid;
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-hero-product {
  border-color: var(--ink);
  box-shadow: var(--shadow);
}

.card-media {
  position: relative;
  display: block;
  background: var(--linen);
}

.card-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Three sizes side by side, since size is the choice a buyer makes here. The
   pack shots are square, so they are left square rather than cropped. */
.card-media-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.card-flag {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  background: var(--ink);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.2rem;
}

.card-body h3 {
  margin-bottom: 0.15rem;
  font-size: 1.4rem;
}

.card-body h3 a {
  text-decoration: none;
}

.card-body h3 a:hover {
  color: var(--terracotta-dark);
}

.card-sub {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--terracotta-dark);
}

.card-desc {
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}

.card-points {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.card-points li::before {
  content: "✓";
  color: var(--terracotta);
  font-weight: 700;
  margin-right: 0.45rem;
}

/* Pins the price and button to the bottom so cards of unequal length still
   line their buy surfaces up with each other. */
.card-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin: auto 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}

.card-price .price {
  font-size: 1.85rem;
}

.card-fine {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* bag price grid */

/* Sized to fit inside the card on a 390px screen rather than scroll sideways. */
.price-grid {
  min-width: 0;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.price-grid th,
.price-grid td {
  padding: 0.5rem 0.4rem;
  white-space: nowrap;
}

.price-grid thead th {
  border-bottom: 1px solid var(--line);
}

.price-grid td {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price-grid tbody th {
  min-width: 0;
}

.bundle-nudge {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.1rem;
  background: var(--linen);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* ---------- reasons ---------- */

.reasons {
  padding: 2.6rem var(--gutter);
}

.reasons-grid {
  display: grid;
  gap: 1.3rem;
}

.reasons-grid article {
  border-top: 2px solid var(--ink);
  padding-top: 0.85rem;
}

.reasons-grid h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.reasons-grid p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* ---------- story ---------- */

.story {
  background: var(--linen);
  padding: 2.6rem var(--gutter);
}

.story-grid {
  display: grid;
  gap: 1.6rem;
}

.story-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

.story p {
  color: var(--ink-soft);
  max-width: 48ch;
}

.story-facts {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.story-facts li {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(28, 22, 18, 0.14);
}

/* ---------- desktop ---------- */

@media (min-width: 48rem) {
  /* The standing announcement bar stays in view on desktop, so the bottom bar
     would only be repeating itself. */
  .offerbar {
    display: none !important;
  }

  body {
    padding-bottom: 0;
  }

  .offer {
    max-width: 27rem;
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
  }

  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2.5rem;
  }

  .story-grid {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 2.5rem;
  }

  .home-hero-actions {
    grid-template-columns: auto auto;
    justify-content: start;
  }
}

@media (min-width: 62rem) {
  .home-hero {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: stretch;
  }

  .home-hero-media img {
    height: 100%;
    min-height: 32rem;
    aspect-ratio: auto;
  }

  .home-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem clamp(1.5rem, 4vw, 3.5rem);
  }

  /* Three products fit across from here; below this they stay two-up so the
     price table in the bags card keeps room to breathe. */
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .reasons-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
