/* Shared type and spacing scale, loaded last so it applies to every page. */
:root {
  --type-page-title: clamp(36px, 5vw, 52px);
  --type-section-title: clamp(30px, 4vw, 42px);
  --space-section: clamp(64px, 8vw, 96px);
}

.section {
  padding: var(--space-section) 0;
}

.page-content {
  padding: 56px 0 96px;
}

.page-title {
  font-size: var(--type-page-title);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-title {
  font-size: var(--type-section-title);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-desc,
.section-desc {
  max-width: 62ch;
  line-height: 1.7;
}

/* Cards: square corners (the site's look) and one shared shadow. */
.about-card,
.info-card,
.content-card,
.resource-card,
.unit-panel,
.widget-panel,
.guide-card,
.donator-card,
.handle-card,
.cta-panel,
.honour-card {
  box-shadow: var(--shadow-sm);
}

.widget-panel,
.donator-card {
  border-radius: 0;
}

/* Smooth scrolling, off when the visitor prefers reduced motion. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Back-to-top button */
.back-to-top {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border-radius: 0;
  border: 1px solid var(--green-border);
  background: var(--bg-card);
  color: var(--green);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover { border-color: var(--green); }
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: none; }
}

/* Motion: stop decorative loops that run on every visit. Entrance animations,
   hovers and the crest glow stay. */
.nav-link.nav-cta::before,
.shield-display::before,
.ring {
  animation: none;
}

.page-hero::after {
  display: none;
}

/* Visitors who have asked for less motion get no looping or long transitions. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Featured cards: the same standard card with a green top accent. */
.honour-card,
.cta-panel {
  border-top: 2px solid var(--green);
}

/* Inline links in body copy are underlined, so colour is not the only cue. */
.content-card p a:not(.btn),
.content-card li a:not(.btn),
.unit-panel p a:not(.btn),
.unit-panel li a:not(.btn),
.unit-callout p a,
.notice p a,
.notice li a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Content available to assistive technology but not shown on screen. */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Keyboard users can jump straight past the navigation. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--bg-card);
  color: var(--green);
  border: 1px solid var(--green);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
#main-content:focus {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}
