/* MyTopLists — styled after gufmad.dk (same tokens, type and components). */
:root {
  --ink: #1d1712;
  --muted: #6d6258;
  --paper: #fffaf4;
  --surface: #ffffff;
  --surface-2: #f6eee5;
  --line: #eadfd4;
  --accent: #c84c13;
  --accent-dark: #92350b;
  --mustard: #f0b429;
  --green: #405f3b;
  --shadow: 0 18px 45px rgba(62, 35, 18, .11);
  --radius: 22px;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(240,180,41,.12), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.ico { width: 1em; height: 1em; flex-shrink: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(234,223,212,.9);
  background: rgba(255,250,244,.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nav-shell {
  max-width: var(--content); margin: 0 auto; min-height: 76px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  position: relative;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; font-weight: 850; letter-spacing: -.03em; font-size: 1.18rem;
}
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  color: white; background: linear-gradient(145deg, var(--accent), #ef7a20);
  box-shadow: 0 8px 18px rgba(200,76,19,.28); font-size: 1.35rem;
}
.primary-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  text-decoration: none; padding: 9px 12px; border-radius: 999px;
  color: var(--muted); font-weight: 700; font-size: .92rem; white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--accent-dark); background: #fff0e4; }
.menu-check { position: absolute; opacity: 0; pointer-events: none; }
.menu-toggle { display: none; cursor: pointer; padding: 8px; font-size: 1.6rem; line-height: 0; }
.menu-close { display: none; }

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 12px; color: var(--accent); text-transform: uppercase;
  letter-spacing: .14em; font-size: .76rem; font-weight: 850;
}
h1, h2, h3 { line-height: 1.08; letter-spacing: -.035em; }
h1 { margin: 0; font-size: clamp(3rem, 7vw, 5.6rem); max-width: 12ch; }
h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); }
h3 { margin: 0; font-size: 1.28rem; }
p { margin: 0 0 1em; }

/* ---------- Home hero ---------- */
.hero {
  max-width: var(--content); margin: 0 auto; padding: 82px 24px 72px;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 72px;
}
.hero-lead { margin: 24px 0 30px; max-width: 62ch; color: var(--muted); font-size: 1.15rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 20px; border-radius: 14px; text-decoration: none; font-weight: 800;
}
.button.primary { color: white; background: var(--accent); box-shadow: 0 12px 22px rgba(200,76,19,.22); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { background: var(--surface); border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--accent); color: var(--accent-dark); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 34px; }
.hero-stats div { display: grid; }
.hero-stats strong { font-size: 1.5rem; line-height: 1.3; }
.hero-stats span { color: var(--muted); font-size: .82rem; }
.hero-stats.light span { color: rgba(255,255,255,.65); }
.hero-media { position: relative; }
.hero-media::before {
  content: ""; position: absolute; inset: 8% -5% -4% 8%; border-radius: 38px;
  background: linear-gradient(145deg, #f4c05b, #e76c25); transform: rotate(3deg); opacity: .34;
}
.cover-frame {
  position: relative; overflow: hidden; border-radius: 28px; background: white; padding: 12px;
  box-shadow: var(--shadow); transform: rotate(-1.2deg);
}
.cover-media { aspect-ratio: 4 / 3.3; border-radius: 18px; }
.cover-caption { display: grid; gap: 4px; padding: 16px 10px 6px; }
.cover-caption .eyebrow { margin: 0; }
.cover-caption strong { font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.25; }

/* ---------- Image boxes (placeholder letter shows if an image is missing or broken) ---------- */
.item-media, .list-media, .cover-media, .best-media {
  position: relative; overflow: hidden;
  background: linear-gradient(145deg, #f4c05b, #e76c25);
}
.item-media .ph, .list-media .ph, .cover-media .ph, .best-media .ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.9); font-weight: 900; font-size: 3rem; letter-spacing: -.04em;
}
.item-media img, .list-media img, .cover-media img, .best-media img {
  position: relative; width: 100%; height: 100%; object-fit: cover; color: transparent;
}
/* Pseudo-elements on <img> only render when the image fails to load:
   cover the browser's broken-image icon with the placeholder instead. No JavaScript needed. */
.item-media img::before, .list-media img::before, .cover-media img::before, .best-media img::before {
  content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, #f4c05b, #e76c25);
}
.item-media img::after, .list-media img::after, .cover-media img::after, .best-media img::after {
  content: attr(data-initial); position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.9); font-weight: 900; font-size: 3rem; letter-spacing: -.04em;
}
.best-media img::after { font-size: 2rem; }

/* ---------- Sections ---------- */
.section-shell { max-width: var(--content); margin: 0 auto; padding: 72px 24px; }
.section-shell + .section-shell { padding-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.section-heading > p { max-width: 46ch; color: var(--muted); margin: 0; }
.text-link { color: var(--accent-dark); font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.category-tag {
  display: inline-flex; align-self: flex-start; border-radius: 999px; padding: 6px 10px;
  background: #fff0e4; color: var(--accent-dark); font-size: .72rem; font-weight: 850;
  text-transform: uppercase; letter-spacing: .05em;
}

/* ---------- Home: list cards ---------- */
.list-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.list-card {
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(62,35,18,.06); transition: .2s ease;
}
.list-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.list-media { aspect-ratio: 16 / 10; }
.list-card:hover .list-media img { transform: scale(1.04); }
.list-media img { transition: transform .5s ease; }
.list-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.list-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.num { color: var(--accent); font-weight: 900; }
.list-card h3 { margin: 18px 0 10px; font-size: 1.55rem; }
.list-card p { color: var(--muted); }
.leader { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; color: var(--ink) !important; }
.leader .ico { color: var(--mustard); margin-top: 4px; }
.list-card-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: .88rem;
}

/* ---------- Home: highest rated ---------- */
.best-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.best-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center;
  padding: 12px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 20px rgba(62,35,18,.045); transition: .2s ease;
}
.best-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.best-media { width: 92px; height: 92px; border-radius: 14px; }
.best-media .ph { font-size: 2rem; }
.best-list { color: var(--accent); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.best-card h3 { font-size: 1.02rem; line-height: 1.25; margin: 4px 0 6px; letter-spacing: -.02em; }

/* ---------- List page hero ---------- */
.page-hero { background: linear-gradient(135deg, #261c15, #5c2a16); color: white; }
.page-hero-inner { max-width: var(--content); margin: 0 auto; padding: 56px 24px 64px; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); max-width: 16ch; }
.page-hero p:not(.eyebrow) { max-width: 68ch; color: rgba(255,255,255,.76); font-size: 1.08rem; margin-top: 18px; }
.page-hero .eyebrow { color: #ff9a5c; }
.back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 36px;
  color: rgba(255,255,255,.7); text-decoration: none; font-weight: 700; font-size: .9rem;
}
.back:hover { color: white; }

/* ---------- Filters (CSS only) ---------- */
.filter-radio { position: absolute; opacity: 0; pointer-events: none; }
.toolbar { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 40px; }
.toolbar-label { margin: 9px 0 0; color: var(--muted); font-weight: 750; font-size: .9rem; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: white;
  color: var(--muted); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 750; font-size: .9rem;
  user-select: none; transition: .15s ease;
}
.pill .ico { color: var(--tag-ic, currentColor); }
.pill span { opacity: .65; font-weight: 600; }
.pill:hover { border-color: var(--accent); color: var(--accent-dark); }
.filter-radio:focus-visible + * { outline: none; }

/* ---------- Items ---------- */
.rank-section + .rank-section { margin-top: 64px; }
.item-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.item {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 8px 20px rgba(62,35,18,.045); transition: .2s ease;
}
.item:hover { box-shadow: var(--shadow); }
.item:target { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200,76,19,.15), var(--shadow); }
.item-media { aspect-ratio: 16 / 10; }
.rank {
  position: absolute; top: 12px; left: 12px; padding: 5px 11px; border-radius: 999px;
  background: rgba(29,23,18,.82); color: white; font-weight: 850; font-size: .85rem;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.item-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 9px;
  background: color-mix(in srgb, var(--tag-ic) 12%, white); color: var(--tag-fg);
  font-size: .72rem; font-weight: 800; line-height: 1.3;
}
.tag .ico { color: var(--tag-ic); }
.item h3 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -.02em; }
.desc { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: 8px 0 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.when { display: inline-flex; align-items: center; gap: 6px; }
.rating { display: inline-flex; align-items: center; gap: 8px; }
.rating b { color: var(--ink); font-size: .9rem; }
.stars { position: relative; display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 1px; white-space: nowrap; font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; }
.stars-bg { color: #e3d6c9; }
.stars-fg { position: absolute; top: 0; left: 0; overflow: hidden; color: var(--mustard); }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 6px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip .ico { color: var(--accent); }
.chip:hover { border-color: var(--accent); background: #fff0e4; color: var(--accent-dark); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 50px; border-top: 1px solid var(--line); background: #211914; color: white; }
.footer-inner {
  max-width: var(--content); margin: 0 auto; padding: 38px 24px;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
}
.footer-inner p { margin: 5px 0 0; color: rgba(255,255,255,.65); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .primary-nav .nav-link { padding: 8px 9px; font-size: .86rem; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 36px; }
  .list-grid, .item-grid, .best-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle { display: block; }
  .primary-nav {
    display: none; position: absolute; left: 16px; right: 16px; top: 72px; flex-direction: column;
    padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .menu-check:checked ~ .primary-nav { display: flex; }
  .menu-check:checked + .menu-toggle .menu-open { display: none; }
  .menu-check:checked + .menu-toggle .menu-close { display: block; }
  .primary-nav .nav-link { width: 100%; padding: 10px 13px; font-size: .95rem; }
}
@media (max-width: 760px) {
  .nav-shell { min-height: 68px; }
  .primary-nav { top: 66px; }
  .hero { grid-template-columns: 1fr; padding-top: 52px; }
  .hero-media { max-width: 520px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 14px; }
  .list-grid, .item-grid, .best-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; gap: 8px; }
  .toolbar-label { margin: 0; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .hero, .section-shell, .page-hero-inner { padding-left: 18px; padding-right: 18px; }
  .hero { padding-top: 38px; }
  h1 { font-size: 3rem; }
  .hero-stats { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Food-themed high-resolution brand mark and adjacent Gufmad shortcut */
.brand { flex-shrink: 0; gap: 8px; }
.brand-mark { overflow: hidden; padding: 0; background: transparent; box-shadow: none; }
.brand-mark img { display: block; width: 42px; height: 42px; object-fit: contain; }
.gufmad-shortcut { display: inline-flex; flex-shrink: 0; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 13px; overflow: hidden; text-decoration: none; }
.gufmad-shortcut img { display: block; width: 42px; height: 42px; object-fit: contain; }
.gufmad-shortcut:hover { transform: translateY(-2px); }
