/* ==========================================================================
   OneTapRecipes — main.css
   Design: Warm & Organic · Mobile-first
   All classes prefixed with otr- to avoid TinySalt conflicts.
   ========================================================================== */

/* ── 0. CSS Custom Properties ── */

:root {
  --otr-bg: #F5F0E8;
  --otr-surface: #FFFFFF;
  --otr-surface2: #F0ECE5;
  --otr-text: #2D2A26;
  --otr-text2: #6A645C;
  --otr-text3: #7A756E;
  --otr-accent: #C67B5C;
  --otr-accent2: #747B2D;
  --otr-gold: #DEB538;
  --otr-border: #EDE9E1;
  --otr-shadow: rgba(45, 42, 38, 0.06);
  --otr-radius: 16px;
  --otr-font-heading: 'Gloock', Georgia, serif;
  --otr-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
/* BUG-011 fix: prevent horizontal scroll from any element */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}


/* ── 1. Reset / Base ── */

.otr-page *,
.otr-page *::before,
.otr-page *::after {
  box-sizing: border-box;
}

.otr-page {
  background: var(--otr-bg);
  font-family: var(--otr-font-body);
  color: var(--otr-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── 2. Header ── */

.otr-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--otr-bg);
  padding: 12px 16px 0;
}

.otr-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.otr-header__logo {
  font-family: var(--otr-font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--otr-text);
  text-decoration: none;
  letter-spacing: -0.3px;
  transition: color 0.2s ease;
}

.otr-header__logo:hover {
  color: var(--otr-accent);
}

.otr-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.otr-header__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 20px;
  color: var(--otr-text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.otr-header__btn:hover {
  background: var(--otr-surface2);
}

.otr-header__btn:active {
  transform: scale(0.92);
}

.otr-header__tagline {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--otr-text3);
  text-align: center;
  margin: 4px 0 8px;
  font-weight: 500;
}

/* ── 4. Cards ── */

.otr-card {
  background: var(--otr-surface);
  border-radius: var(--otr-radius);
  box-shadow: 0 2px 8px var(--otr-shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.otr-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(45, 42, 38, 0.1);
}

/* Recipe card (Browse section) */

.otr-recipe-card {
  display: block;
  background: var(--otr-surface);
  border-radius: var(--otr-radius);
  box-shadow: 0 2px 8px var(--otr-shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--otr-text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.otr-recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(45, 42, 38, 0.1);
}

.otr-recipe-card__img {
  width: 100%;
  height: 0;
  padding-bottom: 66%;
  background-size: cover;
  background-position: center;
  background-color: var(--otr-surface2);
}

.otr-recipe-card__img--placeholder {
  background-image: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.otr-recipe-card__body {
  padding: 12px 14px 14px;
}

.otr-recipe-card__title {
  font-family: var(--otr-font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--otr-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.otr-recipe-card__meta {
  font-size: 12px;
  color: var(--otr-text3);
  font-weight: 500;
}

/* Category card */

.otr-cat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--otr-surface);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--otr-text);
  box-shadow: 0 1px 4px var(--otr-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.otr-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.09);
  background: var(--otr-surface);
}

.otr-cat-card:active {
  transform: scale(0.98);
}

.otr-cat-card__emoji {
  font-size: 28px;
  flex-shrink: 0;
}

.otr-cat-card__info {
  flex: 1;
  min-width: 0;
}

.otr-cat-card__name {
  display: block;
  font-family: var(--otr-font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.otr-cat-card__count {
  display: block;
  font-size: 12px;
  color: var(--otr-text3);
  margin-top: 2px;
}

/* ── 5. Sections ── */

.otr-section {
  padding: 24px 16px;
}

.otr-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.otr-section__title {
  font-family: var(--otr-font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--otr-text);
  margin: 0 0 16px;
  line-height: 1.3;
}

.otr-section__header .otr-section__title {
  margin-bottom: 0;
}

.otr-section__see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--otr-accent);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.otr-section__see-all:hover {
  color: #b56a4c;
}

/* ── 6. Tags / Filter Chips ── */

.otr-tag,
.otr-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--otr-border);
  background: var(--otr-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--otr-text2);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.otr-tag:hover,
.otr-filter-chip:hover {
  border-color: var(--otr-accent);
  color: var(--otr-accent);
  background: rgba(198, 123, 92, 0.06);
}

.otr-tag:active,
.otr-filter-chip:active {
  transform: scale(0.96);
  background: var(--otr-accent);
  color: #FFFFFF;
  border-color: var(--otr-accent);
}

.otr-tag.is-active,
.otr-filter-chip.is-active {
  background: var(--otr-accent);
  color: #FFFFFF;
  border-color: var(--otr-accent);
}

/* Filter chips container */

.otr-filters__wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── 7. Grids ── */

/* Categories grid */

.otr-categories__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Browse grid */

.otr-browse__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── 8. Horizontal Scroll ── */

/* Tonight's scroll */

.otr-tonight__scroll {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.otr-tonight__scroll::-webkit-scrollbar {
  display: none;
}

.otr-tonight__scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.otr-tonight__scroll > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

.otr-tonight__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 40px 0;
  color: var(--otr-text3);
  font-size: 14px;
}

/* Tonight's pick card */

.otr-tonight-card {
  display: block;
  width: 220px;
  background: var(--otr-surface);
  border-radius: var(--otr-radius);
  box-shadow: 0 2px 8px var(--otr-shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--otr-text);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.otr-tonight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(45, 42, 38, 0.1);
}

.otr-tonight-card__img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: var(--otr-surface2);
}

.otr-tonight-card__body {
  padding: 12px 14px 14px;
}

.otr-tonight-card__title {
  font-family: var(--otr-font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.otr-tonight-card__meta {
  font-size: 12px;
  color: var(--otr-text3);
}

/* ── 9. Search ── */

.otr-search {
  padding: 16px 16px 0;
}

.otr-search__form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--otr-surface);
  border: 1.5px solid var(--otr-border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.otr-search__form:focus-within {
  border-color: var(--otr-accent);
  box-shadow: 0 0 0 3px rgba(198, 123, 92, 0.12);
}

.otr-search__icon {
  font-size: 16px;
  flex-shrink: 0;
}

.otr-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--otr-font-body);
  font-size: 15px;
  color: var(--otr-text);
}

.otr-search__input::placeholder {
  color: var(--otr-text3);
}

/* ── 10. Recipe Index Button ── */

.otr-index-btn-section {
  text-align: center;
  padding-top: 8px;
  padding-bottom: 8px;
}

.otr-index-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  padding: 14px 24px;
  background: var(--otr-surface);
  border: 1.5px solid var(--otr-border);
  border-radius: var(--otr-radius);
  font-family: var(--otr-font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--otr-text);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.otr-index-btn:hover {
  border-color: var(--otr-accent);
  box-shadow: 0 4px 12px var(--otr-shadow);
}

.otr-index-btn:active {
  transform: scale(0.98);
}

/* ── 12. Hamburger Menu (Drawer + Overlay) ── */

.otr-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.otr-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.otr-drawer {
  position: fixed;
  top: 0;
  right: -300px;
  z-index: 201;
  width: 280px;
  height: 100%;
  background: var(--otr-bg);
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.otr-drawer.is-open {
  right: 0;
}

.otr-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--otr-border);
}

.otr-drawer__title {
  font-family: var(--otr-font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--otr-text);
}

.otr-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 18px;
  color: var(--otr-text2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.otr-drawer__close:hover {
  background: var(--otr-surface2);
  color: var(--otr-text);
}

.otr-drawer__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.otr-drawer__list > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--otr-text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.otr-drawer__list > li > a:hover {
  background: var(--otr-surface2);
  color: var(--otr-accent);
}

/* Browse divider */

.otr-drawer__divider {
  padding: 16px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--otr-text3);
  border-top: 1px solid var(--otr-border);
  margin-top: 8px;
}

/* Expandable sections */

.otr-drawer__expandable {
  border-top: 1px solid var(--otr-border);
}

.otr-drawer__expandable:first-of-type {
  margin-top: 8px;
}

.otr-drawer__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-family: var(--otr-font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--otr-text2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.otr-drawer__toggle:hover {
  background: var(--otr-surface2);
  color: var(--otr-text);
}

.otr-drawer__arrow {
  font-size: 16px;
  font-weight: 400;
  transition: transform 0.25s ease;
}

.otr-drawer__toggle.is-expanded .otr-drawer__arrow {
  transform: rotate(90deg);
}

/* Submenu */

.otr-drawer__sub {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.otr-drawer__sub.is-expanded {
  max-height: 600px;
}

.otr-drawer__sub li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 10px 32px;
  font-size: 14px;
  color: var(--otr-text2);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.otr-drawer__sub li a:hover {
  background: var(--otr-surface2);
  color: var(--otr-accent);
}

.otr-drawer__count {
  font-size: 12px;
  color: var(--otr-text3);
  font-weight: 400;
}

/* ── 13. Utilities ── */

.otr-hidden {
  display: none !important;
}

.otr-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── 14. Responsive — Desktop (1024px+) ── */

@media (min-width: 1024px) {
  .otr-page {
    max-width: 1200px;
    margin: 0 auto;
  }

  .otr-header {
    border-radius: 0 0 var(--otr-radius) var(--otr-radius);
  }

  .otr-header__logo {
    font-size: 26px;
  }

  .otr-section {
    padding: 32px 24px;
  }

  .otr-section__title {
    font-size: 24px;
  }

  .otr-browse__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .otr-categories__grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .otr-tonight-card {
    width: 280px;
  }

  .otr-tonight-card__img {
    height: 180px;
  }

  .otr-recipe-card__title {
    font-size: 16px;
  }

  .otr-search {
    padding: 20px 24px 0;
  }

  .otr-search__form {
    max-width: 500px;
    margin: 0 auto;
  }

  .otr-drawer {
    width: 320px;
    right: -340px;
  }
}

/* ── 15. Responsive — Tablet (600px - 1023px) ── */

@media (min-width: 600px) and (max-width: 1023px) {
  .otr-categories__grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .otr-browse__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .otr-section {
    padding: 28px 20px;
  }
}

/* Fix long category names in drawer menu */
.otr-drawer__sub li a {
  white-space: normal;
  word-wrap: break-word;
}



/* ==========================================================================
   Static Pages (About, Terms, Privacy, etc.)
   ========================================================================== */
.otr-page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.otr-page-content__title {
  font-family: var(--otr-font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--otr-text);
  margin: 0 0 28px;
  line-height: 1.2;
}

.otr-page-content__body h2 {
  font-family: var(--otr-font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--otr-text);
  margin: 32px 0 12px;
  line-height: 1.3;
}

.otr-page-content__body p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--otr-text2);
  margin: 0 0 16px;
}

.otr-page-content__body a {
  color: var(--otr-accent);
  text-decoration: underline;
}

.otr-page-content__body a:hover {
  color: #b56a4c;
}

@media (min-width: 768px) {
  .otr-page-content {
    padding: 48px 32px 64px;
  }
  .otr-page-content__title {
    font-size: 38px;
    margin-bottom: 36px;
  }
}

/* ── Focus-visible accessibility ── */

.otr-recipe-card:focus-visible,
.otr-cat-card:focus-visible,
.otr-tonight-card:focus-visible,
.otr-filter-chip:focus-visible,
.otr-index-btn:focus-visible,
.otr-header__btn:focus-visible,
.otr-drawer__close:focus-visible,
.otr-drawer__toggle:focus-visible {
  outline: 2px solid var(--otr-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Footer A — Warm & Clean
   ========================================================================== */
.otr-footer-main {
  background: #2C2420;
  color: #F5F0E8;
  font-family: 'Inter', system-ui, sans-serif;
  margin-top: 48px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
.otr-footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 36px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 40px;
}
.otr-footer-brand {
  font-family: 'Gloock', Georgia, serif;
  font-size: 22px;
  color: #FFFFFF;
  margin-bottom: 4px;
}
.otr-footer-tagline {
  font-size: 13px;
  color: #C67B5C;
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.otr-footer-desc {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(245,240,232,0.6);
  margin: 0;
}
.otr-footer-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(245,240,232,0.4);
  margin-bottom: 16px;
}
.otr-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.otr-footer-links li {
  margin-bottom: 10px;
}
.otr-footer-links a {
  color: rgba(245,240,232,0.75);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.otr-footer-links a:hover {
  color: #C67B5C;
}
.otr-footer-social {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.otr-social-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(245,240,232,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}
.otr-social-icon:hover {
  background: #C67B5C;
  transform: translateY(-2px);
}
.otr-social-icon svg {
  width: 16px;
  height: 16px;
  fill: rgba(245,240,232,0.75);
  transition: fill 0.2s;
}
.otr-social-icon:hover svg {
  fill: #FFFFFF;
}
.otr-footer-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 0;
}
.otr-footer-legal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.otr-footer-copy {
  font-size: 12px;
  color: rgba(245,240,232,0.35);
}
.otr-footer-legal-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.otr-footer-legal-links a {
  font-size: 12px;
  color: rgba(245,240,232,0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.otr-footer-legal-links a:hover {
  color: #d4967d;
}
.otr-footer-dot {
  color: rgba(245,240,232,0.2);
  font-size: 10px;
}
@media (max-width: 768px) {
  .otr-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 24px 28px;
  }
  .otr-footer-legal {
    flex-direction: column;
    text-align: center;
    padding: 16px 24px 20px;
    gap: 8px;
  }
  .otr-footer-legal-links {
    justify-content: center;
  }
}


/* BUG-009 fix: prevent huge empty space on taxonomy/category pages with few recipes */
body.tax .otr-page,
body.category .otr-page,
body.page .otr-page {
  min-height: auto;
}