/* ==========================================================================
   Kresso Supported Housing CIC: Shared Stylesheet
   ========================================================================== */

:root {
  color-scheme: light;
  --color-primary: #0b4c80;
  --color-primary-dark: #0a2f52;
  --color-accent: #c96f4a;
  --color-accent-dark: #a8583a;
  --color-secondary: #8fa998;
  --color-bg: #fbf8f3;
  --color-bg-alt: #f1ece2;
  --color-text: #2b2b2b;
  --color-text-muted: #5a5a5a;
  --color-border: #e2dccf;
  --color-white: #ffffff;
  --color-error: #b3261e;

  --font-base: "Work Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --max-width: 1180px;
  --radius: 10px;
  --shadow-soft: 0 4px 18px rgba(15, 61, 62, 0.08);
  --shadow-strong: 0 10px 30px rgba(15, 61, 62, 0.16);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  color: var(--color-primary-dark);
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }

p {
  margin: 0 0 var(--space-2);
  color: var(--color-text-muted);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

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

.section-alt {
  background: var(--color-bg-alt);
}

.section-primary {
  background: var(--color-primary);
  color: var(--color-white);
}
.section-primary h1, .section-primary h2, .section-primary h3, .section-primary p {
  color: var(--color-white);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-1);
}

.section-header {
  max-width: 680px;
  margin: 0 0 var(--space-4);
}

.section-header.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}
.btn-primary:hover {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.section-primary .btn-outline,
.hero .btn-outline {
  color: var(--color-white);
}
.section-primary .btn-outline:hover,
.hero .btn-outline:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-block {
  width: 100%;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  gap: var(--space-3);
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
}
.logo span {
  color: var(--color-accent);
}

.logo img {
  height: 42px;
  width: auto;
  display: block;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle .bar {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--color-primary-dark);
  border-radius: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav-links a {
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary-dark);
  border-color: var(--color-accent);
}

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

  .main-nav {
    position: fixed;
    inset: 0 0 auto auto;
    top: 68px;
    right: 0;
    width: min(320px, 85vw);
    height: calc(100vh - 68px);
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-3);
    gap: var(--space-3);
    box-shadow: var(--shadow-strong);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .nav-links {
    flex-direction: column;
    gap: var(--space-2);
  }

  .main-nav .btn {
    width: 100%;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-6) 0;
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-white);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.hero h1, .hero p {
  color: var(--color-white);
}

.hero-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.hero-image-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-strong);
}

.hero-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 18s ease-in-out infinite alternate;
}

.hero-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 2.5rem 1.4rem 1.2rem;
  background: linear-gradient(to top, rgba(10, 43, 44, 0.88) 0%, rgba(10, 43, 44, 0) 100%);
  color: var(--color-white);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

/* Hero text entrance */
.hero-copy > * {
  opacity: 0;
  transform: translateY(16px);
  animation: heroFadeUp 0.7s ease forwards;
}
.hero-copy .eyebrow { animation-delay: 0.05s; }
.hero-copy h1 { animation-delay: 0.15s; }
.hero-copy p { animation-delay: 0.3s; }
.hero-copy .hero-actions { animation-delay: 0.45s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-image-frame img {
    animation: none;
  }
  .hero-copy > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.page-hero {
  padding: var(--space-5) 0;
  background: var(--color-primary);
  color: var(--color-white);
  text-align: center;
}
.page-hero h1, .page-hero p { color: var(--color-white); }
.page-hero p {
  max-width: 620px;
  margin: 0 auto;
}

.page-hero-photo {
  --hero-photo: none;
  background-image: linear-gradient(100deg, rgba(9, 36, 61, 0.88) 0%, rgba(9, 36, 61, 0.6) 40%, rgba(9, 36, 61, 0.25) 70%),
    var(--hero-photo);
  background-size: cover;
  background-position: center;
  text-align: left;
  min-height: 380px;
  display: flex;
  align-items: center;
}

.page-hero-photo--services {
  --hero-photo: url("../images/sleepingrough.jpeg");
}

.page-hero-photo--about {
  --hero-photo: url("../images/aboutusbanner.jpeg");
}

.page-hero-photo--refer {
  --hero-photo: url("../images/makeareferral.jpeg");
}

.page-hero-photo--faq {
  --hero-photo: url("../images/faq.jpeg");
}

.page-hero-photo .container {
  max-width: var(--max-width);
}

.page-hero-photo p {
  margin: 0;
  text-align: left;
  max-width: 560px;
}

@media (max-width: 640px) {
  .page-hero-photo {
    min-height: 320px;
  }
}

@media (max-width: 860px) {
  .hero .container {
    grid-template-columns: 1fr;
  }
  .hero-image { order: -1; }
}

/* ---------- Cards / Grids ---------- */
.grid {
  display: grid;
  gap: var(--space-3);
}

.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

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

.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
  font-size: 1.4rem;
}

.card a.card-link {
  font-weight: 700;
  color: var(--color-accent);
  display: inline-block;
  margin-top: var(--space-1);
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--color-accent);
  color: var(--color-white);
  text-align: center;
  padding: var(--space-5) 0;
}
.cta-band h2 { color: var(--color-white); }
.cta-band p { color: rgba(255,255,255,0.9); }
.cta-band .btn-outline {
  color: var(--color-white);
}
.cta-band .btn-outline:hover {
  background: var(--color-white);
  color: var(--color-accent);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-5) 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

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

.site-footer h4 {
  color: var(--color-white);
  font-size: 1rem;
  margin-bottom: var(--space-2);
}

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

.footer-links li {
  margin-bottom: 0.6rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: var(--space-2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.placeholder-note {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-soft);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-4);
}

fieldset legend {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 2px solid var(--color-bg-alt);
  width: 100%;
}

.field {
  margin-bottom: var(--space-2);
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.field .hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.3rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid rgba(201, 111, 74, 0.35);
  border-color: var(--color-accent);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--color-error);
}

.field .error-message {
  display: none;
  color: var(--color-error);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.field.invalid .error-message {
  display: block;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
}

.radio-option:has(input:checked) {
  border-color: var(--color-accent);
  background: rgba(201, 111, 74, 0.06);
}

.radio-option input {
  margin-top: 0.25rem;
}

.consent-box {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}

.consent-box p {
  font-size: 0.88rem;
  margin-bottom: var(--space-2);
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.consent-checkbox input {
  margin-top: 0.3rem;
}

.form-success,
.form-error-banner {
  display: none;
  padding: var(--space-3);
  border-radius: var(--radius);
  margin-bottom: var(--space-3);
}

.form-success {
  background: rgba(143, 169, 152, 0.25);
  border: 1px solid var(--color-secondary);
}

.form-error-banner {
  background: rgba(179, 38, 30, 0.08);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.form-success.show,
.form-error-banner.show {
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- Info blocks (About / Services) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: center;
}

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

.pillar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.pillar:last-child { border-bottom: none; }

.pillar-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.service-block {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}

.service-block:last-of-type { border-bottom: none; }

.service-block:nth-of-type(even) .service-image {
  order: 2;
}

@media (max-width: 860px) {
  .service-block {
    grid-template-columns: 1fr;
  }
  .service-block:nth-of-type(even) .service-image {
    order: -1;
  }
}

.service-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.tag-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.tag {
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  color: var(--color-primary-dark);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-accent);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item .faq-answer {
  padding: 0 var(--space-3) var(--space-3);
  color: var(--color-text-muted);
}

/* ---------- Referral pathway cards ---------- */
.pathway-card {
  text-align: center;
}

.pathway-card .card-icon {
  margin: 0 auto var(--space-2);
}

/* ---------- Contact ---------- */
.contact-details li {
  display: flex;
  gap: 0.6rem;
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

.contact-details strong {
  color: var(--color-primary-dark);
}

/* ---------- WhatsApp floating button ---------- */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.whatsapp-float svg {
  width: 30px;
  height: 30px;
  fill: #ffffff;
}

@media (max-width: 640px) {
  .whatsapp-float {
    width: 52px;
    height: 52px;
    bottom: 16px;
    right: 16px;
  }
  .whatsapp-float svg {
    width: 26px;
    height: 26px;
  }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
