/* Worklivewell Design System */
/* Tailwind CSS loaded via CDN in base.html */

:root {
  /* Ergocraft-aligned neutral palette — warm earth tones, no gold. */
  --color-cream: #F6F6F3;
  --color-warm-white: #EEEDE6;
  --color-sand: #CECDC3;
  --color-taupe: #9C947D;
  --color-warm-gray: #7A7670;
  --color-charcoal: #212529;
  --color-deep-brown: #16191C;
  --color-accent: #796F51;
  --color-accent-dark: #5C5440;
  --color-error: #B0463E;
  --color-success: #5A7E62;

  /* Typography — Inter for everything; Playfair Display retired. */
  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Spacing */
  --section-padding: clamp(3rem, 8vw, 8rem);
  --container-max: 1440px;
  --container-padding: clamp(1rem, 4vw, 3rem);
}

*,
*::before,
*::after {
  margin: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400;       /* Ergocraft uses regular weight for headings */
  line-height: 1.1;       /* Tighter than the previous 1.2 to match brief */
  letter-spacing: 0;      /* Drop the serif-era negative tracking */
}

/* Hide native scrollbars on horizontal carousels (Tailwind doesn't ship
   this utility by default in the CDN config). */
.scrollbar-hide { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* Hotspot-image dots — touch-device "click to open" state mirrors the
   hover state from the template's group-hover classes, since tap on
   mobile doesn't trigger :hover. */
.hotspot-dot.is-open .hotspot-card {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.hotspot-dot.is-open > span:first-of-type {
    background-color: var(--color-accent);
    box-shadow: 0 0 0 6px rgba(121, 111, 81, 0.35);
}

/* ──────────────────────────────────────────────
 * Sticky header — scroll-shrink behaviour
 * Toggled by static/js/main.js when window.scrollY > 80.
 * ────────────────────────────────────────────── */
#site-header.is-scrolled #site-header-row {
  height: 3.5rem;          /* h-14, down from 5rem */
}
#site-header.is-scrolled #site-header-bg {
  background-color: var(--color-deep-brown);  /* fully opaque */
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
/* Logo gets a touch smaller when shrunk so the proportions stay right. */
#site-header.is-scrolled .site-wordmark {
  font-size: 1rem;          /* down from text-xl (1.25rem) */
}

/* Container utility */
.container-site {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Section spacing */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* Button system */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 3.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Primary: warm-white on dark backgrounds */
.btn-primary {
  background-color: var(--color-warm-white);
  color: var(--color-deep-brown);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  color: white;
}

/* Primary dark: charcoal fill on light backgrounds */
.btn-primary-dark {
  background-color: var(--color-charcoal);
  color: var(--color-warm-white);
}

.btn-primary-dark:hover {
  background-color: var(--color-deep-brown);
  color: var(--color-warm-white);
}

/* Outline: transparent with subtle border */
.btn-outline {
  background-color: transparent;
  color: var(--color-warm-white);
  box-shadow: inset 0 0 0 1px rgba(245, 242, 238, 0.3);
}

.btn-outline:hover {
  background-color: rgba(245, 242, 238, 0.08);
  box-shadow: inset 0 0 0 1px rgba(245, 242, 238, 0.6);
}

/* Outline dark: for light backgrounds */
.btn-outline-dark {
  background-color: transparent;
  color: var(--color-charcoal);
  box-shadow: inset 0 0 0 1px var(--color-charcoal);
}

.btn-outline-dark:hover {
  background-color: var(--color-charcoal);
  color: var(--color-warm-white);
}

/* Text link style with arrow */
.btn-text {
  padding: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease, gap 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-text::after {
  display: none;
}

.btn-text:hover {
  color: var(--color-accent-dark);
  gap: 0.75rem;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--color-accent);
  color: white;
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--color-charcoal);
  background-color: var(--color-warm-white);
  border: 1px solid var(--color-sand);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(196, 167, 125, 0.15);
  outline: none;
}

.form-input::placeholder {
  color: var(--color-warm-gray);
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
  margin-bottom: 0.5rem;
}

/* Card component */
.card {
  background: white;
  border: 1px solid var(--color-sand);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.badge-accent {
  background-color: var(--color-accent);
  color: white;
}

.badge-success {
  background-color: var(--color-success);
  color: white;
}

.badge-error {
  background-color: var(--color-error);
  color: white;
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--color-sand);
  border: none;
}

/* Price display */
.price {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-charcoal);
}

.price-original {
  text-decoration: line-through;
  color: var(--color-warm-gray);
  font-weight: 400;
}

/* Notification / Alert */
.alert {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  border-left: 3px solid;
}

.alert-success {
  background-color: rgba(75, 140, 107, 0.08);
  border-color: var(--color-success);
  color: var(--color-success);
}

.alert-error {
  background-color: rgba(196, 75, 75, 0.08);
  border-color: var(--color-error);
  color: var(--color-error);
}

.alert-info {
  background-color: rgba(196, 167, 125, 0.08);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

/* Product detail option dropdowns — ErgoCraft-style.
   Label above, borderless select with a thin bottom rule and a chevron
   icon on the right. Used by the option-group cascading picker and the
   legacy flat variant select on the product detail page. */
.pd-option-group {
  border-bottom: 1px solid var(--color-sand);
  padding-bottom: 0.25rem;
}
.pd-option-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-charcoal);
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0.375rem;
}
.pd-option-select {
  width: 100%;
  padding: 0.25rem 2rem 0.25rem 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-charcoal);
  background-color: transparent;
  border: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23212529' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 L6 6.5 L11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  background-size: 12px 8px;
  cursor: pointer;
}
.pd-option-select:focus {
  outline: none;
}
.pd-option-select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.pd-option-select:disabled,
.pd-option-select option:disabled {
  color: var(--color-warm-gray);
}

/* Accordion +/− toggle — ErgoCraft-style product detail accordions.
   Two crossed lines; the vertical one collapses on [open] so + becomes −. */
.accordion-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: currentColor;
}
.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  background-color: currentColor;
  transition: transform 0.25s ease;
}
.accordion-icon::before {
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
}
.accordion-icon::after {
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  transform: translateX(-50%);
}
details[open] > summary .accordion-icon::after {
  transform: translateX(-50%) scaleY(0);
}

/* Product detail accordion summary — strip the default disclosure marker so
   the +/− icon is the only affordance. */
details > summary.pd-summary {
  list-style: none;
  cursor: pointer;
}
details > summary.pd-summary::-webkit-details-marker { display: none; }

/* StreamField block spacing — tighten margins between consecutive blocks */
.streamfield-blocks > .section + .section {
  padding-top: 0;
}

.streamfield-blocks > .section {
  padding-top: clamp(2rem, 4vw, 4rem);
  padding-bottom: clamp(2rem, 4vw, 4rem);
}

.streamfield-blocks > .section:first-child {
  padding-top: var(--section-padding);
}

.streamfield-blocks > .section:last-child {
  padding-bottom: var(--section-padding);
}

/* Rich text content — typography for CMS-authored content */
.rich-text h1 { font-size: 2.5rem; margin-top: 2rem; margin-bottom: 1rem; }
.rich-text h2 { font-size: 2rem; margin-top: 2rem; margin-bottom: 0.75rem; }
.rich-text h3 { font-size: 1.5rem; margin-top: 1.75rem; margin-bottom: 0.75rem; }
.rich-text h4 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

.rich-text p {
  margin-bottom: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-charcoal);
}

.rich-text a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.3s ease;
}

.rich-text a:hover {
  color: var(--color-accent);
}

.rich-text ul, .rich-text ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.rich-text li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.rich-text ul li { list-style-type: disc; }
.rich-text ol li { list-style-type: decimal; }

.rich-text blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-warm-gray);
}

.rich-text img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.rich-text hr {
  border: none;
  height: 1px;
  background: var(--color-sand);
  margin: 2rem 0;
}

.rich-text strong { font-weight: 600; }

.rich-text > *:first-child { margin-top: 0; }
.rich-text > *:last-child { margin-bottom: 0; }
