/* 괴산 옥빵이 — 단일 페이지 스타일 */

:root {
  --bg: #FFFBF1;
  --bg-soft: #FFF3D8;
  --ink: #3D2E1C;
  --ink-soft: #70604A;
  --corn: #F6C445;
  --corn-deep: #E3AC26;
  --leaf: #567F3B;
  --fire: #D6513C;
  --mayo: #E9799F;
  --line: #EAD9B9;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: inherit; }

h1, h2, h3, .logo {
  font-family: Jua, "Pretendard Variable", sans-serif;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 버튼 ---------- */

.btn {
  display: inline-block;
  background: var(--corn);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 999px;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--corn-deep); }
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 2px;
}

.btn-ghost {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn-ghost:hover { background: rgba(61, 46, 28, .08); }

/* ---------- 상단 ---------- */

.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 24px;
}

.logo {
  font-size: 1.45rem;
  text-decoration: none;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.top-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 2px;
}
.top-nav a:hover { color: var(--leaf); }

.btn-top { padding: 10px 20px; }

/* ---------- 히어로 ---------- */

.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  overflow: hidden;
}

.hero picture,
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 9vh 24px 0;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin: 0 0 16px;
}

.hero-sub {
  margin: 0 0 24px;
  font-size: 1.07rem;
  color: #5D4D38;
}

.hero-b2b {
  margin: 18px 0 0;
  font-size: .95rem;
  color: #5D4D38;
}
.hero-b2b a { font-weight: 700; }

@media (min-width: 761px) {
  .hero img {
    top: 0;
    bottom: auto;
    height: 112%;
  }
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- 공통 섹션 ---------- */

.section { padding: 110px 0; }

.section h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0 0 26px;
}

.section-lead {
  margin: -10px 0 40px;
  color: var(--ink-soft);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}
.split.reverse { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }

.split-photo img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.split-text p { margin: 0 0 16px; }

/* ---------- 소개 ---------- */

.enjoy {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.enjoy li {
  padding: 10px 0 10px 30px;
  position: relative;
  border-top: 1px solid var(--line);
}
.enjoy li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--corn);
}

/* ---------- 단면 밴드 ---------- */

.band { position: relative; }
.band img {
  width: 100%;
  max-height: 72vh;
  object-fit: cover;
}
.band figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 70px 24px 22px;
  text-align: center;
  color: #FFF9EC;
  font-weight: 600;
  text-shadow: 0 1px 6px rgba(45, 30, 10, .45);
  background: linear-gradient(to top, rgba(45, 30, 10, .82), rgba(45, 30, 10, 0));
}

/* ---------- 다섯 가지 정성 ---------- */

.promise { background: var(--bg-soft); }

.promise-list { margin: 0; }
.promise-list > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.promise-list > div:first-child { border-top: 1px solid var(--line); }
.promise-list dt { font-weight: 700; }
.promise-list dd {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: .96rem;
}

.haccp {
  margin: 22px 0 0;
  font-size: .93rem;
  color: #466C2E;
  font-weight: 600;
}

/* ---------- 세 가지 맛 ---------- */

.flavor-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.flavor-row[data-count="1"] { grid-template-columns: minmax(0, 420px); }
.flavor-row[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
.flavor-row[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }

.flavor video,
.flavor img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--line);
}
.flavor video { cursor: pointer; }

.flavor h3 {
  font-size: 1.45rem;
  margin: 20px 0 0;
  padding-bottom: 10px;
  position: relative;
}
.flavor h3::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--corn);
}
.flavor[data-color="fire"] h3::after { background: var(--fire); }
.flavor[data-color="mayo"] h3::after { background: var(--mayo); }
.flavor[data-color="leaf"] h3::after { background: var(--leaf); }
.flavor[data-color="ink"] h3::after { background: var(--ink); }

.flavor ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
}
.flavor li { padding: 3px 0; }

.kcal {
  margin: 12px 0 0;
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ---------- 데우는 법 ---------- */

.heat { background: var(--bg-soft); }

.heat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 0;
}
.heat-table th,
.heat-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.heat-table thead th {
  font-size: .9rem;
  color: var(--ink-soft);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}
.heat-table tbody th { font-weight: 700; }
.heat-table small {
  display: block;
  font-size: .82rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.heat-table small:empty { display: none; }

.heat-note {
  margin: 18px 0 0;
  font-size: .95rem;
  color: var(--ink-soft);
}

/* ---------- 협동조합 ---------- */

.coop-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
}

.coop-text p { margin: 0 0 24px; }

.coop-photo img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.coop-photo figcaption {
  margin-top: 10px;
  font-size: .9rem;
  color: var(--ink-soft);
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 3px solid var(--corn);
}
.timeline li {
  position: relative;
  padding: 9px 0 9px 26px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 19px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--corn);
  border: 3px solid var(--bg);
}
.timeline .tl-date {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  color: var(--leaf);
}

/* ---------- 주문 안내 ---------- */

.order { background: var(--bg-soft); }

.order-sub {
  font-size: 1.2rem;
  margin: 26px 0 10px;
}
.order-sub:first-of-type { margin-top: 8px; }

.order-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.order-list li {
  padding: 7px 0 7px 26px;
  position: relative;
}
.order-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--leaf);
}

.order .split-photo img {
  max-height: 560px;
  width: 100%;
  object-fit: cover;
}

/* ---------- 갤러리 ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 10px;
}
.gallery img {
  width: 100%;
  height: 430px;
  object-fit: cover;
  border-radius: 10px;
}
.gallery[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.gallery[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery[data-count="4"] img { height: 360px; }

/* ---------- 구매 ---------- */

.buy {
  background: var(--corn);
  text-align: center;
  padding: 90px 0;
  margin-top: 90px;
}

.buy h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin: 0 0 14px;
}

.buy p { margin: 0 0 28px; }

.btn-big {
  background: var(--ink);
  color: #FFF6DF;
  font-size: 1.12rem;
  padding: 18px 38px;
}
.btn-big:hover { background: #2A1F10; }

.buy-alt {
  margin: 26px 0 0;
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.buy-alt a { font-weight: 600; }

.buy-b2b {
  margin: 34px 0 0;
  font-size: .97rem;
}
.buy-b2b a { font-weight: 700; white-space: nowrap; }

/* ---------- 푸터 ---------- */

.foot {
  background: #2E2313;
  color: #D9CBB2;
  padding: 54px 0 60px;
  font-size: .95rem;
}
.foot p { margin: 0 0 8px; }
.foot a { color: #F3E6C8; }
.foot-name {
  font-family: Jua, sans-serif;
  font-size: 1.25rem;
  color: #F3E6C8;
  margin-bottom: 14px;
}
.foot-copy {
  margin-top: 26px;
  color: #9A8C72;
}

/* ---------- 관리자에서 끈 부분 / 내용 불러오는 동안 ---------- */

.okb-off { display: none !important; }

.cms-wait [data-cms],
.cms-wait [data-cms-list],
.cms-wait [data-cms-img],
.cms-wait picture {
  visibility: hidden;
  animation: okb-reveal 0s 1.6s forwards;
}
@keyframes okb-reveal { to { visibility: visible; } }

/* ---------- 모바일 고정 구매 버튼 ---------- */

.btn-sticky { display: none; }
.btn-sticky.hide { display: none; }

/* ---------- PC 고정 헤더 ---------- */

@media (min-width: 761px) {
  .top {
    position: fixed;
    background: rgba(255, 251, 241, .92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--line);
  }
}

/* ---------- 반응형 ---------- */

@media (max-width: 960px) {
  .split,
  .split.reverse,
  .coop-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .split.reverse .split-photo { order: -1; }
  .section { padding: 76px 0; }
  .gallery img { height: 300px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .foot {
    padding-bottom: calc(60px + 76px + env(safe-area-inset-bottom));
  }

  .top { gap: 14px; padding: 14px 16px; }
  .top-nav { display: none; }
  .btn-top { margin-left: auto; }

  .hero { min-height: 94svh; }
  .hero-copy { padding-top: 13vh; }
  .hero h1 { font-size: 2.5rem; }
  .hero-sub { font-size: 1rem; }
  .hero-sub br { display: none; }
  .hero-cta,
  .hero-b2b { display: none; }

  .flavor-row,
  .flavor-row[data-count] { grid-template-columns: 1fr; gap: 48px; max-width: none; }

  .gallery,
  .gallery[data-count] {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .gallery img,
  .gallery[data-count="4"] img { height: 220px; }
  .gallery > :first-child:nth-last-child(odd):not(:only-child) { display: none; }
  .gallery[data-count="1"] { grid-template-columns: 1fr; }

  .buy { padding: 70px 0; margin-top: 70px; }

  .btn-sticky {
    display: block;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    text-align: center;
    padding: 16px 20px;
    box-shadow: 0 6px 20px rgba(61, 46, 28, .25);
    z-index: 20;
  }
}
