/* 中庄風箏隊 — 方向 A「活潑熱鬧」
   Tokens: see DESIGN.md. Mobile first; desktop from 900px. */

@font-face {
  font-family: "Shrikhand";
  src: url("../fonts/Shrikhand-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans Gujarati";
  src: url("../fonts/NotoSansGujarati-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62.5% 100%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colour, each taken from a team photo or the logo */
  --sky: #2b60b1;        /* photo: 2019 pink octopus field, sky median */
  --sky-deep: #1d559d;   /* photo: 2024 Taitung field, sky median */
  --cloud: #ffffff;
  --ink: #6b2e20;        /* logo outline brown #7A3525, one step darker for body text */
  --logo-yellow: #fff100;/* logo lettering */
  --kite-pink: #e73c7c;  /* photo: pink octopus kite */
  --pink-ink: #c2185b;   /* pink deep enough for white text */
  --octo-purple: #aa5aa1;/* logo octopus */
  --purple-ink: #7d3a76;
  /* fabric colours, used only for the kite-train markers */
  --fab-yellow: #ffd400;
  --fab-orange: #e23907; /* photo: orange goldfish kite */
  --fab-lime: #8ec21f;   /* logo cape */
  --fab-teal: #04a5e0;   /* photo: caterpillar kite */
  --stitch: rgba(107, 46, 32, 0.28);

  --gutter: 20px;
  --wrap: 1180px;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);
  --display-weight: 900;
  --lh-body: 1.6;
  --lh-head: 1.12;
}
html:lang(zh-Hant) {
  --font-body: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: var(--font-body);
  --lh-body: 1.85;
  --lh-head: 1.2;
}
html:lang(en) {
  --font-display: "Shrikhand", Georgia, serif;
  --display-weight: 400;
}
html:lang(gu) {
  --font-body: "Noto Sans Gujarati", system-ui, sans-serif;
  --font-display: "Noto Sans Gujarati", system-ui, sans-serif;
  --display-weight: 850;
  --lh-body: 1.75;
  --lh-head: 1.42;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--lh-body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button.btn { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.2em; text-decoration-color: var(--kite-pink); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--logo-yellow); outline-offset: 3px; box-shadow: 0 0 0 6px var(--ink); border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--logo-yellow); color: var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- the logo-lettering treatment: yellow fill, brown outline, brown drop ---------- */
.lettered {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  color: var(--logo-yellow);
  line-height: var(--lh-head);
  letter-spacing: 0.01em;
  text-shadow:
    2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink),
    1.5px 1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink),
    4px 5px 0 var(--ink);
}

h1, h2, h3 { margin: 0; font-weight: 900; }
h2.section-title {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: var(--lh-head);
  margin-bottom: 0.6em;
}
.on-sky h2.section-title { color: var(--logo-yellow); }

/* ---------- top bar ---------- */
.topbar { background: var(--sky); color: #fff; position: relative; z-index: 2; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.topbar .home { font-weight: 800; text-decoration: none; font-size: 1rem; }
.langs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.langs a { text-decoration: none; padding: 6px 0; display: inline-block; }
.langs a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--logo-yellow); font-weight: 800; }
.langs a:hover { box-shadow: inset 0 -3px 0 rgba(255,255,255,.6); }
/* the switcher label ગુજરાતી uses a tiny subset (only its own glyphs) so zh/en pages don't download the full Gujarati font */
@font-face {
  font-family: "Noto Sans Gujarati Label";
  src: url("../fonts/NotoSansGujarati-label.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
.langs .gu { font-family: "Noto Sans Gujarati Label", "Noto Sans Gujarati", system-ui, sans-serif; }
.gu-text { font-family: "Noto Sans Gujarati", system-ui, sans-serif; }

/* ---------- hero ---------- */
.hero { background: var(--sky); color: #fff; position: relative; padding-top: 18px; }
.hero-grid { display: grid; gap: 28px; }
.hang { position: relative; padding-top: 56px; }
/* two bridle lines from the sail up to a point off the top: the kite line */
.hang svg.bridle { position: absolute; inset: 0 0 auto 0; width: 100%; height: 72px; overflow: visible; }
.sail {
  position: relative;
  background:
    linear-gradient(90deg, transparent calc(25% - 1px), #e9eef7 calc(25% - 1px), #e9eef7 calc(25% + 1px), transparent calc(25% + 1px),
                    transparent calc(50% - 1px), #e9eef7 calc(50% - 1px), #e9eef7 calc(50% + 1px), transparent calc(50% + 1px),
                    transparent calc(75% - 1px), #e9eef7 calc(75% - 1px), #e9eef7 calc(75% + 1px), transparent calc(75% + 1px)),
    #fff;
  border-radius: 28px 28px 40px 40px / 22px 22px 48px 48px;
  padding: 18px 14px 22px;
  transform: rotate(-3deg);
  transform-origin: 50% -60px;
  box-shadow: 0 14px 0 -6px rgba(10, 30, 70, 0.25);
  animation: settle 1.8s cubic-bezier(.3,.6,.3,1) 0.15s both;
}
.sail img { width: 100%; height: auto; }
@keyframes settle {
  0% { transform: rotate(-11deg) translateY(-14px); }
  45% { transform: rotate(2deg); }
  70% { transform: rotate(-4.5deg); }
  100% { transform: rotate(-3deg); }
}
.hero h1 { font-size: clamp(2.5rem, 12vw, 5.4rem); margin: 6px 0 14px; transform: rotate(-2deg); transform-origin: left; }
html:lang(gu) .hero h1 { font-size: clamp(2.2rem, 10vw, 4.6rem); line-height: 1.3; margin-top: 18px; }
.hero .lede { font-size: 1.125rem; max-width: 34em; margin: 0 0 8px; }
.hero-photo { margin: 0 calc(var(--gutter) * -1); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; object-position: 50% 30%; clip-path: polygon(0 9%, 100% 0, 100% 100%, 0 100%); }

/* ---------- generic sections ---------- */
.section { padding: 56px 0; }
.on-sky { background: var(--sky); color: #fff; }
.stitch { border: 0; border-top: 3px dashed var(--stitch); margin: 28px 0; }
.on-sky .stitch { border-top-color: rgba(255,255,255,.4); }

.btn {
  display: inline-block; text-decoration: none; font-weight: 800;
  background: var(--pink-ink); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
}
.btn:hover { background: #a3134b; }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { background: var(--logo-yellow); }

/* next festival */
.next .when { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(2.6rem, 13vw, 5.6rem); line-height: 1.05; color: var(--pink-ink); margin: 0; }
html:lang(gu) .next .when { line-height: 1.35; }
html:lang(en) .next .when { font-size: clamp(2.6rem, 12vw, 4.6rem); }
.next .where { font-size: 1.35rem; font-weight: 900; margin: 8px 0 14px; line-height: 1.35; }
.next p { max-width: 32em; }
.next-grid { display: grid; gap: 8px; }

/* latest */
.feature a.feature-link { text-decoration: none; display: block; }
.feature img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 58%; border-radius: 22px 22px 22px 4px; }
.feature h3 { font-size: 1.6rem; line-height: 1.3; margin: 14px 0 4px; text-decoration: underline; text-decoration-color: var(--kite-pink); text-decoration-thickness: 3px; text-underline-offset: 0.18em; }
.feature .excerpt { margin: 6px 0 0; }
.date { font-size: 0.95rem; opacity: 0.85; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-top: 3px dashed var(--stitch); }
.post-list a { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 16px 0; text-decoration: none; }
.post-list img { width: 96px; height: 96px; object-fit: cover; border-radius: 50% 50% 50% 8px; }
.post-list .noimg { width: 96px; height: 96px; border-radius: 50% 50% 50% 8px; background: var(--sky); display: grid; place-items: center; }
.post-list strong { display: block; font-size: 1.1rem; line-height: 1.35; text-decoration: underline; text-decoration-color: var(--kite-pink); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }

/* festivals: the kite train */
.country { position: relative; }
.country h3 { font-size: 1.25rem; margin: 0 0 6px; }
.train { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.train::before { /* the shared line every kite hangs on */
  content: ""; position: absolute; left: 14px; top: 10px; bottom: 26px; width: 2px;
  background: rgba(255,255,255,.75); transform: skewX(4.5deg); transform-origin: top;
}
.train > li { position: relative; padding: 14px 0 14px 46px; }
.train > li:nth-child(2) { margin-left: 8px; }
.train > li:nth-child(3) { margin-left: 16px; }
.train > li:nth-child(4) { margin-left: 24px; }
.train > li:nth-child(5) { margin-left: 32px; }
.kite { position: absolute; left: 1px; top: 18px; width: 30px; height: 30px; }
.kite i { position: absolute; inset: 3px; transform: rotate(45deg); background: var(--c, var(--fab-yellow)); border: 2.5px solid var(--ink); border-radius: 3px; }
.kite::after { content: ""; position: absolute; left: 14px; top: 30px; width: 2px; height: 16px; background: var(--c, var(--fab-yellow)); }
.train .year { font-family: var(--font-display); font-weight: var(--display-weight); color: var(--logo-yellow); font-size: 1.55rem; line-height: 1.2; display: block; }
.train a { font-weight: 800; font-size: 1.08rem; text-decoration-color: var(--logo-yellow); }
.train .place { display: block; font-size: 0.95rem; opacity: .9; }
.train .upcoming .kite i { background: transparent; border: 2.5px dashed #fff; }
.train .upcoming .kite::after { background: rgba(255,255,255,.6); }

/* media */
.media-item { border-top: 3px dashed var(--stitch); border-bottom: 3px dashed var(--stitch); padding: 18px 0; }
.media-item .src { font-size: .95rem; margin: 0; }
.media-item h3 { font-size: 1.25rem; line-height: 1.4; margin: 6px 0; }
.tag { display: inline-block; background: var(--purple-ink); color: #fff; font-size: .85rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; }
.note { font-size: .95rem; margin-top: 12px; }
.media-empty { display: none; border: 3px dashed var(--stitch); border-radius: 22px; padding: 22px; }
.media-empty p { margin: 0 0 12px; max-width: 30em; }
.media--empty .media-item, .media--empty .note { display: none; }
.media--empty .media-empty { display: block; }

/* about */
.about-photo { margin: 0 0 28px !important; }
.about-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px 40px 4px 40px; }
.about p { max-width: 34em; }
.rules { list-style: none; counter-reset: r; padding: 0; margin: 18px 0 0; }
.rules li { counter-increment: r; position: relative; padding: 0 0 16px 54px; max-width: 36em; }
.rules li::before {
  content: counter(r); position: absolute; left: 0; top: -2px;
  font-family: "Shrikhand", var(--font-body); font-size: 2rem; line-height: 1;
  color: var(--kite-pink);
}
html:lang(gu) .rules li::before { content: counter(r, gujarati); font-family: "Noto Sans Gujarati", sans-serif; font-weight: 900; font-size: 1.9rem; }
.about h3 { font-size: 1.2rem; margin: 22px 0 0; }

/* choreographer entry */
.tool { background: var(--logo-yellow); }
.tool .wrap { display: grid; gap: 14px; }
.tool h2 { font-size: clamp(1.7rem, 6.5vw, 2.6rem); line-height: var(--lh-head); font-family: var(--font-display); font-weight: var(--display-weight); }
.tool p { margin: 0; max-width: 32em; }

/* contact + footer */
.contact { background: var(--sky-deep); color: #fff; }
.contact p { max-width: 32em; }
.site-foot { background: var(--sky-deep); color: #fff; padding: 8px 0 40px; font-size: .95rem; }
.site-foot .wrap > * { max-width: 46em; }
.site-foot .stitch { border-top-color: rgba(255,255,255,.35); }
.site-foot .wrap > .stitch { max-width: none; }
.site-foot small { display: block; font-size: .9rem; opacity: .9; }
.site-foot .langs { margin-bottom: 14px; }

/* ---------- article ---------- */
.post-head { background: var(--sky); color: #fff; padding: 28px 0 46px; }
.post-head h1 { font-size: clamp(2rem, 9.5vw, 4rem); margin: 10px 0 18px; max-width: 16em; }
html:lang(gu) .post-head h1 { font-size: clamp(1.8rem, 8vw, 3.4rem); }
.back { font-weight: 700; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; }
.meta dt { opacity: .85; }
.meta dd { margin: 0; font-weight: 800; }
.post-body { padding: 36px 0 8px; }
.post-body .prose { max-width: 36em; font-size: 1.125rem; }
.post-body .prose p { margin: 0 0 1em; }
.ai-note { background: #f4e9f3; border-left: 6px solid var(--octo-purple); padding: 12px 16px; margin: 0 0 24px; border-radius: 0 14px 14px 0; font-size: 1rem; max-width: 36em; }
.gallery h2 { font-size: 1.4rem; margin: 30px 0 14px; }
.gallery ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery li:first-child { grid-column: 1 / -1; }
.gallery a { display: block; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.gallery li:first-child img { aspect-ratio: 4 / 3; }
.gallery--2 li:first-child { grid-column: auto; }
.gallery--2 li:first-child img { aspect-ratio: 1; }
.post-foot { padding: 10px 0 40px; }
.pn { display: grid; gap: 12px; margin-top: 8px; }
.pn a { display: block; text-decoration: none; padding: 14px 16px; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 3px 4px 0 var(--ink); }
.pn a:hover { background: #fff8b0; }
.pn span { display: block; font-size: .9rem; }
.pn strong { display: block; font-size: 1.08rem; line-height: 1.35; }
.other-langs { margin: 0 0 10px; }
.other-langs .langs { font-size: 1rem; }
.post-foot h2 { font-size: 1.1rem; margin: 18px 0 4px; }

/* videos — added in S1 (2026-11-30): three old posts have clips, the design had no slot for them */
.videos h2 { font-size: 1.4rem; margin: 30px 0 14px; }
.videos figure { margin: 0 0 14px; max-width: 760px; }
.videos video { display: block; width: 100%; height: auto; max-height: 82vh; border-radius: 14px; background: var(--sky-deep); }

/* festivals list — added in S1 (2026-11-30): homepage line shows the latest few, this page lists all */
.train .fname { font-weight: 800; font-size: 1.08rem; }
.train-more { margin: 28px 0 0; position: relative; }
.fest-year { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: var(--lh-head); color: var(--sky); margin: 34px 0 8px; }
.fest-list .fest-upcoming .fest-year { color: var(--pink-ink); margin-top: 0; }
.fest-items { list-style: none; margin: 0; padding: 0; max-width: 40em; }
.fest-items li { border-top: 3px dashed var(--stitch); padding: 12px 0; display: grid; gap: 2px; }
.fest-items .fname { font-weight: 800; font-size: 1.1rem; line-height: 1.4; }
.fest-items .fmeta { font-size: .95rem; opacity: .85; }
.post-head p { margin: 0; max-width: 36em; }

/* lightbox (JS only) */
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
dialog.lightbox::backdrop { background: rgba(14, 40, 84, .92); }
dialog.lightbox img { max-width: 96vw; max-height: 82vh; border-radius: 10px; }
dialog.lightbox .close { margin: 10px auto 0; display: block; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .hero { padding-top: 24px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; align-items: end; gap: 48px; }
  .hang { padding-top: 70px; max-width: 520px; }
  .hero-photo { margin: 0 calc(var(--gutter) * -1) 0 0; }
  .hero-photo img { aspect-ratio: 4 / 4.6; clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%); }
  .hero .text { padding-bottom: 48px; }
  .section { padding: 84px 0; }
  .next-grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
  .latest-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; }
  .latest-grid .post-list li:first-child { border-top: 0; }
  /* kite train runs uphill left to right, like a train of kites on one line */
  .train { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; padding: 60px 0 0; }
  .train::before { left: 0; right: 0; top: auto; bottom: auto; width: auto; height: 2px; top: 150px; transform: rotate(-7deg); transform-origin: left; }
  .train > li { margin: 0 !important; padding: 56px 0 0; }
  .train > li:nth-child(1) { transform: translateY(80px); }
  .train > li:nth-child(2) { transform: translateY(58px); }
  .train > li:nth-child(3) { transform: translateY(36px); }
  .train > li:nth-child(4) { transform: translateY(14px); }
  .train > li:nth-child(5) { transform: translateY(-8px); }
  .kite { left: 0; top: 0; width: 40px; height: 40px; }
  .kite::after { left: 19px; top: 40px; height: 18px; }
  .festivals .section { padding-bottom: 120px; }
  .festivals { padding-bottom: 130px; }
  .media-wrap > * { max-width: 760px; }
  .about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
  .tool .wrap { grid-template-columns: 1fr auto; align-items: center; }
  .tool.section { padding: 56px 0; }
  .post-head { padding: 40px 0 64px; }
  .gallery--1 ul { grid-template-columns: minmax(0, 760px); }
  .gallery--2 ul { grid-template-columns: 1fr 1fr; }
  .gallery--2 li:first-child { grid-column: auto; }
  .gallery--2 img, .gallery--2 li:first-child img { aspect-ratio: 4 / 3; }
  .gallery--3 ul { grid-template-columns: repeat(3, 1fr); }
  .gallery--3 li:first-child { grid-column: span 2; grid-row: span 2; position: relative; }
  .gallery--3 li:first-child a { position: absolute; inset: 0; }
  .gallery--3 li:first-child img { aspect-ratio: auto; height: 100%; }
  .pn { grid-template-columns: 1fr 1fr; }
  .train-more { margin-top: 110px; } /* 線上第一隻風箏往下移了 80px，按鈕要讓開 */
}

@media (prefers-reduced-motion: reduce) {
  .sail { animation: none; }
  .btn:active { transform: none; }
}
