/* ================================================
   Cambodia Humane Society — Stylesheet
   Palette: Warm Charcoal · Stone · Taupe · Off-White
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

/* ---------- Variables ---------- */
/* ─── Cambodia Humane Society — Design Tokens ─── */
:root {
  --ink:        #1A1714;
  --ink-mid:    #3A302A;
  --stone:      #7A6D63;
  --stone-light:#B5A898;
  --border:     #DDD5CB;
  --bg:         #F7F4F0;
  --bg-warm:    #EDE8E2;
  --white:      #FFFFFF;
  --orange:     #B85518;
  --orange-mid: #964411;
  --orange-light:#F5E4D0;
  --accent:     #C8621A;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;

  --max: 1100px;
  --gap: clamp(24px, 5vw, 64px);
  --r: 4px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--sans); color: var(--ink); background: var(--white); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.2; font-weight: 400; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section--bg { background: var(--bg); }
.section--warm { background: var(--bg-warm); }
.section--dark { background: var(--ink); color: var(--white); }

/* ---------- Typography scale ---------- */
.label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: 20px;
}

.label--light { color: rgba(255,255,255,0.55); }

.heading-xl {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.05;
}

.heading-lg {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.heading-md {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.15;
}

.heading-sm {
  font-size: 1.2rem;
  line-height: 1.3;
}

.body-lg {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--ink-mid);
}

.body-md {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--stone);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  padding: 13px 28px;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn--dark {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.btn--dark:hover { background: var(--orange-mid); border-color: var(--orange-mid); }

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

.btn--outline-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn--outline-light:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

.btn--ghost {
  background: transparent;
  color: var(--stone);
  border-color: var(--border);
  padding: 12px 24px;
}
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

/* Arrow link */
.link-arrow {
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--orange);
  border-bottom: 1px solid var(--orange-light);
  padding-bottom: 2px;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.link-arrow:hover { opacity: 0.7; }
.link-arrow--light { color: var(--white); border-bottom-color: rgba(255,255,255,0.5); }
.link-arrow--light:hover { opacity: 0.7; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__brand {
  display: flex;
  align-items: center;
}

.nav__brand img {
  height: 38px;
  width: auto;
  display: block;
}

/* Fallback text shown when logo image is missing */
.nav__brand-fallback {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--stone);
  transition: color 0.2s;
}
.nav__links a:hover, .nav__links a.active { color: var(--ink); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.3s;
}

.nav__mobile {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--white);
  padding: 16px 24px 24px;
}
.nav__mobile.open { display: block; }
.nav__mobile a {
  display: block;
  padding: 12px 0;
  font-size: 0.95rem;
  color: var(--ink-mid);
  border-bottom: 1px solid var(--border);
}
.nav__mobile .btn { margin-top: 20px; width: 100%; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  background-color: var(--ink); /* fallback while image loads / if missing */
  background-image:
    linear-gradient(to right, rgba(20,16,14,0.92) 0%, rgba(20,16,14,0.75) 45%, rgba(20,16,14,0.35) 100%),
    url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: clamp(80px, 12vw, 140px) 0 clamp(64px, 10vw, 112px);
  position: relative;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__title {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 28px;
}

.hero__title em {
  font-style: italic;
  color: var(--orange-light);
}

.hero__desc {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  margin-bottom: 44px;
}

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

/* ---------- Rule / Divider ---------- */
.rule {
  width: 40px;
  height: 2px;
  background: var(--orange);
  margin-bottom: 32px;
  opacity: 0.5;
}
.rule--dark { background: var(--orange); }

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

.programs__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--border);
}

.program-item {
  padding: 48px 40px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.program-item__num {
  font-family: var(--serif);
  font-size: clamp(4rem, 6vw, 6.5rem);
  color: var(--orange-light);
  line-height: 1;
  margin-bottom: 16px;
  font-style: italic;
  opacity: 0.85;
}

.program-item__title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--ink);
}

.program-item__desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--stone);
}

/* ---------- About two-up ---------- */
.about-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}

.about-split__img {
  background: var(--bg-warm);
  aspect-ratio: 4/5;
  border-radius: var(--r);
  overflow: hidden;
  position: relative;
}

.about-split__img-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-warm);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}
.about-split__img-inner.hidden { display: none; }

.about-split__img-caption {
  font-size: 0.75rem;
  color: var(--stone);
  font-style: italic;
}

.about-split__text {
  padding-top: 8px;
}

.about-split__text p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--stone);
  margin-bottom: 20px;
}

/* ---------- Values row ---------- */
.values-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.value-cell {
  background: var(--white);
  padding: 36px 28px;
}

.section--bg .value-cell { background: var(--bg); }

.value-cell__title {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--ink);
}

.value-cell__desc {
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--stone);
}

/* ---------- Quote ---------- */
.pullquote {
  border-left: 2px solid var(--orange);
  padding: 8px 0 8px 28px;
  margin: 32px 0;
}

.pullquote__text {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink-mid);
  line-height: 1.55;
  margin-bottom: 12px;
}

.pullquote__attr {
  font-size: 0.8rem;
  color: var(--stone);
  letter-spacing: 0.04em;
}

/* ---------- Help cards ---------- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.help-card {
  background: var(--white);
  padding: 48px 36px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.help-card__num {
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  color: var(--border);
  margin-bottom: 20px;
  line-height: 1;
}

.help-card__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.help-card__desc {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--stone);
  flex: 1;
  margin-bottom: 28px;
}

/* ---------- Stories / Photos ---------- */
.photo-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2px;
}

.photo-cell {
  background: var(--bg-warm);
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
}

.photo-cell:first-child { aspect-ratio: 3/4; }

.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-cell:hover img { transform: scale(1.03); }

.photo-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-placeholder.hidden { display: none; }

.photo-placeholder span {
  font-size: 0.72rem;
  color: var(--stone-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 20px;
  line-height: 1.6;
}

/* ---------- Newsletter ---------- */
.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus { border-color: var(--stone); }
.newsletter-form input::placeholder { color: var(--stone-light); }

/* Dark version */
.section--dark .newsletter-form input {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  color: var(--white);
}
.section--dark .newsletter-form input::placeholder { color: rgba(255,255,255,0.35); }
.section--dark .newsletter-form input:focus { border-color: rgba(255,255,255,0.4); }

/* ---------- FAQ ---------- */
.faq { max-width: 680px; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 20px 0;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  user-select: none;
}

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

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--stone-light);
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-body {
  padding: 0 0 24px;
  font-size: 0.9rem;
  color: var(--stone);
  line-height: 1.8;
  max-width: 560px;
}

.faq-body a { color: var(--ink); border-bottom: 1px solid var(--border); }

/* ---------- Contact form ---------- */
.contact-form { max-width: 560px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--stone); }

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

/* ---------- Page hero (inner) ---------- */
.page-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 6vw, 80px);
}

.page-hero__title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  max-width: 640px;
  margin-bottom: 20px;
}

.page-hero__sub {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--stone);
  max-width: 520px;
}

/* ---------- Section header ---------- */
.section-header { margin-bottom: 48px; }
.section-header--center { text-align: center; }
.section-header--center .rule { margin: 0 auto 32px; }

/* ---------- Two column text ---------- */
.two-col-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.two-col-text p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--stone);
  margin-bottom: 16px;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.55);
  padding: clamp(48px, 8vw, 80px) 0 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--gap);
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 32px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 16px;
}

.footer__brand img {
  height: 34px;
  width: auto;
  display: block;
}

.footer__brand-fallback {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--white);
}

.footer__brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin-top: 4px;
  font-weight: 500;
}

.footer__desc {
  font-size: 0.875rem;
  line-height: 1.75;
  margin-bottom: 28px;
}

.footer__social {
  display: flex;
  gap: 10px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.social-icon:hover {
  background: var(--orange);
  color: var(--white);
}

.footer__col-title {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 20px;
}

.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--white); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ---------- Donate tiers ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 24px;
}

.tier {
  background: var(--white);
  padding: 28px 20px 24px;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.tier:hover { background: var(--bg); }
.tier--selected { background: var(--orange) !important; color: var(--white); border-color: var(--orange); }
.tier--selected .tier__amount { color: var(--white); }
.tier--selected .tier__desc { color: rgba(255,255,255,0.75); }
.tier--selected .tier__label { color: rgba(255,255,255,0.7); }

.tier__label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-light);
  margin-bottom: 8px;
}
.tier--selected .tier__label { color: var(--stone-light); }

.tier__amount {
  font-family: var(--serif);
  font-size: 1.8rem;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1;
}

.tier__desc {
  font-size: 0.8rem;
  color: var(--stone);
  line-height: 1.55;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .programs__grid { grid-template-columns: 1fr; }
  .about-split { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
  .two-col-text { grid-template-columns: 1fr; }
  .values-row { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .photo-row { grid-template-columns: 1fr; }
  .photo-cell { aspect-ratio: 16/9 !important; }
  .tier-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .values-row { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .tier-grid { grid-template-columns: 1fr 1fr; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { min-width: unset; width: 100%; }
}
