/* ============================================
   TEACHERS CAN BUY HOMES - Main Stylesheet
   Mobile-First | Fast Loading | WebP Images
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Brand Colors ---
   Dark Green:   #1a5c2a
   Mid Green:    #2d6a3f
   Orange/Gold:  #e8a020
   Cream/Bg:     #f5f0e8
   White:        #ffffff
   Dark text:    #222222
*/

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: #f5f0e8;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.site-logo img {
  height: 60px;
  width: auto;
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: #1a5c2a;
  border-radius: 2px;
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Nav */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #f5f0e8;
  border-top: 2px solid #1a5c2a;
  padding: 12px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.site-nav.open { display: block; }
.site-nav ul { display: flex; flex-direction: column; }
.site-nav ul li a {
  display: block;
  padding: 12px 24px;
  font-weight: 600;
  color: #1a5c2a;
  font-size: 1rem;
  border-bottom: 1px solid rgba(26,92,42,0.1);
  transition: background 0.2s;
}
.site-nav ul li a:hover { background: rgba(26,92,42,0.08); }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .site-nav ul {
    flex-direction: row;
    gap: 4px;
  }
  .site-nav ul li a {
    padding: 8px 14px;
    border-bottom: none;
    border-radius: 4px;
    font-size: 0.95rem;
  }
  .site-nav ul li a:hover { background: rgba(26,92,42,0.1); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 16px 28px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.btn-gold {
  background: linear-gradient(135deg, #f5c842 0%, #e8a020 100%);
  color: #1a1a1a;
  box-shadow: 0 3px 10px rgba(232,160,32,0.4);
}
.btn-gold:hover { background: linear-gradient(135deg, #f7d060 0%, #f0b030 100%); transform: translateY(-1px); }

.btn-orange {
  background: #e05c1a;
  color: #fff;
  box-shadow: 0 3px 10px rgba(224,92,26,0.4);
}
.btn-orange:hover { background: #c94e10; transform: translateY(-1px); }

.btn-outline-gold {
  background: transparent;
  border: 3px solid #e8a020;
  color: #e8a020;
  font-weight: 700;
}
.btn-outline-gold:hover { background: #e8a020; color: #fff; }

.btn-green {
  background: #1a5c2a;
  color: #fff;
  box-shadow: 0 3px 10px rgba(26,92,42,0.3);
}
.btn-green:hover { background: #14471f; transform: translateY(-1px); }

.btn-full { width: 100%; display: block; }

/* ============================================
   HERO SECTION (dark green)
   ============================================ */
.hero-section {
  background: #1a5c2a;
  color: #fff;
  padding: 40px 20px;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
}

.hero-heading {
  font-size: 2rem;
  font-weight: 800;
  color: #e8a020;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-text { font-size: 1rem; line-height: 1.7; margin-bottom: 12px; }

.hero-callout {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5c842;
  margin: 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-features {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
}
.hero-features li::before {
  content: "✓";
  color: #e8a020;
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.hero-cta { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 480px) {
  .hero-cta { flex-direction: row; flex-wrap: wrap; }
}

/* YouTube embed */
.yt-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.yt-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ============================================
   MARKET UPDATE SECTION (cream bg)
   ============================================ */
.market-section {
  background: #f5f0e8;
  padding: 48px 20px;
  text-align: center;
}

.market-section .section-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: #e8a020;
  margin-bottom: 16px;
  line-height: 1.3;
}

.market-section .section-sub {
  font-size: 0.95rem;
  color: #444;
  max-width: 700px;
  margin: 0 auto 28px;
}

.market-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   DONATIONS / BLOG GRID SECTION
   ============================================ */
.donations-section {
  background: #fff;
  padding: 48px 20px;
}

.donations-section .section-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1a5c2a;
  text-align: center;
  margin-bottom: 32px;
}

.donations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 480px) { .donations-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .donations-grid { grid-template-columns: repeat(4, 1fr); } }

.donation-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.donation-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.12); transform: translateY(-2px); }
.donation-card img { width: 100%; height: 180px; object-fit: cover; }
.donation-card-body { padding: 14px; }
.donation-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a5c2a;
  margin-bottom: 8px;
  line-height: 1.3;
}
.donation-card-excerpt { font-size: 0.82rem; color: #555; line-height: 1.5; }

/* ============================================
   FINANCING / INFO SECTIONS (green bg)
   ============================================ */
.financing-section {
  background: #2d6a3f;
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}

.financing-section .section-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f5c842;
  margin-bottom: 12px;
}

.financing-section .section-sub {
  font-size: 0.95rem;
  max-width: 700px;
  margin: 0 auto 28px;
  opacity: 0.9;
}

.financing-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
  align-items: center;
}

@media (min-width: 768px) { .financing-inner { grid-template-columns: 1fr 1fr; } }

/* ============================================
   MEET THE TEACHERS SECTION
   ============================================ */
.teachers-section {
  background: #1a5c2a;
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}

.teachers-section .section-heading {
  font-size: 1.5rem;
  font-weight: 800;
  color: #f5c842;
  margin-bottom: 12px;
}

.teachers-section .section-sub {
  font-size: 0.95rem;
  max-width: 600px;
  margin: 0 auto 28px;
  opacity: 0.9;
}

.teachers-section img {
  max-width: 600px;
  margin: 0 auto 28px;
  border-radius: 8px;
}

/* ============================================
   TESTIMONIAL SECTION
   ============================================ */
.testimonial-section {
  background: #f5f0e8;
  padding: 48px 20px;
  text-align: center;
}

.testimonial-block {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  border-left: 5px solid #e8a020;
  border-radius: 0 8px 8px 0;
  padding: 28px 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  text-align: left;
}

.testimonial-text {
  font-size: 1.05rem;
  font-style: italic;
  color: #333;
  line-height: 1.7;
  margin-bottom: 16px;
}

.testimonial-author {
  font-weight: 700;
  color: #1a5c2a;
  font-size: 0.95rem;
}
.testimonial-school { color: #666; font-size: 0.88rem; }

/* ============================================
   VIDEOS SECTION (3 YouTube videos)
   ============================================ */
.videos-section {
  background: #1a5c2a;
  padding: 48px 20px;
}

.videos-section .section-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: #f5c842;
  text-align: center;
  margin-bottom: 32px;
}

.videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 768px) { .videos-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  padding: 32px 20px;
  text-align: center;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}
.footer-social a img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.2s;
}
.footer-social a:hover img { opacity: 0.8; }

.footer-copy {
  font-size: 0.82rem;
  color: #888;
  line-height: 1.6;
}

/* ============================================
   INNER PAGES
   ============================================ */
.page-hero {
  background: #1a5c2a;
  color: #fff;
  padding: 48px 20px;
  text-align: center;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #f5c842;
  margin-bottom: 12px;
}

.page-hero p { font-size: 1rem; max-width: 600px; margin: 0 auto; opacity: 0.9; }

.page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 20px;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a5c2a;
  margin: 32px 0 12px;
}

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2d6a3f;
  margin: 24px 0 8px;
}

.page-content p { margin-bottom: 16px; line-height: 1.7; color: #333; }

.page-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}
.page-content ul li { margin-bottom: 8px; line-height: 1.6; color: #333; }

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 0;
}
.faq-question {
  font-weight: 700;
  color: #1a5c2a;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-question::after { content: "+"; font-size: 1.4rem; color: #e8a020; flex-shrink: 0; }
.faq-item.open .faq-question::after { content: "−"; }
.faq-answer {
  display: none;
  padding-top: 12px;
  color: #444;
  line-height: 1.7;
  font-size: 0.95rem;
}
.faq-item.open .faq-answer { display: block; }

/* Principal cards */
.principal-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
}
@media (min-width: 600px) { .principal-cards { grid-template-columns: 1fr 1fr; } }

.principal-card {
  background: #f5f0e8;
  border-radius: 8px;
  padding: 24px;
  border-left: 4px solid #1a5c2a;
}
.principal-card blockquote {
  font-style: italic;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.6;
}
.principal-card cite {
  font-weight: 700;
  color: #1a5c2a;
  font-size: 0.9rem;
}

/* Opt-in form */
.optin-form {
  background: #fff;
  border: 2px solid #e8a020;
  border-radius: 10px;
  padding: 28px;
  max-width: 480px;
  margin: 0 auto;
}
.optin-form h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a5c2a;
  margin-bottom: 16px;
  text-align: center;
}
.optin-form input[type="text"],
.optin-form input[type="email"],
.optin-form input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  font-family: inherit;
}
.optin-form input:focus { outline: none; border-color: #1a5c2a; }
.optin-form .privacy-note {
  font-size: 0.78rem;
  color: #888;
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* Utility */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.section-divider { height: 4px; background: linear-gradient(90deg, #1a5c2a, #e8a020); }

/* Success message */
.form-success {
  display: none;
  background: #d4edda;
  border: 1px solid #1a5c2a;
  color: #1a5c2a;
  padding: 16px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  margin-top: 12px;
}

/* Shown when /api/lead rejects a submission. The form must never claim a
   success it has not got - a visible failure with a phone number beats a
   fake "Thank you!" that drops the lead. */
.form-error {
  display: none;
  background: #f8d7da;
  border: 1px solid #b02a37;
  color: #842029;
  padding: 16px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  margin-top: 12px;
}
.form-error a { color: #842029; text-decoration: underline; white-space: nowrap; }
