/* ============================================================
   CHAPTER PAGES SPECIFIC STYLES
   (Only applies to pages that have the .logo-banner)
   ============================================================ */

/* Logo Banner */
.logo-banner {
  background: linear-gradient(135deg, #fffdf9 0%, #fff6e8 50%, #fdf0dc 100%);
  border-bottom: 1px solid var(--border);
  padding: 26px 24px;
  position: relative;
  overflow: hidden;
}
.logo-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(232, 132, 26, 0.07) 1px, transparent 1px);
  background-size: 20px 20px;
}
.logo-banner-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}
.logo-banner-logo {
  width: 88px;
  height: 88px;
  flex: none;
  filter: drop-shadow(0 6px 14px rgba(216, 119, 6, 0.22));
}
.logo-banner-text { text-align: left; }
.logo-banner-text .nm {
  font-family: var(--ui);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--navy);
}
.logo-banner-text .nm .accent { color: var(--orange); }
.logo-banner-text .tg {
  font-family: var(--ui);
  font-size: clamp(10px, 1.4vw, 13px);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}

/* Hero & Layout (Only for Chapter Pages) */
body:has(.logo-banner) .hero {
  padding: 72px 24px 76px;
}
.hero-grid {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 52px;
  align-items: center;
}
.hero-copy { text-align: left; }
.hero .byline {
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Portrait Card */
.portrait-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(36, 28, 20, 0.18), 0 6px 16px rgba(36, 28, 20, 0.09);
  border: 5px solid #fff;
  background: #fff;
  transform: rotate(-1.2deg);
  transition: transform 0.5s ease;
}
.portrait-card:hover { transform: rotate(0deg) scale(1.015); }
.portrait-card img {
  display: block;
  width: 100%;
  height: auto;
  filter: sepia(0.14) contrast(1.02);
}
.portrait-card .caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(15, 20, 30, 0.92), rgba(15, 20, 30, 0.55) 60%, transparent);
  color: #fff;
  padding: 30px 22px 18px;
  text-align: left;
}
.portrait-card .caption .n { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; display: block; }
.portrait-card .caption .d { font-family: var(--ui); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; margin-top: 4px; }
.portrait-tape {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-3deg);
  width: 92px; height: 24px; background: rgba(232, 132, 26, 0.72); border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); z-index: 2;
}

/* Chapter Layout */
body:has(.logo-banner) .section { padding: 84px 24px; }
body:has(.logo-banner) .wrap { max-width: 1040px; margin: 0 auto; }
body:has(.logo-banner) .wrap-narrow { max-width: 790px; margin: 0 auto; }
body:has(.logo-banner) .sec-head { margin-bottom: 44px; }
body:has(.logo-banner) .sec-head h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.18; }

/* Bio Grid */
.bio-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 44px; align-items: start; }
.bio-text p { margin-bottom: 18px; color: #3b3128; }
.bio-text p:last-child { margin-bottom: 0; }
.bio-text strong { color: var(--ink); }
.bio-photo { border-radius: 18px; overflow: hidden; border: 4px solid #fff; box-shadow: var(--shadow-md); margin-bottom: 20px; background: #fff; }
.bio-photo img { display: block; width: 100%; height: auto; }
.fact-list { display: grid; gap: 11px; }
.fact {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px;
  display: flex; gap: 13px; align-items: flex-start; box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.fact:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.fact .ico { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; background: rgba(232, 132, 26, 0.11); color: var(--orange-d); }
.fact .k { font-family: var(--ui); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 2px; }
.fact .v { font-size: 15px; line-height: 1.5; }

/* Poem & Essay */
.essay-part { margin-bottom: 44px; padding-bottom: 44px; border-bottom: 1px dashed var(--border); }
.essay-part:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.essay-part h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: baseline; gap: 14px; }
.essay-part h3 .no { font-family: var(--ui); font-size: 0.76rem; font-weight: 800; color: var(--orange-d); background: rgba(232, 132, 26, 0.13); padding: 4px 11px; border-radius: 999px; letter-spacing: 0.06em; flex: none; }
.essay-part p { margin-bottom: 16px; color: #33291f; }
.essay-part p:last-child { margin-bottom: 0; }
.poem-block { background: linear-gradient(135deg, rgba(232, 132, 26, 0.04), rgba(27, 58, 92, 0.04)); border: 1px solid var(--border); border-radius: 16px; padding: 30px 34px; margin: 22px 0; font-family: var(--serif); }
.poem-block .stanza { margin-bottom: 26px; }
.poem-block .stanza:last-child { margin-bottom: 0; }
.poem-line { display: flex; align-items: baseline; gap: 18px; font-size: 1.08rem; line-height: 1.9; color: #2c2318; }
.poem-line .ln { font-family: var(--ui); font-size: 11px; font-weight: 700; color: var(--muted); flex: none; width: 24px; text-align: right; }
.poem-line .txt { font-style: italic; }
.pullquote { margin: 26px 0; padding: 22px 26px; background: linear-gradient(135deg, rgba(232, 132, 26, 0.08), rgba(27, 58, 92, 0.06)); border-left: 4px solid var(--orange); border-radius: 0 14px 14px 0; font-family: var(--serif); font-size: 1.12rem; font-style: italic; color: #2f251b; line-height: 1.65; }
.pullquote cite { display: block; margin-top: 12px; font-family: var(--ui); font-size: 12px; font-style: normal; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* Theme Cards */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.theme-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform 0.26s ease, box-shadow 0.26s ease; }
.theme-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.theme-card:nth-child(even)::before { background: linear-gradient(90deg, var(--navy), var(--gold)); }
.theme-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.theme-card h4 { font-family: var(--ui); font-size: 1rem; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.theme-card p { font-size: 15px; color: var(--muted); line-height: 1.68; }



/* Test & Exercises */
.test-wrap { max-width: 900px; margin: 0 auto; }
.test-block { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 34px; margin-bottom: 30px; box-shadow: var(--shadow-sm); }
.test-block > h3 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.test-block .hint { font-family: var(--ui); font-size: 13.5px; color: var(--muted); margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.q { padding: 22px 0; border-bottom: 1px solid var(--border); }
.q:last-of-type { border-bottom: 0; }
.q-head { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.q-num { flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--navy); color: #fff; font-family: var(--ui); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.q-text { font-size: 16.5px; font-weight: 600; line-height: 1.55; padding-top: 2px; }
.opts { display: grid; gap: 9px; margin-left: 40px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 11px; border: 1.5px solid var(--border); background: #fefcf9; cursor: pointer; transition: all 0.18s ease; font-size: 15.5px; line-height: 1.5; }
.opt:hover { border-color: var(--orange); background: rgba(232, 132, 26, 0.045); }
.opt input { margin-top: 4px; accent-color: var(--orange); cursor: pointer; flex: none; }
.opt .letter { font-family: var(--ui); font-weight: 700; font-size: 12.5px; color: var(--muted); flex: none; padding-top: 1px; }
.opt.correct { border-color: var(--green-2); background: rgba(28, 122, 69, 0.09); }
.opt.correct .letter { color: var(--green-2); }
.opt.wrong { border-color: #dc2626; background: rgba(220, 38, 38, 0.07); }
.opt.wrong .letter { color: #dc2626; }
.opt.locked { cursor: default; }
.explain { margin: 14px 0 0 40px; padding: 14px 18px; background: rgba(184, 134, 11, 0.09); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; font-size: 14.5px; color: #4a3d2c; display: none; line-height: 1.62; }
.explain.show { display: block; }
.blank-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.blank-item:last-of-type { border-bottom: 0; }
.blank-item label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 12px; line-height: 1.6; }
.blank-item label .bno { font-family: var(--ui); font-size: 12px; font-weight: 800; color: var(--navy); background: rgba(27, 58, 92, 0.1); padding: 3px 9px; border-radius: 999px; margin-right: 8px; }
.blank-input { width: 100%; font-family: var(--body); font-size: 15.5px; padding: 12px 16px; border-radius: 11px; border: 1.5px solid var(--border); background: #fefcf9; color: var(--ink); transition: all 0.2s ease; }
.blank-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(232, 132, 26, 0.13); }
.blank-input.correct { border-color: var(--green-2); background: rgba(28, 122, 69, 0.07); }
.blank-input.wrong { border-color: #dc2626; background: rgba(220, 38, 38, 0.06); }
.blank-feedback { font-family: var(--ui); font-size: 13.5px; margin-top: 9px; display: none; line-height: 1.6; }
.blank-feedback.show { display: block; }
.blank-feedback.ok { color: var(--green-2); }
.blank-feedback.no { color: #b91c1c; }
.sa-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.sa-item:last-of-type { border-bottom: 0; }
.sa-q { font-size: 16.5px; font-weight: 600; margin-bottom: 12px; line-height: 1.55; }
.sa-q .bno { font-family: var(--ui); font-size: 12px; font-weight: 800; color: var(--orange-d); background: rgba(232, 132, 26, 0.13); padding: 3px 9px; border-radius: 999px; margin-right: 8px; }
.reveal-btn { font-family: var(--ui); font-size: 13.5px; font-weight: 600; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--border); background: #fefcf9; color: var(--muted); cursor: pointer; transition: all 0.2s ease; }
.reveal-btn:hover { border-color: var(--green-2); color: var(--green-2); background: rgba(28, 122, 69, 0.05); }
.sa-answer { margin-top: 14px; padding: 18px 22px; background: rgba(28, 122, 69, 0.06); border-left: 3px solid var(--green-2); border-radius: 0 12px 12px 0; font-size: 15.5px; line-height: 1.72; color: #2c3a2f; display: none; }
.sa-answer.show { display: block; animation: fadeIn 0.3s ease; }
.test-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--border); }
.score-box { margin-left: auto; font-family: var(--ui); font-size: 15px; font-weight: 700; color: var(--muted); background: var(--bg-alt); padding: 12px 22px; border-radius: 12px; border: 1px solid var(--border); }
.score-box .big { color: var(--orange-d); font-size: 19px; }
.result-banner { display: none; margin-top: 22px; padding: 22px 26px; border-radius: 14px; font-family: var(--ui); font-size: 15.5px; line-height: 1.6; text-align: center; }
.result-banner.show { display: block; animation: fadeIn 0.35s ease; }
.result-banner.good { background: rgba(28, 122, 69, 0.1); border: 1px solid rgba(28, 122, 69, 0.28); color: #14532d; }
.result-banner.mid { background: rgba(184, 134, 11, 0.12); border: 1px solid rgba(184, 134, 11, 0.3); color: #6b4c00; }
.result-banner.low { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); color: #991b1b; }
.result-banner .rt { font-size: 1.25rem; font-weight: 800; display: block; margin-bottom: 6px; }
.disc-list { margin: 8px 0 0 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.disc-list li { position: relative; padding: 12px 16px 12px 44px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px; font-size: 15.5px; line-height: 1.6; }
.disc-list li::before { content: "●"; position: absolute; left: 18px; top: 11px; color: var(--orange); font-size: 13px; }

/* Chapter Footer Override (3 Columns instead of 5) */
body:has(.logo-banner) .footer-inner {
  grid-template-columns: 1.3fr 1fr 1fr;
  max-width: 1140px;
  gap: 40px;
}

/* Chapter Responsive Fixes */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .hero-copy { text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .portrait-card { max-width: 380px; margin: 0 auto; transform: rotate(-1deg); }
  .bio-grid { grid-template-columns: 1fr; gap: 32px; }
  .bio-photo { max-width: 340px; margin: 0 auto 20px; }
  body:has(.logo-banner) .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .logo-banner { padding: 20px 16px; }
  .logo-banner-logo { width: 68px; height: 68px; }
  .logo-banner-text { text-align: center; }
  body:has(.logo-banner) .hero { padding: 52px 18px 58px; }
  body:has(.logo-banner) .section { padding: 60px 18px; }
  .test-block { padding: 24px 18px; }
  .opts { margin-left: 0; }
  .explain { margin-left: 0; }
  .score-box { margin-left: 0; width: 100%; text-align: center; }
  .test-actions .btn { width: 100%; justify-content: center; }
  .poem-block { padding: 22px 18px; }
  .poem-line { font-size: 1rem; }
  body:has(.logo-banner) .footer-inner { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 520px) {
  .logo-banner-inner { flex-direction: column; gap: 12px; }
  .logo-banner-text .tg { letter-spacing: 0.2em; }
}