/*
 * Fonts
 */
@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/marcellus-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Marcellus';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/marcellus-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/*
 * Custom Properties
 */
:root {
  --color-bg: #363636;
  --color-text: #fff;
  --color-text-muted: rgba(255, 255, 255, .75);
  --color-accent: rgba(255, 255, 255, .5);
  --focus-outline: 3px solid #fff;
  --focus-offset: 2px;
}

/*
 * Globals
 */
.responsiveImage {
  width: 99%;
  height: auto;
}

figcaption {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Ensure small text maintains AAA contrast */
figcaption small {
  color: var(--color-text-muted);
}

figcaption small a {
  color: var(--color-text-muted);
}

figcaption small a:hover,
figcaption small a:focus {
  color: var(--color-text);
}

/* Links - WCAG 2.2 AAA: underline for non-color identification */
a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-text);
  text-decoration-thickness: 2px;
}

/* Focus indicators - WCAG 2.2 AAA: 2.4.7, 2.4.11, 2.4.12 */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
.btn:focus,
.btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: var(--focus-offset);
}

/* Custom default button - WCAG 2.2 AAA: 2.5.5 Target Size */
.btn-secondary {
  color: var(--color-bg);
  text-shadow: none;
  background-color: var(--color-text);
  border: .05rem solid var(--color-text);
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.btn-secondary:hover,
.btn-secondary:focus {
  color: var(--color-bg);
  background-color: var(--color-text);
  border-color: var(--color-text);
}

.btn-secondary:hover {
  opacity: 0.9;
}

/*
 * Base structure
 */
html,
body {
  height: 100%;
  background-color: var(--color-bg);
  font-family: 'Marcellus', serif;
}

body {
  display: flex;
  color: var(--color-text);
}

.cover-container {
  max-width: 42em;
}

/*
 * Header
 */
.masthead {
  margin-bottom: 2rem;
}

.masthead-brand-logo {
  width: 100%;
}

/* Nav links - WCAG 2.2 AAA: 2.5.5 Target Size (44px min) */
.nav-masthead .nav-link {
  min-height: 44px;
  min-width: 44px;
  padding: .75rem .5rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background-color: transparent;
  border-bottom: .25rem solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-masthead .nav-link:hover,
.nav-masthead .nav-link:focus {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.nav-masthead .nav-link + .nav-link {
  margin-left: .5rem;
}

.nav-masthead .active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/*
 * Cover
 */
.cover {
  padding: 0 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cover .btn-lg {
  padding: .75rem 1.25rem;
  font-weight: 700;
  width: 12rem;
}

.lead {
  font-size: 1rem;
}

ul.lead {
  display: inline-block;
  text-align: left;
  padding-left: 1.5rem;
}

.cover-heading {
  font-size: 1.75rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

/*
 * Blockquote
 */
blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-accent);
}

blockquote p {
  margin-bottom: 0.5rem;
}

blockquote footer {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

blockquote cite {
  font-style: normal;
}

/*
 * Systems grid
 */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
  margin: 2rem auto;
  width: 90%;
}

.system-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.system-logo {
  width: 100%;
  max-width: 108px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.system-name {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .systems-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .systems-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cover-heading {
    font-size: 1.5rem;
  }

  .masthead-brand-logo {
    width: 80%;
  }
}

/*
 * State map (About page)
 */
.state-map {
  margin: 2rem auto;
  display: block;
}

.rhode-island-map {
  margin: 2rem 0;
}

/*
 * Footer
 */
.mastfoot {
  color: var(--color-text-muted);
}

/*
 * Accessibility - WCAG 2.2 AAA
 */

/* Respect reduced motion preferences (2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  :root {
    --color-text-muted: rgba(255, 255, 255, .9);
    --color-accent: rgba(255, 255, 255, .75);
  }
}

/* Ensure text can be resized (1.4.4, 1.4.10) */
html {
  font-size: 100%;
}

/* Selection contrast */
::selection {
  background-color: var(--color-text);
  color: var(--color-bg);
}

/*
 * Print styles
 */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .masthead,
  .mastfoot,
  .btn {
    display: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  .cover-container {
    max-width: 100%;
  }
}
