/* components.css — reusable Editorial component vocabulary */

/* ============== BUTTONS ============== */
.ws-btn {
  display: inline-block;
  padding: 0.55rem 1.25rem;
  font-family: var(--ws-sans);
  font-size: var(--ws-ui);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ws-btn--primary { background: var(--ws-terracotta); color: var(--ws-cream); }
.ws-btn--primary:hover { background: #8a4530; color: var(--ws-cream); }
[data-bs-theme="dark"] .ws-btn--primary:hover { background: #d27a5e; }
.ws-btn--secondary {
  background: transparent;
  color: var(--ws-ink);
  border: 1px solid var(--ws-ink);
  padding: 0.5rem 1.2rem;
}
.ws-btn--secondary:hover { background: var(--ws-ink); color: var(--ws-cream); }
.ws-btn--ghost {
  background: transparent;
  color: var(--ws-terracotta);
  text-decoration: underline;
  text-transform: none;
  letter-spacing: 0;
  padding: 0.55rem 0.75rem;
}
.ws-btn--ghost:hover { color: #8a4530; }
[data-bs-theme="dark"] .ws-btn--ghost:hover { color: #f0a890; }
.ws-btn--block { display: block; width: 100%; text-align: center; }

/* ============== CHIPS (squared, editorial meta) ============== */
.ws-chip {
  display: inline-block;
  padding: 3px 9px;
  font-family: var(--ws-sans);
  font-size: var(--ws-label-cap);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--ws-terracotta);
  color: var(--ws-terracotta);
  border-radius: 0;
  text-decoration: none;
}
.ws-chip--dim {
  color: var(--ws-muted);
  border-color: var(--ws-line-dotted);
}
.ws-chip--solid {
  background: var(--ws-terracotta);
  color: var(--ws-cream);
}

/* ============== TAG PILLS (rounded, distinct from chips) ============== */
.ws-tag-pill {
  display: inline-block;
  padding: 3px 10px;
  font-family: var(--ws-sans);
  font-size: var(--ws-ui-sm);
  font-weight: 500;
  background: var(--ws-wheat-soft);
  color: var(--ws-muted);
  border-radius: var(--ws-radius-pill);
  text-decoration: none;
}
.ws-tag-pill:hover { background: var(--ws-wheat); color: var(--ws-ink); }

/* ============== FILTER CHIPS (used on list page) ============== */
.ws-filter-chip {
  font-family: var(--ws-sans);
  font-size: var(--ws-ui-sm);
  padding: 3px 9px;
  border: 1px solid var(--ws-line-dotted);
  color: var(--ws-muted);
  cursor: pointer;
  text-decoration: none;
  background: transparent;
}
.ws-filter-chip:hover { color: var(--ws-ink); border-color: var(--ws-ink); }
.ws-filter-chip.is-active {
  background: var(--ws-ink);
  color: var(--ws-cream);
  border-color: var(--ws-ink);
}

/* ============== FIELDS ============== */
.ws-field { margin-bottom: 1rem; }
.ws-field__label {
  display: block;
  font-family: var(--ws-sans);
  font-size: var(--ws-label-cap);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ws-terracotta);
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}
.ws-field__input,
.ws-field__select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ws-ink);
  border-radius: 0;
  padding: 0.4rem 0;
  font-family: var(--ws-serif-body);
  font-size: var(--ws-body);
  color: var(--ws-ink);
  width: 100%;
  outline: none;
}
.ws-field__input::placeholder { color: var(--ws-faint); font-style: italic; }
.ws-field__input:focus,
.ws-field__select:focus { border-bottom-color: var(--ws-terracotta); }
.ws-field__input:focus-visible,
.ws-field__select:focus-visible {
  outline: 2px solid var(--ws-terracotta);
  outline-offset: 2px;
}
.ws-field__textarea {
  background: var(--ws-cream);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-card);
  padding: 0.65rem 0.85rem;
  font-family: var(--ws-serif-body);
  font-size: 0.95rem;
  color: var(--ws-ink);
  width: 100%;
  min-height: 80px;
  outline: none;
}
.ws-field__textarea:focus { border-color: var(--ws-terracotta); }
.ws-field__textarea:focus-visible {
  outline: 2px solid var(--ws-terracotta);
  outline-offset: 2px;
}
.ws-field__error {
  font-family: var(--ws-sans);
  font-size: var(--ws-ui-sm);
  color: #c44d3a;
  margin: 0.25rem 0 0 0;
}
.ws-field__help {
  font-family: var(--ws-serif-body);
  font-size: var(--ws-body-sm);
  color: var(--ws-muted);
  margin: 0.35rem 0 0 0;
}

/* ============== NAVBAR ============== */
.ws-navbar {
  display: flex;
  align-items: center;
  background: var(--ws-cream);
  border-bottom: 1px solid var(--ws-line);
  padding: 0.85rem 1.25rem;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.ws-navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--ws-serif-display);
  font-size: 1.05rem;
  color: var(--ws-ink);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ws-navbar__brand:hover { color: var(--ws-terracotta); }
.ws-navbar__brand-mark { color: var(--ws-terracotta); flex-shrink: 0; }
.ws-navbar__links {
  display: flex;
  gap: 1.25rem;
  flex: 1;
  font-family: var(--ws-sans);
  font-size: var(--ws-ui);
  align-items: center;
}
.ws-navbar__link {
  color: var(--ws-ink);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
}
.ws-navbar__link:hover { color: var(--ws-terracotta); }
.ws-navbar__link.is-active { color: var(--ws-terracotta); }
.ws-navbar__link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  border-bottom: 1px solid var(--ws-terracotta);
}
.ws-navbar__search {
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--ws-ink);
  border-radius: 0;
  padding: 0.25rem 0.5rem 0.25rem 0;
  font-family: var(--ws-serif-body);
  font-size: 0.9rem;
  color: var(--ws-ink);
  font-style: italic;
  min-width: 180px;
  outline: none;
}
.ws-navbar__search::placeholder { color: var(--ws-faint); font-style: italic; }
.ws-navbar__search:focus { border-bottom-color: var(--ws-terracotta); }
.ws-navbar__search:focus-visible {
  outline: 2px solid var(--ws-terracotta);
  outline-offset: 2px;
}
.ws-navbar__icons {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.ws-navbar__icon {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ws-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  font-size: 1rem;
}
.ws-navbar__icon:hover { color: var(--ws-terracotta); }
.ws-navbar__toggler {
  display: none;
  background: transparent; border: none; color: var(--ws-ink);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}
@media (max-width: 768px) {
  .ws-navbar__toggler { display: inline-flex; }
  .ws-navbar__links,
  .ws-navbar__search,
  .ws-navbar__icons { display: none; flex-basis: 100%; }
  .ws-navbar.is-open .ws-navbar__links,
  .ws-navbar.is-open .ws-navbar__search,
  .ws-navbar.is-open .ws-navbar__icons { display: flex; }
  .ws-navbar.is-open .ws-navbar__links { flex-direction: column; gap: 0.5rem; }
  .ws-navbar.is-open .ws-navbar__search { width: 100%; }
}

/* ============== LIST ROW ============== */
.ws-list { background: var(--bs-body-bg); }
.ws-list-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ws-line);
  gap: 1rem;
  background: transparent;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.ws-list-row:hover { background: var(--ws-cream); }
[data-bs-theme="dark"] .ws-list-row:hover { background: var(--ws-wheat); }
.ws-list-row__thumb {
  width: 80px; height: 64px;
  background-color: var(--ws-wheat-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ws-list-row__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ws-list-row__thumb svg { color: var(--ws-terracotta); }
.ws-list-row__body { min-width: 0; }
.ws-list-row__title {
  font-family: var(--ws-serif-display);
  font-size: 1.1rem;
  line-height: 1.2;
  margin: 0 0 0.35rem 0;
  color: var(--ws-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-list-row__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ws-list-row__source {
  display: flex; align-items: center; gap: 0.35rem;
  font-family: var(--ws-sans); font-size: var(--ws-ui-sm);
  color: var(--ws-muted);
}
.ws-list-row__source img { width: 16px; height: auto; }
.favicon_container { margin-right: 0.5rem; }
.favicon_container img { max-height: 20px; width: auto; }
.ws-list-row__actions { display: flex; gap: 0.5rem; opacity: 0.5; position: relative; z-index: 2; }
.ws-list-row:hover .ws-list-row__actions { opacity: 1; }
@media (hover: none) { .ws-list-row__actions { opacity: 1; } }
.ws-list-row__actions a { color: var(--ws-muted); cursor: pointer; text-decoration: none; }
.ws-list-row__actions a:hover { color: var(--ws-ink); }
.ws-list-row__actions a.is-danger:hover { color: #c44d3a; }
.ws-list-row__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-indent: -9999em;
  font-size: 0;
  outline: none;
  text-decoration: none;
}
.ws-list-row__overlay:focus-visible {
  outline: 2px solid var(--ws-terracotta);
  outline-offset: -2px;
}
@media (max-width: 768px) {
  .ws-list-row { grid-template-columns: 60px 1fr auto; }
  .ws-list-row__thumb { width: 60px; }
  .ws-list-row__source,
  .ws-list-row .ws-chip { display: none; }
}

/* ============== RECIPE CARD (grid) ============== */
.ws-rcard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 800px) { .ws-rcard-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .ws-rcard-grid { grid-template-columns: 1fr; } }
.ws-rcard {
  background: var(--bs-body-bg);
  border: 1px solid var(--ws-line);
  border-radius: var(--ws-radius-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ws-rcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(40, 24, 16, 0.07);
  color: inherit;
}
.ws-rcard__img {
  height: 140px;
  background-color: var(--ws-wheat-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ws-rcard__img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ws-rcard__img--small { height: 90px; }
.ws-rcard__img svg { color: var(--ws-terracotta); }
.ws-rcard__body { padding: 0.85rem 1rem 1rem 1rem; }
.ws-rcard__title {
  font-family: var(--ws-serif-display);
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  color: var(--ws-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-rcard__meta {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  font-family: var(--ws-sans); font-size: var(--ws-label-cap);
  color: var(--ws-muted);
}
.ws-rcard__meta .dot { color: var(--ws-line-dotted); }

/* ============== TABS ============== */
.ws-tabs {
  display: flex;
  border-bottom: 1px solid var(--ws-line-dotted);
  padding: 0 0.5rem;
  background: var(--ws-cream);
  list-style: none;
  margin: 0;
}
[data-bs-theme="dark"] .ws-tabs { background: var(--ws-wheat); }
.ws-tabs__item { display: inline-block; }
.ws-tabs__link {
  display: inline-block;
  padding: 0.65rem 1rem;
  font-family: var(--ws-serif-display);
  font-size: 0.95rem;
  color: var(--ws-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  cursor: pointer;
}
.ws-tabs__link:hover { color: var(--ws-ink); }
.ws-tabs__link.is-active {
  color: var(--ws-ink);
  border-bottom-color: var(--ws-terracotta);
  font-weight: 600;
}

/* ============== MODAL ============== */
.ws-modal {
  background: var(--bs-body-bg);
  border-radius: 6px;
  border: 1px solid var(--ws-line);
  box-shadow: 0 20px 60px rgba(40, 24, 16, 0.15);
}
.ws-modal__header {
  padding: 1.25rem 1.5rem 0.85rem 1.5rem;
  border-bottom: 1px solid var(--ws-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ws-modal__title {
  font-family: var(--ws-serif-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--ws-ink);
  font-weight: 400;
}
.ws-modal__close {
  background: none; border: none;
  color: var(--ws-muted); cursor: pointer; font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
}
.ws-modal__close:hover { color: var(--ws-ink); }
.ws-modal__body { padding: 1.25rem 1.5rem; }
.ws-modal__footer {
  padding: 1rem 1.5rem 1.25rem 1.5rem;
  border-top: 1px solid var(--ws-line);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* ============== EMPTY STATE ============== */
.ws-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bs-body-bg);
  border: 1px dashed var(--ws-line-dotted);
  border-radius: var(--ws-radius-card);
}
.ws-empty__glyph { color: var(--ws-line-dotted); margin-bottom: 0.85rem; }
.ws-empty__title {
  font-family: var(--ws-serif-display);
  font-size: 1.25rem;
  color: var(--ws-ink);
  margin: 0 0 0.35rem 0;
}
.ws-empty__body {
  font-family: var(--ws-serif-body);
  font-size: 0.9rem;
  color: var(--ws-muted);
  margin: 0 0 1.25rem 0;
}

/* ============== PAGINATION ============== */
.ws-pag {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 1rem;
  font-family: var(--ws-sans); font-size: var(--ws-ui);
  color: var(--ws-muted);
  list-style: none;
  margin: 0;
}
.ws-pag__btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ws-muted);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  background: transparent;
}
.ws-pag__btn:hover { color: var(--ws-terracotta); border-color: var(--ws-terracotta); }
.ws-pag__btn.is-disabled { opacity: 0.3; pointer-events: none; }
.ws-pag__pos {
  padding: 0 0.85rem;
  color: var(--ws-ink);
  font-family: var(--ws-serif-display);
}

/* ============== AUTH CARD (login / signup) ============== */
.ws-auth-shell {
  display: flex; justify-content: center;
  padding: 2.5rem 1.5rem;
}
.ws-auth-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--ws-line);
  border-radius: 6px;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
}
.ws-auth-card__mark { text-align: center; color: var(--ws-terracotta); margin-bottom: 0.65rem; }
.ws-auth-card__title {
  font-family: var(--ws-serif-display);
  font-size: 1.55rem;
  text-align: center;
  margin: 0 0 1.5rem 0;
  color: var(--ws-ink);
  font-weight: 400;
}
.ws-auth-card__divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.25rem 0 1rem 0;
  color: var(--ws-line-dotted);
  font-family: var(--ws-sans);
  font-size: var(--ws-label-cap);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ws-auth-card__divider::before,
.ws-auth-card__divider::after {
  content: ''; flex: 1;
  border-top: 1px solid var(--ws-line);
}
.ws-auth-card__google {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%;
  padding: 0.55rem;
  background: transparent;
  border: 1px solid var(--ws-line-dotted);
  color: var(--ws-ink);
  font-family: var(--ws-sans);
  font-size: var(--ws-ui);
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
}
.ws-auth-card__google:hover { border-color: var(--ws-ink); }
.ws-auth-card__foot {
  text-align: center;
  font-family: var(--ws-serif-body);
  font-size: var(--ws-body-sm);
  color: var(--ws-muted);
  margin: 1rem 0 0 0;
}
.ws-auth-card__foot a { color: var(--ws-terracotta); text-decoration: underline; }

/* ============== INGREDIENT LIST (A+C combo: dotted dividers + checkable) ============== */
.ws-ing-list { list-style: none; padding: 0; margin: 0; }
.ws-ing-list__item {
  font-family: var(--ws-serif-body);
  font-size: 0.95rem;
  color: var(--ws-ink);
  line-height: 1.5;
  padding: 0.55rem 0;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border-bottom: 1px dotted var(--ws-line-dotted);
  cursor: pointer;
}
.ws-ing-list__item:last-child { border-bottom: none; }
.ws-ing-list__check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--ws-terracotta);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--ws-cream);
  position: relative;
}
.ws-ing-list__item.is-done .ws-ing-list__check {
  background: var(--ws-terracotta);
}
.ws-ing-list__item.is-done .ws-ing-list__check::after {
  content: '\2713';
  color: #FAF6F0;
  position: absolute;
  top: -2px; left: 3px;
  font-size: 0.85rem;
  font-family: var(--ws-sans);
}
.ws-ing-list__item.is-done .ws-ing-list__text {
  color: var(--ws-faint);
  text-decoration: line-through;
}
/* Let the text wrapper grow to fill the row so inline-block percentage widths
 * inside (used by the formset-entered ingredients) can compute correctly. */
.ws-ing-list__text { flex: 1 1 auto; min-width: 0; }
