/*
 * DaisyUI Overrides
 * This file loads AFTER tailwind.css to override DaisyUI component defaults.
 * Keep overrides minimal - prefer Tailwind utility classes when possible.
 */

.stat-value {
  font-size: 1.5rem;
}

/*
 * ActionText / Lexxy Editor Overflow Fix
 * Prevents ActionText content from overflowing on mobile devices
 */
.instruction-item lexxy-editor {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* Touch-friendly drag handle styles */
[data-sortable-handle] {
  touch-action: none;
  cursor: grab;
}

[data-sortable-handle]:active {
  cursor: grabbing;
}

/*
 * Label Text Wrapping Fix
 * DaisyUI sets text-wrap-mode: nowrap on .label which causes
 * labels to overflow their containers. Override to allow wrapping.
 */
.label {
  text-wrap-mode: wrap;
}

.dropdown-content {
  border-radius: 4px;
}

.menu {
  border-radius: 4px;
}

/* World Spice button overrides */
.btn {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 4px;
  transition: background 120ms cubic-bezier(0.34, 0.07, 0.16, 1),
              color 120ms cubic-bezier(0.34, 0.07, 0.16, 1),
              border-color 120ms cubic-bezier(0.34, 0.07, 0.16, 1),
              transform 120ms cubic-bezier(0.34, 0.07, 0.16, 1);
}

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: transparent;
  color: #000000;
  border: 1px solid #000000;
}

.btn-secondary:hover {
  background: #F2F2F2;
}

.btn-ghost:hover {
  background: #F2F2F2;
}

/* World Spice category chip overrides */
.badge {
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
}

.badge-ghost {
  background: transparent;
  border: 1px solid #000;
  color: #000;
}

.badge-secondary {
  background: #51251F;
  border-color: #51251F;
  color: #FFFFFF;
}

.badge-info {
  background: #136096;
  border-color: #136096;
  color: #FFFFFF;
}

.badge-warning {
  background: #DECA6A;
  border-color: #DECA6A;
  color: #41191C;
}

.badge-outline {
  background: transparent;
  border: 1px solid #000;
  color: #000;
}

.badge-outline:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-content);
}

/* No dropdown menu may be wider than the screen. The script in
   app/javascript/dropdown_viewport_clamp.js slides an open menu back onto the
   page; this makes sure there is a position it can slide to. */
.dropdown-content {
  max-width: calc(100vw - 1rem);
}

/* Filters collapse: collapsed by default on mobile (toggleable),
   always expanded on desktop. Pure CSS so there is no open/close flash. */
@media (min-width: 1024px) {
  .filters-collapse {
    grid-template-rows: max-content 1fr;
  }

  .filters-collapse > .collapse-content {
    visibility: visible;
    min-height: fit-content;
    padding-bottom: 1rem;
  }

  /* Keep the arrow in its "open" orientation on desktop. */
  .filters-collapse.collapse-arrow > .collapse-title:after {
    transform: translateY(-50%) rotate(225deg);
  }

  /* Filters are always shown on desktop, so the toggle isn't interactive. */
  .filters-collapse > input[type="checkbox"],
  .filters-collapse > .collapse-title {
    cursor: default;
    pointer-events: none;
  }
}

/* ============================================================
   World Spice house typography
   Ported from shopify/theme/assets/ws-home.css so CooksClub reads
   as the same brand as the storefront homepage.

   .ws-eyebrow    small tracked-out uppercase kicker
   .ws-display    page and section headings: BN Bergen, all caps
   .ws-headline   a name or title that must stay mixed-case: Bergen Text
   .ws-subtitle   the sentence under a heading

   .ws-display deliberately sets no font-size — each view keeps its existing
   Tailwind text-* class, so sizes can be tuned per page without touching CSS.
   BN Bergen is condensed, so a heading reads a little smaller than it did in
   Poppins at the same text-* step. Bump the step where you want it louder.
   ============================================================ */
.ws-eyebrow {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.2;
}

.ws-display {
  font-family: 'BN Bergen', 'Bebas Neue', 'Oswald', Impact, sans-serif;
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.ws-headline {
  font-family: 'Bergen Text', 'Poppins', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

/* An <em> inside a display heading is the accent word, same as the storefront. */
.ws-display em {
  font-style: normal;
  color: #DC6239;
}

.ws-subtitle {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  max-width: 52ch;
}

/* Card titles: Bergen Text, mixed case — recipe and post names read as names,
   not as billboard type. */
.card-title {
  font-family: 'Bergen Text', 'Poppins', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

/* Cards match the storefront photo card: hairline black edge, 8px radius,
   and the signature hard-shadow lift on hover. */
.card {
  border-radius: 8px;
}

/* ============================================================
   Fixed world-map backdrop
   app/assets/images/ws-world-map.svg is used as a mask so the colour
   stays in CSS and works in both themes. Sits at z-index -1, above the
   canvas background and below every piece of content.
   ============================================================ */
.ws-world-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #B8B8B4;
  opacity: 0.32;
  -webkit-mask-image: url("/assets/ws-world-map-d4e41e9f.svg");
  mask-image: url("/assets/ws-world-map-d4e41e9f.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: cover;
  mask-size: cover;
}

[data-theme="dark"] .ws-world-backdrop {
  background-color: #B8B8B4;
  opacity: 0.14;
}

/* Named category badges for spice/blend families */
.badge-curry { background: #DC6239; border-color: #DC6239; color: #FFF; }
.badge-salt { background: #1D7A58; border-color: #1D7A58; color: #FFF; }
.badge-spicy { background: #94292B; border-color: #94292B; color: #FFF; }
.badge-region { background: #136096; border-color: #136096; color: #FFF; }
.badge-bbq { background: #94253F; border-color: #94253F; color: #FFF; }
.badge-herb { background: #2E6B38; border-color: #2E6B38; color: #FFF; }
.badge-misc { background: #38346A; border-color: #38346A; color: #FFF; }
.badge-pepper { background: #131416; border-color: #131416; color: #FFF; }
.badge-warmspice { background: #51251F; border-color: #51251F; color: #FFF; }

/*
 * Lexxy link dropdown
 * Lexxy tags its URL field and buttons with DaisyUI's .input/.btn classes, and
 * its own styles are wrapped in :where(), so DaisyUI wins every time. Without
 * this the Link/Unlink buttons render full-size and spill out of the dropdown.
 */
lexxy-link-dropdown .input,
lexxy-link-dropdown .btn {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: normal;
  text-transform: none;
  border-radius: 4px;
  box-shadow: none;
}

lexxy-link-dropdown .lexxy-editor__toolbar-dropdown-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  font-weight: 600;
}
