/*
Theme Name: B-Line Supply
Theme URI: https://blinesupply.com
Author: B-Line Supply
Description: Custom storefront for B-Line Supply — bamboo bedding for the night, coffee for the morning. Built for WooCommerce with a store-open switch in the Customizer.
Version: 1.1.1
Requires at least: 6.4
Requires PHP: 8.0
License: Proprietary
Text Domain: bline
*/

/* ---------- Tokens ---------- */
:root {
  --night: #1d2340;      /* lights out */
  --night-2: #2b3360;
  --dawn: #e3a53c;       /* first light / honey */
  --dawn-soft: #f3d79a;
  --roast: #3a2820;      /* coffee */
  --sage: #7f9779;       /* bamboo */
  --linen: #eef0eb;      /* page */
  --paper: #fbfbf8;
  --ink: #1b1d22;
  --muted: #5a5f68;
  --line: #d6d9d1;

  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: 3.157rem;
  --step-5: clamp(3.4rem, 9vw, 7.5rem);

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
a:hover { color: var(--night-2); }
:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.005em;
  margin: 0 0 0.4em;
}
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; max-width: 62ch; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 0.5rem; left: 0.5rem; width: auto; height: auto; clip: auto; background: var(--paper); padding: 0.6rem 1rem; z-index: 100; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--step-0);
  padding: 0.85em 1.4em;
  border-radius: 999px;
  border: 2px solid currentColor;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
  transition: background-color .15s, color .15s;
}
.btn--solid { background: var(--dawn); border-color: var(--dawn); color: var(--ink); }
.btn--solid:hover { background: var(--dawn-soft); border-color: var(--dawn-soft); color: var(--ink); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: inherit; }
.btn--dark { background: var(--night); border-color: var(--night); color: var(--paper); }
.btn--dark:hover { background: var(--night-2); border-color: var(--night-2); color: var(--paper); }

/* ---------- Notice bar + header ---------- */
.notice {
  background: var(--night);
  color: var(--dawn-soft);
  font-size: var(--step--1);
  text-align: center;
  padding: 0.55rem var(--gutter);
}
.notice a { color: var(--paper); font-weight: 700; }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font-family: var(--display); font-weight: 800; font-size: 1.65rem; line-height: 1; }

.nav ul { list-style: none; display: flex; gap: 1.6rem; margin: 0; padding: 0; }
.nav a { text-decoration: none; font-weight: 600; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-toggle { display: none; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0.5rem; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1rem; }
  .nav li a { display: block; padding: 0.7rem 0; }
}

/* ---------- Hero: the day cycle (the one bold move) ---------- */
.hero {
  position: relative;
  color: var(--paper);
  background: linear-gradient(100deg, var(--night) 0%, var(--night) 34%, #4a3f5e 52%, #c27a3a 72%, var(--dawn) 100%);
  overflow: hidden;
  isolation: isolate;
}
.hero__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero__inner { padding-top: clamp(4rem, 12vw, 9rem); padding-bottom: clamp(3.5rem, 9vw, 7rem); }
.hero h1 { font-size: var(--step-5); line-height: 0.86; margin-bottom: 0.45em; }
.hero h1 span { display: block; }
.hero h1 span + span { color: var(--ink); text-align: right; }
.hero__sub { font-size: var(--step-1); line-height: 1.45; max-width: 34ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero__ends {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: clamp(3rem, 8vw, 6rem);
  font-size: var(--step--1); font-weight: 600;
}
.hero__ends span:last-child { color: var(--ink); }

@media (max-width: 640px) {
  .hero { background: var(--dawn); }
  .hero__inner { padding-top: 0; }
  .hero h1 span:first-child {
    background: linear-gradient(180deg, var(--night) 0, var(--night) 78%, #c27a3a 100%);
    color: var(--paper);
    margin: 0 calc(-1 * var(--gutter));
    padding: 3rem var(--gutter) 0.45em;
  }
  .hero h1 span + span { margin-top: 0.3em; }
  .hero .btn--solid { background: var(--night); border-color: var(--night); color: var(--paper); }
  .hero__ends, .hero__sky { display: none; }
  .hero__sub { color: var(--ink); }
  .hero .btn--ghost { color: var(--ink); }
  .hero h1 span + span { color: var(--ink); text-align: left; }
  .hero__sub, .hero__actions { position: relative; }
  .hero__ends span:last-child { color: var(--ink); }
}

/* ---------- Sections ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section__head { display: grid; grid-template-columns: 1fr; gap: 0.5rem; margin-bottom: 2.5rem; }
.section__head p { color: var(--muted); font-size: var(--step-1); line-height: 1.45; }
@media (min-width: 860px) {
  .section__head { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 3rem; }
  .section__head p { margin-bottom: 0.4rem; }
}

/* Coffee */
.coffee { background: var(--paper); }
.blends { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 760px) { .blends { grid-template-columns: 1fr 1fr; } }
.blend {
  display: grid; grid-template-rows: auto 1fr;
  background: var(--linen);
  border-radius: 28px;
  overflow: hidden;
}
.blend__art { aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 1.5rem; }
.blend--classic .blend__art { background: #d9c4a8; }
.blend--mushroom .blend__art { background: #c9cbbd; }
.blend__art svg { height: 88%; width: auto; }
.blend__body { padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; gap: 0.2rem; }
.blend__body h3 { margin-bottom: 0.2rem; }
.blend__meta { color: var(--muted); font-size: var(--step--1); margin-bottom: 0.8rem; }
.blend__body .btn { align-self: flex-start; margin-top: auto; }

/* Bamboo */
.bamboo { background: var(--night); color: var(--paper); }
.bamboo .section__head p { color: #c9cde0; }
.bamboo__grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; }
@media (min-width: 860px) { .bamboo__grid { grid-template-columns: 1.1fr 1fr; } }
.bamboo__art { background: var(--night-2); border-radius: 28px; padding: 2rem; }
.facts { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1.1rem; }
.facts li { padding-left: 1.4rem; position: relative; max-width: 52ch; }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.fine { font-size: var(--step--1); color: #aab0c8; }

/* Pantry (coming soon) */
.pantry { background: var(--linen); }
.pantry__row { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 760px) { .pantry__row { grid-template-columns: 1fr 1fr; } }
.jar {
  border: 2px dashed var(--line);
  border-radius: 28px;
  padding: 1.8rem;
  display: grid; grid-template-columns: 72px 1fr; gap: 1.2rem; align-items: center;
}
.jar svg { width: 72px; height: 72px; }
.jar h3 { margin-bottom: 0.15rem; }
.jar p { margin: 0; color: var(--muted); }
.soon { display: inline-block; font-size: var(--step--1); font-weight: 700; color: var(--roast); background: var(--dawn-soft); padding: 0.15rem 0.7rem; border-radius: 999px; margin-bottom: 0.4rem; }

/* Early access */
.access { background: var(--dawn); color: var(--ink); }
.access__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: end; }
@media (min-width: 860px) { .access__grid { grid-template-columns: 1fr 1fr; } }
.access h2 { font-size: var(--step-4); }
.signup { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.signup label { flex-basis: 100%; font-weight: 700; }
.signup input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  font: inherit; padding: 0.85em 1.1em;
  border-radius: 999px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
}
.signup .hp { position: absolute; left: -9999px; }
.signup__note { flex-basis: 100%; font-size: var(--step--1); margin: 0; }
.alert { border-radius: 16px; padding: 0.9rem 1.1rem; margin-bottom: 1rem; font-weight: 600; }
.alert--ok { background: var(--paper); }
.alert--err { background: #f7d6d0; }

/* Story */
.story { background: var(--paper); }
.story__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 860px) { .story__grid { grid-template-columns: 1fr 1.2fr; gap: 4rem; } }
.story p { font-size: var(--step-1); line-height: 1.55; }

/* Footer */
.site-footer { background: var(--ink); color: #c9ccd2; padding: 3.5rem 0 2.5rem; font-size: var(--step--1); }
.site-footer .wrap { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: var(--step-2); color: var(--paper); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--dawn-soft); text-decoration: underline; }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid #333; padding-top: 1.5rem; }

/* Generic pages */
.page-body { background: var(--paper); padding: clamp(3rem, 7vw, 5rem) 0; }
.page-body h1 { font-size: var(--step-4); }
.entry > * { max-width: 70ch; }
.entry a { text-underline-offset: 3px; }

.contact-form { display: grid; gap: 0.2rem; max-width: 560px; }
.contact-form label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; padding: 0.8em 1em; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink);
}
.contact-form .hp { position: absolute; left: -9999px; width: 1px; }


/* ---------- Photos ---------- */
img.cover { width: 100%; height: 100%; object-fit: cover; }
.blend__art:has(img.cover) { padding: 0; }
.bamboo__art:has(img.cover) { padding: 0; overflow: hidden; aspect-ratio: 4 / 5; }
.jar img.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; }
.story__img { margin-top: 1.5rem; border-radius: 28px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Subscribe band ---------- */
.subscribe { background: var(--linen); padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.subscribe__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .subscribe__grid { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.tiers { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.tiers li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 1rem 1.25rem; border-radius: 18px; background: var(--paper); }
.tiers li:nth-child(2) { background: var(--night); color: var(--paper); }
.tiers strong { font-family: var(--display); font-size: var(--step-2); font-weight: 800; line-height: 1; }
.tiers span { text-align: right; font-size: var(--step--1); }

/* ---------- Exclusivity ---------- */
.exclusive { border-left: 4px solid var(--dawn); background: var(--linen); padding: 0.9rem 1.1rem; border-radius: 0 14px 14px 0; font-size: var(--step--1); margin: 1.2rem 0; max-width: 62ch; }
.story .exclusive { font-size: var(--step-0); }
.exclusive-foot { grid-column: 1 / -1; max-width: 80ch; color: #9fa3ab; margin: 0; }

/* ---------- Footer extras ---------- */
.socials { display: flex !important; flex-wrap: wrap; gap: 0.4rem 1rem !important; margin: 1rem 0 !important; }
.pref-source { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #333; }
.pref-source p { margin: 0 0 0.6rem; }
.pref-source [google-add-preferred-source-btn] { min-height: 40px; }

/* ---------- Journal ---------- */
.journal-head { background: var(--night); color: var(--paper); padding: clamp(3rem, 7vw, 5rem) 0 2.5rem; }
.journal-head h1 { font-size: var(--step-4); }
.journal-head p { color: #c9cde0; font-size: var(--step-1); line-height: 1.45; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; padding: 0; }
.chips a { display: inline-block; padding: 0.35rem 0.9rem; border-radius: 999px; border: 1.5px solid #4a5280; text-decoration: none; font-weight: 600; font-size: var(--step--1); color: var(--paper); }
.chips a:hover { background: var(--night-2); color: var(--paper); }
.cards { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 700px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .cards { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--linen); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.card__img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card__body { padding: 1.3rem 1.4rem 1.6rem; }
.card__body h2 { font-size: var(--step-2); margin-bottom: 0.4rem; }
.card__body h2 a { text-decoration: none; }
.card__body p { font-size: var(--step--1); color: var(--muted); margin: 0; }
.card__meta { font-size: var(--step--1); font-weight: 700; color: var(--sage); margin: 0 0 0.4rem; display: flex; gap: 0.9rem; }
.card__meta a { color: inherit; }
.post-hero { background: var(--paper); padding: clamp(3rem, 7vw, 5rem) 0 1.5rem; }
.post-hero h1 { font-size: var(--step-4); max-width: 22ch; }
.post-cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: 28px; }
.post-body { max-width: 72ch; }
.post-body h2 { font-size: var(--step-3); margin-top: 1.6em; }
.post-body h3 { font-size: var(--step-1); font-family: var(--body); font-weight: 700; line-height: 1.3; margin-top: 1.4em; }
.post-body ul, .post-body ol { padding-left: 1.2rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-cta { margin-top: 3rem; background: var(--dawn); border-radius: 24px; padding: 1.8rem; }
.post-cta h2 { margin-top: 0; }
.nav-links { display: flex; gap: 0.6rem; margin-top: 2rem; }
.nav-links .page-numbers { padding: 0.4rem 0.8rem; border-radius: 10px; background: var(--linen); text-decoration: none; }
.nav-links .current { background: var(--night); color: var(--paper); }

/* ---------- FAQ / policy pages ---------- */
.entry h2 { font-size: var(--step-3); margin-top: 1.5em; }
.entry h3 { font-family: var(--body); font-size: var(--step-1); font-weight: 700; line-height: 1.3; margin-top: 1.3em; }

/* ---------- Recent-order popup (real orders only) ---------- */
.recent-pop {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60; max-width: min(340px, calc(100vw - 2rem));
  background: var(--paper); color: var(--ink); border-radius: 18px; box-shadow: 0 12px 32px rgba(29,35,64,.22);
  padding: 0.9rem 2.4rem 0.9rem 1rem; font-size: var(--step--1);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s;
}
.recent-pop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.recent-pop a { text-decoration: none; display: grid; gap: 0.1rem; }
.recent-pop small { color: var(--muted); }
.recent-pop button { position: absolute; top: 0.35rem; right: 0.5rem; border: 0; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .recent-pop { transition: none; } }

/* ---------- WooCommerce ---------- */
.woocommerce .page-body { background: var(--paper); }
.woocommerce ul.products li.product .button,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  border-radius: 999px; background: var(--night); color: var(--paper); font-weight: 700; padding: 0.8em 1.3em;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--night-2); color: var(--paper); }
.woocommerce div.product .product_title { font-size: var(--step-4); }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-family: var(--display); font-size: var(--step-2); font-weight: 800; }
.woocommerce span.onsale { background: var(--dawn); color: var(--ink); }
.closed-note { background: var(--dawn-soft); border-radius: 16px; padding: 1rem 1.2rem; margin: 1rem 0; font-weight: 600; }
.closed-note a { font-weight: 800; }
