/*
Theme Name: World Kangdukwon Federation
Theme URI: https://kangdukwon.org/
Author: World Kangdukwon Federation
Description: A responsive, archive-conscious WordPress theme for the World Kangdukwon Federation. It highlights the shared lineage of Hwa Chong and Ahn Gun Soon, the 1966 transmission to Vietnam, and the growth of Kangdukwon in Portugal and worldwide.
Version: 1.0.1
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: world-kangdukwon-federation
Tags: accessibility-ready, custom-logo, custom-menu, featured-images, translation-ready, blog
*/

:root {
  --ink: #101a25;
  --ink-soft: #25384b;
  --paper: #f6f1e8;
  --white: #fffdf8;
  --gold: #e7b72f;
  --gold-light: #f7e3a2;
  --red: #a9282f;
  --line: rgba(16, 26, 37, .15);
  --shadow: 0 18px 45px rgba(16, 26, 37, .13);
  --radius: 18px;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.7;
}
img { display: block; max-width: 100%; height: auto; }
a { color: #7d1d25; text-decoration-thickness: .08em; text-underline-offset: .16em; }
a:hover { color: var(--red); }
h1, h2, h3, h4 {
  margin: 0 0 .55em;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
  letter-spacing: -.025em;
}
h1 { font-size: clamp(2.7rem, 6vw, 5.9rem); }
h2 { font-size: clamp(2rem, 4vw, 3.65rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
p { margin: 0 0 1.1em; }
.site-shell { width: min(calc(100% - 2rem), var(--content)); margin-inline: auto; }
.skip-link {
  position: fixed; left: 1rem; top: -100px; z-index: 9999;
  padding: .7rem 1rem; background: var(--gold); color: var(--ink); font-weight: 800;
}
.skip-link:focus { top: 1rem; }
.eyebrow {
  display: block; margin-bottom: .7rem; color: var(--red);
  font-size: .76rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase;
}
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: .72rem 1.15rem; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--ink); color: #fff; font-weight: 800;
  text-decoration: none; transition: transform .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); background: var(--red); color: #fff; }
.button--light { border-color: var(--white); background: transparent; }
.button--light:hover { background: var(--white); color: var(--ink); }
.text-link { font-weight: 850; }

.site-header { position: relative; z-index: 20; background: var(--ink); color: #fff; }
.identity-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding-block: .85rem; }
.custom-logo-link img, .brand-mark { width: 64px; height: 64px; object-fit: contain; }
.brand-name { display: block; color: #fff; font-family: Georgia, serif; font-size: clamp(1.15rem, 2vw, 1.55rem); font-weight: 700; line-height: 1.1; text-decoration: none; }
.brand-subtitle { margin-top: .22rem; color: var(--gold-light); font-size: .76rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.language-nav { display: flex; align-items: center; gap: .48rem; color: #fff; font-size: .78rem; font-weight: 800; }
.language-nav a { color: inherit; text-decoration: none; }
.language-nav a:hover, .language-nav .is-active { color: var(--gold); }
.nav-row { border-top: 1px solid rgba(255,255,255,.13); }
.nav-inner { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 58px; }
.menu-toggle { display: none; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; padding: .5rem .8rem; color: #fff; background: transparent; font: inherit; font-weight: 800; }
.primary-menu, .primary-menu ul { padding: 0; margin: 0; list-style: none; }
.primary-menu { display: flex; align-items: center; gap: clamp(.45rem, 2vw, 1.5rem); }
.primary-menu a { display: block; padding: .9rem .15rem; color: #fff; font-size: .88rem; font-weight: 750; text-decoration: none; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { color: var(--gold); }
.primary-menu .menu-item-has-children { position: relative; }
.primary-menu .sub-menu { display: none; position: absolute; top: 100%; left: -.9rem; min-width: 220px; padding: .45rem .8rem; border-top: 3px solid var(--gold); background: var(--ink); box-shadow: var(--shadow); }
.primary-menu .menu-item-has-children:hover > .sub-menu,
.primary-menu .menu-item-has-children:focus-within > .sub-menu { display: block; }
.primary-menu .sub-menu a { padding: .55rem .2rem; }

.hero {
  position: relative; overflow: hidden; background: var(--ink); color: #fff;
  isolation: isolate;
}
.hero::after {
  content: ""; position: absolute; z-index: -1; right: -12vw; top: -22%; width: 48vw; height: 145%;
  background: linear-gradient(135deg, transparent 0 48%, var(--gold) 48% 50%, transparent 50% 56%, rgba(169,40,47,.75) 56% 77%, transparent 77%);
  opacity: .78; transform: rotate(-2deg);
}
.hero-grid { display: grid; grid-template-columns: 1.06fr .94fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 700px; padding-block: clamp(4rem, 8vw, 7rem); }
.hero h1 { max-width: 820px; }
.hero h1 span { color: var(--gold); }
.hero-copy { max-width: 700px; color: #dbe2e8; font-size: clamp(1.06rem, 1.5vw, 1.28rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.pioneer-portraits { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; align-items: end; }
.portrait-card { margin: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius); background: rgba(255,255,255,.08); box-shadow: var(--shadow); }
.portrait-card:first-child { transform: translateY(-2.2rem); }
.portrait-card img { width: 100%; aspect-ratio: .86; object-fit: cover; object-position: center top; filter: saturate(.82) contrast(1.04); }
.portrait-card figcaption { padding: .85rem 1rem 1rem; }
.portrait-card strong { display: block; color: var(--gold); font-family: Georgia, serif; font-size: 1.15rem; }
.portrait-card span { display: block; margin-top: .15rem; color: #dbe2e8; font-size: .75rem; line-height: 1.35; }

.section { padding-block: clamp(4rem, 8vw, 7rem); }
.section--white { background: var(--white); }
.section--ink { background: var(--ink); color: #fff; }
.section-heading { display: grid; grid-template-columns: minmax(0, .82fr) minmax(260px, .48fr); gap: 3rem; align-items: end; margin-bottom: 2.7rem; }
.section-heading p { margin: 0; color: var(--ink-soft); }
.section--ink .section-heading p { color: #ccd5dd; }
.lineage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.lineage-card { position: relative; min-height: 310px; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.lineage-card::before { content: attr(data-step); display: block; color: var(--red); font-family: Georgia, serif; font-size: 3.2rem; line-height: 1; opacity: .24; }
.lineage-card p { color: var(--ink-soft); font-size: .93rem; }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.feature-media { position: relative; }
.feature-media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.feature-year { position: absolute; right: -1rem; bottom: -1rem; padding: .55rem .95rem; border-radius: 12px; background: var(--gold); color: var(--ink); font-family: Georgia, serif; font-size: 1.7rem; font-weight: 800; }
.feature-copy .lead { color: var(--ink-soft); font-size: 1.18rem; }
.section--ink .feature-copy .lead { color: #d7dfe6; }
.section--ink .feature-media img { outline: 1px solid rgba(255,255,255,.2); }

.country-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.country-card { display: flex; min-height: 245px; padding: 1.6rem; border-radius: var(--radius); background: linear-gradient(155deg, #fff 0 74%, #f0d986 74%); color: var(--ink); text-decoration: none; box-shadow: 0 8px 25px rgba(16,26,37,.08); }
.country-card:hover { transform: translateY(-4px); color: var(--ink); }
.country-card div { margin-top: auto; }
.country-card small { display: block; color: var(--red); font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.country-card h3 { margin-top: .25rem; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.post-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.post-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.post-card-body { padding: 1.3rem; }
.post-card time, .entry-meta { color: #657181; font-size: .78rem; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; }
.post-card h3 { margin-top: .45rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--red); }

.archive-cta { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: clamp(2rem, 5vw, 4rem); border-radius: var(--radius); background: var(--red); color: #fff; }
.archive-cta p { max-width: 700px; margin: 0; color: #f8dfe1; }

.page-hero { padding-block: clamp(3rem, 7vw, 5.5rem); background: var(--ink); color: #fff; }
.page-hero h1 { max-width: 950px; font-size: clamp(2.5rem, 5vw, 4.8rem); }
.breadcrumbs { margin-bottom: 1rem; color: var(--gold-light); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.breadcrumbs a { color: inherit; }
.content-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(230px, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.entry-content { min-width: 0; }
.entry-content > * { max-width: 760px; }
.entry-content > .alignwide { max-width: 1040px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content h3 { margin-top: 1.25em; }
.entry-content blockquote { margin: 2rem 0; padding: 1.3rem 1.6rem; border-left: 5px solid var(--gold); background: #fff; font-family: Georgia, serif; font-size: 1.2rem; }
.entry-content figure { margin: 2rem 0; }
.entry-content figcaption { margin-top: .6rem; color: #66727f; font-size: .82rem; }
.page-aside { position: sticky; top: 1rem; padding: 1.3rem; border-top: 4px solid var(--gold); background: #fff; box-shadow: 0 10px 25px rgba(16,26,37,.08); }
.page-aside ul { padding-left: 1.1rem; margin-bottom: 0; }
.page-aside a { font-weight: 730; }
.pagination { margin-top: 2.4rem; }

.site-footer { background: #09111a; color: #d6dde4; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; padding-block: 4rem; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer a { color: var(--gold-light); }
.footer-menu { padding: 0; margin: 0; list-style: none; }
.footer-menu li { margin: .4rem 0; }
.footer-bottom { padding-block: 1.1rem; border-top: 1px solid rgba(255,255,255,.12); color: #aab5bf; font-size: .78rem; }

@media (max-width: 920px) {
  .language-nav { display: none; }
  .identity-row { grid-template-columns: auto 1fr; }
  .menu-toggle { display: inline-flex; }
  .primary-navigation { display: none; position: absolute; left: 0; right: 0; top: 100%; padding: .5rem 1rem 1rem; background: var(--ink); }
  .primary-navigation.is-open { display: block; }
  .primary-menu { display: block; }
  .primary-menu a { padding: .62rem 0; }
  .primary-menu .sub-menu { display: block; position: static; min-width: 0; margin-left: 1rem; padding: 0; border: 0; box-shadow: none; }
  .hero-grid, .feature-grid, .content-layout { grid-template-columns: 1fr; }
  .hero-grid { min-height: 0; }
  .pioneer-portraits { max-width: 620px; }
  .section-heading { grid-template-columns: 1fr; gap: .5rem; }
  .lineage-grid { grid-template-columns: repeat(2, 1fr); }
  .country-grid, .post-grid { grid-template-columns: repeat(2, 1fr); }
  .page-aside { position: static; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .site-shell { width: min(calc(100% - 1.25rem), var(--content)); }
  .custom-logo-link img, .brand-mark { width: 52px; height: 52px; }
  .brand-subtitle { font-size: .62rem; }
  .hero-grid { padding-block: 3.3rem; }
  .pioneer-portraits { gap: .45rem; }
  .portrait-card:first-child { transform: none; }
  .portrait-card figcaption { padding: .65rem; }
  .lineage-grid, .country-grid, .post-grid, .footer-grid { grid-template-columns: 1fr; }
  .archive-cta { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
