
/* ============================================================
   Fonts — self-hosted from the ECR design system
   ============================================================ */
@font-face {
  font-family: 'MADECanvas';
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/MADECanvas-Black.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Montserrat-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Montserrat-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/Montserrat-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/Montserrat-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'FreightText';
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/FreightText-Book.woff2') format('woff2');
}

/* ============================================================
   Design tokens — ECR Design System
   ============================================================ */
:root {
  --ecr-charcoal: #3f4443;
  --ecr-red: #d6001c;
  --ecr-gray-mid: #919d9d;
  --ecr-gray-light: #bec6c4;
  --ecr-white: #ffffff;

  --ecr-orange: #ff6720;
  --ecr-cream: #efeade;
  --ecr-burgundy: #651c32;

  --ecr-charcoal-90: #535857;
  --ecr-charcoal-70: #6b7170;
  --ecr-charcoal-20: #d4d6d6;
  --ecr-charcoal-10: #eaebeb;
  --ecr-cream-80: #f5f2ec;

  --fg1: var(--ecr-charcoal);
  --fg2: var(--ecr-charcoal-70);
  --fg3: var(--ecr-gray-mid);
  --border: var(--ecr-gray-light);

  --font-display: 'MADECanvas', Georgia, serif;
  --font-heading: 'Montserrat', system-ui, sans-serif;
  --font-body: 'FreightText', Georgia, serif;

  --shadow-sm: 0 1px 3px rgba(63, 68, 67, 0.1), 0 1px 2px rgba(63, 68, 67, 0.06);
  --shadow-md: 0 4px 12px rgba(63, 68, 67, 0.12), 0 2px 4px rgba(63, 68, 67, 0.06);
  --shadow-lg: 0 12px 32px rgba(63, 68, 67, 0.14), 0 4px 8px rgba(63, 68, 67, 0.08);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --page-max: 1240px;
  --gutter: 32px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The React version removed filtered cards from the DOM; this one toggles the
   `hidden` attribute instead. Any explicit `display` beats the browser's
   default `[hidden] { display: none }`, and every card carries `display: flex`
   — so without this the search filter updates the count while changing
   nothing on screen. Must stay above the component rules. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  font-family: var(--font-heading);
  background: var(--ecr-white);
  color: var(--fg1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ecr-red);
  outline-offset: 3px;
}

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Screen-reader-only, but focusable (skip link). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 20px;
  background: var(--ecr-red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ecr-charcoal);
  border-bottom: 3px solid var(--ecr-red);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-logo {
  height: 32px;
  width: auto;
  display: block;
}

.header-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.22);
}

.header-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ecr-white);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}

.header-link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.66);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color var(--ease) 150ms, border-color var(--ease) 150ms;
}

.header-link:hover {
  color: var(--ecr-white);
  border-bottom-color: var(--ecr-red);
}

/* ============================================================
   Hero — charcoal field with the brand's diagonal motif
   ============================================================ */
.hero {
  position: relative;
  background: var(--ecr-charcoal);
  overflow: hidden;
  padding: 84px 0 76px;
}

/* Flat diagonal wedge, bottom-left to top-right (logo motif). No gradients. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ecr-charcoal-90);
  clip-path: polygon(58% 100%, 100% 0, 100% 100%);
  pointer-events: none;
}

/* Optional hero photograph, sat under a flat charcoal scrim. */
.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* The hero is a wide, short band cut from a 4:3 frame. Biasing upward keeps
     the skyline in shot instead of centring on the water below it. */
  object-position: center 34%;
  /* Only a light pass — the source is already near-monochrome. This just
     neutralises its blue cast so it sits with the warmer brand charcoal. */
  filter: grayscale(0.25);
}

/* Flat opacity, not a gradient scrim — the brand is flat colour only. Kept low
   because the photograph is already dark; a heavier scrim crushes the skyline
   to a black rectangle. Contrast is carried by the image, not the overlay. */
.hero-scrim {
  position: absolute;
  inset: 0;
  background: var(--ecr-charcoal);
  opacity: 0.42;
}

/* Over a photo the opaque wedge would read as a grey slab, so it drops to a
   translucent facet — same motif, lets the image through. */
.hero--photo::after {
  background: rgba(255, 255, 255, 0.07);
}

/* A light photo lifts the effective background enough to drag the lede under
   4.5:1, so it gains opacity when there's an image behind it. */
.hero--photo .hero-lede {
  color: rgba(255, 255, 255, 0.88);
}

.hero-inner {
  position: relative;
  z-index: 1;
  /* Unconstrained so the title can run the full measure on one line. The lede
     carries its own 54ch cap, so it stays readable regardless. */
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 26px;
}

.hero-eyebrow::before {
  content: '';
  width: 40px;
  height: 2px;
  background: var(--ecr-red);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  /* Scales with the viewport so "Team Resources" holds one line at every
     width — the vw term is tuned to the measured width of that exact string,
     so materially longer wording will need it re-checked. */
  font-size: clamp(1.75rem, 8vw, 7rem);
  letter-spacing: 0.06em;
  line-height: 1.05;
  white-space: nowrap;
  color: var(--ecr-white);
  /* Design system calls for a 0.3–1px stroke on large display type. */
  -webkit-text-stroke: 0.5px currentColor;
  paint-order: stroke fill;
}

.hero-lede {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 22px;
  max-width: 54ch;
}

/* ============================================================
   Search
   ============================================================ */
.search-bar {
  position: sticky;
  top: 71px;
  z-index: 30;
  background: var(--ecr-white);
  border-bottom: 1px solid var(--border);
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 14px;
  color: var(--fg3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 44px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--ecr-cream-80);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color var(--ease) 150ms, background var(--ease) 150ms;
}

.search-input::placeholder {
  color: var(--fg3);
  font-weight: 400;
}

.search-input:focus {
  outline: none;
  border-color: var(--ecr-charcoal);
  background: var(--ecr-white);
}

.search-clear {
  position: absolute;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--fg3);
  cursor: pointer;
  transition: color var(--ease) 150ms;
}

.search-clear:hover {
  color: var(--ecr-red);
}

.search-count {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg3);
  white-space: nowrap;
}

/* ============================================================
   Featured panels
   ============================================================ */
.featured {
  padding: 64px 0 8px;
}

/* Same gap as .card-grid below, so the two panels read as part of one system
   rather than a split slab. */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-height: 210px;
  padding: 32px;
  background: var(--ecr-red);
  color: var(--ecr-white);
  transition: background var(--ease) 200ms, box-shadow var(--ease) 200ms;
}

a.featured-card:hover {
  background: #b60018;
  box-shadow: var(--shadow-lg);
}

/* Secondary brand accent. Deep enough to pair with the red rather than
   compete with it — orange at this size would vibrate against it. */
.featured-card--burgundy {
  background: var(--ecr-burgundy);
}

a.featured-card--burgundy:hover {
  background: #4e1526;
}

/* Keeps the brand red — the "link needed" tag carries the signal, so the panel
   still previews the way it will look once the URL lands. */
.featured-card.is-pending {
  cursor: default;
}

.featured-card.is-pending .featured-card-cta {
  color: rgba(255, 255, 255, 0.72);
}

.featured-card-icon {
  color: rgba(255, 255, 255, 0.85);
}

.featured-card-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.15;
}

.featured-card-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 10px;
  max-width: 34ch;
}

.featured-card-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.featured-card-cta svg {
  transition: transform var(--ease) 200ms;
}

a.featured-card:hover .featured-card-cta svg {
  transform: translateX(4px);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 56px 0 8px;
}

.section-head {
  border-top: 1px solid var(--border);
  padding-top: 22px;
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg1);
  position: relative;
  padding-top: 18px;
}

.section-title::before {
  content: '';
  position: absolute;
  top: -23px;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--ecr-red);
}

.section-blurb {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg2);
  padding-top: 18px;
}

/* Fixed column counts rather than auto-fill: most sections hold four items, and
   a 4/3/2/1 ladder keeps them filling whole rows instead of orphaning one. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1120px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Resource card
   ============================================================ */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 168px;
  padding: 22px 24px 20px;
  background: var(--ecr-white);
  border: 1px solid var(--border);
  transition: border-color var(--ease) 200ms, box-shadow var(--ease) 200ms;
}

/* Red edge grows in on hover — the brand's accent, not a glow. */
.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  bottom: -1px;
  width: 3px;
  background: var(--ecr-red);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--ease) 220ms;
}

a.card:hover {
  border-color: var(--ecr-charcoal);
  box-shadow: var(--shadow-md);
}

a.card:hover::before {
  transform: scaleY(1);
}

.card-icon {
  color: var(--ecr-charcoal);
  transition: color var(--ease) 200ms;
}

a.card:hover .card-icon {
  color: var(--ecr-red);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--fg1);
}

.card-desc {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg2);
}

.card-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-host {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-arrow {
  color: var(--ecr-charcoal);
  flex-shrink: 0;
  transition: transform var(--ease) 200ms, color var(--ease) 200ms;
}

a.card:hover .card-arrow {
  color: var(--ecr-red);
  transform: translate(3px, -3px);
}

/* Tile with no URL yet — flagged, not disguised, but still shown at full
   fidelity so the page reads as designed while links are being collected. */
.card.is-pending {
  cursor: default;
}

.card.is-pending .card-icon {
  color: var(--fg3);
}

.pending-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ecr-orange);
}

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  padding: 80px 0;
  text-align: center;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg1);
}

.empty-body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg2);
  margin-top: 12px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 88px;
  background: var(--ecr-charcoal);
  color: var(--ecr-white);
  border-top: 3px solid var(--ecr-red);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  padding: 52px 0 48px;
}

.footer-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.footer-role {
  font-family: var(--font-body);
  font-size: 15px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

.footer-contact {
  font-family: var(--font-body);
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
  line-height: 1.7;
}

.footer-contact a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  transition: color var(--ease) 150ms, border-color var(--ease) 150ms;
}

.footer-contact a:hover {
  color: var(--ecr-white);
  border-bottom-color: var(--ecr-red);
}

.footer-right {
  text-align: right;
  margin-left: auto;
}

.footer-wordmark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: color var(--ease) 150ms;
}

.footer-wordmark:hover {
  color: var(--ecr-red);
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 8px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  :root {
    --gutter: 20px;
  }

  .header-nav {
    display: none;
  }

  .hero {
    padding: 56px 0 52px;
  }

  .hero::after {
    clip-path: polygon(70% 100%, 100% 20%, 100% 100%);
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .search-inner {
    flex-wrap: wrap;
  }

  .footer-inner {
    flex-direction: column;
    padding: 40px 0;
  }

  .footer-right {
    text-align: left;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
