/* ──────────────────────────────────────────
   Beimbatti — Main CSS  (flat light magazine)
   ────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400;1,600&display=swap');

/* ── Design tokens ──────────────────────── */
:root {
  --bg:        #ffffff;
  --panel:     #ffffff;
  --panel-2:   #f8f6f3;
  --text:      #1a1208;
  --muted:     #8a7a68;
  --border:    #e8e2d9;
  --brand:     #EFB11D;
  --brand-dark:#c9920a;
  --brand-light:#fef7e0;
  --gold:      #EFB11D;
  --shadow:    none;
  --shadow-sm: none;
  --r:         10px;
  --r-sm:      6px;
  --max:       1220px;
  --nav-h:     72px;
  --font-head: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
}


/* ── Reset & base ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
body > main, body > section.hero ~ main { flex: 1; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  line-height: 1.2;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
textarea { resize: vertical; }

.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Layout ────────────────────────────── */
.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
  white-space: nowrap;
  border-radius: var(--r-sm);
}
.btn:hover { background: var(--panel-2); border-color: var(--text); }

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn--outline {
  background: transparent;
  border: 1px solid currentColor;
}
.btn--outline:hover { background: var(--panel-2); }

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--panel-2); border-color: var(--border); }

.btn--icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn--sm { padding: 7px 16px; font-size: 11px; }
.btn--full { width: 100%; }

/* ── Nav ───────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--bg);
  /*border-bottom: 1px solid var(--border);*/
}
.nav__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo {
  width: 38px; height: 38px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700; font-size: 19px; flex-shrink: 0;
  border-radius: var(--r-sm);
}
.brand__name {
  font-family: var(--font-head);
  font-size: 21px; font-weight: 700;
  letter-spacing: -.2px; color: var(--text);
}
.brand__name span { color: var(--brand); }
.brand__svg { height: 42px; width: auto; display: block; }

.nav__links { display: flex; align-items: stretch; height: var(--nav-h); }
.nav__links a {
  display: flex; align-items: center;
  padding: 0 16px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav__links a:hover,
.nav__links a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

.nav__right { display: flex; align-items: center; gap: 8px; }
.nav__user { font-size: 13px; color: var(--muted); font-weight: 700; }
.nav__hamburger { display: none; }

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__hamburger { display: inline-flex; }
  .nav__right > *:not(.nav__hamburger) { display: none; }
}

/* ── Mobile sheet ───────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.4); display: none; }
.sheet[aria-hidden="false"] { display: block; }
.sheet__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(300px, 85vw);
  background: var(--bg); border-left: 1px solid var(--border);
  padding: 20px;
  display: flex; flex-direction: column;
}
.sheet__top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 16px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sheet__top strong { font-family: var(--font-head); font-size: 18px; }
.sheet__panel a {
  display: block; padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--muted); font-weight: 700;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.sheet__panel a:hover { color: var(--brand); }

/* ── Hero ───────────────────────────────── */
.hero {
  padding: 24px 0 40px;
}
.hero__inner {
  background: url('/header.png') center center / cover no-repeat;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  min-height: 380px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: flex-end;
  padding: 48px 56px;
}
.hero__inner::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,.40) 0%, rgba(0,0,0,.20) 50%, transparent 100%),
    linear-gradient(to top,   rgba(0,0,0,.25) 0%, rgba(0,0,0,.10) 55%, transparent 100%);
  border-radius: 20px;
  pointer-events: none;
}
.hero__text { position: relative; z-index: 1; }
@media (max-width: 980px) {
  .hero__inner { padding: 32px 28px; min-height: 300px; }
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 16px;
}
.hero__eyebrow::before, .hero__eyebrow::after {
  content: ''; display: inline-block;
  width: 24px; height: 1px; background: var(--brand);
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 700;
  line-height: 1.06;
  color: #ffffff;
}
.hero h1 em { color: var(--brand); font-style: normal; }
.hero__lead { margin: 0 0 28px; color: rgba(255,255,255,.80); font-size: 16px; font-weight: 300; max-width: 52ch; }
.hero p { color: rgba(255,255,255,1); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Search card inside hero */
.hero__search {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 28px;
}
.hero__search h3 {
  margin: 0 0 16px;
  font-family: var(--font-head); font-size: 20px; color: var(--text);
}

.searchbar { display: flex; }
.searchbar__inner {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.searchbar__inner input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 7px 36px 7px 12px; font-size: 11px; min-width: 320px; width: 100%;
}
.searchbar__icon {
  position: absolute; right: 0; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  width: 36px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; padding: 0;
}
.searchbar__icon:hover { color: var(--brand); }
.searchbar--lg { margin-bottom: 18px; width: 100%; }
.searchbar--lg .searchbar__inner { width: 100%; }
.searchbar--lg .searchbar__inner input { padding: 11px 40px 11px 14px; font-size: 14px; min-width: 0; width: 100%; }
.searchbar--lg .searchbar__icon { width: 42px; }

.chips { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: all .14s;
  border-radius: 999px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip--active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ── Section header ─────────────────────── */
main { padding-bottom: 72px; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  padding: 44px 0 20px;
  margin-bottom: 28px;
}
.section-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.section-head h2 {
  margin: 0;
  font-family: var(--font-head); font-size: 30px; font-weight: 700;
}
.section-head .count { font-family: var(--font-body); font-size: 14px; color: var(--muted); font-weight: 400; }

/* legacy alias */
.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 36px 0 18px;
}
.section-title h2 { margin: 0; font-family: var(--font-head); font-size: 26px; }

.sort-bar { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.pill {
  padding: 7px 16px;
  border: 0; border-right: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  transition: all .14s; cursor: pointer;
}
.pill:last-child { border-right: 0; }
.pill:hover { background: var(--panel-2); color: var(--text); }
.pill--active { background: var(--brand); color: var(--bg); }

/* ── Mobile filter toggle ───────────────── */
.filter-toggle {
  display: none;
  width: 100%; padding: 11px 16px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 700;
  cursor: pointer; text-align: left;
  color: var(--text); margin-bottom: 4px;
}
.filter-toggle svg { float: right; transition: transform .2s; }
.filter-toggle.is-open svg { transform: rotate(180deg); }

/* ── Layout grid ────────────────────────── */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: 0; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

/* ── Filters ────────────────────────────── */
.filters {
  position: sticky; top: calc(var(--nav-h) + 16px);
  padding-right: 0;
}
@media (max-width: 980px) {
  .filters { position: static; border-right: 0; border-bottom: 1px solid var(--border); }
  .filter-toggle { display: block; }
  .filters__body { display: none; }
  .filters__body.is-open { display: block; }
  .filters__title { display: none; }
}

.filters__title {
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 900;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin: 0;
}
.filter-group { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.filter-group:last-of-type { border-bottom: 0; }
.filter-group__title {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 900;
  letter-spacing: .10em; text-transform: uppercase; color: var(--text);
}
.check {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 0;
  color: var(--muted); font-size: 14px; cursor: pointer;
  transition: color .12s;
}
.check:hover { color: var(--brand); }
.check input { accent-color: var(--brand); }
.filter-row { display: flex; gap: 0; padding: 16px 20px; border-top: 1px solid var(--border); }
.filter-row .btn { flex: 1; }
.filter-row .btn:first-child { border-right: 0; }

/* ── Small screen adjustments ──────────── */
@media (max-width: 600px) {
  .section-head { padding: 24px 0 16px; gap: 10px; }
  .section-head h2 { font-size: 22px; }
  .searchbar { width: 100%; }
  .searchbar__inner { width: 100%; }
  .searchbar__inner input { min-width: 0; width: 100%; }
  .sort-bar { width: 100%; }
  .pill { flex: 1; text-align: center; padding: 9px 8px; font-size: 10px; }
}

/* ── Recipe cards ───────────────────────── */
.cards-wrap { padding: 24px 0 0 28px; }
@media (max-width: 980px) { .cards-wrap { padding: 24px 0 0; } }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: var(--bg);
  border: none;
}
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--bg);
  display: flex; flex-direction: column;
  transition: background .15s, box-shadow .15s;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.card:hover { background: var(--panel-2); }

.card__media-link {
  position: relative; display: block;
  height: 200px; overflow: hidden;
}
.card__img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.card:hover .card__img { transform: scale(1.03); }
.card__img--placeholder {
  background: var(--panel-2); width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--border); font-size: 40px;
}

.card__heart-overlay {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(4px);
  border: 1px solid rgba(0,0,0,.08); border-radius: 20px;
  padding: 4px 9px; font-size: 13px; font-weight: 700;
  color: var(--brand); pointer-events: none;
}

.badge {
  position: absolute; left: 0; top: 14px;
  padding: 5px 12px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 900; letter-spacing: .10em; text-transform: uppercase;
}

.card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__category { font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.card__title { margin: 0; font-family: var(--font-head); font-size: 17px; line-height: 1.25; font-weight: 700; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--brand); }
.card__meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.hearts { color: var(--brand); font-weight: 700; }
.by { color: var(--muted); }
.card__time { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.card__divider { height: 1px; background: var(--border); }
.card__cta { margin-top: auto; }

.empty-state { padding: 60px 28px; color: var(--muted); }
.empty-state p { font-size: 16px; }

.muted { color: var(--muted); }
.accent { color: var(--brand); }

/* ── Pagination ─────────────────────────── */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 32px 0 8px; }
.pager__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .14s, border-color .14s;
}
.pager__btn:hover { background: var(--panel-2); border-color: var(--text); }
.pager__btn--active { background: var(--brand); border-color: var(--brand); color: #fff; pointer-events: none; }
.pager__btn--disabled { opacity: .35; pointer-events: none; }
.pager__dots { color: var(--muted); padding: 0 4px; }

/* ── Auth pages ─────────────────────────── */
.auth-page { padding-top: 64px; padding-bottom: 80px; display: flex; justify-content: center; }
.auth-card {
  width: min(460px, 100%);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 40px;
}
.auth-card__header { text-align: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-card__header h1 { margin: 0 0 6px; font-size: 30px; }
.auth-card__header p { margin: 0; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; font-weight: 900; letter-spacing: .10em; text-transform: uppercase; color: var(--muted);
}
.auth-form input {
  padding: 11px 14px;
  border: 1px solid var(--border); background: var(--panel-2);
  border-radius: var(--r-sm);
  color: var(--text); outline: none; font-size: 15px;
}
.auth-form input:focus { border-color: var(--brand); }
.auth-link { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.auth-link a { color: var(--brand); font-weight: 700; }

.alert { padding: 12px 14px; font-size: 14px; margin-bottom: 6px; }
.alert--error { background: var(--brand-light); border: 1px solid rgba(193,68,14,.25); color: var(--brand); }

/* ── Footer ─────────────────────────────── */
.footer {
  background: var(--panel-2);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.footer__top { padding: 40px 0 28px; }
.footer__inner {
  display: grid; grid-template-columns: 1.4fr 2fr; gap: 48px;
}
@media (max-width: 780px) { .footer__inner { grid-template-columns: 1fr; } }
.footer__brand p { margin: 14px 0 0; max-width: 36ch; line-height: 1.7; }
.footer__brand .brand__name { color: var(--text); }
.footer__brand .brand__logo { background: var(--brand); }

.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 500px) { .footer__cols { grid-template-columns: repeat(2, 1fr); } }
.footer__col h4 {
  margin: 0 0 14px;
  font-family: var(--font-body);
  font-size: 10px; font-weight: 900;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.footer__col a { display: block; padding: 5px 0; color: var(--muted); transition: color .14s; }
.footer__col a:hover { color: var(--brand); }

.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--muted);
}
.footer__bottom a { color: var(--brand); }
.footer__bottom a:hover { text-decoration: underline; }
