/* ==========================================================================
   Historic Town Bank Chapel — site styles
   Color palette and fonts pulled from the live Wix site:
   - accent (brick red):      #bb4b46
   - heading text (charcoal): #2f2b34
   - body text:                #222
   - headings use "Calistoga" (a Google Font, display serif)
   - body copy uses the system sans-serif stack (fast, no download needed)
   ========================================================================== */

/* CSS custom properties (variables) — defined once on :root (the <html>
   element) so every rule below can reuse them with var(--name) instead of
   repeating the same color/value everywhere. */
:root {
  --color-accent: #bb4b46;
  --color-heading: #2f2b34;
  --color-text: #2b2b2b;
  --color-bg: #ffffff;
  --color-bg-alt: #faf7f2;
  --font-heading: "Calistoga", Georgia, serif;
  --font-body: Arial, Helvetica, sans-serif;
  --max-width: 1120px;
}

/* A minimal reset: browsers ship different default margins/paddings on
   elements like <h1> or <ul>, so we zero them out and pick our own spacing
   deliberately instead of fighting inconsistent defaults. */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

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

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

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

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 400;
  line-height: 1.15;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); color: var(--color-accent); }
h3 { font-size: 1.3rem; }

p { margin-bottom: 1rem; }

/* Pill-shaped outline button, matching the "Read More" / "Explore" /
   "Donate Today" buttons on the live site. */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-heading);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ---------- Site header / nav ---------- */
.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 28px 0;
}

.site-header .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-list a {
  font-weight: 700;
  color: var(--color-accent);
  font-size: 0.95rem;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  text-decoration: underline;
}

/* Hamburger button — hidden on desktop, shown on small screens via the
   media query near the bottom of this file. */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 26px;
  height: 2px;
  background: var(--color-accent);
}

/* Header variant used on interior pages (no hero image behind it), so nav
   text needs to be readable on a plain white background instead of an
   absolutely-positioned overlay. */
.site-header.static {
  position: static;
  background: var(--color-bg);
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

/* ---------- Hero (home page) ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  background-image: url("../images/watercolor-house.jpg");
  background-size: cover;
  background-position: center;
}

.hero-inner {
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  padding: 40px 24px;
  text-align: center;
}

.hero-inner h1 {
  white-space: pre-line;
}

/* ---------- Generic page banner (interior pages) ---------- */
.page-banner {
  padding: 64px 0 32px;
  text-align: center;
}

/* ---------- Content sections ---------- */
.section {
  padding: 64px 0;
}

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

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.section-grid.reverse .section-media {
  order: 2;
}

.section-media img {
  border-radius: 4px;
}

.eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.text-center { text-align: center; }

/* ---------- Photo gallery grid (About / Services pages) ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 32px;
}

.gallery img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 4px;
}

/* ---------- Contact form ---------- */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

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

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form button {
  justify-self: start;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
}

.contact-form button:hover {
  background: transparent;
  color: var(--color-accent);
}

/* Message shown after a contact-form submit. site.js swaps the modifier
   class (success / error) to switch colour; the base rule covers "Sending…". */
.form-status {
  font-size: 0.9rem;
  margin: 0;
  padding: 10px 14px;
  border-radius: 4px;
  background: #f2ede8;
  color: var(--color-heading);
}

.form-status.success {
  background: #e6f4ea;
  color: #1e6b34;
}

.form-status.error {
  background: #fbe9e8;
  color: var(--color-accent);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-heading);
  color: #f2ede8;
  padding: 48px 0 24px;
  text-align: center;
}

.site-footer h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.footer-nav {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-social a {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.footer-address {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 6px;
}

.footer-credit {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .section-grid {
    grid-template-columns: 1fr;
  }

  .section-grid.reverse .section-media {
    order: 0;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }
}

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

  .nav-list {
    position: absolute;
    top: 100%;
    right: 24px;
    background: #fff;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
  }

  .nav-list.open {
    max-height: 300px;
  }

  .nav-list a {
    display: block;
    padding: 14px 20px;
  }

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