/* ================================================================
   COPE COMMUNITY WEBSITE
   1. Design tokens and reset
   2. Header and navigation
   3. Hero section
   4. Our approach
   5. What we do
   6. Impact
   7. Stories
   8. How you can help
   9. Information panels
   10. Footer
   11. Responsive styles
   ================================================================ */

/* 1. DESIGN TOKENS AND RESET
   --------------------------------------------------------------- */
:root {
  --navy: #0a3454;
  --navy-deep: #062940;
  --navy-soft: #164d70;
  --gold: #d6a32d;
  --gold-dark: #ad7910;
  --ink: #17324b;
  --muted: #5e6b74;
  --paper: #fffdf8;
  --cream: #f7f2e7;
  --white: #ffffff;
  --line: #ded8ca;
  --shadow-soft: 0 12px 35px rgba(15, 44, 65, 0.10);
  --shadow-deep: 0 18px 45px rgba(0, 20, 35, 0.22);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: #e9e6df;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
img { width: 100%; }
h1, h2, h3, p { margin-top: 0; }

h1, h2 {
  font-family: var(--serif);
  letter-spacing: -0.035em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 1.15rem;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
}

main,
.site-footer {
  max-width: 1180px;
  margin-inline: auto;
  background: var(--paper);
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 0.7rem 1rem;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 700;
}

.skip-link:focus { top: 12px; }

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

.eyebrow {
  margin-bottom: 0.9rem;
  color: var(--gold-dark);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow.light { color: #f0c65d; }
.section-pad { padding: 76px clamp(24px, 5vw, 70px); }
.section-heading > p:last-child { color: var(--muted); font-weight: 600; }
.section-heading h2 { margin-bottom: 0.65rem; }
.centered { text-align: center; }

/* 2. HEADER AND NAVIGATION
   --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
  min-height: 78px;
  margin-inline: auto;
  padding-inline: 24px;
}

.brand {
  display: block;
  flex: 0 0 116px;
  padding: 0;
  background: transparent;
}

.brand img {
  width: 116px;
  height: 68px;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
}

.primary-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-nav a,
.dropdown-toggle {
  padding: 1rem 0.58rem;
  border: 0;
  background: none;
  color: var(--white);
  font: 700 0.76rem/1 var(--sans);
  letter-spacing: 0.015em;
  white-space: nowrap;
  cursor: pointer;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.dropdown-toggle:hover,
.dropdown-toggle:focus-visible {
  color: #f4c861;
  outline: none;
}

.nav-cta {
  padding: 0.84rem 1rem !important;
  border-radius: 5px;
  background: var(--gold) !important;
  box-shadow: 0 4px 0 var(--gold-dark);
  color: var(--navy-deep) !important;
  font-size: 0.7rem !important;
  text-transform: uppercase;
}

.has-dropdown { position: relative; }

.dropdown {
  position: absolute !important;
  top: calc(100% + 4px);
  left: 0;
  z-index: 15;
  display: block !important;
  min-width: 195px;
  padding: 0.5rem !important;
  border-top: 3px solid var(--gold);
  background: var(--white);
  box-shadow: var(--shadow-deep);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.dropdown li { display: block; }

.dropdown a {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.84rem;
}

.dropdown a:hover,
.dropdown a:focus-visible {
  background: var(--cream);
  color: var(--navy);
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 42px;
  margin-left: auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: transparent;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: var(--white);
}

/* 3. HERO SECTION
   --------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 52% 48%;
  min-height: 650px;
  overflow: hidden;
  background: var(--paper);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px clamp(42px, 7vw, 90px);
}

.hero-copy::after {
  content: "";
  position: absolute;
  top: 0;
  right: -42px;
  bottom: 0;
  z-index: -1;
  width: 84px;
  background: linear-gradient(90deg, var(--paper) 35%, rgba(255, 253, 248, 0));
  pointer-events: none;
}

.hero h1 {
  margin-bottom: 1.45rem;
  color: var(--navy);
  font-size: clamp(3.8rem, 8vw, 7.2rem);
}

.hero-intro {
  max-width: 500px;
  margin-bottom: 2rem;
  color: #4e5d68;
  font-size: 1.06rem;
}

.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0.92rem 1.2rem;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-gold { background: var(--gold); box-shadow: 0 4px 0 var(--gold-dark); color: var(--navy-deep); }
.button-outline { border: 2px solid var(--navy); background: var(--white); box-shadow: 0 4px 0 #bec5c9; }

.hero-image,
.approach-image,
.story-image {
  position: relative;
  overflow: hidden;
  background: #18354a;
}

.hero-image img,
.approach-image img,
.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image img { object-position: center 54%; }

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(4, 28, 45, 0.38));
  pointer-events: none;
}

.image-note,
.hand-note,
.closing-note { font-family: "Segoe Print", "Bradley Hand", cursive; }

.image-note {
  position: absolute;
  right: 6%;
  bottom: 8%;
  z-index: 2;
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  transform: rotate(-5deg);
}

/* 4. OUR APPROACH
   --------------------------------------------------------------- */
.approach {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  min-height: 430px;
  background: #fbf7ed;
}

.approach-copy {
  position: relative;
  padding: 62px clamp(42px, 7vw, 90px) 55px;
}

.approach-copy p:not(.eyebrow, .hand-note) { max-width: 510px; }
.approach-image { min-height: 430px; }
.approach-image img { object-position: center 52%; filter: saturate(0.96) contrast(1.03); }

.hand-note {
  position: absolute;
  right: 8%;
  bottom: 7%;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1.4;
  transform: rotate(-5deg);
}

/* 5. WHAT WE DO
   --------------------------------------------------------------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 38px;
}

.service-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.service-card:hover {
  box-shadow: 0 18px 40px rgba(15, 44, 65, 0.15);
  transform: translateY(-5px);
}

.service-card > img {
  height: 160px;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.04);
}

.service-card:nth-child(1) > img { object-position: 58% center; }
.service-card:nth-child(2) > img { object-position: 62% center; }
.service-card:nth-child(3) > img { object-position: 48% center; }
.service-card:nth-child(4) > img { object-position: center 62%; }

.service-body { position: relative; padding: 21px 18px 20px; }

.service-icon {
  position: absolute;
  top: -25px;
  left: 16px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
}

.service-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.service-card h3 {
  margin: 12px 0 6px;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.1;
}

.service-card p { margin: 0; color: var(--muted); font-size: 0.88rem; }

/* 6. IMPACT
   --------------------------------------------------------------- */
.impact {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr;
  overflow: hidden;
  background: var(--navy);
  color: var(--white);
}

.impact-photo {
  min-height: 400px;
  background:
    linear-gradient(90deg, transparent 62%, var(--navy)),
    linear-gradient(0deg, rgba(6, 41, 64, 0.25), rgba(6, 41, 64, 0.08)),
    url("images/clothing-support-v2.jpg") center / cover;
}

.impact-copy { padding: 58px; }
.impact h2 { margin-bottom: 1rem; font-size: clamp(2.8rem, 5vw, 5rem); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stats div {
  display: flex;
  flex-direction: column;
  padding-right: 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.stats div:last-child { border-right: 0; }
.stats strong { color: var(--gold); font-family: var(--serif); font-size: 1.2rem; }
.stats span { font-size: 0.72rem; font-weight: 700; }

/* 7. STORIES
   --------------------------------------------------------------- */
.story {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  min-height: 390px;
  background: var(--white);
}

.story-copy { padding: 62px clamp(42px, 7vw, 90px) 52px; }
.story-copy h2 { font-size: clamp(2.5rem, 5vw, 4.8rem); }

blockquote {
  padding-left: 26px;
  margin: 1.2rem 0;
  border-left: 6px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
}

cite {
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-image { min-height: 390px; }
.story-image img { object-position: center 46%; filter: saturate(0.95) contrast(1.04); }

/* 8. HOW YOU CAN HELP
   --------------------------------------------------------------- */
.help { position: relative; padding-bottom: 62px; background: var(--cream); }
.help .section-heading { max-width: 660px; }

.help-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  max-width: 780px;
  margin-top: 36px;
}

.help-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
}

.help-grid span {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  color: var(--gold-dark);
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.help-grid svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.help-grid a:hover span,
.help-grid a:focus-visible span {
  background: var(--gold);
  color: var(--white);
  transform: translateY(-3px);
}

.closing-note {
  position: absolute;
  right: 6%;
  bottom: 48px;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.45;
  transform: rotate(-5deg);
}

/* 9. INFORMATION PANELS
   --------------------------------------------------------------- */
.details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #0c3a5e;
  color: var(--white);
}

.details article {
  padding: 42px 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  scroll-margin-top: 100px;
}

.details article:last-child { border-right: 0; }
.details h2 { font-size: 1.65rem; letter-spacing: -0.02em; line-height: 1.08; }
.details p:last-child { margin: 0; color: #d9e2e7; font-size: 0.9rem; }

/* 10. FOOTER
   --------------------------------------------------------------- */
.site-footer {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 36px;
  padding: 52px clamp(24px, 5vw, 70px) 28px;
  border-top: 5px solid var(--gold);
  background: var(--navy-deep);
  color: var(--white);
}

.footer-brand img {
  width: 132px;
  height: auto;
  margin-bottom: 15px;
  border-radius: 3px;
}

.site-footer h2 {
  margin-bottom: 14px;
  color: var(--gold);
  font: 800 0.78rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer a,
.site-footer > div > p {
  display: block;
  margin: 0.45rem 0;
  color: #dbe4e8;
  font-size: 0.87rem;
}

.site-footer a:hover { color: var(--gold); }

.copyright {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #9fb0ba;
  font-size: 0.75rem;
}

/* 11. RESPONSIVE STYLES
   --------------------------------------------------------------- */
@media (max-width: 1000px) {
  .header-inner { min-height: 72px; }
  .brand, .brand img { width: 102px; }
  .brand img { height: 62px; }
  .primary-nav { gap: 6px; }
  .primary-nav a, .dropdown-toggle { padding-inline: 0.42rem; font-size: 0.68rem; }
  .hero { grid-template-columns: 50% 50%; min-height: 620px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card > img { height: 210px; }
  .help { padding-bottom: 165px; }
  .closing-note { right: auto; bottom: 38px; left: 50%; }
  .details { grid-template-columns: repeat(2, 1fr); }
  .details article:nth-child(2) { border-right: 0; }
  .site-footer { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 72px; }
  .menu-toggle { display: block; }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: 15px 20px 22px;
    background: var(--navy-deep);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.25);
  }

  .primary-nav.open { display: flex; }
  .primary-nav > ul { align-items: stretch; flex-direction: column; }
  .primary-nav li { width: 100%; }

  .primary-nav a,
  .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    font-size: 0.9rem;
    text-align: left;
  }

  .dropdown {
    position: static !important;
    display: none !important;
    padding: 0.3rem !important;
    border: 0;
    background: var(--white);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .has-dropdown.open .dropdown { display: block !important; }
  .dropdown a { border-bottom: 1px solid #eeeeee; color: var(--ink); }
  .nav-cta { justify-content: center !important; margin-top: 8px; }

  .hero,
  .approach,
  .story { grid-template-columns: 1fr; }

  .hero { min-height: 0; }
  .hero-copy, .approach-copy, .story-copy { padding: 50px 28px; }
  .hero-copy::after { display: none; }
  .hero-image { min-height: 0; aspect-ratio: 4 / 5; }
  .hero-image img { object-position: center; }
  .approach-copy { padding-bottom: 132px; }
  .approach-image, .story-image { min-height: 360px; }
  .impact { grid-template-columns: 1fr; }

  .impact-photo {
    min-height: 340px;
    background:
      linear-gradient(0deg, var(--navy), transparent 46%),
      url("images/clothing-support-v2.jpg") center / cover;
  }

  .impact-copy { padding: 44px 28px; }
  .details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 3.8rem; }
  .section-pad { padding: 56px 20px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-card > img { height: 230px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(2) { border-right: 0; }
  .help { padding-bottom: 180px; }
  .help-grid { grid-template-columns: repeat(3, 1fr); row-gap: 26px; }
  .closing-note { left: 30px; }
  .details { grid-template-columns: 1fr; }

  .details article,
  .details article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .site-footer { grid-template-columns: 1fr; gap: 22px; }
  .copyright { grid-column: 1; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
