/*PHZ full stack static site: shared styles for the front page and the
  protected-area pages.

  The background art lives in the shared file store:
    /phz-wallpaper.png              desktop (3840x2160, 16:9)
    /phz-background-mobile_720.png  mobile (350x719, 9:16 portrait)
  Every background rule has a solid navy fallback color that matches the
  art, so the pages render correctly in dev where the store images are
  not on disk.

  The page uses a LIGHT theme for strong WCAG 2.1 readability:
    - white #ffffff page background with near-black #1a202c body text
      (about 16:1, WCAG AAA);
    - the hero keeps the dark wallpaper art, brightened with a light 20%
      scrim so the PHZ wordmark and logo read clearly;
    - links use a dark blue #0b57d0 (about 6.4:1 on white, WCAG AA);
    - the TLP:CLEAR badge uses white on #006400 (about 7.4:1).
  The only text that sits over the wallpaper is the self-contained TLP
  badge, which carries its own opaque background, so the content area is
  the only place body-text contrast applies.*/

:root {
  --background: #ffffff;
  --text: #1a202c;
  --muted: #4a5568;
  --link: #0b57d0;
  --border: #d3dae3;
  --hero: #0d1b2a;
  --tlp-clear: #006400;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--background);
}

body {
  margin: 0;
  background-color: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  line-height: 1.6;
}

/*Hero: the wallpaper art carries the PHZ wordmark. The 20% scrim is light
  enough to keep the art vivid (brighter) while still unifying the look.
  The hero keeps its own navy fallback so it matches the art in dev where
  the store image is absent.*/
.hero {
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  background-color: var(--hero);
  background-image: url("/phz-wallpaper.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
  .hero {
    background-image: url("/phz-background-mobile_720.png");
  }
}

/*TLP classification badge, fixed to the top-right corner of the viewport
  so it stays visible while scrolling. On mobile it shrinks and respects
  the device safe area (notch, browser chrome). The badge is self-contained
  (opaque green with white text) so it is readable over any background.*/
.tlp-badge {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background-color: var(--tlp-clear);
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tlp-badge .tlp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
}

@media (max-width: 767px) {
  .tlp-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
}

/*Content sits on the light page background.*/
main {
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

h1 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: clamp(1.75rem, 1.25rem + 2.5vw, 2.75rem);
  line-height: 1.2;
}

h2 {
  margin: 2rem 0 0.75rem;
  color: var(--text);
  font-size: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/*Call to action: open the full directory index (the nginx autoindex).*/
.index-cta {
  display: inline-block;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  background-color: var(--hero);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.index-cta:hover,
.index-cta:focus {
  background-color: #16324f;
  text-decoration: underline;
}

.index-cta:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/*File store directories: one column on mobile, two from 640px up.*/
.directory-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.directory-list a {
  display: block;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--link);
  text-decoration: none;
}

.directory-list a:hover,
.directory-list a:focus {
  text-decoration: underline;
}

.directory-list a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

footer {
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

footer a {
  color: var(--link);
}
