/* Community House Port Lincoln — simple local charity site */

:root {
  --pink: #e6007e;
  --pink-dark: #c4006a;
  --cyan: #00c4e0;
  --black: #1a1a1a;
  --text: #222;
  --muted: #555;
  --line: #ddd;
  --bg: #fafafa;
  --white: #fff;
  --header-h: 76px;
  --max: 1040px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 10px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  image-rendering: auto;
  -ms-interpolation-mode: bicubic;
}

a {
  color: var(--pink-dark);
}

a:hover {
  color: var(--pink);
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--black);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--black);
  color: var(--white);
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
  color: var(--white);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  min-height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.4rem;
}

.logo {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  height: 58px;
  width: auto;
  object-fit: contain;
  image-rendering: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  color: var(--black);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--pink);
}

.nav-cta {
  background: var(--pink);
  color: var(--white) !important;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
}

.nav-cta:hover {
  background: var(--pink-dark);
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--black);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
}

.btn-primary:hover {
  background: var(--pink-dark);
  border-color: var(--pink-dark);
  color: var(--white);
}

.btn-outline {
  background: var(--white);
  color: var(--black);
  border-color: #bbb;
}

.btn-outline:hover {
  border-color: var(--black);
  color: var(--black);
}

/* Hero */
.hero {
  background: var(--black);
}

.hero-photo {
  max-height: min(58vh, 560px);
  overflow: hidden;
  background: #333;
}

.hero-photo img {
  width: 100%;
  height: min(58vh, 560px);
  object-fit: cover;
  object-position: center 28%;
  /* keep hero crisp on high-DPI screens */
  image-rendering: auto;
}

.hero-panel {
  background: var(--white);
  border-bottom: 4px solid var(--pink);
  padding: 1.75rem 0 2rem;
}

.hero-panel-inner {
  max-width: 40rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink);
}

.hero-lead {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 36em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

/* Info strip */
.strip {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.strip-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.strip p {
  margin: 0;
}

.strip strong {
  color: var(--black);
}

.strip a {
  font-weight: 600;
  text-decoration: none;
}

/* Sections */
.section {
  padding: 2.75rem 0;
}

.section-head {
  margin-bottom: 1.5rem;
  max-width: 36rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

/* About */
.about {
  background: var(--white);
}

.about-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 2rem;
  align-items: start;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 0.15rem;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--black);
  font-size: 0.95rem;
}

.about-figure {
  margin: 0;
  border: 1px solid var(--line);
  background: var(--bg);
}

.about-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center top;
}

.about-figure figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Programs */
.programs {
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.program-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  border-radius: 4px;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: #999;
}

.filter-btn.is-active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.program-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.1rem 1.15rem 1.2rem;
}

.program-card.has-photo {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.program-card.has-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  background: #eee;
}

.program-body {
  padding: 0.95rem 1.1rem 1.15rem;
}

.program-card h3 {
  margin-bottom: 0.25rem;
}

.program-tag {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pink);
}

.program-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.program-card.is-hidden {
  display: none;
}

/* Photos */
.photos {
  background: var(--white);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eee;
  aspect-ratio: 4 / 3;
}

.photo--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Prefer natural photo proportions in the gallery */
.photo:not(.photo--wide) {
  aspect-ratio: 4 / 3;
}

/* Who we help */
.help {
  background: var(--black);
  color: #eee;
}

.help h2 {
  color: var(--white);
}

.help .section-head p {
  color: #bbb;
}

.help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.5rem;
}

.help-list li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.7rem 0.85rem;
  font-size: 0.92rem;
}

/* Visit */
.visit-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  align-items: center;
}

.visit-text address {
  font-style: normal;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 1rem 0;
  color: var(--black);
}

.visit-text .note {
  font-size: 0.9rem;
  color: var(--muted);
}

.map-wrap {
  border: 1px solid var(--line);
  min-height: 300px;
  background: #eee;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 0;
  display: block;
}

/* Contact */
.contact {
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 2rem;
  align-items: start;
}

.contact-details {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.contact-details li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.15rem;
}

.contact-details li:first-child {
  border-top: 0;
  padding-top: 0;
}

.contact-details span {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.contact-details a {
  font-weight: 700;
  text-decoration: none;
  color: var(--black);
}

.contact-details a:hover {
  color: var(--pink);
}

.contact-details strong {
  font-weight: 600;
  color: var(--black);
}

.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.35rem;
}

.form-row {
  margin-bottom: 0.95rem;
}

.form-row label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: var(--white);
  color: var(--text);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  border-color: var(--cyan);
}

.form-row input.is-invalid,
.form-row textarea.is-invalid {
  border-color: var(--pink);
}

.form-note {
  margin: 0.85rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 1.3em;
}

.form-note.is-success { color: #1a7a3a; }
.form-note.is-error { color: var(--pink-dark); }

.form-fallback {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  background: #111;
  color: #ccc;
  padding: 2rem 0 1.25rem;
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-brand img {
  height: 48px;
  width: auto;
  margin-bottom: 0.65rem;
  background: var(--white);
  padding: 0.25rem 0.4rem;
}

.footer-brand p {
  margin: 0;
}

.site-footer a {
  color: #eee;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--cyan);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 1rem;
  border-top: 1px solid #333;
  font-size: 0.88rem;
}

.footer-bottom p {
  margin: 0;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 4px;
  background: var(--pink);
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.back-to-top:hover {
  background: var(--pink-dark);
}

.back-to-top[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 860px) {
  .about-layout,
  .visit-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

  .photo--wide {
    grid-column: span 2;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.25rem 1rem;
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0.35rem;
  }

  .site-nav .nav-cta {
    text-align: center;
    margin-top: 0.35rem;
  }

  .hero-photo img {
    height: 280px;
  }

  .hero-photo {
    max-height: 280px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

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

  .photo--wide {
    grid-column: span 1;
  }

  .strip-inner {
    flex-direction: column;
  }
}

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