/* ==========================================================================
   OJU — Design system & shared components
   ========================================================================== */

:root {
  --oju-blue: #1e3a8a;
  --oju-blue-dark: #152a66;
  --oju-blue-mid: #2563eb;
  --oju-green: #22c55e;
  --oju-green-dark: #16a34a;
  --oju-accent: #dc2626;
  --oju-accent-hover: #b91c1c;
  --oju-gold: #facc15;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --container-max: 1320px;
  --transition: 0.2s ease;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                       */
/* -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body.oju-site {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body.oju-site main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.oju-header {
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

a {
  color: var(--oju-blue-mid);
  transition: color var(--transition);
}

a:hover {
  color: var(--oju-green-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Country flags — fixed 3:2 aspect, never stretched */
img.flag-icon {
  display: inline-block;
  width: 1.375rem;
  height: 0.92rem;
  max-width: none;
  object-fit: contain;
  object-position: center;
  vertical-align: -0.12em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}

/* Page titles */
.page-title,
.exec-container > h2,
.news-container > h1,
.federations-container > h1,
.documents-container > h2,
.commissions-main > .exec-container > h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--oju-blue);
  margin-bottom: 1.5rem;
}

/* Shared inputs */
.oju-input,
.filter-bar input,
.filter-bar select,
#searchExec,
#searchCommissioners,
#searchInput,
.documents-filter input,
.documents-filter select,
.federations-filter input,
.docs-filter input,
.news-filter-bar input,
.news-filter-bar select,
.calendar-main .field select,
.calendar-main .field input,
.calendar-main .search input {
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.oju-input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
#searchExec:focus,
#searchCommissioners:focus,
#searchInput:focus,
.documents-filter input:focus,
.documents-filter select:focus,
.federations-filter input:focus,
.docs-filter input:focus,
.news-filter-bar input:focus,
.news-filter-bar select:focus,
.calendar-main .field select:focus,
.calendar-main .field input:focus {
  outline: none;
  border-color: var(--oju-blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Buttons */
.btn,
.btn.view-all,
.view-toggle-btn,
.download-btn,
.doc-link a,
.section-header .btn-all,
.calendar-main .view-toggle button,
.calendar-main .prev-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary,
.btn.view-all,
.view-toggle-btn,
.download-btn,
.doc-link a,
.section-header .btn-all {
  background: var(--oju-blue);
  color: #fff;
}

.btn-primary:hover,
.btn.view-all:hover,
.view-toggle-btn:hover,
.download-btn:hover,
.doc-link a:hover,
.section-header .btn-all:hover {
  background: var(--oju-blue-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--oju-accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--oju-accent-hover);
  color: #fff;
}

/* Category label */
.category,
.news-category,
.article-category,
.news-info .category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oju-accent);
}

/* -------------------------------------------------------------------------- */
/* Sidebar boxes (homepage)                                                     */
/* -------------------------------------------------------------------------- */

.sidebar .box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.sidebar .box h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--oju-blue);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--oju-green);
}

.sidebar .box.upcoming-events-widget h3 {
  margin-bottom: 0;
}

.quick-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quick-links li {
  margin-bottom: 0.35rem;
}

.quick-links a {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.quick-links a:hover {
  background: var(--bg);
  color: var(--oju-blue);
}

.social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-icons a {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--oju-blue);
  font-size: 1.1rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.social-icons a:hover {
  background: var(--oju-blue);
  color: #fff;
}

/* Games countdown cards */
.sidebar .box.games-countdown {
  color: #fff;
  position: relative;
  overflow: hidden;
  border-width: 1px;
  border-style: solid;
  box-shadow: var(--shadow-md);
}

.sidebar .box.games-countdown h3 {
  color: #fff;
  border-bottom: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.games-countdown-kicker {
  margin: 0;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  opacity: 0.9;
}

.games-countdown-logo-wrap {
  margin-bottom: 0.45rem;
}

.games-countdown-logo {
  display: block;
  height: 1.35rem;
  width: auto;
  max-width: 100%;
  opacity: 0.98;
}

.games-countdown-logo-fallback {
  display: inline-block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

/* Search page */
.search-main {
  padding: 2rem 0 2.5rem;
}

.search-container {
  width: min(var(--container-max), 100%);
  margin: 0 auto;
  padding: 0 1rem;
}

.search-header {
  margin-bottom: 1rem;
}

.search-page-form {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin: 0.9rem 0 0.55rem;
}

.search-page-form input[type='search'] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.search-meta {
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.search-error {
  color: #b91c1c;
  margin-top: 0.5rem;
}

.search-empty {
  padding: 1rem 1.1rem;
}

.search-section {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
}

.search-section h2 {
  margin-bottom: 0.7rem;
}

.search-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.search-list li {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.search-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.search-list a {
  color: var(--oju-blue);
  font-weight: 700;
  text-decoration: none;
}

.search-list a:hover {
  text-decoration: underline;
}

.search-list p {
  margin: 0.2rem 0 0;
  color: var(--text);
}

@media (max-width: 700px) {
  .search-page-form {
    flex-direction: column;
    align-items: stretch;
  }
}

.games-countdown-date {
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  opacity: 0.95;
}

.games-countdown::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  opacity: 0.28;
  pointer-events: none;
}

.games-countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.games-countdown-item {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  text-align: center;
  padding: 0.45rem 0.35rem;
  backdrop-filter: blur(2px);
}

.games-countdown-item strong {
  display: block;
  font-size: 1.1rem;
  line-height: 1.1;
  font-weight: 800;
}

.games-countdown-item span {
  display: block;
  margin-top: 0.14rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.sidebar .box.games-countdown--commonwealth {
  /* Glasgow 2026 palette: teal, pink, violet */
  background:
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.32) 0, rgba(56, 189, 248, 0) 46%),
    linear-gradient(140deg, #0f766e 0%, #7e22ce 46%, #ec4899 100%);
  border-color: rgba(236, 72, 153, 0.55);
}

.games-countdown--commonwealth::after {
  background: #22d3ee;
}

.sidebar .box.games-countdown--la28 {
  /* LA28 look: poppy, scarlet flax, bluebell, sagebrush families */
  background:
    radial-gradient(circle at 16% 20%, rgba(59, 130, 246, 0.32) 0, rgba(59, 130, 246, 0) 44%),
    linear-gradient(140deg, #ea580c 0%, #e11d48 45%, #2563eb 100%);
  border-color: rgba(37, 99, 235, 0.52);
}

.games-countdown--la28::after {
  background: #84cc16;
}

.box.tile-box {
  padding: 0;
  border: none;
  box-shadow: none;
  background: none;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.box.tile-box a {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.box.tile-box a:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* -------------------------------------------------------------------------- */
/* Homepage                                                                     */
/* -------------------------------------------------------------------------- */

.home-main {
  padding: 1.25rem 1rem 2.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.home-main .container {
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
  min-width: 0;
}

@media (min-width: 768px) {
  .home-main {
    padding: 2rem 1.25rem 3rem;
  }
}

.home-main .layout {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.2fr) minmax(220px, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.home-main .hero-article {
  position: relative;
  display: block;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.home-main .hero-article img {
  width: 100%;
  height: min(380px, 50vh);
  object-fit: cover;
  display: block;
}

.home-main .hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.75rem;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.88));
  color: #fff;
}

.home-main .hero-text .category {
  color: var(--oju-gold);
}

.home-main .hero-text h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.home-main .news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.home-main .news-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.home-main .news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.home-main .news-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.home-main .news-info {
  padding: 1.1rem 1.15rem 1.25rem;
}

.home-main .news-info h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.35rem;
  line-height: 1.35;
  color: var(--text);
}

/* Calendar widget (homepage sidebar) */
.upcoming-events-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.sidebar .box.upcoming-events-widget .upcoming-events-head h3 {
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--oju-green);
}

.upcoming-events-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}

.upcoming-events-toggle-btn {
  padding: 0.2rem 0.55rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1.4;
  transition: background 0.15s, color 0.15s;
}

.upcoming-events-toggle-btn:hover {
  color: var(--oju-blue);
}

.upcoming-events-toggle-btn.is-active {
  background: var(--oju-blue);
  color: #fff;
}

.upcoming-events-panel {
  display: none;
}

.upcoming-events-panel.is-active {
  display: block;
}

.upcoming-events-empty {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.calendar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.calendar-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.calendar-list li:last-child {
  border-bottom: none;
}

.cal-left {
  min-width: 0;
}

.cal-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.cal-title {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.cal-title:hover {
  color: var(--oju-blue-mid);
}

.cal-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

/* flag-icon rules live in base img.flag-icon block */

.cal-abbr {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.btn.view-all {
  width: 100%;
  margin-top: 0.85rem;
}

/* Top athletes widget (homepage sidebar) */
.top-athletes-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.top-athletes-empty a {
  color: var(--oju-blue-mid);
}

.top-athletes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: top-athlete;
}

.top-athletes-list > li {
  border-bottom: 1px solid var(--border);
}

.top-athletes-list > li:last-child {
  border-bottom: none;
}

.top-athlete-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.top-athlete-link:hover {
  background: var(--bg);
}

.top-athlete-rank-num {
  flex-shrink: 0;
  width: 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
}

.top-athlete-photo-wrap {
  flex-shrink: 0;
}

.top-athlete-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 2px solid var(--border);
  background: var(--bg);
}

.top-athlete-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 1rem;
}

.top-athlete-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.top-athlete-name {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: anywhere;
}

.top-athlete-country {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.top-athlete-country .flag-icon {
  width: 1.1rem;
  height: 0.73rem;
}

.top-athlete-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.top-athlete-world-rank {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--oju-blue);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.top-athlete-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--oju-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 1200px) {
  .home-main .layout {
    display: flex;
    flex-direction: column;
  }
  .home-main .main-content { order: 1; }
  .home-main .left-sidebar { order: 2; }
  .home-main .right-sidebar { order: 3; }
  .home-main .sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .home-main .news-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------- */
/* News listing                                                                 */
/* -------------------------------------------------------------------------- */

.news-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.news-filter-bar input,
.news-filter-bar select {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.news-main .news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.news-main .news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.news-main .news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.news-main .news-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.news-main .news-content {
  padding: 1.25rem;
}

.news-main .news-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.5rem 0;
  line-height: 1.35;
  color: var(--text);
}

.news-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 960px) {
  .news-main .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .news-main .news-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------- */
/* Article detail                                                               */
/* -------------------------------------------------------------------------- */

.article-container {
  max-width: 52rem;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0.5rem 0;
  color: var(--oju-blue);
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-share {
  margin-top: 1rem;
  display: flex;
  gap: 0.65rem;
}

.article-share a {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--oju-blue);
  font-size: 1rem;
}

.article-share a:hover {
  background: var(--oju-blue);
  color: #fff;
}

.article-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 1.25rem 0;
}

.article-lightbox-trigger {
  cursor: zoom-in;
}

/* Article prose — original spacing/typography, left-aligned only */
.article-body-content {
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  text-align: left;
}

.article-body-content h2,
.article-body-content h3 {
  margin-top: 24px;
  color: #1e3a8a;
  text-align: left;
}

.article-body-content img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 6px;
}

/* Rich article media blocks (admin inserted) */
.article-body-content .article-media-block {
  margin: 1.25rem auto;
  width: 100%;
}

.article-body-content .article-media-caption {
  margin: 0.6rem auto 0;
  padding: 0.45rem 0.75rem;
  width: fit-content;
  max-width: min(100%, 860px);
  font-size: 0.84rem;
  line-height: 1.5;
  color: #334155;
  text-align: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.article-body-content .article-media-block.media-type-video .article-media-caption::before,
.article-body-content .article-media-block.media-type-youtube .article-media-caption::before {
  content: "Video";
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.08rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a8a;
  background: #dbeafe;
  border-radius: 999px;
  vertical-align: middle;
}

.article-body-content .article-media-block.media-type-image .article-media-caption::before {
  content: "Image";
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.08rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  vertical-align: middle;
}

.article-body-content .article-media-block img,
.article-body-content .article-media-block video,
.article-body-content .article-media-block iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  background: #000;
}

.article-body-content .article-media-block.media-type-image img {
  object-fit: contain;
  background: transparent;
}

.article-body-content .article-media-block.media-type-image img:hover {
  opacity: 0.96;
}

.article-body-content .article-media-block.media-size-small { max-width: 360px; }
.article-body-content .article-media-block.media-size-medium { max-width: 560px; }
.article-body-content .article-media-block.media-size-large { max-width: 820px; }
.article-body-content .article-media-block.media-size-full { max-width: 100%; }

.article-body-content .article-media-block.media-type-video video,
.article-body-content .article-media-block.media-type-youtube iframe {
  height: 100%;
}

.article-body-content .article-media-block.media-ratio-16-9 { aspect-ratio: 16 / 9; }
.article-body-content .article-media-block.media-ratio-4-3 { aspect-ratio: 4 / 3; }
.article-body-content .article-media-block.media-ratio-1-1 { aspect-ratio: 1 / 1; }
.article-body-content .article-media-block.media-ratio-9-16 {
  aspect-ratio: 9 / 16;
  max-height: min(80vh, 860px);
}

/* Fallback for legacy iframe/video embeds */
.article-body-content iframe,
.article-body-content video {
  max-width: 100%;
  width: min(100%, 820px);
  margin: 1rem auto;
  display: block;
  border-radius: var(--radius-md);
}

.article-body-content blockquote,
.article-body-content .pullquote,
.article-body-content .quote-block {
  position: relative;
  margin: 1.35rem 0;
  padding: 1rem 1.1rem 1rem 1.2rem;
  border-left: 4px solid var(--oju-green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  color: #1e3a8a;
  text-align: left;
}

.article-body-content blockquote::before,
.article-body-content .pullquote::before,
.article-body-content .quote-block::before {
  content: "\201C";
  position: absolute;
  top: -0.55rem;
  left: 0.55rem;
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 700;
  color: rgba(30, 58, 138, 0.26);
}

.article-body-content blockquote p,
.article-body-content .pullquote p,
.article-body-content .quote-block p {
  margin: 0.3rem 0 0;
  font-size: 1.03rem;
  line-height: 1.8;
  font-style: italic;
}

.article-body-content blockquote p:first-child,
.article-body-content .pullquote p:first-child,
.article-body-content .quote-block p:first-child {
  margin-top: 0;
}

.article-body-content blockquote cite,
.article-body-content .pullquote cite,
.article-body-content .quote-block cite {
  display: block;
  margin-top: 0.55rem;
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #334155;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  .article-body-content blockquote,
  .article-body-content .pullquote,
  .article-body-content .quote-block {
    margin: 1rem 0;
    padding: 0.9rem 0.85rem 0.9rem 1rem;
  }

  .article-body-content blockquote::before,
  .article-body-content .pullquote::before,
  .article-body-content .quote-block::before {
    left: 0.45rem;
    font-size: 1.8rem;
  }

  .article-body-content blockquote p,
  .article-body-content .pullquote p,
  .article-body-content .quote-block p {
    font-size: 1rem;
    line-height: 1.7;
  }
}

.article-body-content ul,
.article-body-content ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.article-body-content a {
  color: #0073e6;
  text-decoration: underline;
}

/* Article image lightbox */
.article-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15, 23, 42, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.article-lightbox.is-open {
  display: flex;
}

.article-lightbox-inner {
  max-width: min(1100px, 96vw);
  max-height: 92vh;
  text-align: center;
}

.article-lightbox-inner img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: #000;
}

.article-lightbox-caption {
  margin: 0.75rem auto 0;
  color: #e2e8f0;
  font-size: 0.95rem;
  max-width: 900px;
}

.article-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.article-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

@media (max-width: 640px) {
  .article-container {
    padding: 1.25rem;
  }

  .article-body-content .article-media-caption {
    width: 100%;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    text-align: left;
  }
}

/* -------------------------------------------------------------------------- */
/* People cards (executive, commissions list)                                   */
/* -------------------------------------------------------------------------- */

.exec-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.filter-bar input {
  flex: 1;
  min-width: 200px;
}

#searchExec {
  width: 100%;
  max-width: 28rem;
  margin-bottom: 2rem;
}

.exec-grid,
.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.exec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  padding: 1.15rem;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.exec-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.exec-card > img {
  width: 5rem;
  height: 5rem;
  max-width: 5rem;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.exec-info h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--oju-accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.exec-info p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.exec-info p strong {
  color: var(--text);
  font-weight: 600;
}

.exec-info img.flag-icon {
  margin-right: 0.4rem;
  vertical-align: middle;
}

.term-info {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.35rem;
}

.commission-block {
  margin-bottom: 3rem;
}

.commission-block h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--oju-blue);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--oju-green);
}

@media (max-width: 960px) {
  .exec-grid,
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .exec-grid,
  .member-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------------------- */
/* Commission detail page                                                       */
/* -------------------------------------------------------------------------- */

.page-hero,
.commission-header,
.event-header {
  background: linear-gradient(135deg, var(--oju-blue-dark) 0%, var(--oju-blue) 55%, #1d4ed8 100%);
  color: #fff;
  padding: 2.5rem 1rem;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  .page-hero,
  .commission-header,
  .event-header {
    padding: 3.5rem 1.25rem;
  }
}

.page-hero::before,
.commission-header::before,
.event-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(34, 197, 94, 0.2), transparent 45%);
  pointer-events: none;
}

.commission-header .inner,
.event-header .inner {
  max-width: var(--container-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.commission-title,
.event-header h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
}

.commission-content,
.event-content {
  max-width: min(var(--container-max), 100%);
  width: 100%;
  margin: -1.5rem auto 2.5rem;
  background: var(--surface);
  padding: 1.25rem 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .commission-content,
  .event-content {
    margin-top: -2rem;
    margin-bottom: 3rem;
    padding: 2rem 2.5rem;
  }
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--oju-blue);
}

.commission-content .news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.commission-content .news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.commission-content .news-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.commission-content .news-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.commission-content .news-card .content {
  padding: 1rem;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.event-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.event-card:hover {
  border-color: var(--oju-blue-mid);
  box-shadow: var(--shadow-sm);
}

.evt-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 5rem;
  flex-shrink: 0;
  font-weight: 600;
}

.evt-body h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--oju-blue);
}

.evt-location {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.doc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.doc-card:hover {
  box-shadow: var(--shadow-md);
}

.doc-icon {
  font-size: 1.75rem;
  color: var(--oju-accent);
  margin-bottom: 0.75rem;
}

.doc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--oju-blue);
  margin: 0 0 0.5rem;
}

.doc-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.doc-link a {
  margin-top: auto;
  align-self: flex-start;
}

.docs-filter {
  margin: 1.5rem 0 1rem;
}

.docs-filter input {
  max-width: 28rem;
}

@media (max-width: 900px) {
  .commission-content .news-grid,
  .docs-grid { grid-template-columns: repeat(2, 1fr); }
  .events-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .commission-content .news-grid,
  .docs-grid { grid-template-columns: 1fr; }
  .commission-content,
  .event-content { padding: 1.25rem; }
}

/* -------------------------------------------------------------------------- */
/* Event detail                                                                 */
/* -------------------------------------------------------------------------- */

.event-header .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.event-info .location {
  margin-top: 0.5rem;
  opacity: 0.9;
  font-size: 1.05rem;
}

.event-info .btn.reg {
  margin-top: 0.85rem;
  background: var(--oju-green-dark);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
}

.event-info .btn.reg:hover {
  background: var(--oju-green);
  color: #fff;
}

.countdown {
  text-align: right;
}

.countdown-item {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-left: 0.5rem;
  min-width: 3.5rem;
}

.countdown-item span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.countdown-item small {
  font-size: 0.75rem;
  opacity: 0.85;
}

.event-main {
  padding-bottom: 0;
}

.event-content .modules {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: start;
}

.modules-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modules-right {
  min-width: 0;
}

.countdown .past {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.95;
}

.module {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}

.module h2 {
  margin: 0;
  padding: 1rem 1.15rem;
  background: var(--bg);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--oju-blue);
  border-bottom: 1px solid var(--border);
}

.module .body {
  padding: 1.15rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.module.dates table {
  width: 100%;
  border-collapse: collapse;
}

.module.dates th,
.module.dates td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.module.documents .doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.module.documents .doc-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.module.documents .doc-list li:last-child {
  border-bottom: none;
}

@media (max-width: 800px) {
  .event-header .inner {
    flex-direction: column;
    text-align: center;
  }
  .countdown {
    text-align: center;
    margin-top: 1rem;
  }
  .event-content .modules {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------- */
/* Calendar page                                                                */
/* -------------------------------------------------------------------------- */

.calendar-main > .container {
  max-width: 1200px;
  margin: 0 auto;
}

.calendar-main .page-title {
  margin-bottom: 1.25rem;
}

.calendar-main .controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.calendar-main .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-main .field label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.calendar-main .view-toggle button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.calendar-main .view-toggle .active {
  background: var(--oju-blue);
  color: #fff;
  border-color: var(--oju-blue);
}

.calendar-main .prev-toggle button {
  background: var(--oju-green-dark);
  color: #fff;
}

.calendar-main .prev-toggle button:hover {
  background: var(--oju-green);
}

.table-wrapper {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.evt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.evt-table tbody {
  display: flex;
  flex-direction: column;
}

.evt-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.evt-row:hover {
  background: var(--bg);
}

.evt-row td {
  padding: 0 0.75rem;
}

.date-col {
  flex: 0 0 6.5rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.title-col {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
}

.loc-col {
  flex: 0 1 14rem;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.table-wrapper {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
  width: 100%;
  min-width: 0;
}

.evt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
}

.evt-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header .date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-header h3 {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  color: var(--oju-blue);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0;
}

.badge {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
}

.badge.type { background: var(--oju-blue); }
.badge.exec { background: #ea580c; }
.badge.comm { background: var(--oju-green-dark); }

.location {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 768px) {
  .calendar-main .controls { flex-direction: column; }
  .calendar-main .view-toggle { display: none; }
  #tableView { display: none; }
  #cardView { margin-top: 1.25rem; }
}

/* -------------------------------------------------------------------------- */
/* Documents & federations                                                      */
/* -------------------------------------------------------------------------- */

.documents-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.documents-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.documents-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.documents-table th,
.documents-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.documents-table th {
  background: var(--bg);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.documents-grid {
  display: grid;
  gap: 1rem;
}

.document-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.doc-info h3 {
  margin: 0 0 0.35rem;
  color: var(--oju-blue);
  font-size: 1.05rem;
}

.federations-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.federations-container h1 {
  text-align: center;
}

.federations-filter {
  text-align: center;
  margin-bottom: 2rem;
}

.federations-filter input {
  max-width: 28rem;
}

.federation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.federation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: 1.15rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}

.federation-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.federation-card .flag {
  width: 5.5rem;
  height: auto;
  max-height: 3.75rem;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.fed-content h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--oju-blue);
}

.fed-content p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.president {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.president img {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border-radius: 50%;
}

@media (max-width: 960px) {
  .federation-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .federation-grid { grid-template-columns: 1fr; }
  .document-card { flex-direction: column; }
}

/* Empty / error states (do not target .article-body-content paragraphs) */
.article-not-found,
.exec-container > p:only-child {
  color: var(--text-muted);
  padding: 2rem;
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* Shared page shells — responsive padding, no horizontal bleed               */
/* -------------------------------------------------------------------------- */

.news-main,
.exec-main,
.commissions-main,
.article-main,
.documents-main,
.federations-main,
.calendar-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 768px) {
  .news-main,
  .exec-main,
  .commissions-main,
  .article-main,
  .documents-main,
  .federations-main,
  .calendar-main {
    padding: 2rem 1.25rem 3rem;
  }
}

.news-container,
.exec-container,
.documents-container,
.federations-container,
.calendar-main > .container,
.article-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

.article-container {
  max-width: 52rem;
}

/* -------------------------------------------------------------------------- */
/* Athletes (IJF sync)                                                        */
/* -------------------------------------------------------------------------- */

.athletes-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 1.25rem 1rem 2.5rem;
}

@media (min-width: 768px) {
  .athletes-main {
    padding: 2rem 1.25rem 3rem;
  }
}

.athletes-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}

.athletes-hero {
  margin-bottom: 1.5rem;
}

.athletes-intro {
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0.5rem 0 0;
}

.athletes-meta {
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.athletes-meta a {
  color: var(--oju-blue-mid);
}

.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.athletes-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.athletes-filters {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.athletes-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.athletes-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.athletes-filters input[type='search'],
.athletes-filters select {
  min-width: 10rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.athletes-filter-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  font-weight: 500 !important;
  color: var(--text) !important;
}

.athletes-clear {
  align-self: center;
  color: var(--oju-blue-mid);
  font-size: 0.9rem;
}

.athletes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.athletes-toolbar .athletes-count {
  margin: 0;
}

.athletes-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.athletes-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  background: transparent;
  transition: background var(--transition), color var(--transition);
}

.athletes-view-btn:hover {
  color: var(--oju-blue);
  background: var(--surface);
}

.athletes-view-btn.is-active {
  background: var(--oju-blue);
  color: #fff;
}

.athletes-results--list .athletes-grid[hidden],
.athletes-results--cards .athletes-table-wrap[hidden] {
  display: none !important;
}

.athletes-table-wrap {
  padding: 0;
  overflow: hidden;
}

.athletes-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.athletes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.athletes-table th,
.athletes-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.athletes-table tbody td {
  vertical-align: top;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.athletes-table thead th {
  vertical-align: middle;
}

.athletes-table th {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg);
  white-space: nowrap;
}

.athletes-table-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.athletes-table-sort:hover {
  color: var(--oju-blue-mid);
}

.athletes-table-sort.is-active {
  color: var(--oju-blue);
}

.athletes-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.athletes-table tbody tr:last-child td {
  border-bottom: none;
}

.athletes-table-col-photo {
  width: 3.5rem;
}

.athletes-table-col-link {
  width: 3rem;
  text-align: center;
}

.athletes-table-photo {
  width: 3.5rem;
  padding-top: 0.75rem;
}

.athletes-table-photo img,
.athletes-table-photo-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 2px solid var(--border);
}

.athletes-table-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--text-light);
  font-size: 1rem;
}

.athletes-table-name {
  min-width: 9rem;
  padding-top: 0.95rem;
}

.athletes-table-name a {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.35;
}

.athletes-table-name a:hover {
  color: var(--oju-blue-mid);
}

.athletes-table-country {
  min-width: 7rem;
  padding-top: 0.95rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.35;
}

.athletes-table-country .flag-icon {
  margin-right: 0.35rem;
  vertical-align: -0.12em;
}

.athletes-table-col-rank,
.athletes-table-rank {
  width: 5.5rem;
}

.athletes-table-points {
  min-width: 4.5rem;
  padding-top: 0.95rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.athletes-table-rank {
  padding-top: 0.95rem;
  line-height: 1.5;
}

.athletes-table-rank-meta {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
  line-height: 1.3;
}

.athletes-table-link {
  padding-top: 0.95rem;
  text-align: center;
  vertical-align: top;
}

.athletes-table-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  color: var(--oju-blue-mid);
  text-decoration: none;
}

.athletes-table-profile:hover {
  background: var(--bg);
  color: var(--oju-blue);
}

@media (max-width: 768px) {
  .athletes-table th:nth-child(5),
  .athletes-table td.athletes-table-points {
    display: none;
  }
}

.athletes-count {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.athletes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.athlete-card {
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.athlete-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.athlete-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.athlete-photo-wrap {
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
}

.athlete-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.athlete-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-light);
}

.athlete-card-body {
  padding: 1rem;
}

.athlete-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.athlete-country {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.athlete-country .flag-icon {
  width: 1.15rem;
  height: 0.77rem;
}

.athlete-rank {
  margin: 0.65rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
}

.athlete-age-badge {
  background: var(--oju-green);
  color: #fff;
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.athlete-rank-badge {
  background: var(--oju-blue);
  color: #fff;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.athlete-rank-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  line-height: 1.5;
}

.athlete-rank-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.athlete-rank-list li:last-child {
  border-bottom: none;
}

.athlete-points-inline {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 100%;
}

.athlete-division {
  font-weight: 600;
  color: var(--text);
}

.athlete-gender {
  color: var(--text-muted);
}

.athlete-points {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}

.athlete-unranked {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}

.athletes-attribution {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-align: center;
}

/* Athlete profile page */
.athlete-profile-main {
  padding: 2rem 1rem 3rem;
}

.athlete-profile-container {
  max-width: 900px;
  margin: 0 auto;
}

.athlete-profile-back {
  margin: 0 0 1.25rem;
}

.athlete-profile-back a {
  color: var(--oju-blue, #0d4f8b);
  text-decoration: none;
  font-weight: 500;
}

.athlete-profile-back a:hover {
  text-decoration: underline;
}

.athlete-profile-empty {
  padding: 2rem;
  text-align: center;
}

.athlete-profile-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.athlete-profile-photo-wrap {
  flex-shrink: 0;
}

.athlete-profile-photo {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: #f1f5f9;
}

.athlete-profile-photo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #94a3b8;
}

.athlete-profile-name {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.athlete-profile-country {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.athlete-profile-external a {
  color: var(--oju-blue, #0d4f8b);
  font-weight: 500;
}

.athlete-profile-synced {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}

.athlete-profile-section {
  margin-bottom: 2rem;
}

.athlete-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.athlete-page-tab {
  padding: 0.48rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.athlete-page-tab:hover {
  border-color: var(--oju-blue-mid);
  color: var(--oju-blue);
}

.athlete-page-tab.is-active {
  background: var(--oju-blue);
  border-color: var(--oju-blue);
  color: #fff;
}

.athlete-page-panel {
  display: none;
}

.athlete-page-panel.is-active {
  display: block;
}

.athlete-profile-section-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.athlete-profile-subsection-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.athlete-profile-history-note {
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
}

.athlete-profile-rankings-table-wrap {
  overflow-x: auto;
  padding: 0;
}

.athlete-profile-rankings-table,
.athlete-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.athlete-profile-rankings-table th,
.athlete-profile-rankings-table td,
.athlete-history-table th,
.athlete-history-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.athlete-profile-rankings-table th,
.athlete-history-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}

.athlete-profile-no-rank {
  padding: 1.25rem;
}

.athlete-history-panel {
  padding: 1.25rem;
}

.athlete-division-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.athlete-division-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.athlete-division-tab:hover {
  border-color: var(--oju-blue-mid);
  color: var(--oju-blue);
}

.athlete-division-tab.is-active {
  background: var(--oju-blue);
  border-color: var(--oju-blue);
  color: #fff;
}

.athlete-chart-wrap {
  margin-bottom: 1.25rem;
}

#athlete-rank-chart {
  min-height: 300px;
}

.athlete-division-panel {
  display: none;
}

.athlete-division-panel.is-active {
  display: block;
}

.athlete-history-table-wrap {
  overflow-x: auto;
}

.athlete-extra-panel {
  padding: 1.1rem 1.25rem;
}

.athlete-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.85rem;
}

.athlete-subtab {
  padding: 0.45rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.athlete-subtab.is-active {
  background: var(--oju-blue);
  border-color: var(--oju-blue);
  color: #fff;
}

.athlete-subpanel {
  display: none;
}

.athlete-subpanel.is-active {
  display: block;
}

.athlete-contest-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.athlete-contest-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.athlete-contest-duration {
  font-size: 0.82rem;
  color: #475569;
}

.athlete-contest-athletes {
  margin: 0 0 0.4rem;
  padding-left: 1rem;
}

.athlete-contest-athletes li {
  margin: 0.2rem 0;
}

.athlete-contest-score {
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
}

.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;
}

@media (max-width: 600px) {
  .athlete-profile-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .athlete-profile-country {
    justify-content: center;
  }

  .athlete-page-tabs {
    padding: 0.75rem;
  }
}
