/* ==========================================================================
   Don Bosco Cares — shared stylesheet
   Mobile-first, semantic HTML5. No frameworks or external libraries.
   Palette: white/light backgrounds, two blue tones, limited green accent,
   dark gray body text.
   ========================================================================== */

/* Design tokens */
:root {
  --color-text: #2b2b2b;          /* dark gray body text */
  --color-text-muted: #555f66;
  --color-bg: #ffffff;            /* white */
  --color-bg-soft: #f4f7fa;       /* light background */
  --color-border: #d7dee4;

  --color-blue: #1f5d8c;          /* primary blue */
  --color-blue-dark: #143f60;     /* complementary darker blue */
  --color-green: #2e7d4f;         /* limited green accent */

  --color-focus: #143f60;

  --space: 1rem;
  --maxwidth: 76rem;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
          sans-serif;
}

/* Base */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3 {
  line-height: 1.25;
  color: var(--color-blue-dark);
}

a { color: var(--color-blue); }
a:hover { color: var(--color-blue-dark); }

/* Address blocks render upright, not italic */
address { font-style: normal; }

img { max-width: 100%; height: auto; }

/* Visible keyboard focus states */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--color-blue-dark);
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0.5rem;
  color: #fff;
}

/* Layout helpers: centered content container */
.header-inner,
.footer-inner {
  max-width: var(--maxwidth);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* Full-width section backgrounds; a single .section-inner wrapper aligns and
   constrains each section's content to --maxwidth and pads it to match the
   hero's main content edges. Vertical rhythm scales via clamp() — no fixed
   viewport heights. */
main > section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-inner {
  max-width: var(--maxwidth);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* Reusable soft section background (restrained alternation, esp. internal pages) */
.section-soft { background: var(--color-bg-soft); }

.section-intro { color: var(--color-text-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--color-blue);
  color: #fff;
}
.btn-primary:hover { background: var(--color-blue-dark); color: #fff; }

.btn-donate {
  background: var(--color-green);
  color: #fff;
}
.btn-donate:hover { background: #246340; color: #fff; }

/* Shared list reset (nav menus and content lists) */
.site-nav ul,
.lang-switch ul,
.service-list,
.stat-list,
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Header */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-block: 0.75rem;
}
/* Brand: small parish logo on the left, wordmark + subtitle stacked to its right. */
.brand {
  flex: 0 0 auto;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 20rem;
  color: inherit;
  text-decoration: none;
}
.site-brand:hover,
.site-brand:focus {
  text-decoration: none;
}
.brand-logo {
  width: 4.5rem;
  max-width: 4.5rem;
  height: auto;
  flex: 0 0 4.5rem;
  display: block;
}
.brand-text {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}
.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-blue-dark);
  text-decoration: none;
}
.brand-subtitle {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-nav ul,
.lang-switch ul {
  display: flex;
  flex-wrap: wrap;
}
.site-nav ul { gap: 0.25rem 1rem; }
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  text-decoration: none;
  color: var(--color-blue-dark);
  font-weight: 600;
}
.site-nav a:hover { color: var(--color-blue); }
.site-nav a[aria-current="page"] {
  color: var(--color-blue);
  border-bottom: 2px solid var(--color-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.lang-switch ul { gap: 0.5rem; }
.lang-switch a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
}
.lang-switch a[aria-current="page"] {
  border-bottom: 2px solid var(--color-blue);
}

/* Hero */
.hero {
  padding-block: 2rem;
  background: var(--color-bg-soft);
}
.hero .section-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.hero-text { max-width: 40rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Services */
.service-list {
  display: grid;
  gap: 1rem;
}
.service {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-blue);
  padding: 1rem;
}
.service h3 { margin-top: 0; }

/* Hours section */
.hours { background: var(--color-bg-soft); }

/* Hours table */
.hours-table {
  width: 100%;
  border-collapse: collapse;
}
.hours-table th,
.hours-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}
.hours-table thead th { color: var(--color-blue-dark); }

/* Impact */
.stat-list {
  display: grid;
  gap: 1rem;
}
.stat {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-soft);
  padding: 1rem;
  border-top: 4px solid var(--color-green);
}
.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-blue-dark);
}
.stat-label { color: var(--color-text-muted); }

/* Principles (About page) — simple readable list, intentionally not card-styled */
.principles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.principles-list li {
  padding-left: 0.75rem;
  border-left: 2px solid var(--color-green);
  align-self: start;
}

/* About page — combined narrative + image layout */
.about-grid { display: grid; gap: 1.5rem; }
.about-text { display: grid; gap: 2rem; }
.about-text h3 { margin-top: 0; font-size: 1.4rem; }

/* Text/policy page — one continuous column (e.g. Accessibility statement).
   Narrower measure for readability; tighter rhythm between <h2> subsections
   than the homepage bands. No section banding, borders, or cards. */
.text-page { max-width: 44rem; }
.text-page h2 { margin-top: 2rem; margin-bottom: 0.5rem; }
.text-page ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.text-page li { margin-bottom: 0.35rem; }

/* Detail list — semantic term/value pairs (service hours, requirements, notes) */
.detail-list {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.4rem;
}
.detail-list dt {
  font-weight: 600;
  color: var(--color-blue-dark);
}
.detail-list dd { margin: 0; }

/* Partners */
.partners { background: var(--color-bg-soft); }
.partner-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  color: var(--color-text-muted);
}

/* Partner directory grid (full Partners page) */
.partner-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem 1.5rem;
}

/* Call to action — the only intentionally centered section */
.cta { background: var(--color-bg); }
.cta .section-inner { text-align: center; }
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--color-blue-dark);
  color: #eef3f7;
  margin-top: 2rem;
}
.footer-inner {
  display: grid;
  gap: 1.5rem;
  padding-block: 2rem;
}
.footer-title {
  font-size: 1.1rem;
  color: #fff;
  margin-top: 0;
}
.footer-links a { color: #cfe0ee; }
.footer-links a:hover { color: #fff; }
.footer-note {
  max-width: var(--maxwidth);
  margin-inline: auto;
  padding: 0 var(--space) 2rem;
  font-size: 0.85rem;
  color: #b9cddd;
}

/* ==========================================================================
   Responsive enhancements (mobile-first: rules above are the small-screen base)
   ========================================================================== */
@media (min-width: 40rem) {
  .header-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .service-list { grid-template-columns: repeat(2, 1fr); }
  .stat-list { grid-template-columns: repeat(2, 1fr); }
  .principles-list { grid-template-columns: repeat(2, 1fr); }
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(3, 1fr); }
  /* aligned term/value columns for detail lists */
  .detail-list {
    grid-template-columns: max-content 1fr;
    column-gap: 1.5rem;
    row-gap: 0.5rem;
    align-items: baseline;
  }
}

@media (min-width: 48rem) {
  /* About narrative: two columns (~58% text / ~42% image) with restrained indent */
  .about-grid { grid-template-columns: 1.4fr 1fr; gap: 2rem; }
  .about-text { grid-column: 1; padding-left: 2rem; }
  .about-grid > img { grid-column: 2; }
}

@media (min-width: 60rem) {
  .hero .section-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .service-list { grid-template-columns: repeat(3, 1fr); }
  .stat-list { grid-template-columns: repeat(4, 1fr); }
  .principles-list { grid-template-columns: repeat(3, 1fr); }
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Wide desktop: five equal service columns in a single row */
@media (min-width: 75rem) {
  .service-list { grid-template-columns: repeat(5, 1fr); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
