/* ==========================================================================
   REAIM 2027 EDITORIAL & INSTITUTIONAL DESIGN SYSTEM EXTENSION
   ========================================================================== */

/* Zero Page-Level Horizontal Scroll Guarantee */
html, body {
  max-width: 100vw !important;
  overflow-x: clip !important;
}

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

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

/* Diplomatic Editorial Typography */
.editorial-lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.75;
  color: var(--color-primary);
  font-weight: 500;
  border-left: 3px solid var(--color-accent-gold);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}

.editorial-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  line-height: 1.5;
  color: var(--color-primary);
  font-style: italic;
  padding: 1.5rem 2rem;
  background: rgba(11, 27, 61, 0.03);
  border-left: 4px solid var(--color-accent-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
}

.editorial-quote cite {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 600;
  color: var(--color-accent-gold);
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Split Image/Text Compositions */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin: 3.5rem 0;
}

.split-layout.reversed {
  direction: rtl;
}

.split-layout.reversed > * {
  direction: ltr;
}

.split-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.split-media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.split-media:hover img {
  transform: scale(1.02);
}

@media (max-width: 900px) {
  .split-layout, .split-layout.reversed {
    grid-template-columns: 1fr;
    gap: 2rem;
    direction: ltr;
  }
}

/* Continuous Diplomatic Timeline */
.timeline-diplomatic {
  position: relative;
  padding-left: 2.5rem;
  margin: 2.5rem 0;
}

.timeline-diplomatic::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, var(--color-accent-gold) 0%, var(--color-border) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.75rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.5rem;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg-main);
  border: 2px solid var(--color-accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.timeline-marker.active {
  background: var(--color-accent-gold);
  box-shadow: 0 0 0 4px rgba(197, 155, 39, 0.35);
}

.timeline-marker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent-gold);
}

.timeline-marker.active .timeline-marker-dot {
  background: #ffffff;
}

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.timeline-year {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-accent-gold);
  letter-spacing: 0.05em;
}

.timeline-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.timeline-body {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 850px;
}

.timeline-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Numbered Institutional Framework (Replaces Boxed Grids) */
.numbered-framework {
  display: flex;
  flex-direction: column;
  margin: 2.5rem 0;
  border-top: 1px solid var(--color-border);
}

.framework-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
  transition: background-color 0.2s ease;
}

.framework-row:hover {
  background-color: rgba(11, 27, 61, 0.015);
}

.framework-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-accent-gold);
  line-height: 1;
}

.framework-content h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.framework-content p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 900px;
}

@media (max-width: 600px) {
  .framework-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.5rem 0;
  }
  .framework-num {
    font-size: 1.6rem;
  }
}

/* Diplomatic Stats Ribbon (Replaces Floating Stat Cards) */
.editorial-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin: 3rem 0;
}

.editorial-stat-item {
  display: flex;
  flex-direction: column;
  padding: 0 1rem;
  border-right: 1px solid var(--color-border);
}

.editorial-stat-item:last-child {
  border-right: none;
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.stat-number span {
  color: var(--color-accent-gold);
}

.stat-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 768px) {
  .editorial-stat-item {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
  }
  .editorial-stat-item:last-child {
    border-bottom: none;
  }
}

/* Operational Programme Schedule (Replaces 268 Card Blocks) */
.schedule-agenda {
  margin: 2rem 0;
}

.schedule-day-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.schedule-day-tab {
  background: none;
  border: none;
  padding: 1rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.schedule-day-tab:hover {
  color: var(--color-primary);
}

.schedule-day-tab.active {
  color: var(--color-primary);
  font-weight: 700;
  border-bottom-color: var(--color-accent-gold);
}

.schedule-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
  align-items: center;
}

.schedule-filter-btn {
  background: rgba(11, 27, 61, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.schedule-filter-btn:hover {
  background: rgba(197, 155, 39, 0.1);
  border-color: var(--color-accent-gold);
}

.schedule-filter-btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.schedule-search-input {
  flex: 1;
  min-width: 240px;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #ffffff;
}

.schedule-search-input:focus {
  outline: none;
  border-color: var(--color-accent-gold);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.schedule-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: start;
  transition: background-color 0.15s ease;
}

.schedule-row:hover {
  background-color: rgba(11, 27, 61, 0.015);
}

.schedule-time-col {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.schedule-time-col span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.schedule-body-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.schedule-session-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.35;
}

.schedule-session-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0.25rem 0 0 0;
}

.schedule-session-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.schedule-badge-plenary {
  background: rgba(197, 155, 39, 0.12);
  color: #8c6a0c;
  border: 1px solid rgba(197, 155, 39, 0.3);
}

.schedule-badge-breakout {
  background: rgba(0, 122, 61, 0.1);
  color: var(--color-kenya-green);
  border: 1px solid rgba(0, 122, 61, 0.25);
}

.schedule-badge-ministerial {
  background: rgba(200, 16, 46, 0.1);
  color: var(--color-maasai-red);
  border: 1px solid rgba(200, 16, 46, 0.25);
}

.schedule-venue {
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.schedule-expand-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  align-self: start;
}

.schedule-expand-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

@media (max-width: 768px) {
  .schedule-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1.25rem 0;
  }
  .schedule-time-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 0.4rem;
  }
}

/* Institutional Document Repository (Replaces Resource Cards) */
.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 2rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.doc-table th {
  background: rgba(11, 27, 61, 0.03);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--color-border);
}

.doc-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  color: var(--color-text-main);
}

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

.doc-table tr:hover td {
  background-color: rgba(197, 155, 39, 0.03);
}

.doc-title {
  font-weight: 600;
  color: var(--color-primary);
  display: block;
}

.doc-desc {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.doc-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.doc-action-btn:hover {
  background: var(--color-accent-gold);
  color: var(--color-primary) !important;
}

/* Persona Selection for Attend Page (Decision Simplicity) */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.persona-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.persona-card:hover {
  border-color: var(--color-accent-gold);
  box-shadow: 0 4px 15px rgba(197, 155, 39, 0.15);
  transform: translateY(-2px);
}

.persona-card.active {
  border-color: var(--color-primary);
  background: rgba(11, 27, 61, 0.03);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.persona-icon {
  font-size: 1.8rem;
  color: var(--color-accent-gold);
  margin-bottom: 0.75rem;
}

.persona-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.persona-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* Stepper Progress Bar */
.stepper-bar {
  display: flex;
  justify-content: space-between;
  margin: 2.5rem 0 1.5rem;
  position: relative;
}

.stepper-bar::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.stepper-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg-main);
  padding: 0 0.5rem;
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  transition: all 0.25s ease;
}

.stepper-step.active .stepper-circle {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.stepper-step.completed .stepper-circle {
  background: var(--color-kenya-green);
  border-color: var(--color-kenya-green);
  color: #ffffff;
}

.stepper-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.stepper-step.active .stepper-label {
  color: var(--color-primary);
}

@media (max-width: 600px) {
  .stepper-label {
    display: none;
  }
}

/* Speaker Directory Grid */
.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}

.speaker-tile {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.speaker-portrait-wrap {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
  background: rgba(11, 27, 61, 0.05);
  border: 1px solid var(--color-border);
}

.speaker-portrait-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.speaker-tile:hover .speaker-portrait-wrap img {
  transform: scale(1.04);
}

.speaker-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.speaker-role {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent-gold);
  margin-bottom: 0.2rem;
}

.speaker-affiliation {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* Editorial News & Media Stream */
.editorial-news-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

.news-stream-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.news-stream-item:hover {
  background-color: rgba(11, 27, 61, 0.015);
  padding-left: 0.5rem;
}

.news-stream-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-stream-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.news-stream-desc {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.news-stream-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 768px) {
  .news-stream-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}
