:root {
  --bg: #fff6ef;
  --paper: #fffaf6;
  --ink: #24251f;
  --muted: #746b61;
  --line: #ead9c8;
  --accent: #e86645;
  --accent-soft: #ffe7dc;
  --herb: #5f8a4b;
  --herb-soft: #edf5df;
  --sky: #547f92;
  --sky-soft: #e8f1f3;
  --shadow: 0 16px 36px rgba(97, 69, 44, .12);
  --overlay: rgba(37, 34, 30, .42);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  line-height: 1.65;
  background: linear-gradient(180deg, #fffaf6 0%, var(--bg) 58%, #fffaf4 100%);
}

a {
  color: inherit;
}

.page {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
}

.list-hero {
  display: grid;
  padding: clamp(24px, 5vw, 46px) 0 18px;
}

h1 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.list-hero h1 {
  max-width: 780px;
  font-size: clamp(32px, 5vw, 58px);
}

.list-main {
  padding: 0 0 52px;
}

.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 16px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-control {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(232, 102, 69, .38);
  border-radius: 999px;
  background: rgba(255, 250, 245, .86);
  color: #9a5a46;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
}

.active-filter-summary {
  display: none;
  max-width: min(100%, 520px);
  color: #8a4d3a;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.active-filter-summary.is-visible {
  display: block;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recipe-card {
  display: grid;
  min-height: 100%;
  border: 1px solid rgba(234, 217, 200, .95);
  border-radius: 14px;
  background: rgba(255, 250, 245, .96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.recipe-card.is-hidden {
  display: none;
}

.recipe-card a {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  min-height: 168px;
  text-decoration: none;
  overflow: hidden;
}

.thumb {
  position: relative;
  min-height: 100%;
  width: 100%;
  background: linear-gradient(135deg, rgba(232, 102, 69, .14), rgba(95, 138, 75, .16)), #f3eadf;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.pending {
  display: grid;
  place-items: center;
  padding: 12px;
  color: #9a5a46;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  text-align: center;
}

.card-body {
  display: grid;
  gap: 9px;
  align-content: start;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 12px;
  font-weight: 700;
}

.pill.time {
  background: var(--herb-soft);
  color: var(--herb);
}

.recipe-card h2 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.18;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ingredients li {
  padding: 5px 8px;
  border: 1px solid #ead9c8;
  border-radius: 999px;
  background: #fff;
  color: #6d5542;
  font-size: 12px;
  font-weight: 760;
}

.filter-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: end;
  background: var(--overlay);
  padding: 16px;
}

.filter-layer.is-open {
  display: flex;
}

.filter-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px 16px var(--radius) var(--radius);
  background: var(--paper);
  box-shadow: 0 22px 60px rgba(37, 34, 30, .2);
}

.filter-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.2;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-chip {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #6d5542;
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
}

.tag-chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.empty-state {
  display: none;
  margin: 14px 0 0;
  padding: 18px;
  border: 1px dashed #cbbd9f;
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .82);
  color: var(--muted);
  font-weight: 700;
}

.empty-state.is-visible {
  display: block;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 16px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  appearance: none;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(74, 58, 38, .08);
  cursor: pointer;
  font-family: inherit;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 760;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: end;
  padding: 18px 0 22px;
}

.detail-hero h1 {
  font-size: clamp(34px, 6vw, 64px);
}

.hero-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 560;
}

.fact-box {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, .94);
  box-shadow: var(--shadow);
}

.detail-thumb,
.detail-thumb-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #efe6d8;
  box-shadow: 0 10px 24px rgba(74, 58, 38, .1);
}

.detail-thumb {
  object-fit: cover;
}

.detail-thumb-placeholder {
  display: grid;
  place-items: center;
  padding: 14px;
  color: #9a5a46;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.fact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.fact-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.fact-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.fact-row strong {
  text-align: right;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  padding: 0 0 52px;
}

.content,
.media {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.panel {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, .94);
  box-shadow: 0 14px 36px rgba(74, 58, 38, .09);
}

.panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.panel h3 {
  margin: 0;
  font-size: 17px;
}

.panel ul,
.panel ol {
  margin: 0;
  padding-left: 22px;
}

.panel li {
  margin: 6px 0;
  color: #403a33;
  font-size: 15px;
}

.prep-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding-left: 0;
  list-style: none;
}

.prep-list li {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.memo {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 560;
}

.embed-wrap {
  width: min(100%, 300px);
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.embed-wrap iframe {
  display: block;
  width: 100%;
  min-height: 360px;
  border: 0;
}

.top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--accent);
  appearance: none;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(74, 58, 38, .18);
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 860px) {
  .page {
    width: min(100% - 20px, 1040px);
  }

  .detail-hero,
  .detail-main {
    grid-template-columns: 1fr;
  }

  .hero-text {
    grid-template-columns: minmax(0, 1fr) 112px;
  }
}

@media (max-width: 760px) {
  .recipe-list {
    grid-template-columns: 1fr;
  }

  .recipe-card a {
    grid-template-columns: 116px minmax(0, 1fr);
    min-height: 132px;
  }

  .card-body {
    gap: 6px;
    padding: 11px 12px;
  }

  .pill,
  .ingredients li {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .active-filter-summary {
    flex-basis: 100%;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .list-hero,
  .detail-hero {
    padding-top: 18px;
  }

  .list-hero h1 {
    font-size: 30px;
  }

  .detail-hero h1 {
    font-size: 34px;
  }

  .filter-layer {
    padding: 10px;
  }

  .filter-panel,
  .panel,
  .fact-box {
    padding: 16px;
  }

  .detail-thumb,
  .detail-thumb-placeholder {
    width: 96px;
    justify-self: end;
  }

  .embed-wrap iframe {
    min-height: 340px;
  }

  .prep-list {
    gap: 7px;
  }

  .prep-list li {
    padding: 7px 8px;
    font-size: 13px;
  }
}
