/*
Theme Name: PIM v1
Theme URI: https://www.partners-in-missions.org
Author: Partners in Missions (built with Otto + ZCode)
Description: Warm editorial nonprofit theme for Partners in Missions. Custom classic theme, no page builders.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: pim-v1
*/

:root {
  --cream: #FBF7EF;
  --cream-2: #F4EDE0;
  --forest: #1F4D3A;
  --forest-2: #173B2C;
  --terracotta: #A84B2B;
  --terracotta-2: #96421f;
  --gold: #D9A441;
  --gold-soft: #EFDCB4;
  --ink: #1B2A22;
  --ink-soft: #43544B;
  --line: #E4DAC8;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(27, 42, 34, 0.10);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--terracotta-2); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; background: var(--white); padding: 8px 14px; z-index: 999; border-radius: 8px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--ink); margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 600; font-size: 12.5px; color: var(--terracotta); margin-bottom: 10px;
}

/* Buttons */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: 15.5px; line-height: 1; border: 2px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--terracotta); color: var(--white); }
.btn-primary:hover { background: var(--terracotta-2); color: var(--white); }
.btn-forest { background: var(--forest); color: var(--white); }
.btn-forest:hover { background: var(--forest-2); color: var(--white); }
.btn-outline { border-color: var(--forest); color: var(--forest); background: transparent; }
.btn-outline:hover { background: var(--forest); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { filter: brightness(1.05); color: var(--ink); }

/* Header */
.site-header { background: var(--cream); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.site-header .inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); font-weight: 600; font-size: 15.5px; }
.main-nav a:hover { color: var(--terracotta); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 18px; color: var(--ink); cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--line); padding: 18px 24px 24px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 14px; }
  .nav-cta .btn { display: none; }
}

/* Hero */
.hero { padding: 64px 0 56px; background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%); }
.hero .inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 54px); margin-bottom: 14px; }
.hero .claim-sub { font-size: 19px; color: var(--ink-soft); max-width: 34ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/3.4; object-fit: cover; width: 100%; }
.hero-badge {
  position: absolute; bottom: -18px; left: -14px; background: var(--gold); color: var(--ink);
  padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); font-size: 14px;
}
@media (max-width: 900px) { .hero .inner { grid-template-columns: 1fr; } .hero-media { order: -1; } }

/* Stats band */
.stats { background: var(--forest); color: var(--white); padding: 40px 0; }
.stats .inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat .n { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.stat .label { font-size: 14.5px; opacity: .92; }
@media (max-width: 800px) { .stats .inner { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
.section { padding: 72px 0; }
.section.tint { background: var(--cream-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(28px, 3.2vw, 38px); }

/* Ministry cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 18px rgba(27,42,34,.07); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .thumb { aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.card .body { padding: 18px 20px 22px; }
.card h3 { font-size: 20px; margin-bottom: 6px; }
.card p { font-size: 15px; color: var(--ink-soft); margin-bottom: 12px; }
.card .more { font-weight: 600; font-size: 14.5px; }

/* Feature (Doña Concepción) */
.feature { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: center; }
.feature .media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/4.6; object-fit: cover; width: 100%; }
.feature h2 { font-size: clamp(26px, 3vw, 36px); }
.feature .name { font-weight: 600; color: var(--terracotta); margin-bottom: 12px; }
@media (max-width: 900px) { .feature { grid-template-columns: 1fr; } }

/* Quote */
.quote { background: var(--forest); color: var(--white); padding: 64px 0; }
.quote .mark { font-family: var(--font-display); font-size: 72px; line-height: .5; color: var(--gold); }
.quote blockquote { margin: 18px 0 20px; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 27px); line-height: 1.4; font-weight: 600; }
.quote cite { font-style: normal; color: var(--gold-soft); font-weight: 600; font-size: 15px; }

/* Newsletters grid */
.news-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .news-grid { grid-template-columns: 1fr; } }

/* Newsletter band */
.newsband { background: var(--gold); padding: 48px 0; }
.newsband .inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.newsband h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; }

/* Page headers */
.page-hero { background: var(--cream-2); padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(32px, 4vw, 46px); margin-bottom: 8px; }
.page-hero .sub { color: var(--ink-soft); max-width: 60ch; font-size: 18px; }

/* Content */
.content { padding: 48px 0 72px; }
.content-narrow { max-width: 760px; margin: 0 auto; }
.entry-content h2 { font-size: 30px; margin-top: 1.4em; }
.entry-content h3 { font-size: 24px; margin-top: 1.3em; }
.entry-content img { border-radius: var(--radius); }
.entry-content ul { padding-left: 22px; }
.entry-content li { margin-bottom: 6px; }
.entry-content .wp-block-image img { border-radius: var(--radius); }
.wp-block-file { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }

/* Story single */
.single-hero { position: relative; }
.single-hero img { width: 100%; max-height: 520px; object-fit: cover; }
.single-wrap { max-width: 760px; margin: -60px auto 0; background: var(--white); border-radius: var(--radius); padding: 40px 44px 48px; box-shadow: var(--shadow); position: relative; }
@media (max-width: 700px) { .single-wrap { padding: 26px 20px 32px; margin: -40px 16px 0; } }
.single-meta { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.single-meta .cat { color: var(--terracotta); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 12.5px; margin-right: 10px; }

/* Give CTA box */
.give-box {
  background: var(--cream-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; margin: 36px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.give-box p { margin: 0; font-weight: 600; }

/* Related */
.related { padding: 8px 0 72px; }
.related h2 { font-size: 26px; margin-bottom: 24px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.contact-item strong { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); margin-bottom: 6px; }

/* Footer */
.site-footer { background: var(--forest-2); color: #DCE7E0; padding: 56px 0 0; }
.site-footer h4 { color: var(--gold); font-size: 16px; margin-bottom: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 32px; padding-bottom: 40px; }
@media (max-width: 900px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #DCE7E0; }
.site-footer a:hover { color: var(--gold); }
.site-footer .addr { font-style: normal; line-height: 1.7; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding: 18px 0; font-size: 13.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Search/404 */
.notfound { text-align: center; padding: 90px 0; }
.search-form { display: flex; gap: 10px; max-width: 520px; margin: 24px auto; }
.search-form input[type="search"] { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 16px; background: var(--white); }

/* Pagination */
.pagination { margin-top: 40px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pagination .page-numbers { padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--white); font-weight: 600; font-size: 14.5px; }
.pagination .current { background: var(--forest); color: var(--white); border-color: var(--forest); }

/* Year groups (newsletters) */
.year-group h3 { font-size: 24px; border-bottom: 2px solid var(--line); padding-bottom: 8px; margin: 34px 0 20px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
