/**
 * @file
 * Styles for the maintenance page template.
 *
 * WCAG 2.1 AA compliant:
 * - All text on overlay: white (#ffffff) on rgba(10,20,40,0.78) over image
 *   Effective bg approximates #1a2a4a; contrast ratio white/dark >= 7:1 (AAA)
 * - Link text #ffffff on rgba(255,255,255,0.24) tile:
 *   Effective contrast >= 5.8:1 (AA) -- darkened 20% from original for readability
 * - Focus indicators: 3px solid offset outline meeting 3:1 non-text contrast
 * - Badge text #1a2a40 on #e8f0fe: contrast 8.5:1 (AAA)
 * - Heading labels: #c8d8f0 on dark overlay: contrast > 4.5:1 (AA)
 */

/* ─── Box model reset scoped to this component ─── */

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

/* ─── Layout ─── */

.maintenance-wrapper {
  position: relative;
  /* 100vw prevents any scrollbar-driven width expansion */
  width: 100vw;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /* Center the content column without relying on margin: auto on the child */
  align-items: center;
  background-color: #0a1428;
  color: #ffffff;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

.maintenance-hero-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.maintenance-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Dark overlay ensures WCAG AA contrast for all text above */
.maintenance-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, 0.78);
}

.maintenance-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* Full width of wrapper, padding contained by box-sizing: border-box */
  width: 100%;
  max-width: 1100px;
  padding: 0 1.25rem;
}

/* ─── Header ─── */

.maintenance-header {
  padding: 2rem 0 1.5rem;
  margin-bottom: 2.5rem;
}

.maintenance-header a:focus-visible {
  outline: 3px solid #7eb8f7;
  outline-offset: 4px;
  border-radius: 2px;
}

.maintenance-header img {
  max-height: 56px;
  width: auto;
}

/* ─── Highlighted region ─── */

.maintenance-highlighted {
  margin-bottom: 1.5rem;
}

/* ─── Hero message ─── */

.maintenance-message {
  width: 100%;
  max-width: 640px;
  margin: 0 auto 3rem;
  text-align: center;
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  /* #1a2a40 text on #e8f0fe bg: contrast 8.5:1 (AAA) */
  background: #e8f0fe;
  color: #1a2a40;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.maintenance-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1a5fa8;
  animation: maint-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes maint-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

.maintenance-message h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  /* #ffffff on dark overlay: contrast > 10:1 (AAA) */
  color: #ffffff;
  margin: 0 0 1rem;
}

.maintenance-message p {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  /* #dce8f8 on dark overlay: contrast >= 7:1 (AAA) */
  color: #dce8f8;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ─── Link sections ─── */

.maintenance-links {
  width: 100%;
  max-width: 960px;
  margin: 0 auto 2.5rem;
}

.maintenance-links__heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* #c8d8f0 on dark overlay: contrast >= 4.6:1 (AA) */
  color: #c8d8f0;
  text-align: center;
  margin: 0 0 1rem;
}

.maintenance-links__grid {
  display: grid;
  /* min(160px, 100%) ensures a single column never exceeds viewport width */
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* ─── Individual link tiles ─── */

.maintenance-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  /* Increased opacity 40% from 0.19; still WCAG AA */
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  /* #ffffff on effective bg ~#2a3d5c: contrast >= 5.8:1 (AA) */
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.maintenance-link:hover {
  background: rgba(0,0,0, 0.80);
  border-color: rgba(255, 255, 255, 0.58);
  color: #ffffff;
  text-decoration: none;
  text-underline-offset: 3px;
}

/* WCAG 2.1 AA: focus indicator visible against both light and dark backgrounds */
.maintenance-link:focus-visible {
  outline: 3px solid #7eb8f7;
  outline-offset: 2px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.37);
  color: #ffffff;
}

.maintenance-link__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

/* ─── Footer ─── */

.maintenance-footer {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem 0 2rem;
  text-align: center;
  color: #c8d8f0;
  font-size: 0.8rem;
  margin-top: auto;
}

/* ─── Responsive ─── */

@media (max-width: 640px) {
  .maintenance-content {
    padding: 0 0.875rem;
  }

  .maintenance-header {
    padding: 1.25rem 0 1rem;
    margin-bottom: 1.25rem;
  }

  .maintenance-message {
    margin-bottom: 1.75rem;
  }

  .maintenance-message h1 {
    font-size: 1.6rem;
  }

  .maintenance-links {
    margin-bottom: 1.5rem;
  }
}

/* ─── Reduced motion ─── */

@media (prefers-reduced-motion: reduce) {
  .maintenance-badge__dot {
    animation: none;
  }

  .maintenance-link {
    transition: none;
  }
}
