/* ============================================================
   人文底蕴 · 现代流体响应式设计系统
   长春市第四十八中学 2024级5班
   ============================================================ */

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
  /* 品牌色彩：沉稳砖红与纸张白 */
  --red-900: #621b1f;
  --red-800: #762328;
  --red-700: #8d3033;
  --red-100: #f4e9e8;
  --paper: #fffdfa;
  --white: #ffffff;
  --ink: #24201e;
  --muted: #6c625d;
  --line: #d9d0ca;
  --concrete: #e9e4df;

  /* 布局尺寸 */
  --max: 1180px;

  /* 字体栈：衬线用于标题(底蕴)，无衬线用于正文(可读性) */
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}

/* ── 2. Reset & Global ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--red-800); }
a:hover { color: var(--red-900); }
ul, ol { padding-inline-start: 1.25em; }

/* ── 3. A11y ──────────────────────────────────────────────── */
/* 焦点可见性 */
:focus-visible {
  outline: 3px solid #d9a441;
  outline-offset: 3px;
}

/* 跳过导航 */
.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.5em 1em;
  background: var(--red-900);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 1rem;
}

/* ── 4. Layout Containers ─────────────────────────────────── */
.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

.section {
  padding-block: clamp(4.2rem, 8vw, 7rem);
}

/* ── 5. Typography ────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.3;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }

/* ── 6. Header / Brand ────────────────────────────────────── */
.site-header {
  border-block-end: 1px solid var(--line);
  padding-block: 1rem;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--red-900);
  letter-spacing: 0.08em;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  text-decoration: none;
  display: inline-block;
}

.brand:hover { color: var(--red-700); }

/* ── 7. Hero ──────────────────────────────────────────────── */
.hero {
  display: grid;
  align-items: end;
  min-height: clamp(520px, 68vw, 720px);
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* 双层线性渐变遮罩，确保 WCAG AAA 对比度 */
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(36,32,30,.82) 0%, rgba(36,32,30,.45) 50%, transparent 100%),
    linear-gradient(to right, rgba(36,32,30,.3) 0%, transparent 60%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(2rem, 5vw, 4rem);
  color: var(--white);
}

.hero h1 {
  color: var(--white);
  text-shadow: 0 2px 18px rgba(0,0,0,.28);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-block-end: 0.5em;
}

.hero p {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: rgba(255,255,255,.88);
  max-width: 36em;
}

/* ── 8. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 48px;
  padding-inline: 1.5em;
  padding-block: 0.6em;
  border: 2px solid var(--line);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover {
  background: var(--concrete);
  border-color: var(--muted);
}

/* 主按钮：白底红字 */
.btn-primary {
  background: var(--white);
  color: var(--red-900);
  border-color: var(--red-900);
}
.btn-primary:hover {
  background: #f3e9e6;
  color: var(--red-900);
  border-color: var(--red-900);
}

/* 强调按钮 (CTA)：深红背景 */
.btn-wall {
  background: var(--red-800);
  color: var(--white);
  border-color: var(--red-800);
  box-shadow: 0 10px 28px rgba(43, 14, 15, .34);
}
.btn-wall:hover {
  background: var(--red-900);
  border-color: var(--red-900);
  color: var(--white);
}

/* ── 9. Cards / Fact ──────────────────────────────────────── */
.fact {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1rem;
  align-items: center;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}

.fact-num {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--red-900);
  text-align: center;
  line-height: 1;
}

.fact-body h3 { margin-block-end: 0.25em; }
.fact-body p  { color: var(--muted); }

/* ── 10. Info Cards (legacy compat, refactored) ───────────── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 2.5vw, 1.75rem);
}

.card h3 {
  color: var(--red-900);
  padding-block-end: 0.5em;
  margin-block-end: 0.75em;
  border-block-end: 1px solid var(--line);
}

/* ── 11. Section Divider ──────────────────────────────────── */
.divider {
  border: none;
  border-block-start: 1px solid var(--line);
  margin-block: 2rem;
}

/* ── 12. Footer ───────────────────────────────────────────── */
.site-footer {
  border-block-start: 1px solid var(--line);
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--red-700);
}

/* ── 13. Video Container ──────────────────────────────────── */
.video-container {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 2px 12px rgba(36,32,30,.08);
}

/* ── 14. Photo Wall ───────────────────────────────────────── */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1.25rem;
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
  background: var(--concrete);
  transition: box-shadow 0.3s;
}

.photo-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-item:hover {
  box-shadow: 0 6px 20px rgba(36,32,30,.14);
}

.photo-item:hover img {
  transform: scale(1.04);
}

/* ── 15. Button Group (layout) ────────────────────────────── */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-group--stack {
  flex-direction: column;
  align-items: flex-start;
}

/* ── 16. 404 Page ─────────────────────────────────────────── */
.page-404 h1 {
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--red-900);
  font-family: var(--serif);
  line-height: 1;
}

/* ── 17. Utility ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-auto     { margin-block-start: auto; }

/* ── 18. Reduced Motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
