/* ==========================================================
   Yarabelle — components.css
   Shared component styles.
   Tokens from tokens.css (:root) are used throughout.
   base.css owns: .container, .section, .section__head,
   .eyebrow, .section__title, .reveal, reset.
   ========================================================== */

/* ──────────────────────────────────────────────────────────
   STICKY HEADER
   ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(243, 241, 233, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding-inline: clamp(1rem, 4vw, 2rem);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.site-header.is-stuck {
  background: rgba(243, 241, 233, 0.97);
  box-shadow: 0 2px 24px rgba(63, 74, 51, 0.12);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 1.5rem;
}

/* Brand / wordmark */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--moss);
  letter-spacing: 0.02em;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.2s var(--ease);
}

/* Brand leaf mark: the inline SVG has no intrinsic size, so constrain it to a
   small icon beside the wordmark (was rendering ~233px tall and overflowing the
   header). Keeps the header compact + sticky. */
.site-brand .leaf--wordmark {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: block;
}
.site-brand:hover,
.site-brand:focus-visible {
  color: var(--moss);
  opacity: 0.75;
}

/* Leaf botanical accent inside brand (optional helper output) */
.site-brand .site-brand__leaf {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-inline-start: 0.25em;
  opacity: 0.55;
}

/* Primary nav */
.site-nav {
  display: flex;
  align-items: center;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list li a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s var(--ease);
}

.site-nav__list li a::after {
  content: '';
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: 0;
  height: 1.5px;
  background: var(--sage);
  border-radius: var(--radius-pill);
  transition: width 0.25s var(--ease);
}

.site-nav__list li a:hover,
.site-nav__list li a:focus-visible {
  color: var(--sage);
}
.site-nav__list li a:hover::after,
.site-nav__list li a:focus-visible::after {
  width: 100%;
}

/* Cart icon + pill badge */
.site-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--moss);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease);
  flex-shrink: 0;
}
.site-cart:hover,
.site-cart:focus-visible {
  color: var(--sage);
}

.site-cart svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-cart__count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--sage);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  padding-inline: 3px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  /* hide when zero */
}
.site-cart__count:empty,
.site-cart__count[data-cart-count="0"] {
  display: none;
}

/* Mobile menu toggle (shown <768px) */
.site-header__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  color: var(--moss);
  background: none;
  border: none;
  cursor: pointer;
}
.site-header__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

/* Mobile nav drawer */
.site-mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(243, 241, 233, 0.97);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.site-mobile-nav.is-open {
  display: flex;
}
.site-mobile-nav a {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 300;
  color: var(--moss);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-mobile-nav a:hover { color: var(--sage); }

/* ── Controller integration patches (cross-agent seams) ── */
@keyframes yarabelle-cart-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.site-cart__count.is-pulsing { animation: yarabelle-cart-pulse 0.4s var(--ease); }

.archive-card { display: grid; gap: 0.6rem; margin-bottom: 2.25rem; }
.archive-card img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.archive-card a { color: var(--moss); text-decoration: none; }
.archive-card a:hover { color: var(--sage); }
.archive-card h2, .archive-card h3 { font-family: var(--font-display); color: var(--moss); margin: 0; }

.site-mobile-nav__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--moss);
  line-height: 1;
  padding: 4px;
}

/* ──────────────────────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 2.125rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.25s var(--ease),
    color 0.25s var(--ease),
    border-color 0.25s var(--ease),
    transform 0.2s var(--ease),
    box-shadow 0.25s var(--ease);
}
.btn:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* Sage-fill primary */
.btn--primary {
  background: var(--sage);
  color: var(--white);
  border-color: var(--sage);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(124, 140, 107, 0.35);
}

/* Outline ghost */
.btn--ghost {
  background: transparent;
  color: var(--moss);
  border-color: var(--moss);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--moss);
  color: var(--cream);
}

/* Inverted (for dark backgrounds) */
.btn--light {
  background: var(--cream);
  color: var(--moss);
  border-color: var(--cream);
}
.btn--light:hover,
.btn--light:focus-visible {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
}

/* Full-width */
.btn--block {
  display: flex;
  width: 100%;
}

/* ──────────────────────────────────────────────────────────
   SECTION HEADING (supplement base.css rules)
   ────────────────────────────────────────────────────────── */
/* .section__head, .eyebrow, .section__title defined in base.css */
.section__head--center {
  text-align: center;
}
.section__head--center .section__sub {
  margin-inline: auto;
}

.section__sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.7;
  margin-top: 0.75rem;
}

/* ──────────────────────────────────────────────────────────
   PRODUCT CARD
   Used on homepage AND shop (identical markup via helper)
   ────────────────────────────────────────────────────────── */
.product-card {
  background: var(--cream);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(63, 74, 51, 0.07);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(63, 74, 51, 0.14);
}

/* Image wrapper */
.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--sand);
  flex-shrink: 0;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}
.product-card:hover .product-card__img {
  transform: scale(1.06);
}

/* Badge (Bestseller / New) */
.product-card__badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  background: var(--sage);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

/* Add-to-cart CTA — slides up on card hover */
.product-card__atc {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--moss);
  color: var(--cream);
  border: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.product-card:hover .product-card__atc {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.product-card__atc:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

/* Card body */
.product-card__body {
  padding: 1.25rem 1.375rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--moss);
  margin-bottom: 0.3rem;
  line-height: 1.25;
}

.product-card__desc {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.875rem;
  flex: 1;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-card__price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--sage-dark);
}

/* Wishlist / secondary action */
.product-card__wish {
  background: none;
  border: 1.5px solid var(--sand);
  color: var(--sage);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s, border-color 0.2s;
}
.product-card__wish:hover {
  background: var(--sand);
  border-color: var(--sage);
}

/* ──────────────────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--moss);
  color: rgba(243, 241, 233, 0.7);
  padding: 5rem clamp(1rem, 4vw, 2rem) 2.5rem;
}

.site-footer__cols {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 2.25rem;
}

.site-footer__col {
  display: flex;
  flex-direction: column;
}

/* Brand column */
.site-footer__brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.02em;
  text-decoration: none;
  display: block;
  margin-bottom: 1rem;
}

.site-footer__tagline {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.7;
  color: rgba(243, 241, 233, 0.55);
  max-width: 260px;
  margin-bottom: 1.5rem;
}

/* Column headings */
.site-footer__col-heading {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1.125rem;
}

/* Nav links */
.site-footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.site-footer__col ul li a,
.site-footer__col a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(243, 241, 233, 0.55);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-footer__col ul li a:hover,
.site-footer__col a:hover {
  color: rgba(243, 241, 233, 0.9);
}

/* wp_nav_menu output inside footer col */
.site-footer__col .menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
}
.site-footer__col .menu li a {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: rgba(243, 241, 233, 0.55);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-footer__col .menu li a:hover { color: rgba(243, 241, 233, 0.9); }

/* Social icons row */
.site-footer__social {
  display: flex;
  gap: 0.625rem;
  margin-top: 0;
}

.site-footer__social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(243, 241, 233, 0.65);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-footer__social-link:hover {
  border-color: var(--sage);
  color: var(--sage);
  background: rgba(124, 140, 107, 0.15);
}
.site-footer__social-link svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* Newsletter form (inside footer or standalone section) */
.site-footer__newsletter {
  margin-top: 1.5rem;
}
.site-footer__newsletter-label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243, 241, 233, 0.55);
  display: block;
  margin-bottom: 0.75rem;
}
.site-footer__newsletter-form {
  display: flex;
  gap: 0.5rem;
}
.site-footer__newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.125rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--cream);
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-footer__newsletter-form input[type="email"]::placeholder {
  color: rgba(243, 241, 233, 0.42);
}
.site-footer__newsletter-form input[type="email"]:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
}
.site-footer__newsletter-form button {
  flex-shrink: 0;
  background: var(--sage);
  color: var(--white);
  border: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.site-footer__newsletter-form button:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

/* Footer bottom bar */
.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.site-footer__copy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(243, 241, 233, 0.35);
}
.site-footer__legal {
  display: flex;
  gap: 1.5rem;
}
.site-footer__legal a {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(243, 241, 233, 0.35);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.site-footer__legal a:hover { color: rgba(243, 241, 233, 0.7); }

/* ──────────────────────────────────────────────────────────
   LEAF LAYERS & ORGANIC DIVIDERS
   ────────────────────────────────────────────────────────── */
.leaf-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
  overflow: hidden;
}

.leaf-layer--back  { z-index: 1; }
.leaf-layer--back  svg { opacity: 0.18; }

.leaf-layer--mid   { z-index: 2; }
.leaf-layer--mid   svg { opacity: 0.26; }

.leaf-layer--front { z-index: 3; }
.leaf-layer--front svg { opacity: 0.48; }

/* Wave / blob organic section dividers */
.wave-divider {
  position: relative;
  height: 80px;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.blob-divider {
  position: relative;
  height: 110px;
  overflow: hidden;
}
.blob-divider::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 110px;
  background: var(--cream);
  clip-path: ellipse(60% 100% at 50% 100%);
}

/* Screen-reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ──────────────────────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-footer__cols {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  /* Header: hide desktop nav, show toggle */
  .site-nav {
    display: none;
  }
  .site-header__toggle {
    display: flex;
  }

  /* Footer stacks */
  .site-footer__cols {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Newsletter form stacks */
  .site-footer__newsletter-form {
    flex-direction: column;
  }
  .site-footer__newsletter-form input[type="email"],
  .site-footer__newsletter-form button {
    width: 100%;
    text-align: center;
  }

  /* Footer bottom stacks */
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 375px) {
  .site-header__inner {
    height: 58px;
  }
  .site-brand {
    font-size: 1.35rem;
  }

  .product-card__atc {
    font-size: 0.72rem;
    padding: 0.6rem 1.125rem;
  }
}

/* ──────────────────────────────────────────────────────────
   REDUCED MOTION GUARD
   ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header.is-stuck {
    transition: none;
  }
  .product-card,
  .product-card__img,
  .product-card__atc,
  .btn,
  .site-nav__list li a::after {
    transition: none;
  }
  .product-card:hover {
    transform: none;
  }
  .product-card:hover .product-card__img {
    transform: none;
  }
  .product-card:hover .product-card__atc {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .leaf-layer {
    display: none;
  }
}
