/* =========================================================
   美食详情页共用样式（food/food.css）
   详情页使用；首页也引用本文件，但只用到第 0 节（卡片光标与热区）
   ========================================================= */

/* ---------------------------------------------------------
   0. 首页卡片：只补定位与光标，上浮/阴影沿用 style.css
   --------------------------------------------------------- */
.food-card {
  position: relative;      /* 必需：否则 inset:0 的热区会铺到更外层 */
  cursor: pointer;
}
.ext-card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-indent: -9999px;
  overflow: hidden;
  border-radius: inherit;
}
.ext-card-link:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   1. 详情页骨架
   --------------------------------------------------------- */
html { scroll-behavior: smooth; }

/* 纸底 + 极淡竖纹：呼应首页的宣纸质感，只在留白处显现 */
.ext-detail {
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(90deg,
      rgba(46, 51, 45, .022) 0 1px,
      transparent 1px 5px);
}

.ext-wrap {
  width: min(100% - 48px, 920px);
  margin-inline: auto;
}

/* 返回条（吸顶） */
.ext-back {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 0 24px;
  background: rgba(247, 244, 238, .88);
  -webkit-backdrop-filter: saturate(1.1) blur(12px);
  backdrop-filter: saturate(1.1) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
/* 底边线两端淡出，比整条实线轻 */
.ext-back::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 18%, var(--line) 82%, transparent);
}
.ext-back__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .3s;
}
.ext-back__link:hover { color: var(--brick); }
.ext-back__now {
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--ink-3);
}

/* 头图：与正文同宽（不再满屏出血） */
.ext-hero {
  position: relative;
  width: min(100% - 48px, 920px);
  margin: clamp(22px, 3.2vw, 36px) auto 0;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line);
}
.ext-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 内描边：像装裱的画心 */
.ext-hero::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 1;
  border: 1px solid rgba(255, 253, 249, .34);
  pointer-events: none;
}
/* 左下角小签条 */
.ext-hero::after {
  content: "张家口美食志 · ZHANGJIAKOU FOOD";
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  padding: 7px 14px;
  font-size: 10px;
  letter-spacing: .16em;
  color: var(--white);
  background: rgba(47, 62, 51, .56);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 标题区 */
body.ext-detail .ext-head {
  position: relative;
  padding: clamp(32px, 4.4vw, 56px) 0 clamp(16px, 2.4vw, 24px);
}
/* 右上角印章：与首页页脚 .seal 同一语汇 */
body.ext-detail .ext-head::after {
  content: "张";
  position: absolute;
  top: clamp(34px, 4.6vw, 58px);
  right: 0;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 20px;
  line-height: 1;
  color: var(--brick);
  border: 1px solid var(--brick);
  opacity: .78;
  user-select: none;
}
body.ext-detail .ext-head__en {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
body.ext-detail .ext-head__en::after {
  content: "";
  flex: 0 0 clamp(32px, 8vw, 64px);
  height: 1px;
  background: var(--line);
}
body.ext-detail .ext-head h1 {
  padding-right: 60px;   /* 给印章留位 */
  font-size: clamp(28px, 4.6vw, 42px);
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.3;
}
/* 标题下砖红短线：与首页 .sec-title::after 一致 */
body.ext-detail .ext-head h1::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 18px;
  background: var(--brick);
}
body.ext-detail .ext-head__lead {
  margin-top: 20px;
  max-width: 680px;
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-2);
}

/* 页内锚点 */
.ext-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.ext-anchors a {
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 1px;
  transition: border-color .3s, color .3s, background .3s;
}
.ext-anchors a:hover {
  border-color: var(--brick);
  color: var(--brick);
  background: transparent;
}

/* 章节 */
.ext-sec {
  position: relative;
  padding: clamp(28px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 72px;   /* 避开吸顶条 */
}
/* 分隔线中点一枚空心菱：新中式的小节点 */
.ext-sec::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 7px;
  height: 7px;
  margin-left: -4px;
  background: var(--paper);
  border: 1px solid var(--line);
  transform: rotate(45deg);
}
.ext-sec:last-of-type { border-bottom: 0; }
.ext-sec:last-of-type::after { content: none; }
/* 章节标题：序号与名称合为一行（不再出现「小字 + 大字」两行重复） */
.ext-sec__ttl {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 600;
  letter-spacing: .1em;
  line-height: 1.4;
}
/* 砖红前缀线：沿用原来小字行上的那根 */
.ext-sec__ttl::before {
  content: "";
  flex: 0 0 26px;
  height: 1px;
  background: var(--brick);
  opacity: .8;
}
/* 序号：与标题同字号，靠字重与砖红区分层级 */
.ext-sec__no {
  font-size: 1em;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--brick);
}
.ext-sec p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink-2);
}
.ext-sec p:last-child { margin-bottom: 0; }
.ext-sec strong { color: var(--ink); font-weight: 600; }

/* 图文块 */
.ext-figures {
  display: grid;
  gap: 22px;
  margin: 24px 0;
}
.ext-figures--two {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.ext-figure { margin: 0; }
.ext-figure img {
  display: block;
  max-width: 100%;
  max-height: 720px;      /* 超高竖图限高，避免占满整屏 */
  width: auto;
  height: auto;
  margin-inline: auto;
  border: 1px solid var(--line-soft);
  border-radius: 1px;
  background: var(--paper-3);
  box-shadow: 0 10px 26px rgba(46, 51, 45, .045);
}
.ext-figure figcaption {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-3);
}
.ext-figure figcaption b { color: var(--ink-2); font-weight: 600; }

/* 工艺步骤块 */
.ext-step {
  margin: 26px 0;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
}
.ext-step:first-of-type {
  margin-top: 20px;
  padding-top: 0;
  border-top: 0;
}
.ext-step__no {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--brick);
}
.ext-step__no::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--brick);
  opacity: .8;
  transform: rotate(45deg);
}
.ext-step__body {
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink-2);
}
.ext-step__body + .ext-figures { margin-top: 18px; }

/* 竖版营养图 */
.ext-nutrition {
  max-width: 500px;
  margin: 26px auto;
}

/* 上下篇 */
.ext-pager {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(28px, 4vw, 44px);
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid var(--line);
}
.ext-pager a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  letter-spacing: .06em;
  transition: color .3s;
}
.ext-pager a span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-3);
}
.ext-pager a:hover { color: var(--brick); }
.ext-pager__next { text-align: right; margin-left: auto; }

/* 来源说明 */
.ext-credit {
  margin: 30px 0 8px;
  font-size: 11px;
  line-height: 1.9;
  color: var(--ink-3);
}

/* 页脚间距 */
.ext-footer-wrap { margin-top: clamp(40px, 6vw, 72px); }

/* ---------------------------------------------------------
   2. 响应式
   --------------------------------------------------------- */
@media (max-width: 720px) {
  .ext-wrap { width: min(100% - 32px, 920px); }
  .ext-hero {
    width: min(100% - 32px, 920px);
    aspect-ratio: 3 / 2;          /* 窄屏别太扁 */
    margin-top: 18px;
  }
  .ext-hero::after { font-size: 9px; padding: 6px 10px; letter-spacing: .12em; }
  body.ext-detail .ext-head::after { content: none; }   /* 窄屏隐藏印章，避免挤标题 */
  body.ext-detail .ext-head h1 { padding-right: 0; }
  .ext-figures--two { grid-template-columns: 1fr; }
  .ext-back { padding: 0 16px; }
  .ext-back__now { display: none; }
  body.ext-detail .ext-head__lead { font-size: 14px; }
  .ext-sec p,
  .ext-step__body { font-size: 14px; line-height: 1.95; }
  .ext-pager { flex-direction: column; gap: 14px; }
  .ext-pager__next { text-align: left; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
