/**
 * ErrorOrDown.com — Layout Stylesheet (layout.css)
 * Responsive containers, sticky navbar, 3-column hero dashboard (Sidebar + Live Map + Alerts),
 * section headers, grids, and footer.
 * Uses CSS logical properties (margin-inline, padding-inline, inset-inline) for RTL support.
 */

.container {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 1.75rem;
  }
}

/* ============================================================================
   1. STICKY NAVBAR & ERRORORDOWN BRAND IDENTITY
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.navbar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-icon-shell {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  padding: 2px;
  background: linear-gradient(135deg, #4f46e5 0%, #0f172a 50%, #e11d48 100%);
  box-shadow: 0 4px 10px -2px rgba(79, 70, 229, 0.35), 0 2px 4px -2px rgba(225, 29, 72, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-link:hover .brand-icon-shell {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -2px rgba(79, 70, 229, 0.45), 0 3px 6px -2px rgba(225, 29, 72, 0.35);
}

.brand-icon-inner {
  width: 100%;
  height: 100%;
  border-radius: 0.625rem;
  background: #0b1120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-icon-shell svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-word-error {
  position: relative;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
}

.brand-word-error::after {
  content: '';
  position: absolute;
  left: 0;
  right: 2px;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #f43f5e 100%);
  opacity: 0.85;
}

.brand-error-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.75);
  margin-left: 1px;
  margin-bottom: 9px;
}

.brand-word-or {
  font-weight: 600;
  font-size: 0.78rem;
  margin-inline: 0.16rem;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.03em;
}

.brand-word-down {
  background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

html.dark .brand-word-down {
  background: linear-gradient(90deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-tld-badge {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  background-color: #eef2ff;
  color: #4f46e5;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  margin-inline-start: 0.28rem;
  border: 1px solid #c7d2fe;
  letter-spacing: 0;
  align-self: center;
}

html.dark .brand-tld-badge {
  background-color: rgba(79, 70, 229, 0.16);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.35);
}


.nav-links {
  display: none;
  align-items: center;
  gap: 1.75rem;
}

@media (min-width: 960px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-block: 0.35rem;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ============================================================================
   2. MINIMALIST HERO PANEL (CLOUDFLARE RADAR / LINEAR DESIGN)
   Strict 3-color palette:
   - Obsidian/Slate backgrounds (#090d16, #111827) & Slate borders (#1e293b)
   - Crisp White (#f8fafc) & Muted Slate (#94a3b8) typography
   - Semantic Accents: Indigo (#6366f1 / #4f46e5) search CTA + Rose/Amber (#f43f5e / #f59e0b) outage dots
   ============================================================================ */
.hero-section {
  padding-block: 1.25rem 2rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(180deg, #0b0f19 0%, #090d16 100%);
  color: #f8fafc;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 24px 48px -12px rgba(2, 6, 23, 0.55);
  border: 1px solid #1e293b;
}

@media (min-width: 768px) {
  .hero-panel {
    padding: 2.15rem 2.25rem;
  }
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.35rem;
}

@media (min-width: 1024px) {
  .hero-intro {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
  }
}

.hero-title {
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #f8fafc;
  margin: 0;
}

.hero-subtitle {
  font-size: 0.925rem;
  color: #94a3b8;
  max-width: 56ch;
  line-height: 1.55;
  margin: 0;
}

/* 2-Column Radar Container: [ 8 Cols SVG Map ] + [ 4 Cols Early Warning Feed ] */
.hero-radar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .hero-radar-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .hero-radar-grid > .hero-map-wrapper {
    grid-column: span 8 / span 8;
  }

  .hero-radar-grid > .hero-alerts-panel {
    grid-column: span 4 / span 4;
  }
}

/* ============================================================================
   SECTION HEADINGS & RHYTHM
   ============================================================================ */
.page-section {
  padding-block: 2.25rem;
}

@media (min-width: 768px) {
  .page-section {
    padding-block: 3rem;
  }
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ============================================================================
   5. POPULAR SERVICES GRID (2 cols mobile, 5 cols desktop)
   ============================================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* ============================================================================
   7. IN NUMBERS STATS ROW
   ============================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* ============================================================================
   8. GET NOTIFIED ABOUT FAULTS (2-Column Split)
   ============================================================================ */
.notify-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (min-width: 960px) {
  .notify-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
  }
}

/* ============================================================================
   10. FOOTER
   ============================================================================ */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding-block: 3.5rem 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 2rem;
  }
}

.footer-brand-desc {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 32ch;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.social-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background-color: var(--bg-surface-subtle);
}

.footer-col-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.9rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}
