/* ==========================================================================
   Klik-Nik — public site stylesheet
   Custom CSS, no framework. Mobile-first, light/dark aware.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --bg-raised: #ffffff;
  --border: #e6e6e9;
  --text: #17181c;
  --text-muted: #5b5d66;
  --text-faint: #8a8c94;
  --accent: #d43f2e;
  --accent-hover: #b8331f;
  --accent-contrast: #ffffff;
  --link: #17181c;
  --focus: #2f6fed;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 25, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 20, 25, 0.08);
  --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif-size-adjust: 1;
  --max-width: 1360px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --bg-subtle: #1a1b1f;
    --bg-raised: #1c1d21;
    --border: #2c2d32;
    --text: #f1f1f3;
    --text-muted: #b3b4bc;
    --text-faint: #7d7f88;
    --accent: #ff6a52;
    --accent-hover: #ff8266;
    --accent-contrast: #17181c;
    --link: #f1f1f3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  --bg: #121316; --bg-subtle: #1a1b1f; --bg-raised: #1c1d21; --border: #2c2d32;
  --text: #f1f1f3; --text-muted: #b3b4bc; --text-faint: #7d7f88; --accent: #ff6a52;
  --accent-hover: #ff8266; --accent-contrast: #17181c; --link: #f1f1f3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 8px 28px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-subtle: #f7f7f8; --bg-raised: #ffffff; --border: #e6e6e9;
  --text: #17181c; --text-muted: #5b5d66; --text-faint: #8a8c94; --accent: #d43f2e;
  --accent-hover: #b8331f; --accent-contrast: #ffffff; --link: #17181c;
  --shadow-sm: 0 1px 2px rgba(20,20,25,.06); --shadow-md: 0 8px 24px rgba(20,20,25,.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem); }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.6rem); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-contrast);
  padding: 10px 16px; border-radius: var(--radius-sm); z-index: 1000; transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--bg);
  border-bottom: 1px solid var(--border); backdrop-filter: saturate(180%) blur(8px);
}
.site-header__bar { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { color: var(--text); display: inline-flex; align-items: center; margin-right: auto; }
.brand__logo { display: block; height: 24px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  background: none; border: none; color: var(--text); margin-left: auto; order: 2;
}
.nav-toggle__icon, .nav-toggle__icon::before, .nav-toggle__icon::after {
  content: ""; display: block; width: 20px; height: 2px; background: currentColor; position: relative;
  transition: transform .2s ease;
}
.nav-toggle__icon::before { position: absolute; top: -6px; }
.nav-toggle__icon::after { position: absolute; top: 6px; }

.search-form { position: relative; }
.search-form input {
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text);
  border-radius: 999px; padding: 9px 16px; font-size: 0.9rem; width: 220px;
}
.search-form button { position: absolute; right: 4px; top: 4px; background: none; border: none; color: var(--text-muted); padding: 6px; }
.search-form--mobile { display: none; }

.lang-switcher { position: relative; }
.lang-switcher__current {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: 0.8rem; padding: 8px 14px;
}
.lang-switcher__menu {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); min-width: 120px; padding: 6px; display: none;
}
.lang-switcher__menu.is-open { display: block; }
.lang-switcher__menu a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.lang-switcher__menu a:hover, .lang-switcher__menu a[aria-current] { background: var(--bg-subtle); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  .theme-toggle .icon-sun { display: none; }
  .theme-toggle .icon-moon { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
}

.primary-nav {
  max-height: 0; overflow: hidden; transition: max-height .25s ease; border-bottom: 1px solid transparent;
}
.primary-nav.is-open { max-height: 600px; border-bottom-color: var(--border); }
.primary-nav__inner { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 10px 0; }
.primary-nav a {
  padding: 8px 12px; border-radius: 999px; font-size: 0.92rem; font-weight: 600; color: var(--text-muted);
}
.primary-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.primary-nav form.search-form--mobile { padding: 0 20px 14px; }
.primary-nav form.search-form--mobile input { width: 100%; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-nav { max-height: none; overflow: visible; }
  .primary-nav__inner { padding: 10px 0; justify-content: center; }
  .search-form--mobile { display: none !important; }
  .search-form--desktop { display: block; }
}
@media (max-width: 899px) {
  .search-form--desktop { display: none; }
  .primary-nav form.search-form--mobile { display: block; }
}

/* ---------------------------------- Layout helpers ---------------------------------- */
main { display: block; min-height: 50vh; }
.page-home, .page-category, .page-article, .page-search, .page-static, .page-error { padding: 28px 20px 64px; }
.page-heading { margin-bottom: 24px; }
.page-heading__description { color: var(--text-muted); max-width: 60ch; }
.empty-state { color: var(--text-muted); padding: 48px 0; text-align: center; }

.content-section { margin: 48px 0; }
.content-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.content-section__head h2 { margin: 0; }
.view-all { font-size: 0.85rem; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ---------------------------------- Breadcrumbs ---------------------------------- */
.breadcrumbs { margin-bottom: 20px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; color: var(--text-faint); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; }
.breadcrumbs a { color: var(--text-faint); }
.breadcrumbs a:hover { color: var(--accent); }

/* ---------------------------------- Hero ---------------------------------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 12px; }
.hero__secondary { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) {
  .hero { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .hero__secondary { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------- Article grid & cards ---------------------------------- */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 28px 24px; }
.article-grid--compact { gap: 18px; }
@media (min-width: 560px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid--compact { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .article-grid { grid-template-columns: repeat(4, 1fr); }
}

.article-card { display: flex; flex-direction: column; min-width: 0; }
.article-card__media-wrap { position: relative; margin-bottom: 12px; }
.article-card__media {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-subtle); margin-bottom: 0;
}
.article-card__media img { width: 100%; height: 100%; object-fit: cover; }
.article-card__placeholder {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.9;
}
.article-card__placeholder--logo {
  object-fit: contain; padding: 18%; background: var(--bg-subtle); opacity: 0.85;
}
.article-card__credit {
  position: static; display: block; margin-top: 5px; padding: 0 2px; color: var(--text-faint);
  background: transparent; font-size: 0.68rem; line-height: 1.3; text-align: right; overflow-wrap: anywhere;
}
.article-card__credit:hover { color: var(--accent); }
.article-card__meta { font-size: 0.78rem; color: var(--text-faint); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.article-card__category { color: var(--accent); font-weight: 700; }
.article-card__title { margin: 0 0 6px; font-size: 1.05rem; overflow-wrap: anywhere; }
.article-card__title a { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; }
.article-card__title-text { min-width: 0; }
.article-card__title .external-icon { color: var(--text-faint); flex-shrink: 0; }
.article-card__excerpt { font-size: 0.9rem; color: var(--text-muted); margin: 0; overflow-wrap: anywhere; }

.article-card--lead .article-card__title { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.article-card--lead .article-card__media { aspect-ratio: 16 / 10; }
.article-card--secondary .article-card__title { font-size: 1rem; }
.article-card--secondary .article-card__media { aspect-ratio: 16 / 9; }
.article-card--compact { flex-direction: row; gap: 14px; }
.article-card--compact .article-card__media-wrap { width: 96px; flex-shrink: 0; margin-bottom: 0; }
.article-card--compact .article-card__media { width: 100%; height: 72px; aspect-ratio: auto; }
.article-card--compact .article-card__credit { font-size: .58rem; }
.article-card--compact .article-card__title { font-size: 0.92rem; }

.nav-live { display: inline-flex !important; align-items: center; gap: 6px; }
.nav-live span, .quake-hero__eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #e23b32; box-shadow: 0 0 0 4px rgba(226,59,50,.13); }
.quake-page { padding-top: 34px; padding-bottom: 70px; }
.quake-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 40px; padding: clamp(26px,5vw,52px); border-radius: 22px; background: linear-gradient(135deg,#161b25,#26334a); color: #fff; }
.quake-hero__eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; color: #ffaca6; }
.quake-hero h1 { margin: 0 0 12px; font-size: clamp(2rem,5vw,4rem); letter-spacing: -.045em; }
.quake-hero > div > p:last-child { max-width: 650px; margin: 0; color: #c9d2df; line-height: 1.65; }
.quake-summary { min-width: 175px; padding: 22px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(255,255,255,.07); display: flex; flex-direction: column; }
.quake-summary strong { font-size: 2.5rem; line-height: 1; }.quake-summary span { margin: 7px 0 14px; font-size: .8rem; color: #d5dce7; }.quake-summary small { color: #99a7ba; }
.quake-note { margin: 18px 0 34px; color: var(--text-faint); font-size: .78rem; text-align: right; }.quake-title { margin-bottom: 16px; }
.quake-list { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--bg-raised); }
.quake-item { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 18px; padding: 15px 18px; color: var(--text); border-bottom: 1px solid var(--border); transition: background .15s ease; }
.quake-item:last-child { border-bottom: 0; }.quake-item:hover { background: var(--bg-subtle); }
.quake-mag { display: inline-flex; justify-content: center; padding: 8px 9px; border-radius: 9px; font-weight: 800; background: #e8edf3; color: #344054; }
.quake-mag--medium { background: #fff0c7; color: #8b5c00; }.quake-mag--high { background: #fee1df; color: #b42318; }
.quake-item__body { display: flex; flex-direction: column; gap: 4px; }.quake-item__body small { color: var(--text-faint); }.quake-item__arrow { color: var(--text-faint); }
@media (max-width: 650px) { .quake-hero { grid-template-columns: 1fr; gap: 24px; }.quake-summary { min-width: 0; }.quake-item { grid-template-columns: 68px 1fr auto; gap: 11px; padding: 13px 12px; }.quake-item__body strong { font-size: .9rem; } }

/* ---------------------------------- Article detail ---------------------------------- */
.article-detail { max-width: 780px; margin: 0 auto; }
.article-detail__category { color: var(--accent); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.article-detail__byline { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-muted); font-size: 0.88rem; margin: 10px 0; }
.article-detail__translation-notice { font-size: 0.85rem; color: var(--text-faint); font-style: italic; }
.article-detail__media { margin: 20px 0; }
.article-detail__media img { border-radius: var(--radius-lg); width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.article-detail__media img.article-detail__media--logo { object-fit: contain; padding: 10%; background: var(--bg-subtle); }
.article-detail__media figcaption { font-size: 0.8rem; color: var(--text-faint); margin-top: 8px; }
.article-detail__media .credit { display: block; }
.article-detail__body { font-size: 1.05rem; }
.article-detail__excerpt { color: var(--text); }
.article-detail__cta {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; margin: 28px 0; text-align: center;
}
.article-detail__imported { font-size: 0.78rem; color: var(--text-faint); margin: 10px 0 0; }

.share-buttons { display: flex; align-items: center; gap: 10px; margin: 24px 0; flex-wrap: wrap; }
.share-buttons__label { font-size: 0.85rem; color: var(--text-muted); }
.share-buttons a, .share-buttons__copy {
  width: 34px; height: 34px; border-radius: 999px; background: var(--bg-subtle); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--text);
}

/* ---------------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: 0.92rem; border: 1px solid transparent;
}
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn--ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn--large { padding: 14px 28px; font-size: 1rem; }

/* ---------------------------------- Pagination ---------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; margin: 36px 0; font-size: 0.9rem; color: var(--text-muted); }
.pagination__link { font-weight: 700; color: var(--text); }

/* ---------------------------------- Forms ---------------------------------- */
.legal-form { display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin-top: 24px; }
.legal-form label { font-size: 0.85rem; font-weight: 600; margin-top: 10px; }
.legal-form input, .legal-form textarea, .legal-form select {
  border: 1px solid var(--border); background: var(--bg-subtle); color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: inherit; font-size: 0.95rem;
}
.legal-form button { margin-top: 16px; align-self: flex-start; }
.form-notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.form-notice--success { background: rgba(46, 160, 67, 0.12); color: #2ea043; }
.form-notice--error { background: rgba(212, 63, 46, 0.12); color: var(--accent); }

.newsletter-form { display: flex; flex-wrap: wrap; gap: 8px; }
.newsletter-form input { flex: 1; min-width: 180px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; }
.newsletter-form button { background: var(--accent); color: var(--accent-contrast); border: none; border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 700; }
.newsletter-form__consent { flex-basis: 100%; font-size: 0.75rem; color: var(--text-faint); margin: 6px 0 0; }

.static-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.9rem; }
.static-table th, .static-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.static-table th { background: var(--bg-subtle); }
.page-static { max-width: 760px; margin: 0 auto; }
.page-static__disclaimer { color: var(--text-faint); font-size: 0.85rem; margin-top: 32px; }

/* ---------------------------------- Cookie banner ---------------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: var(--bg-raised);
  border-top: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px; }
.cookie-banner__inner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.88rem; color: var(--text-muted); }
.cookie-banner__actions { display: flex; gap: 10px; }

/* ---------------------------------- Footer ---------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); margin-top: 60px; padding: 48px 0 0; }
.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding-bottom: 32px; }
.site-footer__brand p { color: var(--text-muted); font-size: 0.88rem; max-width: 32ch; }
.site-footer__rights { font-size: 0.78rem !important; color: var(--text-faint) !important; }
.site-footer__col h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 12px; }
.site-footer__col li { margin-bottom: 8px; }
.site-footer__col a { color: var(--text-muted); font-size: 0.92rem; }
.site-footer__col a:hover { color: var(--accent); }
.site-footer__bottom { border-top: 1px solid var(--border); padding: 18px 20px; font-size: 0.78rem; color: var(--text-faint); }
@media (min-width: 700px) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
}

/* ---------------------------------- Error page ---------------------------------- */
.page-error { text-align: center; max-width: 480px; margin: 60px auto; }
