/* ==========================================================================
   Ningbo XMA Toastmasters — Official Website Mockup
   Design system. Brand colors = Toastmasters International (official VI).
   Layout/components = newly designed (not a FreeToastHost replica).
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  /* Official TI brand */
  --loyal-blue: #004165;
  --true-maroon: #772432;
  --cool-gray: #A9B2B1;
  --happy-yellow: #F2DF74;

  /* Derived UI scale (interface layers only — not for brand collateral) */
  --blue-900: #002C44;
  --blue-700: #004165;
  --blue-500: #1F6E97;
  --blue-100: #D6E4EC;
  --blue-50:  #EEF4F8;
  --maroon-500: #9C3242;
  --maroon-100: #EAD3D7;
  --yellow-300: #F8EDAB;
  --yellow-700: #D9C24A;
  --gray-300: #CDD3D2;
  --gray-100: #EDEFEF;
  --ink: #1A2326;
  --muted: #5B6A70;
  --white: #ffffff;

  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;

  --container: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,40,68,.10), 0 1px 2px rgba(0,40,68,.06);
  --shadow: 0 6px 20px rgba(0,40,68,.10);
  --shadow-lg: 0 18px 50px rgba(0,40,68,.18);
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(48px, 7vw, 96px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  font-size: 17px;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-500); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--loyal-blue); line-height: 1.18; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1rem; }
.lang-zh body, [lang] { }

/* ---- Layout helpers ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--blue-50); }
.section--blue { background: var(--loyal-blue); color: #dceaf2; }
.section--blue h2, .section--blue h3 { color: var(--white); }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--true-maroon); margin-bottom: .6rem; }
.section--blue .eyebrow { color: var(--happy-yellow); }
.center { text-align: center; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.center .lead { margin-inline: auto; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  padding: .8em 1.5em; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .2s, box-shadow .2s, color .2s;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--happy-yellow); color: var(--loyal-blue); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--yellow-700); }
.btn--solid { background: var(--loyal-blue); color: var(--white); }
.btn--solid:hover { background: var(--blue-900); }
.btn--maroon { background: var(--true-maroon); color: var(--white); }
.btn--maroon:hover { background: var(--maroon-500); }
.btn--ghost { background: transparent; color: var(--loyal-blue); border-color: var(--blue-100); }
.btn--ghost:hover { border-color: var(--loyal-blue); background: var(--blue-50); }
.section--blue .btn--ghost,
.hero .btn--ghost,
.cta-band .btn--ghost { color: var(--white); border-color: rgba(255,255,255,.45); }
.section--blue .btn--ghost:hover,
.hero .btn--ghost:hover,
.cta-band .btn--ghost:hover { background: rgba(255,255,255,.12); }
.btn--lg { padding: 1em 1.9em; font-size: 1.08rem; }

/* ---- Header / Nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--gray-100);
}
.nav { display: flex; align-items: center; gap: 1.2rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-head); font-weight: 800; color: var(--loyal-blue); }
.brand:hover { text-decoration: none; }
.brand__mark {
  height: 44px; width: auto; flex: none; display: block;
  object-fit: contain;
}
.brand__name { font-size: 1.02rem; line-height: 1.1; }
.brand__name small { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.nav__links { display: flex; gap: .3rem; margin-left: auto; align-items: center; }
.nav__links a {
  font-family: var(--font-head); font-weight: 600; font-size: .95rem;
  color: var(--ink); padding: .5rem .7rem; border-radius: 8px;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--loyal-blue); background: var(--blue-50); text-decoration: none; }
.nav__actions { display: flex; align-items: center; gap: .5rem; }
.lang-toggle {
  display: inline-flex; border: 1px solid var(--gray-300); border-radius: 999px; overflow: hidden; font-family: var(--font-head);
}
.lang-toggle button {
  border: 0; background: transparent; padding: .35rem .7rem; font-weight: 700; font-size: .82rem; color: var(--muted); cursor: pointer;
}
.lang-toggle button.is-active { background: var(--loyal-blue); color: var(--white); }
.nav__login { font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--loyal-blue); padding: .5rem .6rem; }
.nav__toggle { display: none; border: 0; background: transparent; cursor: pointer; padding: .4rem; margin-left: auto; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--loyal-blue); margin: 5px 0; border-radius: 2px; transition: .2s; }

/* Mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.is-open { display: block; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(0,40,68,.45); }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(82vw, 340px);
  background: var(--white); box-shadow: var(--shadow-lg); padding: 1.2rem; display: flex; flex-direction: column; gap: .3rem;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.is-open .drawer__panel { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.drawer__close { border: 0; background: var(--gray-100); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: var(--loyal-blue); }
.drawer a { font-family: var(--font-head); font-weight: 600; color: var(--ink); padding: .8rem .6rem; border-radius: 8px; }
.drawer a:hover { background: var(--blue-50); text-decoration: none; }
.drawer__actions { margin-top: auto; display: grid; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--gray-100); }

/* ---- Hero ---- */
.hero { position: relative; color: var(--white); overflow: hidden; background: var(--loyal-blue); }
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(242,223,116,.22), transparent 60%),
    radial-gradient(700px 600px at 0% 110%, rgba(119,36,50,.55), transparent 55%),
    linear-gradient(135deg, var(--blue-900), var(--loyal-blue) 55%, #00567f);
}
.hero__inner { position: relative; padding-block: clamp(64px, 11vw, 132px); max-width: 760px; }
.hero h1 { color: var(--white); }
.hero p { font-size: 1.2rem; color: #d4e6f0; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__badge { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: .4rem .9rem; font-family: var(--font-head); font-weight: 600; font-size: .82rem; margin-bottom: 1.2rem; }
.hero__badge b { color: var(--happy-yellow); }

/* ---- Quick facts bar ---- */
.facts { background: var(--white); margin-top: -34px; position: relative; z-index: 5; }
.facts__inner { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(4,1fr); }
.fact { padding: 1.1rem 1.3rem; display: flex; gap: .8rem; align-items: center; border-right: 1px solid var(--gray-100); }
.fact:last-child { border-right: 0; }
.fact__ico { font-size: 1.5rem; line-height: 1; }
.fact__k { font-family: var(--font-head); font-weight: 700; color: var(--loyal-blue); font-size: 1.02rem; }
.fact__v { font-size: .82rem; color: var(--muted); }

/* ---- Cards ---- */
.card { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__ico { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--blue-50); color: var(--loyal-blue); margin-bottom: 1rem; }
.card--accent .card__ico { background: var(--yellow-300); color: var(--true-maroon); }
.card h3 { margin-bottom: .35rem; }
.card p { color: var(--muted); margin-bottom: 0; }

.media-card { overflow: hidden; padding: 0; }
.media-card__img { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--blue-100), var(--cool-gray)); position: relative; }
.media-card__img span { position: absolute; left: 12px; top: 12px; background: var(--true-maroon); color: #fff; font-family: var(--font-head); font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.media-card__body { padding: 1.2rem 1.3rem 1.5rem; }
.media-card__meta { font-size: .8rem; color: var(--muted); font-family: var(--font-head); font-weight: 600; }
.media-card h3 { font-size: 1.12rem; margin: .3rem 0 .4rem; }
.media-card__body p { color: var(--muted); font-size: .95rem; margin-bottom: 0; }

/* ---- Events + testimonial split ---- */
.evt-list { display: grid; gap: .8rem; }
.evt { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-sm); padding: .9rem 1.1rem; }
.evt__date { text-align: center; background: var(--loyal-blue); color: #fff; border-radius: 10px; padding: .4rem; font-family: var(--font-head); }
.evt__date b { display: block; font-size: 1.3rem; line-height: 1; }
.evt__date span { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.evt__t { font-family: var(--font-head); font-weight: 700; color: var(--ink); }
.evt__s { font-size: .85rem; color: var(--muted); }
.evt__tag { font-size: .72rem; font-weight: 700; font-family: var(--font-head); color: var(--true-maroon); }

.quote { background: linear-gradient(160deg, var(--maroon-100), var(--blue-50)); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 1.8rem; }
.quote__mark { font-family: var(--font-head); font-size: 3rem; color: var(--true-maroon); line-height: .6; }
.quote p { font-size: 1.1rem; font-style: italic; color: var(--ink); }
.quote__who { font-family: var(--font-head); font-weight: 700; color: var(--loyal-blue); font-style: normal; }

/* ---- CTA band ---- */
.cta-band { background: linear-gradient(120deg, var(--true-maroon), var(--maroon-500)); color: #fff; border-radius: var(--radius); padding: clamp(28px, 5vw, 56px); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #f3dde1; max-width: 50ch; margin-inline: auto; }
.cta-band .hero__cta { justify-content: center; }

/* ---- Page header (inner pages) ---- */
.page-head { background: var(--loyal-blue); color: #fff; position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 100% 0, rgba(242,223,116,.18), transparent 60%); }
.page-head__inner { position: relative; padding-block: clamp(40px, 7vw, 72px); }
.page-head h1 { color: #fff; margin-bottom: .3rem; }
.page-head p { color: #cfe3ee; margin: 0; }
.breadcrumb { font-size: .82rem; color: #9fc3d6; font-family: var(--font-head); margin-bottom: .8rem; }
.breadcrumb a { color: #cfe3ee; }

/* ---- Info/feature blocks ---- */
.infobox { background: var(--white); border: 1px solid var(--gray-100); border-left: 4px solid var(--loyal-blue); border-radius: var(--radius-sm); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.infobox dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; margin: 0; }
.infobox dt { font-family: var(--font-head); font-weight: 700; color: var(--muted); font-size: .9rem; }
.infobox dd { margin: 0; font-weight: 600; }
.map-embed { aspect-ratio: 4/3; border-radius: var(--radius); background: repeating-linear-gradient(45deg, var(--gray-100), var(--gray-100) 12px, var(--blue-50) 12px, var(--blue-50) 24px); display: grid; place-items: center; color: var(--muted); font-family: var(--font-head); border: 1px solid var(--gray-300); }

/* timeline (agenda / steps) */
.timeline { display: grid; gap: 0; }
.timeline li { list-style: none; display: grid; grid-template-columns: 84px 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--gray-300); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-family: var(--font-head); font-weight: 700; color: var(--true-maroon); }

/* step flow */
.flow { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.flow span { background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--loyal-blue); font-family: var(--font-head); font-weight: 700; padding: .5rem .9rem; border-radius: 999px; font-size: .9rem; }
.flow i { color: var(--cool-gray); font-style: normal; }

/* officer list */
.officers { display: grid; grid-template-columns: repeat(2,1fr); gap: .7rem; }
.officer { display: flex; align-items: center; justify-content: space-between; background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius-sm); padding: .9rem 1.1rem; }
.officer__role { font-family: var(--font-head); font-weight: 700; color: var(--loyal-blue); }
.officer__name { color: var(--muted); }

/* numbers */
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.stat { text-align: center; background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--radius); padding: 1.4rem 1rem; }
.stat b { display: block; font-family: var(--font-head); font-size: 2rem; color: var(--true-maroon); }
.stat span { font-size: .85rem; color: var(--muted); }

/* pathways grid */
.paths { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.path { background: var(--white); border: 1px solid var(--gray-100); border-top: 4px solid var(--happy-yellow); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; }
.path b { font-family: var(--font-head); color: var(--loyal-blue); display: block; }
.path span { font-size: .85rem; color: var(--muted); }

/* calendar */
.cal { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); overflow: hidden; }
.cal th { background: var(--blue-50); color: var(--loyal-blue); font-family: var(--font-head); font-size: .8rem; padding: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.cal td { border: 1px solid var(--gray-100); height: 84px; vertical-align: top; padding: .4rem; font-size: .85rem; color: var(--muted); width: 14.28%; }
.cal .ev { display: block; margin-top: .25rem; font-family: var(--font-head); font-weight: 700; font-size: .72rem; padding: .15rem .4rem; border-radius: 5px; color: #fff; }
.ev--mtg { background: var(--loyal-blue); }
.ev--cnt { background: var(--true-maroon); }
.ev--spc { background: var(--yellow-700); color: var(--loyal-blue); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; font-size: .85rem; font-family: var(--font-head); font-weight: 600; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: .35rem; vertical-align: -1px; }

/* forms */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-family: var(--font-head); font-weight: 600; font-size: .9rem; color: var(--ink); }
.field input, .field select, .field textarea {
  font: inherit; padding: .7rem .85rem; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue-500); outline-offset: 1px; border-color: var(--blue-500); }
.field--row { grid-template-columns: 1fr 1fr; gap: 1rem; display: grid; }
.choices { display: flex; flex-wrap: wrap; gap: .8rem; }
.choices label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-family: var(--font-body); }
.note-inline { font-size: .85rem; color: var(--muted); background: var(--blue-50); border-radius: var(--radius-sm); padding: .7rem .9rem; }

/* blog list */
.post-row { display: grid; grid-template-columns: 200px 1fr; gap: 1.2rem; background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); overflow: hidden; }
.post-row__img { background: linear-gradient(135deg, var(--blue-100), var(--cool-gray)); min-height: 130px; }
.post-row__body { padding: 1.2rem 1.3rem 1.2rem 0; }
.tag { display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--true-maroon); }

/* ---- Footer ---- */
.site-footer { background: var(--blue-900); color: #b9d0dd; font-size: .92rem; }
.site-footer .container { padding-block: clamp(40px, 6vw, 64px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .9rem; }
.site-footer a { color: #cfe1ec; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.foot-brand { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; }
.foot-brand__mark { height: 48px; width: auto; flex: none; display: block; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.social { display: flex; gap: .5rem; }
.social a { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; font-size: .9rem; font-family: var(--font-head); font-weight: 700; }
.social a:hover { background: var(--true-maroon); text-decoration: none; }
.disclaimer { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2rem; padding-top: 1.4rem; font-size: .8rem; color: #8fb0c1; }
.disclaimer p { margin: 0 0 .4rem; }

/* i18n visibility */
[data-zh] { }
html[data-lang="en"] .zh-only { display: none !important; }
html[data-lang="zh"] .en-only { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
  .split { grid-template-columns: 1fr; }
  .facts__inner { grid-template-columns: repeat(2,1fr); }
  .fact:nth-child(2) { border-right: 0; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .paths { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  .nav__links, .nav__login, .nav__actions .lang-toggle { display: none; }
  .nav__toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .facts { margin-top: 0; }
  .facts__inner { grid-template-columns: 1fr 1fr; box-shadow: var(--shadow-sm); }
  .officers { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .paths { grid-template-columns: 1fr; }
  .evt { grid-template-columns: 56px 1fr; }
  .evt__tag { display: none; }
  .field--row { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; }
  .post-row__img { min-height: 160px; }
  .post-row__body { padding: 1.2rem 1.3rem; }
  .cal-wrap { overflow-x: auto; }
  .cal { min-width: 560px; }
  .btn { width: 100%; justify-content: center; }
  .hero__cta .btn, .nav .btn { width: auto; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
}
