/* Dong Bei Bei Taijiquan Wushu Academy - shared styles */
:root {
  --ink: #16120f;
  --ink-2: #2a221c;
  --paper: #f6f0e4;
  --paper-2: #ebe2d0;
  --card: #fffaf0;
  --red: #b3261e;
  --red-dark: #8a1b15;
  --gold: #b8892b;
  --muted: #6b5f53;
  --line: #d9cdb6;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(22, 18, 15, .10);
  --serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans SC", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--red); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: #fff;
  border-bottom: 3px solid var(--red);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; font-family: var(--serif); font-weight: 700; letter-spacing: .02em; }
.brand:hover { color: #fff; }
.brand img { height: 40px; width: auto; }
.brand .seal {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--red); color: #fff; border-radius: 6px; font-size: 1.15rem;
}
.brand small { display: block; font-family: var(--sans); font-weight: 400; font-size: .7rem; opacity: .75; letter-spacing: .08em; text-transform: uppercase; }
.nav-toggle { display: none; background: none; border: 1px solid #ffffff55; color: #fff; padding: .45rem .8rem; border-radius: 8px; font: inherit; cursor: pointer; }
.nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.nav a { display: block; color: #ffffffd9; text-decoration: none; padding: .5rem .85rem; border-radius: 8px; font-size: .95rem; }
.nav a:hover { background: #ffffff1a; color: #fff; }
.nav a[aria-current="page"] { background: var(--red); color: #fff; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-bottom: 3px solid var(--red); padding: .5rem 1rem 1rem; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
}

/* hero */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, #b3261e55, transparent 60%),
    linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 100%);
  color: #fff; padding: clamp(3rem, 9vw, 7rem) 0;
}
.hero .eyebrow { color: #e7c77c; letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; margin-bottom: 1rem; }
.hero p.lead { max-width: 58ch; font-size: 1.15rem; color: #ffffffcc; }
.hero .zh { font-family: var(--serif); color: #e7c77c; font-size: 1.1rem; margin-bottom: 1.5rem; }
.page-hero { padding: clamp(2rem, 6vw, 4rem) 0; }
.page-hero p { max-width: 62ch; color: #ffffffcc; }

.btn {
  display: inline-block; background: var(--red); color: #fff; text-decoration: none;
  padding: .75rem 1.3rem; border-radius: 10px; font-weight: 600; border: 0; cursor: pointer; font: inherit; font-weight: 600;
}
.btn:hover { background: var(--red-dark); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid #ffffff88; }
.btn.ghost:hover { background: #ffffff1a; }
.btn.light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.light:hover { background: var(--paper-2); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* sections */
section.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
section.alt { background: var(--paper-2); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }
.grid { display: grid; gap: 1.25rem; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4rem; }
.card .zh { font-family: var(--serif); color: var(--red-dark); font-size: .95rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 999px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.badge.red { background: var(--red); border-color: var(--red); color: #fff; }
.badge.gold { background: #f3e3b8; border-color: #e0c274; color: #5a4210; }
.badge.grey { background: #e7e1d6; color: #6b5f53; }

/* timeline-ish facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 2rem; }
.fact { border-left: 3px solid var(--gold); padding-left: .9rem; }
.fact strong { display: block; font-family: var(--serif); font-size: 1.7rem; }
.fact span { color: var(--muted); font-size: .9rem; }

/* contact */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.contact-list li { display: flex; gap: .7rem; }
.contact-list b { min-width: 6.5rem; color: var(--muted); font-weight: 600; }
.map-frame { width: 100%; height: 340px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* events */
.event { display: grid; grid-template-columns: 92px 1fr auto; gap: 1.1rem; align-items: center; padding: 1.1rem 1.3rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.event + .event { margin-top: .9rem; }
.event .date { text-align: center; background: var(--ink); color: #fff; border-radius: 10px; padding: .5rem .2rem; }
.event .date b { display: block; font-family: var(--serif); font-size: 1.6rem; line-height: 1; }
.event .date span { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: #e7c77c; }
.event h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.event .meta { color: var(--muted); font-size: .9rem; }
.event.past { opacity: .72; }
.event.past .date { background: #6b5f53; }
@media (max-width: 640px) { .event { grid-template-columns: 76px 1fr; } .event .badge { grid-column: 2; justify-self: start; } }
.tabs { display: flex; gap: .5rem; margin-bottom: 1.2rem; }
.tab { border: 1px solid var(--line); background: var(--card); padding: .5rem 1rem; border-radius: 999px; cursor: pointer; font: inherit; color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* history timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 1.6rem; list-style: none; border-left: 2px solid var(--gold); }
.timeline li { position: relative; padding: 0 0 1.5rem 1rem; }
.timeline li::before { content: ""; position: absolute; left: -2.05rem; top: .35rem; width: 14px; height: 14px; border-radius: 50%; background: var(--red); border: 3px solid var(--paper); }
.timeline .when { font-weight: 700; font-family: var(--serif); color: var(--red-dark); }

/* footer */
.site-footer { background: var(--ink); color: #ffffffb3; padding: 2.5rem 0; margin-top: 0; font-size: .92rem; }
.site-footer a { color: #e7c77c; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }

/* ===== ITEDW ===== */
.toolbar { display: grid; gap: .9rem; grid-template-columns: 2fr 1fr 1fr; align-items: end; background: var(--card); border: 1px solid var(--line); padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 720px) { .toolbar { grid-template-columns: 1fr; } }
.toolbar label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .06em; }
.toolbar input, .toolbar select { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
.view-switch { display: flex; gap: .5rem; margin: 1.2rem 0 .4rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.result-count { color: var(--muted); font-size: .92rem; }

.p-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 1rem; }
.p-card { display: flex; flex-direction: column; gap: .6rem; text-align: left; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; cursor: pointer; font: inherit; color: inherit; transition: transform .12s, box-shadow .12s, border-color .12s; }
.p-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--red); }
.p-top { display: flex; gap: .8rem; align-items: center; }
.avatar { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: #e7c77c; display: grid; place-items: center; font-family: var(--serif); font-size: 1.25rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 2.2rem; border: 2px solid var(--gold); }
.p-name { font-weight: 700; line-height: 1.25; }
.p-zh { font-family: var(--serif); color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }

.level-section { margin-top: 2rem; }
.level-section > header { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; border-bottom: 2px solid var(--red); padding-bottom: .4rem; margin-bottom: .8rem; }
.level-section h3 { margin: 0; }
.level-section .zh { font-family: var(--serif); color: var(--muted); }
.level-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.level-list button { width: 100%; display: flex; justify-content: space-between; gap: .8rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; font: inherit; color: inherit; text-align: left; }
.level-list button:hover { border-color: var(--red); background: #fff; }
.year-tag { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--red-dark); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); margin-top: 1rem; }
.load-more { margin: 1.5rem auto 0; display: block; }

/* profile modal */
.modal-back { position: fixed; inset: 0; background: #16120fcc; display: none; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow: auto; z-index: 100; }
.modal-back.open { display: flex; }
.modal { background: var(--card); width: min(640px, 100%); border-radius: 18px; box-shadow: 0 20px 60px #0008; overflow: hidden; }
.modal-head { background: var(--ink); color: #fff; padding: 1.4rem; display: flex; gap: 1.1rem; align-items: center; position: relative; }
.modal-head h2 { margin: 0; font-size: 1.5rem; }
.modal-head .zh { font-family: var(--serif); color: #e7c77c; }
.modal-close { position: absolute; right: .8rem; top: .8rem; background: #ffffff22; border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; }
.modal-close:hover { background: var(--red); }
.modal-body { padding: 1.4rem; }
.modal-body h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); }
.ach-list { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--gold); }
.ach-list li { position: relative; padding: 0 0 1.1rem 1.2rem; }
.ach-list li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.ach-list .yr { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--red-dark); }
.ach-list .lv { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; }
.ach-list .note { color: var(--muted); font-size: .92rem; }
.ach-list li.fail::before { background: #a99f90; }
.ach-list li.fail .lv { color: var(--muted); }
.share-row { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.data-note { font-size: .85rem; color: var(--muted); margin-top: 2rem; }
.error-box { background: #fde8e6; border: 1px solid #e9a39d; color: #7a1a14; padding: 1rem; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
