/* ══════════════════════════════════════════════════════════
   LAYOUT.CSS — Structural elements shared across all pages
   ══════════════════════════════════════════════════════════ */

/* ── Page Layout ──────────────────────────────────────── */
.page-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  position: relative;
}
.page-content { width: 100%; }
@media (min-width: 768px) {
  .page-layout { padding-right: 56px; }
}

/* ── Skip Link ────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 10000;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 8px; }

/* ── Alert Banner ─────────────────────────────────────── */
.alert-banner {
  background: var(--alert-bg);
  color: var(--alert-text);
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
}
.alert-banner a {
  color: var(--alert-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.alert-banner.urgent {
  background: #b91c1c;
  padding: 14px 20px;
  font-size: 16px;
  letter-spacing: 0.03em;
  animation: urgentPulse 3s ease-in-out infinite;
}
.alert-banner.urgent a { color: #ffffff; font-weight: 700; }
.alert-banner.modified {
  background: #b45309;
  padding: 12px 20px;
  font-size: 15px;
}
@keyframes urgentPulse {
  0%, 100% { background: #b91c1c; }
  50% { background: #991b1b; }
}
@media (prefers-reduced-motion: reduce) {
  .alert-banner.urgent { animation: none; background: #b91c1c; }
}

/* ── Status Badge ─────────────────────────────────────── */
.status-badge {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.header-status-badge {
  font-size: 12px;
  display: none;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  padding: 4px 12px;
  border-radius: 100px;
  animation: fadeIn 0.3s ease;
  white-space: nowrap;
}
.header-status-badge.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Top Bar ──────────────────────────────────────────── */
.top-bar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  padding: 6px 24px;
  font-size: 13px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
}
.top-bar a {
  color: var(--topbar-text);
  text-decoration: none;
  transition: color var(--transition);
}
.top-bar a:hover,
.top-bar a:focus { color: var(--color-accent); }
.top-bar-social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 4px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}
.top-bar-social a { display: flex; align-items: center; }
.top-bar-social svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  transition: fill var(--transition);
}

/* ── Site Header ──────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: background 0.35s ease;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--color-text);
}
.logo-mark {
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.logo-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.logo-text span {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Theme Toggle ─────────────────────────────────────── */
.theme-toggle {
  background: var(--color-bg-muted);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  width: 64px;
  height: 32px;
  flex-shrink: 0;
  transition: all var(--transition);
  padding: 0;
  overflow: hidden;
}
.theme-toggle:hover { border-color: var(--color-accent); }
.theme-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}
.theme-toggle-thumb.dark { transform: translateX(32px); }
.theme-toggle-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 7px;
  font-size: 14px;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* ── Desktop Navigation ───────────────────────────────── */
.nav-and-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}
.desktop-nav {
  display: none;
  align-items: center;
  gap: 2px;
  list-style: none;
}
@media (min-width: 1040px) {
  .desktop-nav { display: flex; }
  .mobile-toggle { display: none !important; }
}
.nav-item { position: relative; }
.nav-item > button,
.nav-item > a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-item > button:hover,
.nav-item > a:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}
.nav-chevron {
  font-size: 10px;
  transition: transform var(--transition);
}
.nav-item.open .nav-chevron { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 100;
}
.nav-item.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition);
}
.nav-dropdown a:hover {
  background: var(--color-accent-bg);
  color: var(--color-accent);
}

/* ── Mobile Navigation ────────────────────────────────── */
.mobile-toggle {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 28px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  line-height: 1;
}
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }
.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 85vw);
  background: var(--color-bg-elevated);
  z-index: 2001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.mobile-nav-panel.open { transform: translateX(0); }
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 2px solid var(--color-accent);
}
.mobile-nav-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--color-text);
}
.mobile-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
}
.mobile-nav-list {
  list-style: none;
  padding: 12px;
  flex: 1;
}
.mobile-nav-section > button,
.mobile-nav-section > a {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  padding: 14px 12px;
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  transition: background var(--transition);
}
.mobile-nav-section > button:hover,
.mobile-nav-section > a:hover { background: var(--color-accent-bg); }
.mobile-subnav {
  list-style: none;
  padding: 0 0 8px 16px;
  display: none;
}
.mobile-subnav.open { display: block; }
.mobile-subnav a {
  display: block;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: background var(--transition);
}
.mobile-subnav a:hover { background: var(--color-accent-bg); }
.mobile-theme-row {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-theme-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ── Subpage Hero ─────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #111 0%, #1a1a1a 40%, #222 100%);
  padding: 36px 24px 40px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--bv-orange-muted), var(--color-accent));
}
.page-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.breadcrumb {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb span { color: rgba(255, 255, 255, 0.3); }
.page-hero h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.page-hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 8px;
  max-width: 600px;
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 24px 24px;
  transition: background 0.35s ease;
  border-top: none solid var(--color-accent);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand h3 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--footer-heading);
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 4px;
}
.footer-brand a {
  color: var(--color-accent);
  text-decoration: none;
}
.footer-brand a:hover { text-decoration: underline; }
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--footer-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  color: var(--footer-link);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--footer-link-hover); }
.footer-bottom {
  max-width: var(--max-w);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--footer-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--footer-muted);
}
.footer-bottom a {
  color: var(--footer-muted);
  text-decoration: none;
  margin-left: 16px;
}
.footer-bottom a:hover { color: var(--footer-link-hover); 
}

/* ── Scroll-Responsive Side Borders ───────────────────── */

body::before,
body::after {
  content: '';
  position: fixed;
  top: 0;
  bottom: 0;
  width: 10px;
  z-index: 9999;
  background: var(--border-scroll-color, var(--color-bg));
  pointer-events: none;
}
body::before { left: 0; }
body::after { right: 0; }

/* ── Layered Chevron Footer Divider ───────────────────── */
/* Make sure .site-footer still has border-top: none;      */

.footer-chevron {
  width: 100%;
  height: 250px;
  line-height: 0;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.footer-chevron svg {
  width: 100%;
  height: 250px;
  display: block;
}
.chevron-outer {
  fill: var(--color-accent);
}
.chevron-inner {
  fill: none;
  stroke: var(--color-bg);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.chevron-fill {
  fill: var(--footer-bg);
}
@media (max-width: 768px) {
  .footer-chevron {
    display: none;
  }
  .site-footer {
    border-top: 3px solid var(--color-accent) !important;
  }
}