/* root-modern.css v2 — bridge to ikeriri-design.css */
/* This file provides backward compatibility for pages still using rt-* classes */

/* Map old rt- variables to new ik- variables */
:root {
  --rt-blue: var(--ik-primary, #1a5276);
  --rt-blue-strong: var(--ik-primary, #1a5276);
  --rt-blue-soft: var(--ik-primary-light, #2980b9);
  --rt-bg: var(--ik-bg, #f5f7fa);
  --rt-text: var(--ik-text, #2c3e50);
  --rt-line: var(--ik-border, #dce3ed);
  --rt-card: var(--ik-card, #ffffff);
}

/* Header compatibility */
#rt-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--ik-header-bg, #2c3e50);
  border-bottom: 3px solid var(--ik-primary-light, #2980b9);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: background 0.25s;
}
.rt-header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0.5rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem;
}
.rt-logo { display: block; text-align: center; }
.rt-logo img { max-width: 100%; height: auto; max-height: 36px; }
.rt-nav-wrap { display: flex; justify-content: center; }
.rt-fallback-nav {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.25rem;
}
.rt-fallback-nav a {
  display: inline-block; padding: 0.4rem 0.75rem;
  border: 1px solid transparent; border-radius: 6px;
  background: var(--ik-nav-bg, rgba(255,255,255,0.08));
  color: var(--ik-header-link, #bdc3c7) !important;
  text-decoration: none; font-size: 0.8rem; font-weight: 500;
  transition: all 0.25s;
}
.rt-fallback-nav a:hover {
  background: var(--ik-nav-active, #3498db);
  color: #fff !important;
}

/* Global nav dropdown compatibility */
#global-nav { text-align: center; }
#global-nav ul.dropdown { float: none; display: inline-block; text-align: left; }
#global-nav ul.dropdown > li { float: left; }

/* Main content */
.rt-main { max-width: 1200px; margin: 1.5rem auto 3rem; padding: 0 1rem; }
.rt-lang-switch { text-align: right; margin-bottom: 0.5rem; font-size: 0.8rem; color: var(--ik-text-muted); }
.rt-breadcrumb {
  margin: 0 0 1rem; padding: 0.5rem 0.75rem;
  background: var(--ik-surface, #fff); border: 1px solid var(--ik-border);
  border-radius: 8px; font-size: 0.8rem;
}
.rt-content {
  background: var(--ik-card); border: 1px solid var(--ik-border);
  border-radius: 12px; padding: 1.25rem;
  box-shadow: var(--ik-card-shadow, 0 2px 8px rgba(0,0,0,0.06));
  overflow-x: auto;
}
.rt-intro {
  padding: 1rem 1.25rem; margin-bottom: 1rem;
  border-radius: 12px; border: 1px solid var(--ik-border);
  background: var(--ik-surface);
}
.rt-intro h1 {
  margin: 0 0 0.5rem; color: var(--ik-heading);
  font-size: clamp(1.2rem, 2.8vw, 1.9rem);
}

/* Legacy content */
.legacy-content table { width: 100% !important; max-width: 100%; border-collapse: collapse; background: var(--ik-card); }
.legacy-content td, .legacy-content th { border: 1px solid var(--ik-border) !important; padding: 8px; vertical-align: top; }
.legacy-content tr[bgcolor="#0033CC"] td, .legacy-content tr[bgcolor="#0033cc"] td {
  background: var(--ik-primary) !important; color: #fff;
}
.legacy-content img { max-width: 100%; height: auto; }

/* Footer */
#rt-footer { margin-top: 1.5rem; background: var(--ik-footer-bg); }
#rt-footer #footer { max-width: 1200px; width: 100%; margin: 0 auto; }
#rt-footer article { background: var(--ik-footer-bg) !important; }
#rt-footer footer, #rt-footer address, #rt-footer a, #rt-footer h3, #rt-footer li {
  color: var(--ik-footer-text) !important;
}

/* Back to top */
.rt-backtotop { position: fixed; right: 1rem; bottom: 1.5rem; z-index: 1200; }
.rt-backtotop a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ik-primary); color: #fff !important;
  text-decoration: none; font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: all 0.25s;
}
.rt-backtotop a:hover { background: var(--ik-primary-light); transform: translateY(-2px); }

@media (max-width: 768px) {
  .rt-header-inner { padding: 0.5rem 0.75rem; }
  #global-nav ul.dropdown { display: block; width: 100%; }
  #global-nav ul.dropdown > li { float: none; display: block; }
  .rt-main { margin-top: 0.75rem; padding: 0 0.5rem; }
  .rt-content { padding: 0.75rem; }
  .legacy-content td, .legacy-content th { font-size: 13px; }
}
