/* ============================================================================
   stevenaholland.com — Steven's 2020 "Sandpaper Melon" design, modernized.
   Deep-purple page with a fixed sidebar card, a white content sheet with a purple
   sawtooth right edge, Poppins, "# Heading #" accents, a grey + lavender display
   headline and a sparing yellow accent. Colours derive from the profile's
   --bs-primary (card purple) and --accent (yellow), so the editor recolours live.
   Loaded after site.css (via _ThemeHead), so these rules win.
   ============================================================================ */

/* Poppins, self-hosted (@fontsource/poppins, OFL). */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 800; font-display: swap; src: url(/sites/stevenaholland.com/fonts/poppins-latin-800-normal.woff2) format("woff2"); }

:root {
  --sah-card: var(--bs-primary);                                         /* #461d7b */
  --sah-deep: color-mix(in srgb, var(--bs-primary) 30%, #05010c);        /* ≈ #160729 page */
  --sah-ink: #1d1530;                                                    /* body text */
  --sah-muted: #6a6478;
  --sah-lavender: color-mix(in srgb, var(--bs-primary) 42%, white);      /* ≈ #ab8cd4 */
  --sah-purple-text: color-mix(in srgb, var(--bs-primary) 80%, white);   /* ≈ #663e9b */
  --sah-grey: #c9c7cf;
  --sah-yellow: var(--accent);                                           /* #ffde00 */
  --sah-side-w: 300px;
  --sah-tooth: 15.6px;                   /* sawtooth depth */
  --sah-tooth-h: 31.2px;                 /* sawtooth pitch */
  --sah-edge: 37.6px;                    /* sawtooth strip width (teeth + a 22px solid band) */

  --bs-font-sans-serif: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: 1rem;
  --bs-body-color: var(--sah-ink);
}

body.sah {
  margin: 0;
  background: var(--sah-deep);
  color: var(--sah-ink);
  font-family: var(--bs-font-sans-serif);
  line-height: 1.7;
  display: block;              /* site.css makes body a flex column for its sticky footer */
}

/* ---------- shell ---------- */
.sah-shell {
  display: grid;
  grid-template-columns: var(--sah-side-w) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 2560px;           /* fills the screen up to 1440p; wider screens centre it on the page colour */
  margin: 0 auto;
}

/* ---------- sidebar (the _SiteNav override) ---------- */
.sah-nav { position: relative; }
.sah-bar { display: none; }
.sah-drawer { position: sticky; top: 0; padding: 20px 0 20px 20px; height: 100vh; box-sizing: border-box; }
.sah-card {
  height: 100%;
  max-height: 760px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 2.25rem 1.5rem 1.25rem 1.75rem;
  background:
    radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--sah-card) 70%, white 8%) 0%, transparent 60%),
    var(--sah-card);
  border: 1px solid color-mix(in srgb, var(--sah-deep) 80%, black);
  border-radius: 14px;
  box-shadow: inset -2px 0 4px rgba(10, 4, 20, 0.55), 0 18px 40px rgba(5, 1, 12, 0.45);
  color: #fff;
  overflow-y: auto;
}
.sah .sah-id { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.55rem; text-decoration: none; color: #fff; }
.sah-portrait {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  object-position: 50% 22%;   /* a portrait-shaped photo: keep the face, not the middle, in the circle */
  border: 3px solid var(--sah-yellow);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--sah-yellow) 18%, transparent), 0 10px 24px rgba(5, 1, 12, 0.4);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.sah-id:hover .sah-portrait { transform: rotate(-3deg) scale(1.03); }
/* The name block is a link: keep it white on hover — the sheet's `.sah a:hover` (card purple) would
   otherwise win and the first name would vanish into the purple card. */
.sah .sah-id:hover, .sah .sah-id:focus-visible { color: #fff; }
.sah-name { font-size: 1.65rem; font-weight: 800; line-height: 1.05; letter-spacing: 0.01em; text-transform: uppercase; margin-top: 0.4rem; }
.sah-name .sah-n2 { color: var(--sah-yellow); }
.sah-tagline { font-size: 0.82rem; color: var(--sah-lavender); letter-spacing: 0.03em; }

.sah-links { display: flex; flex-direction: column; margin: 1.6rem 0 0; }
.sah .sah-links a {
  display: block;
  padding: 0.7rem 0.25rem;
  text-align: center;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  transition: color 0.2s ease;
}
.sah .sah-links a::after { display: none; }              /* base site.css hover underline */
.sah .sah-links a:hover, .sah .sah-links a:focus-visible { color: var(--sah-yellow); }
.sah .sah-links a.is-active { color: var(--sah-yellow); }
/* School colors (just for fun, UI only): the sidebar buttons set html[data-school] (js/site.js), which
   swaps the theme's two knobs — the primary (the card purple) and the accent (the yellow); everything
   else derives from them. More specific than the layout's injected :root colors, so it wins.
   Official values: brand.illinois.edu/visual-identity/color, brand.psu.edu/design-toolkit/design-essentials. */
html[data-school="uiuc"] { --bs-primary: #13294b; --bs-primary-rgb: 19, 41, 75; --accent: #ff5f05; }   /* Illini Blue + Illini Orange */
html[data-school="psu"]  { --bs-primary: #001e44; --bs-primary-rgb: 0, 30, 68;  --accent: #96bee6; }   /* Nittany Navy + Pugh Blue */
.sah-schools { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1.1rem; }
.sah .sah-school {
  display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0;
  border: 0; border-radius: 0.75rem; cursor: pointer;
  background: color-mix(in srgb, #fff 10%, transparent);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.sah .sah-school:hover { background: color-mix(in srgb, #fff 18%, transparent); transform: translateY(-2px); }
.sah .sah-school[aria-pressed="true"] { background: color-mix(in srgb, #fff 22%, transparent); box-shadow: inset 0 0 0 2px var(--sah-yellow); }
.sah .sah-school img { display: block; height: 35px; width: auto; }
.sah-extlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem; margin-top: 1rem; font-size: 0.85rem; }
.sah .sah-extlinks a { color: var(--sah-lavender); text-decoration: none; }
.sah .sah-extlinks a:hover { color: var(--sah-yellow); }
.sah .sah-extlinks a::after { display: none; }

/* ---------- content sheet + sawtooth edge ---------- */
.sah-sheet {
  position: relative;
  min-width: 0;
  background: #fff;
  box-shadow: -2px 0 4px rgba(20, 10, 30, 0.6);
  padding-right: var(--sah-edge);
  display: flex;
  flex-direction: column;
}
/* The purple edge: a strip whose LEFT side is cut into teeth pointing into the sheet. Mask = a
   column of left-pointing triangles + a solid block. The triangle is an inline SVG (stretched to the
   tile), not a gradient: browsers anti-alias SVG edges but not a gradient's hard stops, which left
   the diagonals stair-stepped. The block starts half a pixel early so no seam shows between them. */
.sah-sheet::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--sah-edge);
  background: linear-gradient(90deg, var(--sah-card) 0 55%, color-mix(in srgb, var(--sah-card) 60%, var(--sah-deep)) 100%);
  --sah-tooth-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 24' preserveAspectRatio='none'%3E%3Cpath d='M0 12 12 0v24z'/%3E%3C/svg%3E");
  -webkit-mask:
    var(--sah-tooth-svg) 0 0 / var(--sah-tooth) var(--sah-tooth-h) repeat-y,
    linear-gradient(#000 0 0) calc(var(--sah-tooth) - 0.5px) 0 / 100% 100% no-repeat;
          mask:
    var(--sah-tooth-svg) 0 0 / var(--sah-tooth) var(--sah-tooth-h) repeat-y,
    linear-gradient(#000 0 0) calc(var(--sah-tooth) - 0.5px) 0 / 100% 100% no-repeat;
  filter: drop-shadow(-1px 0 0 color-mix(in srgb, var(--sah-deep) 70%, black));
  pointer-events: none;
}
.sah-sheet > main { flex: 1 0 auto; padding: clamp(1.75rem, 4.5vw, 3.75rem) clamp(1.25rem, 4.5vw, 4rem) 2rem; }
.sah-copy { margin: auto 0 0; padding-top: 1.5rem; text-align: center; font-size: 0.75rem; color: var(--sah-lavender); opacity: 0.8; }

/* ---------- typography ---------- */
.sah h1, .sah h2, .sah h3, .sah h4 { font-family: var(--bs-font-sans-serif); color: var(--sah-ink); }
.sah a { color: var(--sah-purple-text); }
.sah a:hover { color: var(--sah-card); }

.sah-hero-head { margin: 0 0 1.75rem; }
.sah-me { margin: 0; font-size: clamp(1.9rem, 3.8vw, 2.6rem); font-weight: 600; line-height: 1.15; }
.sah-lead { margin: 0.75rem 0 0; font-size: 1.15rem; color: var(--sah-ink); }

/* The Explorer's "Me" tab: the hero + intro sit in the docked column beside the board, sized for it. */
.sah .xp-dock .sah-hero-head { margin: 0 0 1rem; }
.sah .xp-dock .sah-lead { margin: 0; font-size: 1.08rem; font-weight: 500; line-height: 1.5; }
.sah .xp-dock .band-intro { font-size: 0.98rem; }

.sah-page-head h1, .sah .page-heading h1 { font-size: clamp(1.9rem, 3.8vw, 2.6rem); font-weight: 600; margin: 0 0 1.5rem; }
.sah-pound { color: var(--sah-card); font-weight: 800; }

/* Bands become plain sections inside the sheet (no full-bleed): the sheet supplies the gutters. */
.sah .band { padding: 0; margin: 0 0 2.25rem; }
.sah .band-intro { font-size: 1.12rem; }
.sah .band-wash { background: #f7f4fb; padding: 1.5rem 1.75rem; border-radius: 12px; }
.sah .band-invert { background: var(--sah-card); color: #fff; padding: 1.75rem; border-radius: 12px; }
.sah .band h2 { display: block; border: 0; padding: 0; font-size: 1.75rem; font-weight: 500; margin: 0 0 1rem; }
.sah .band h2::before { content: "# "; color: var(--sah-card); font-weight: 800; }
.sah .band h2::after { content: " #"; color: var(--sah-card); font-weight: 800; }
.sah .band-invert h2, .sah .band-invert h2::before, .sah .band-invert h2::after { color: #fff; }
.sah .sub-heading { font-weight: 600; }
.sah .prose-text p, .sah .prose-text li { color: var(--sah-ink); }

/* Focus rings that read on both the white sheet and the purple card. */
.sah a:focus-visible, .sah button:focus-visible { outline: 3px solid var(--sah-yellow); outline-offset: 2px; border-radius: 4px; }

/* The signed-in admin pill (from site.css) sits over the sawtooth — nudge it inward. */
.sah .ps-admin-btn { right: calc(var(--sah-edge) + 0.75rem); }

/* ---------- mobile: top bar + slide-in drawer ---------- */
@media (max-width: 900px) {
  :root { --sah-edge: 18px; --sah-tooth: 8px; --sah-tooth-h: 16px; }
  .sah-shell { display: block; }
  .sah-nav { position: sticky; top: 0; z-index: 80; }
  .sah-bar {
    display: flex; align-items: center; gap: 0.9rem;
    height: 60px; padding: 0 calc(var(--sah-edge) + 0.75rem) 0 1rem;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 #ece9f2, 0 6px 18px rgba(20, 10, 30, 0.08);
  }
  .sah-menu-btn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 42px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
    background: var(--sah-yellow); cursor: pointer;
  }
  .sah-menu-btn span { display: block; height: 2px; background: var(--sah-deep); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
  .sah-nav.is-open .sah-menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .sah-nav.is-open .sah-menu-btn span:nth-child(2) { opacity: 0; }
  .sah-nav.is-open .sah-menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .sah-bar-name { font-weight: 700; font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.02em; text-decoration: none; }
  .sah .sah-bar-name .sah-n1 { color: var(--sah-card); }
  .sah .sah-bar-name .sah-n2 { color: color-mix(in srgb, var(--sah-yellow) 75%, #b08800); }

  .sah-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
    width: min(86vw, 320px); height: auto; padding: 14px;
    transform: translateX(-105%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .sah-nav.is-open .sah-drawer { transform: none; }
  .sah-card { max-height: none; }
  .sah-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(10, 4, 20, 0.5); }
  .sah-scrim[hidden] { display: none; }
  .sah-sheet { box-shadow: none; min-height: calc(100vh - 60px); }
}

@media (prefers-reduced-motion: reduce) {
  .sah *, .sah *::before, .sah *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
