/*
Theme Name: Sloan's Diaper Drive
Theme URI: https://nourishphx.org
Author: Dustin Petty
Description: Custom theme for Sloan's Diaper Drive, an annual diaper collection drive benefiting Nourish Phoenix. Tracks progress, shares blog/video updates, drives visitors to the Amazon Wish List, and collects emails for future drives.
Version: 1.0.4
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: sloans-diaper-drive
*/

/* =========================================================
   1. Design tokens
   ========================================================= */
:root {
  --font-base: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Brand blue matches the navy in Sloan's Diaper Drive logo; soft butter
     yellow is the site's one accent color. --color-ink now IS that navy
     (not a separate near-black), so headings, body text, borders, and dark
     section backgrounds (why-band, footer) all unify under one brand blue
     automatically. */
  --color-blue: #1D3557;
  --color-blue-dark: #14283F;
  --color-butter: #F0C674;
  --color-butter-dark: #DCAA3F;
  --color-error: #C0392B;
  --color-green: #2E9E6D;
  --color-cream: #FFFBF5;
  --color-cream-dark: #FBF1E4;
  --color-ink: #1D3557;
  --color-ink-light: #56708C;
  --color-white: #FFFFFF;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 8px 24px rgba(38, 49, 58, 0.08);
  --container-width: 1120px;
}

/* =========================================================
   2. Reset + base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-ink);
  background: var(--color-cream);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--color-blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-base);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-ink);
  margin: 0 0 0.5em;
}

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

p { margin: 0 0 1.1em; }

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

section { padding: 64px 0; }
section.tight { padding: 32px 0; }

/* =========================================================
   3. Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-base);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-decoration: none !important;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--color-butter);
  color: var(--color-ink);
  box-shadow: 0 6px 18px rgba(240, 198, 116, 0.45);
}
.btn-primary:hover { background: var(--color-butter-dark); }

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

.btn-blue {
  background: var(--color-blue);
  color: var(--color-white);
  box-shadow: 0 6px 18px rgba(29, 53, 87, 0.35);
}
.btn-blue:hover { background: var(--color-blue-dark); }

/* =========================================================
   4. Site header
   ========================================================= */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid rgba(38,49,58,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  padding-top: 8px;
  padding-bottom: 8px;
  min-height: 76px;
}

/* Branding block: just the logo (or, before one's uploaded, a fallback
   icon + site title). When a custom logo is active it is NOT wrapped in
   this element's own <a> — the_custom_logo() already outputs its own
   home link, and nesting a link inside a link is invalid HTML that
   browsers silently repair by breaking the DOM apart, which used to make
   the logo-sizing rule below fail to match at all. Keeping .site-branding
   as a plain <div> in that case avoids the whole problem. */
.site-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-branding--fallback {
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-ink);
}
.site-branding--fallback:hover { text-decoration: none; }
.site-logo-icon { width: 40px; height: 40px; flex-shrink: 0; }
.site-title-text { white-space: nowrap; }

/* Uploaded custom logo (Appearance -> Customize -> Site Identity). WordPress's
   flexible custom-logo support doesn't constrain display size on its own, so
   without this the logo renders at its full native upload resolution. Height
   is capped to keep the header a slim, consistent bar regardless of the
   uploaded file's actual dimensions; width scales to match automatically. */
.site-branding .custom-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-branding img.custom-logo {
  height: 68px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Guarantees real breathing room between the branding block and the nav —
   a fixed visual divider rather than relying on leftover flex space, which
   could shrink to nothing on medium-width windows. */
.header-divider {
  width: 1px;
  height: 36px;
  background: rgba(38, 49, 58, 0.15);
  margin: 0 18px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .site-branding img.custom-logo { height: 48px; max-width: 170px; }
  .header-divider { margin: 0 12px; }
}

/* Sits immediately after the branding/divider block in normal flex flow —
   previously had margin-left: auto, which shoved the whole nav+CTA block
   flush to the container's right edge and left a dead gap right after the
   logo instead of any leftover space landing at the far right where it
   belongs. */
.main-navigation {
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.6vw, 26px);
  margin: 0;
  padding: 0;
  align-items: center;
}
.main-navigation li { white-space: nowrap; }
.main-navigation a {
  color: var(--color-ink);
  font-weight: 500;
  font-size: 0.92rem;
}
.main-navigation a:hover { text-decoration: underline; }

/* Rendered directly in header.php, outside .main-navigation, so it always
   shows up regardless of whether a real menu is assigned in Appearance ->
   Menus or the theme's placeholder fallback is active. Pinned to the far
   right of the header via its own margin-left: auto (overridden to a fixed
   gap on mobile, below, once it's sitting next to the hamburger button
   instead of at the end of a row of links). */
.nav-cta {
  margin-left: auto;
  flex-shrink: 0;
  background: var(--color-butter);
  color: var(--color-ink);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--color-butter-dark); color: var(--color-ink); }

.menu-toggle { display: none; }

/* Switches to the hamburger menu earlier than before (was 820px) — with a
   site title, 7 nav links, and a CTA button, cramming everything into one
   row on medium-width windows looked crowded/wrapped rather than clean. */
@media (max-width: 1060px) {
  .header-divider { display: none; }
  .main-navigation ul { display: none; }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
    background: none;
    border: 2px solid var(--color-ink);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-weight: 700;
  }
  /* At this width the hamburger button (above) is the one pinned to the
     right via its own margin-left: auto, so the CTA just needs a small
     fixed gap next to it instead of also trying to auto-push itself. */
  .nav-cta { margin-left: 12px; }
  .main-navigation.is-open ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    padding: 20px 24px;
    box-shadow: var(--shadow-soft);
  }
}

/* =========================================================
   5. Hero
   ========================================================= */
.hero {
  background: linear-gradient(160deg, var(--color-cream) 0%, var(--color-cream-dark) 100%);
  padding: 72px 0 56px;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(240,198,116,0.28);
  color: var(--color-ink);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
/* Nourish Phoenix's logo is a wide horizontal wordmark, not a square icon —
   sized by height only so it keeps its own proportions inline with the
   surrounding tag-line text. */
.hero-eyebrow-logo {
  height: 20px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}
.hero-subhead { font-size: 1.2rem; color: var(--color-ink-light); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero-media {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   6. Progress module
   ========================================================= */
.progress-module {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}
.progress-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 18px;
}
.progress-stat .stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-ink);
  display: block;
}
.progress-stat .stat-label { color: var(--color-ink-light); font-size: 0.95rem; }
.progress-bar-track {
  background: var(--color-cream-dark);
  border-radius: 999px;
  height: 16px;
  overflow: hidden;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--color-butter), var(--color-ink));
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* =========================================================
   7. Sections / cards
   ========================================================= */
.section-header { max-width: 700px; margin: 0 0 40px; }
.section-header.centered { margin-left: auto; margin-right: auto; text-align: center; }

.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.stat-block { text-align: center; }
.stat-block .stat-number { font-size: 2.4rem; font-weight: 700; color: var(--color-blue-dark); }
.stat-block .stat-label { color: var(--color-ink-light); }

.why-band {
  background: var(--color-ink);
  color: var(--color-white);
}
.why-band h2, .why-band a { color: var(--color-white); }
.why-band .section-header { max-width: 780px; }

.impact-table { width: 100%; border-collapse: collapse; background: var(--color-white); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-soft); }
.impact-table th, .impact-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--color-cream-dark); }
.impact-table th { background: var(--color-cream-dark); font-weight: 700; }

/* =========================================================
   8. Blog / posts
   ========================================================= */
.post-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.post-card .post-card-media { aspect-ratio: 16/10; background: var(--color-cream-dark); overflow: hidden; }
.post-card .post-card-media img { width: 100%; height: 100%; object-fit: contain; }
.post-card .post-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-card .post-date { color: var(--color-ink-light); font-size: 0.85rem; margin-bottom: 6px; }
.post-card .read-more { margin-top: auto; font-weight: 700; }

.single-post-content { max-width: 760px; margin: 0 auto; }

/* Photo block on Our Why (e.g. a first-year drive photo) — sits inline in
   the entry-content flow, sized naturally rather than cropped to a fixed
   ratio, since drive photos can be any orientation. */
.why-photo {
  margin: 32px 0;
}
.why-photo img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.why-photo figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--color-ink-light);
  text-align: center;
  font-style: italic;
}
.single-post-content video, .single-post-content iframe { width: 100%; border-radius: var(--radius-md); margin: 20px 0; }
.post-meta { color: var(--color-ink-light); margin-bottom: 24px; }

.instagram-package {
  border: 2px dashed var(--color-blue);
  border-radius: var(--radius-md);
  padding: 20px;
  background: rgba(29,53,87,0.05);
  margin: 24px 0;
}

/* =========================================================
   8b. Founder bio + FAQ accordion
   ========================================================= */
.founder-hero {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 40px;
}
@media (max-width: 820px) { .founder-hero { grid-template-columns: 1fr; } }
.founder-photo {
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  background: var(--color-cream-dark);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ink-light);
  text-align: center;
  padding: 20px;
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: calc(var(--radius-lg) - 6px); }
.founder-facts {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.founder-facts li {
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 12px 16px;
  font-size: 0.95rem;
}
.founder-facts li strong { display: block; color: var(--color-ink); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-ink);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 24px 22px; color: var(--color-ink-light); }
.faq-item .faq-answer p:last-child { margin-bottom: 0; }

/* =========================================================
   9. Forms (signup / contact)
   ========================================================= */
.form-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px;
}
.ddrive-form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.92rem; }
.ddrive-form input[type="text"],
.ddrive-form input[type="email"],
.ddrive-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--color-cream-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-base);
  font-size: 1rem;
  margin-bottom: 18px;
  background: var(--color-cream);
}
.ddrive-form input:focus, .ddrive-form textarea:focus {
  outline: none;
  border-color: var(--color-blue);
}
.ddrive-form .form-note { font-size: 0.85rem; color: var(--color-ink-light); }
.ddrive-form .form-success { color: var(--color-green); font-weight: 700; }
.ddrive-form .form-error { color: var(--color-error); font-weight: 700; }

/* =========================================================
   10. Footer
   ========================================================= */
.site-footer {
  background: var(--color-ink);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 28px;
}
.site-footer a { color: var(--color-white); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: var(--color-white); font-size: 1rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 18px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255,255,255,0.6);
}

/* Visually hides text while keeping it available to screen readers — a
   standard WordPress accessibility utility class, used on the 404 page's
   search field label. */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Skip link (accessibility) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-ink);
  color: var(--color-white);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }
