/* ==========================================================================
   The Hong Kong Healthy Longevity Study — site styles
   Palette sampled from the logo: forest ink, crane teal, mint, "H" orange,
   peach, coral arc and the red crest (accent only).
   ========================================================================== */
:root {
  --ink: #0f3b2e;          /* logo lettering */
  --ink-soft: #2f5a4c;
  --teal-700: #2f6e5c;
  --teal-600: #3f8872;     /* crane / "L" */
  --teal-500: #5a917b;     /* mockup card */
  --mint-300: #a8d8c2;     /* logo lower gradient */
  --mint-200: #c3dcc4;     /* mockup sage card */
  --mint-100: #e6f2ea;
  --orange-500: #f08a3e;   /* "H" */
  --orange-400: #f6a55a;
  --peach-300: #f9c894;
  --peach-100: #fdf0e1;
  --coral-500: #ec6e6e;    /* arc */
  --coral-300: #f7a39a;
  --crest: #e0483b;
  --cream: #fbf8f3;
  --white: #fff;
  --line: #dde7e0;
  --muted: #5b6f67;

  --grad-logo: linear-gradient(135deg, var(--peach-300) 0%, #d7d4b2 45%, var(--mint-300) 100%);
  --grad-warm: linear-gradient(100deg, var(--orange-500) 0%, var(--orange-400) 40%, var(--peach-300) 100%);
  --grad-arc: linear-gradient(90deg, var(--coral-300), var(--coral-500));

  --font-head: "Montserrat", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
  --font-body: "Noto Sans", "Noto Sans TC", "Noto Sans SC", system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(15, 59, 46, .25);
  --container: 1200px;
  --header-h: 96px;
}
.lang-zh_hans { --font-head: "Montserrat", "Noto Sans SC", system-ui, sans-serif; --font-body: "Noto Sans", "Noto Sans SC", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-700); }
a:hover { color: var(--orange-500); }
:focus-visible { outline: 3px solid var(--orange-500); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; color: var(--ink); margin: 0 0 .6em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 860px; }
.section { padding: 72px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.empty { color: var(--muted); text-align: center; padding: 32px 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
}
/* blur lives on a pseudo-element so it does not become the containing block of the fixed mobile menu */
.site-header::before { content: ""; position: absolute; inset: 0; z-index: -1; backdrop-filter: saturate(1.4) blur(8px); }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--grad-arc); opacity: .85; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); max-width: 1320px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 84px; height: auto; }
.brand-text { display: none; font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1rem; line-height: 1.2; max-width: 190px; }

.site-nav { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-list { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a {
  display: block; padding: 10px 13px; font-family: var(--font-head); font-weight: 700; font-size: .95rem;
  color: var(--ink); text-decoration: none; border-radius: 999px; white-space: nowrap; transition: background .2s, color .2s;
}
.nav-item > a:hover { background: var(--mint-100); color: var(--ink); }
.nav-item.is-active > a { color: var(--teal-600); }
.nav-item.is-active > a::after { content: ""; display: block; height: 3px; margin-top: 2px; border-radius: 2px; background: var(--orange-500); }
.sub-toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px; }
.sub-menu {
  list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 50%; transform: translate(-50%, 6px);
  min-width: 250px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); z-index: 5; /* above the header's coloured bottom line */
  opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s;
}
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.sub-menu a {
  display: block; padding: 10px 14px; border-radius: 10px; text-decoration: none; font-family: var(--font-head);
  font-weight: 600; font-size: .92rem; color: var(--coral-500);
}
.sub-menu a:hover, .sub-menu a[aria-current] { background: var(--peach-100); color: var(--crest); }

.lang-switch { display: flex; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; flex-shrink: 0; }
.lang-switch a {
  min-width: 36px; text-align: center; padding: 4px 9px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: .85rem; color: var(--ink-soft); font-family: var(--font-head);
}
.lang-switch a:hover { background: var(--mint-100); color: var(--ink); }
.lang-switch a.is-current { background: var(--teal-600); color: #fff; }

.nav-toggle { display: none; margin-left: auto; width: 46px; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 20px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; position: relative; transition: transform .2s; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; } .nav-toggle-bars::after { top: 6px; }
.nav-open .nav-toggle-bars { background: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1180px) {
  .nav-item > a { padding: 10px 9px; font-size: .88rem; }
}
@media (max-width: 1040px) {
  :root { --header-h: 76px; }
  .brand img { width: 64px; }
  .brand-text { display: block; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; background: #fff; flex-direction: column; align-items: stretch;
    padding: 16px 20px 32px; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
  }
  .nav-open .site-nav { transform: none; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav-item > a { flex: 1; padding: 14px 6px; font-size: 1.05rem; border-radius: 0; }
  .nav-item > a:hover { background: none; }
  .nav-item.is-active > a::after { display: none; }
  .sub-toggle { display: block; }
  .sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .sub-menu { position: static; transform: none; opacity: 1; visibility: inherit; box-shadow: none; border: 0; width: 100%; display: none; padding: 0 0 10px 10px; }
  .sub-menu::before { display: none; }
  .has-sub.sub-open .sub-menu { display: block; }
  .has-sub:hover .sub-menu, .has-sub:focus-within .sub-menu { transform: none; visibility: inherit; }
  .lang-switch { align-self: flex-start; margin-top: 18px; }
  .lang-switch a { min-width: 48px; padding: 8px 12px; font-size: 1rem; }
  body.nav-open { overflow: hidden; }
}
@media (max-width: 420px) { .brand-text { font-size: .85rem; max-width: 150px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 26px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s, background .2s, color .2s, box-shadow .2s; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--teal-600); color: #fff; box-shadow: 0 6px 18px -8px rgba(63,136,114,.8); }
.btn-primary:hover { background: var(--teal-700); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); box-shadow: 0 8px 22px -10px rgba(0,0,0,.35); }
.btn-light:hover { background: var(--ink); color: #fff; }

/* "Learn more" pill from the mockup */
.btn-pill {
  display: inline-flex; align-items: center; gap: 12px; padding: 5px 22px 5px 5px; border: 2.5px solid var(--ink); border-radius: 999px;
  font-family: var(--font-head); font-weight: 800; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; background: rgba(255,255,255,.35); transition: background .2s, color .2s;
}
.btn-pill-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 1.5rem; line-height: 1; padding-bottom: 3px; transition: transform .2s, background .2s; }
.btn-pill:hover { background: var(--ink); color: #fff; }
.btn-pill:hover .btn-pill-icon { background: var(--orange-500); transform: translateX(2px); }
.btn-pill-light { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-pill-light .btn-pill-icon { background: #fff; color: var(--ink); }
.btn-pill-light:hover { background: #fff; color: var(--ink); }
.btn-pill-light:hover .btn-pill-icon { background: var(--orange-500); color: #fff; }
.lang-en .btn-pill { letter-spacing: .06em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.text-link { font-family: var(--font-head); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* ---------- Hero carousel ---------- */
.hero { position: relative; overflow: hidden; background: var(--grad-warm); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  flex: 0 0 100%; scroll-snap-align: start; min-height: clamp(340px, 46vw, 500px); display: flex; align-items: center;
  position: relative; background: var(--grad-warm); isolation: isolate;
}
.hero-slide:nth-child(3n+2) { background: linear-gradient(100deg, var(--coral-500), var(--orange-400) 55%, var(--peach-300)); }
.hero-slide:nth-child(3n+3) { background: linear-gradient(100deg, var(--teal-600), var(--mint-300) 60%, var(--peach-300)); }
/* soft grain like the mockup banner */
.hero-slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-slide::after { /* logo-arc motif */
  content: ""; position: absolute; z-index: -1; right: -8vw; top: 50%; width: min(55vw, 620px); aspect-ratio: 1; transform: translateY(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.35), rgba(255,255,255,0) 65%);
  box-shadow: inset 0 0 0 26px rgba(255,255,255,.12);
}
.hero-slide.has-image { background: var(--ink) var(--slide-img) center/cover no-repeat; }
.hero-slide.has-image::before { opacity: 1; mix-blend-mode: normal; background: linear-gradient(90deg, rgba(15,59,46,.78), rgba(15,59,46,.25) 70%, rgba(15,59,46,0)); }
.hero-slide.has-image::after { display: none; }
.hero-content { padding-top: 56px; padding-bottom: 80px; text-align: center; }
.hero-title { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 800; color: #fff; max-width: 16em; margin: 0 auto .35em; text-shadow: 0 2px 18px rgba(15,59,46,.25); }
.hero-text { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: #fff; max-width: 36em; margin: 0 auto 1.6em; font-weight: 500; text-shadow: 0 1px 10px rgba(15,59,46,.3); }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); transition: background .2s, color .2s;
}
.hero-arrow:hover { background: var(--ink); color: #fff; }
.hero-arrow.prev { left: 20px; } .hero-arrow.next { right: 20px; }
.hero-dots { position: absolute; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.hero-dots button { width: 12px; height: 12px; border-radius: 999px; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; transition: width .25s, background .25s; }
.hero-dots button[aria-current="true"] { width: 32px; background: #fff; }
@media (max-width: 640px) { .hero-arrow { display: none; } }

/* ---------- Home: about ---------- */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: center; }
.about-pic img { border-radius: 28px; width: 100%; aspect-ratio: 4/5; object-fit: cover; box-shadow: var(--shadow); }
.about-pic-placeholder {
  aspect-ratio: 4/5; border-radius: 28px 28px 28px 140px; background: var(--grad-logo); display: grid; place-items: center; padding: 14%;
  position: relative; overflow: hidden;
}
.about-pic-placeholder::before { content: ""; position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; top: -30%; right: -30%; background: var(--grad-arc); opacity: .55; }
.about-pic-placeholder img { position: relative; box-shadow: none; aspect-ratio: auto; object-fit: contain; border-radius: 0; filter: drop-shadow(0 12px 24px rgba(15,59,46,.2)); }
.kicker { font-family: var(--font-head); font-weight: 700; color: var(--teal-600); font-size: 1.15rem; margin-bottom: .4em; letter-spacing: .01em; }
.section-title { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 800; }
.about-copy .prose { font-size: 1.12rem; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-pic { max-width: 300px; margin: 0 auto; }
  .about-pic img, .about-pic-placeholder { aspect-ratio: 1/1; }
}

/* ---------- Home: brush cards ---------- */
.home-pillars { display: grid; gap: 36px; padding-top: 24px; overflow: hidden; }
.brush-card { position: relative; width: min(64%, 820px); isolation: isolate; }
.brush-card::before { content: ""; position: absolute; inset: 0; z-index: -1; filter: url(#rough); }
.brush-mint::before { background: var(--mint-200); border-radius: 0 60px 60px 0; }
.brush-teal { justify-self: end; color: #fff; }
.brush-teal::before { background: var(--teal-500); border-radius: 60px 0 0 60px; }
.brush-inner { padding: 48px 56px 44px; min-height: 280px; display: flex; flex-direction: column; }
.brush-mint .brush-inner { padding-left: max(24px, calc((100vw - var(--container)) / 2 + 24px)); }
.brush-teal .brush-inner { padding-right: max(24px, calc((100vw - var(--container)) / 2 + 24px)); text-align: right; align-items: flex-end; }
.brush-card h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 800; }
.brush-teal h2 { color: var(--ink); }
.brush-teal .prose { color: #fff; text-align: left; }
.brush-card .prose { font-size: 1.08rem; max-width: 40em; flex: 1; }
.brush-card .btn-pill { align-self: flex-end; margin-top: 8px; }
.brush-teal .btn-pill { align-self: flex-end; }
@media (max-width: 860px) {
  .brush-card { width: calc(100% - 20px); }
  .brush-inner { padding: 36px 24px; min-height: 0; }
  .brush-mint .brush-inner { padding-left: 24px; }
  .brush-teal .brush-inner { padding-right: 24px; }
}

/* ---------- Brush heading (Latest Events) ---------- */
.brush-heading { text-align: center; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; padding: 22px 0; margin: 0 auto 48px; width: fit-content; min-width: min(420px, 90%); position: relative; }
.brush-heading::before, .brush-heading::after {
  content: ""; position: absolute; left: -4%; right: -4%; height: 6px; border-radius: 6px; background: var(--ink); filter: url(#rough);
}
.brush-heading::before { top: 0; transform: rotate(-.6deg); }
.brush-heading::after { bottom: 0; transform: rotate(.4deg); left: 0; right: -6%; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px; margin-bottom: 36px; }
.news-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.news-card-media { display: block; aspect-ratio: 1/1; background: var(--mint-200); overflow: hidden; }
.news-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-card-media > img { transform: scale(1.04); }
.news-card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: var(--grad-logo); }
.news-card-placeholder img { width: 38%; height: auto; opacity: .9; }
.news-card-body { padding: 20px 22px 24px; }
.news-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; font-family: var(--font-head); }
.tag-event { background: var(--peach-100); color: #b4521a; }
.tag-news { background: var(--mint-100); color: var(--teal-700); }
.tag-publication { background: #fde7e5; color: #b53c35; }
.news-title { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; }
.news-title a { color: var(--ink); text-decoration: none; }
.news-title a:hover { color: var(--teal-600); text-decoration: underline; }
.news-summary { color: var(--muted); font-size: .96rem; margin: 0; }
.news-summary p, .news-summary ul, .news-summary ol { margin: 0 0 .6em; }
.news-summary > :last-child { margin-bottom: 0; }
.news-summary h2, .news-summary h3, .news-summary h4 { font-size: 1rem; margin: .4em 0; padding: 0; border: 0; }
.news-summary img, .news-summary video, .news-summary .embed { margin: .6em 0; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filter-bar button {
  padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-family: var(--font-head);
  font-weight: 700; font-size: .9rem; color: var(--ink); cursor: pointer;
}
.filter-bar button:hover { border-color: var(--teal-600); }
.filter-bar button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Page hero & prose ---------- */
.page-hero { background: var(--grad-logo); padding: 64px 0 56px; position: relative; overflow: hidden; }
.page-hero::after { content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%; border: 48px solid rgba(236,110,110,.28); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin: 0; position: relative; }
.page-hero-sub { font-size: 1.2rem; color: var(--ink-soft); margin: 10px 0 0; position: relative; max-width: 40em; }
.content-layout.has-image { display: grid; grid-template-columns: 1fr 380px; gap: 56px; align-items: start; }
.content-figure { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.content-figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 900px) { .content-layout.has-image { grid-template-columns: 1fr; } .content-figure { position: static; } }
.prose { max-width: 72ch; }
.prose-lg { font-size: 1.1rem; }
.prose h2 { font-size: 1.65rem; font-weight: 800; margin-top: 1.6em; padding-left: 16px; border-left: 5px solid var(--orange-500); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin-top: 1.4em; color: var(--teal-700); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose ul li::marker { color: var(--orange-500); }
.prose ol li::marker { color: var(--teal-600); font-weight: 700; }
.prose strong { color: var(--ink); }
.brush-teal .prose strong { color: #fff; }
.intro { margin-bottom: 28px; }

/* ---------- Calculator ---------- */
.privacy-note {
  display: flex; gap: 12px; align-items: flex-start; background: var(--mint-100); border-left: 5px solid var(--teal-600);
  padding: 14px 18px; border-radius: 10px; color: var(--ink-soft); margin: 0 0 32px;
}
.privacy-note svg { flex-shrink: 0; margin-top: 3px; color: var(--teal-600); }
.sf10-progress { position: sticky; top: calc(var(--header-h) + 4px); z-index: 5; display: flex; align-items: center; gap: 14px; background: #fff; padding: 12px 0; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.sf10-progress-bar { flex: 1; height: 10px; background: var(--mint-100); border-radius: 999px; overflow: hidden; }
.sf10-progress-bar span { display: block; height: 100%; width: 0; background: var(--grad-warm); border-radius: 999px; transition: width .3s; }
.sf10-item, .quiz-q { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px 24px 24px; margin: 0 0 18px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.sf10-item.is-answered { border-color: var(--mint-300); }
.sf10-item.is-missing, .quiz-q.is-missing { border-color: var(--coral-500); box-shadow: 0 0 0 3px rgba(236,110,110,.18); }
.sf10-item legend, .quiz-q legend { display: flex; gap: 14px; align-items: flex-start; font-weight: 600; font-size: 1.08rem; padding: 0; margin-bottom: 16px; float: left; width: 100%; }
.sf10-item legend + *, .quiz-q legend + * { clear: both; }
.q-num { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: .95rem; }
.q-text { padding-top: 4px; }
.likert { display: grid; grid-template-columns: repeat(var(--opts, 5), 1fr); gap: 10px; clear: both; }
.likert-opt { position: relative; cursor: pointer; }
.likert-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.likert-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 86px; padding: 10px 6px;
  border: 2px solid var(--line); border-radius: 14px; text-align: center; transition: all .15s; background: var(--cream); height: 100%;
}
.likert-val { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--teal-600); }
.likert-label { font-size: .86rem; line-height: 1.3; color: var(--ink-soft); }
.likert-opt:hover .likert-box { border-color: var(--teal-500); }
.likert-opt input:focus-visible + .likert-box { outline: 3px solid var(--orange-500); outline-offset: 2px; }
.likert-opt input:checked + .likert-box { background: var(--teal-600); border-color: var(--teal-600); }
.likert-opt input:checked + .likert-box .likert-val, .likert-opt input:checked + .likert-box .likert-label { color: #fff; }
@media (max-width: 640px) {
  .likert { grid-template-columns: 1fr; gap: 8px; }
  .likert-box { flex-direction: row; justify-content: flex-start; min-height: 0; padding: 12px 16px; gap: 14px; }
  .likert-label { font-size: 1rem; }
  .sf10-item, .quiz-q { padding: 18px 16px; }
}
.form-error { color: #b53c35; font-weight: 600; background: #fde7e5; padding: 12px 16px; border-radius: 10px; }
.sf10-result { margin-top: 12px; padding: 36px; border-radius: 24px; background: var(--cream); border: 1.5px solid var(--line); }
.sf10-result:focus { outline: none; }
.result-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.result-scores > div { background: #fff; border-radius: 16px; padding: 18px 20px; border: 1px solid var(--line); }
.result-label { display: block; font-size: .9rem; color: var(--muted); }
.result-num { font-family: var(--font-head); font-weight: 800; font-size: 2.4rem; color: var(--ink); line-height: 1.2; }
.result-num small { font-size: 1.1rem; color: var(--muted); }
.result-band { border-radius: 16px; padding: 20px 24px; margin-bottom: 22px; color: #fff; }
.result-band h3 { color: inherit; font-size: 1.5rem; margin-bottom: .3em; }
.result-band p { margin: 0; }
.result-band.band-robust { background: var(--teal-600); }
.result-band.band-prefrail { background: var(--orange-500); }
.result-band.band-frail { background: var(--coral-500); }
.result-scale { margin-bottom: 20px; }
.scale-bar { position: relative; display: flex; height: 14px; border-radius: 999px; overflow: visible; }
.scale-bar .seg:first-child { border-radius: 999px 0 0 999px; } .scale-bar .seg:nth-child(3) { border-radius: 0 999px 999px 0; }
/* segment widths and tick positions are set inline from the scoring thresholds */
.seg-robust { background: var(--teal-600); } .seg-pre { background: var(--orange-500); } .seg-frail { background: var(--coral-500); }
.scale-bar i { position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); transform: translate(-50%, -50%); transition: left .5s; }
.scale-ticks { position: relative; height: 22px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.scale-ticks span { position: absolute; transform: translateX(-50%); }
.scale-ticks span:nth-child(1) { left: 0; transform: none; } .scale-ticks span:nth-child(4) { right: 0; transform: none; }
.scoring-ref { margin-bottom: 16px; }
.scoring-ref summary { cursor: pointer; font-weight: 700; color: var(--teal-700); }
@media (max-width: 560px) { .result-scores { grid-template-columns: 1fr; } .sf10-result { padding: 22px 18px; } }

/* ---------- Videos & quiz ---------- */
.video-block { padding: 40px 0; border-top: 1px solid var(--line); }
.video-block:first-of-type { border-top: 0; padding-top: 0; }
.video-title { font-size: 1.7rem; font-weight: 800; margin-bottom: .2em; }
.video-frame { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--ink); margin: 16px 0 20px; box-shadow: var(--shadow); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--grad-logo); color: var(--ink-soft); font-weight: 600; }
.video-missing img { width: 90px; }
.quiz { margin-top: 24px; padding: 28px; border-radius: 24px; background: var(--cream); }
.quiz-heading { font-size: 1.4rem; font-weight: 800; margin-bottom: .2em; }
.quiz-opt { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-radius: 12px; border: 2px solid var(--line); margin-bottom: 8px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; clear: both; }
.quiz-opt:hover { border-color: var(--teal-500); }
.quiz-opt input { accent-color: var(--teal-600); width: 20px; height: 20px; flex-shrink: 0; margin: 0; }
.quiz-opt:has(input:checked) { border-color: var(--teal-600); background: var(--mint-100); }
.quiz.is-checked .quiz-opt { cursor: default; }
.quiz-opt.is-correct { border-color: var(--teal-600); background: var(--mint-100); }
.quiz-opt.is-correct::after { content: "✓"; margin-left: auto; font-weight: 800; color: var(--teal-600); }
.quiz-opt.is-wrong { border-color: var(--coral-500); background: #fde7e5; }
.quiz-opt.is-wrong::after { content: "✕"; margin-left: auto; font-weight: 800; color: var(--coral-500); }
.quiz-feedback { margin: 10px 0 0; font-weight: 600; }
.quiz-feedback.ok { color: var(--teal-700); } .quiz-feedback.bad { color: #b53c35; }
.quiz-score { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; background: var(--grad-warm); color: #fff; padding: 16px 22px; border-radius: 16px; margin-top: 8px; }
@media (max-width: 560px) { .quiz { padding: 20px 14px; } }

/* ---------- Partners / contact ---------- */
.partner-grid, .contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.partner-card, .contact-card { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px; transition: box-shadow .2s, transform .2s; }
.partner-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.partner-logo { height: 90px; display: flex; align-items: center; margin-bottom: 18px; }
.partner-logo img { max-height: 90px; width: auto; object-fit: contain; }
.partner-logo span { width: 72px; height: 72px; border-radius: 50%; background: var(--grad-logo); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--ink); }
.partner-name { font-size: 1.12rem; font-weight: 700; }
.contact-card svg { color: var(--orange-500); margin-bottom: 12px; }
.contact-card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4em; }
.contact-card p { margin: 0; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d7e6de; margin-top: 40px; position: relative; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--orange-500), var(--peach-300), var(--mint-300), var(--teal-600)); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-top: 60px; padding-bottom: 44px; }
.footer-brand img { width: 84px; background: #fff; border-radius: 50%; padding: 4px; margin-bottom: 14px; }
.footer-title { font-family: var(--font-head); font-weight: 800; color: #fff; font-size: 1.15rem; margin-bottom: .4em; }
.footer-note { font-size: .95rem; max-width: 30em; }
.footer-heading { font-family: var(--font-head); font-weight: 700; color: var(--peach-300); text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; margin-bottom: 14px; }
.footer-links, .footer-social { list-style: none; margin: 0 0 20px; padding: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--peach-300); text-decoration: underline; }
.footer-social a { display: inline-block; padding: 6px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: .9rem; }
.footer-contact { font-style: normal; font-size: .95rem; }
.footer-contact p { margin-bottom: .7em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .85rem; color: #a9c3b7; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- Print (calculator result) ---------- */
@media print {
  .site-header, .site-footer, .page-hero::after, .sf10, .privacy-note, .cta-row, .skip-link { display: none !important; }
  .page-hero { background: none; padding: 0 0 12px; }
  .sf10-result { border: 0; background: none; padding: 0; }
  .result-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Admin entry points ---------- */
.footer-bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.site-footer .admin-link { color: #a9c3b7; text-decoration: none; }
.site-footer .admin-link:hover { color: var(--peach-300); text-decoration: underline; }
.admin-fab {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: .9rem; box-shadow: var(--shadow);
}
.admin-fab:hover { background: var(--teal-600); color: #fff; }
@media print { .admin-fab { display: none; } }

/* ---------- Rich content from the visual editor ---------- */
.prose img { max-width: 100%; height: auto; border-radius: 12px; }
.prose p > img:only-child { margin: 8px 0; }
.prose figure { margin: 1.4em 0; }
.prose figure img { display: block; }
.prose figcaption { font-size: .92rem; color: var(--muted); margin-top: 8px; text-align: center; }
.prose img[style*="float: left"] { margin: 4px 22px 12px 0; }
.prose img[style*="float: right"] { margin: 4px 0 12px 22px; }
.prose .embed { position: relative; aspect-ratio: 16 / 9; margin: 1.4em 0; border-radius: 16px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow); }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose video { display: block; width: 100%; height: auto; margin: 1.4em 0; border-radius: 16px; background: var(--ink); }
.prose audio { width: 100%; margin: .6em 0; }
.prose .pdf-embed { display: block; width: 100%; height: min(80vh, 900px); margin: 1.4em 0 .6em; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cream); }
.prose a.file-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; font-weight: 600; text-decoration: none; color: var(--ink);
}
.prose a.file-link::before { content: ""; width: 26px; height: 30px; flex-shrink: 0; border-radius: 4px; background: var(--coral-500);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M3 0h12l9 9v17a2 2 0 01-2 2H3a2 2 0 01-2-2V2a2 2 0 012-2zm11 1.5V10h8.5' fill='black'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='M3 0h12l9 9v17a2 2 0 01-2 2H3a2 2 0 01-2-2V2a2 2 0 012-2zm11 1.5V10h8.5' fill='black'/%3E%3C/svg%3E") center/contain no-repeat; }
.prose a.file-link:hover { border-color: var(--teal-600); color: var(--teal-700); box-shadow: var(--shadow); }
.prose .file-meta { color: var(--muted); font-size: .9rem; }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 5px solid var(--mint-300); background: var(--mint-100); border-radius: 0 12px 12px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .98rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--mint-100); font-weight: 700; }
.prose hr { border: 0; height: 3px; background: var(--grad-arc); border-radius: 3px; margin: 2em 0; opacity: .6; }

/* questions with many answers wrap onto several rows */
.likert.likert-many { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
@media (max-width: 640px) { .likert.likert-many { grid-template-columns: 1fr; } }

/* ---------- Clickable news cards & item page ---------- */
.news-card { position: relative; cursor: pointer; }
.news-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.news-card-link:focus-visible { outline: none; }
.news-card:focus-within { outline: 3px solid var(--orange-500); outline-offset: 3px; }
.news-card .news-summary a { position: relative; z-index: 2; } /* links inside the summary stay clickable */
.news-card:hover .news-title a { color: var(--teal-600); text-decoration: underline; }
.news-read-more { display: inline-block; margin-top: 12px; font-family: var(--font-head); font-weight: 700; font-size: .9rem; color: var(--teal-700); }
.news-card:hover .news-read-more { color: var(--orange-500); }
.news-hero .news-meta { margin-bottom: 12px; }
.news-hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.news-detail-figure { margin: 0 0 32px; }
.news-detail-figure img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.news-detail .cta-row { margin-top: 36px; }
.more-news { background: var(--cream); }
.more-news .section-title { margin-bottom: 32px; }
