/*
Theme Name:   Pennypack Trust
Theme URI:    https://pennypacktrust.org/
Description:  Lightweight, standalone WordPress theme for the Pennypack Ecological Restoration Trust. Brand palette, Newsreader/Archivo typography, full-width no-sidebar layout, utility bar, hover mega-menu, and deep-green footer. Content-builder friendly (works with WPBakery Page Builder as a plugin). No parent theme required.
Author:       Artefact Design
Author URI:   https://artefactdesign.com/
Version:      1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License:      GNU General Public License v2 or later
Text Domain:  pennypack-trust
*/


/* ==========================================================================
   Pennypack Ecological Restoration Trust — Child Theme
   Sections: 1) Fonts  2) Tokens  3) Base type  4) Layout  5) Utility bar
             6) Header + mega-menu  7) Body content  8) Footer  9) Responsive
   NOTE: selectors tagged "VERIFY" in the comments below are best-guess against
   generic themes. Confirm them against the live parent theme's DOM before shipping.
   ========================================================================== */

/* ---- 1) Fonts are enqueued in functions.php (pp-fonts handle) ---- */

/* ---- 2) Design tokens ---- */
:root {
  --pp-bg:        #f7f5f0;
  --pp-ink:       #221f1f;
  --pp-body:      #374243;
  --pp-muted:     #5f7867;
  --pp-muted-2:   #97a39d;
  --pp-rule:      #d6c5b4;
  --pp-green-900: #043822;
  --pp-green-800: #07392e;
  --pp-green-700: #0b2720;
  --pp-green-500: #5f8a4b;
  --pp-amber:     #f1aa4a;
  --pp-amber-700: #ba922e;
  --pp-rust:      #812a19; /* alerts only — not used on this page */
  --pp-footer-fg: #d3d4d6;
  --pp-shadow:    0 18px 44px rgba(4,56,34,0.16);
  --pp-max:       1250px;  /* content window — section backgrounds stay full-width */
  --pp-content:   1250px;
}

.narrow {
	max-width: 1240px;
	margin: 0 auto !important;
}

/* ---- 3) Base + typography ---- */
body {
  background: var(--pp-bg);
  color: var(--pp-body);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
h1, h2, h3, h4,
.vc_custom_heading, .wpb_heading {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--pp-green-900);
}
h1 { font-weight: 400; font-size: clamp(40px,5.4vw,68px); line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-size: clamp(28px,3.2vw,40px); line-height: 1.15; }
a  { color: var(--pp-green-800); text-decoration: none; }
a:hover { color: var(--pp-green-700); }

/* ---- 4) Full-width, no-sidebar layout ---- */
/* VERIFY: these container/sidebar selectors vary by parent theme */
.content-area, .site-content, #primary { width: 100% !important; float: none !important; }
#secondary, .widget-area, .sidebar { display: none !important; }
.pp-shell { max-width: var(--pp-max); margin: 0 auto; padding: 0 40px; }

/* ==========================================================================
   5) Utility bar
   ========================================================================== */
.pp-utility { width: 100%; background: var(--pp-green-900); color: var(--pp-footer-fg); font-size: 13px; letter-spacing: 0.02em; }
.pp-utility .pp-shell { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
.pp-utility a { color: var(--pp-footer-fg); }
.pp-utility a:hover { color: #fff; }
.pp-utility-links { display: flex; gap: 22px; }

/* ==========================================================================
   6) Header + mega-menu
   ========================================================================== */
.pp-header { position: relative; z-index: 30; width: 100%; background: var(--pp-bg); border-bottom: 1px solid var(--pp-rule); }
/* items stretch to the full header height so dropdowns anchor flush at the
   header's bottom edge — no dead gap between the item and its dropdown */
.pp-header .pp-shell { display: flex; align-items: stretch; justify-content: space-between; gap: 48px; flex-wrap: wrap; min-height: 92px; padding-top: 0; padding-bottom: 0; }
.pp-logo { display: flex; align-items: center; flex: 0 1 360px; }
.pp-logo img { width: 100%; max-width: 360px; height: auto; display: block; }

/* nav bar — the wrapper and list stretch to full header height so each
   item's dropdown anchors flush at the header's bottom edge */
.pp-nav-wrap { display: flex; align-items: stretch; }
.pp-nav { display: flex; align-items: stretch; gap: 4px; list-style: none; margin: 0; padding: 0; font-size: 15.5px; font-weight: 500; }
.pp-nav .pp-top { position: relative; display: flex; align-items: stretch; }
.pp-nav .pp-top > a {
  display: flex; align-items: center; gap: 7px;
  padding: 0 16px; color: var(--pp-body);
  font-family: 'Archivo', sans-serif; font-weight: 500;
}
.pp-nav .pp-top > a:hover,
.pp-nav .pp-top.is-open > a { background: #e8e4da; color: var(--pp-green-900); }
.pp-nav .pp-top > a .pp-chev { transition: transform 140ms ease; }
.pp-nav .pp-top.is-open > a .pp-chev { transform: rotate(180deg); }
.pp-nav .current-menu-item > a,
.pp-nav .current-menu-ancestor > a { color: var(--pp-green-900); }

/* dropdown panel — narrow, anchored flush under its top-level item */
.pp-mega {
  position: absolute; top: 100%; left: 0; right: auto;
  min-width: 250px; width: max-content; max-width: 320px;
  background: #fff; border-top: 3px solid var(--pp-green-500);
  box-shadow: var(--pp-shadow);
  opacity: 0; visibility: hidden; pointer-events: none;
  /* fade out, but keep the panel present until the fade completes so a quick
     diagonal mouse move from item to link doesn't drop it */
  transition: opacity 140ms ease, visibility 0s linear 140ms;
}
.pp-mega-inner { display: flex; flex-direction: column; padding: 10px 0; margin: 0; max-width: none; }
/* open on hover, keyboard focus, or JS-added .is-open (touch) */
.pp-nav .pp-top:hover > .pp-mega,
.pp-nav .pp-top:focus-within > .pp-mega,
.pp-nav .pp-top.is-open > .pp-mega {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 140ms ease, visibility 0s;
}
/* right-aligned dropdowns (flipped by JS when they'd overflow the content edge) */
.pp-nav .pp-top.pp-align-right > .pp-mega { left: auto; right: 0; }

.pp-group { display: block; padding: 6px 0; }
.pp-group + .pp-group { border-top: 1px solid #efece4; margin-top: 2px; padding-top: 8px; }
.pp-group-head { display: block; padding: 5px 22px; font-family: 'Newsreader', Georgia, serif; font-size: 16px; font-weight: 600; color: var(--pp-green-900); line-height: 1.25; }
.pp-group-head:hover { background: #f4f2ec; color: var(--pp-green-900); }
.pp-sublinks { display: block; }
.pp-sublink { display: block; padding: 7px 22px 7px 30px; font-size: 14.5px; font-weight: 400; color: var(--pp-body); line-height: 1.35; }
.pp-sublink:hover { background: #f4f2ec; color: var(--pp-green-900); }

/* donate pill */
.pp-nav .pp-top.pp-donate { align-items: center; margin-left: 14px; }
.pp-donate > a, a.pp-donate {
  display: flex; align-items: center; padding: 11px 24px;
  background: var(--pp-amber); color: var(--pp-green-700);
  border-radius: 999px; font-weight: 700; letter-spacing: 0.01em;
}
.pp-donate > a:hover, a.pp-donate:hover { background: var(--pp-amber-700); color: #fff; }
.pp-donate .pp-chev { display: none; }

/* banner */
.pp-banner { width: 100%; height: 280px; display: block; object-fit: cover; object-position: center 45%; }

/* ==========================================================================
   7) Body content (WPBakery)
   ========================================================================== */
.pp-main { width: 100%; max-width: var(--pp-content); margin: 0 auto; padding: 0 40px 88px; }
.pp-main-inner { max-width: none; margin: 0; }  /* .pp-main does the windowing so it lines up with the header shell */
.pp-breadcrumb { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pp-muted); font-weight: 600; padding-top: 44px; }
.pp-breadcrumb a { color: var(--pp-muted); }
.pp-breadcrumb .sep { color: var(--pp-muted-2); }
.pp-h1 { margin: 18px 0 40px; text-wrap: balance; }
.pp-prose { font-size: 19px; line-height: 1.72; color: var(--pp-body); }
.pp-prose p { margin: 0 0 26px; text-wrap: pretty; }
.pp-prose p:last-child { margin-bottom: 0; }

/* floated inline images (works in WPBakery text blocks) */
.pp-prose img, .wpb_text_column img, .vc_single_image-img { border-radius: 2px; height: auto; }
.pp-prose img.alignleft,  .wpb_text_column img.alignleft  { float: left;  width: 300px; max-width: 42%; margin: 6px 30px 18px 0; }
.pp-prose img.alignright, .wpb_text_column img.alignright { float: right; width: 300px; max-width: 42%; margin: 6px 0 18px 30px; }

/* WPBakery button mapping, if you build CTAs with vc_btn3 */
.vc_btn3.vc_btn3-color-orange, .pp-btn-donate {
  background: var(--pp-amber) !important; border-color: var(--pp-amber) !important;
  color: var(--pp-green-700) !important; border-radius: 999px !important; font-weight: 700 !important;
}
.vc_btn3.vc_btn3-color-orange:hover, .pp-btn-donate:hover { background: var(--pp-amber-700) !important; color: #fff !important; }

/* ==========================================================================
   8) Footer
   ========================================================================== */
.pp-footer { width: 100%; background: var(--pp-green-900); color: var(--pp-footer-fg); padding: 56px 0 30px; }
.pp-footer a { color: var(--pp-footer-fg); }
.pp-footer a:hover { color: #fff; }
.pp-footer-shell { max-width: var(--pp-max); margin: 0 auto; padding: 0 40px; }
/* one row: logo left, the four link columns right */
.pp-footer-main { display: flex; align-items: flex-start; gap: 56px; }
.pp-footer-logo-col { flex: 0 0 230px; }
.pp-footer-logo { max-width: 230px; width: 100%; height: auto; display: block; margin: 0; }
/* Prefer a real white logo file; this filter is a stopgap only */
.pp-footer-logo.is-filtered { filter: invert(1) brightness(1.9); }
.pp-footer-grid { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 40px; }
.pp-footer-col { display: grid; gap: 9px; font-size: 14.5px; align-content: start; }
.pp-footer-col .pp-col-head { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pp-muted-2); margin-bottom: 5px; font-weight: 600; }
.pp-footer-bottom { max-width: var(--pp-max); margin: 40px auto 0; padding: 24px 40px 0; border-top: 1px solid var(--pp-green-700); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13.5px; color: var(--pp-muted-2); }
.pp-footer-bottom a { color: var(--pp-muted-2); }
.pp-social { display: flex; gap: 16px; }

/* ==========================================================================
   9) Responsive — the design is desktop-only; these are sane fallbacks.
   A real mobile nav (drawer/accordion) still needs building — see BUILD-GUIDE.
   ========================================================================== */
@media (max-width: 980px) {
  .pp-header .pp-shell { gap: 20px; align-items: center; min-height: 0; padding-top: 16px; padding-bottom: 16px; }
  .pp-nav { display: none; } /* TODO: replace with mobile drawer toggle */
  .pp-prose { font-size: 17px; }
  /* footer stacks: logo over a 2-column link grid */
  .pp-footer-main { flex-direction: column; gap: 32px; }
  .pp-footer-logo-col { flex: 0 0 auto; }
  .pp-footer-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 32px; }
}
@media (max-width: 640px) {
  .pp-shell, .pp-main, .pp-footer-shell, .pp-footer-bottom { padding-left: 20px; padding-right: 20px; }
  .pp-prose img.alignleft, .pp-prose img.alignright { float: none; display: block; width: 100%; max-width: 100%; margin: 0 0 22px; }
  .pp-banner { height: 190px; }
  .pp-footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

/* ==========================================================================
   10) Standalone theme extras (blog list, single, search, a11y)
   ========================================================================== */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden; position: absolute !important; word-wrap: normal !important;
}
.pp-skip-link:focus {
  position: fixed; left: 12px; top: 12px; z-index: 100; width: auto; height: auto;
  clip: auto; clip-path: none; background: var(--pp-green-900); color: #fff;
  padding: 10px 16px; border-radius: 3px;
}
.pp-menu-notice { display: inline-flex; padding: 10px 16px; color: var(--pp-green-800); }

.pp-post-thumb { margin: 0 0 26px; }
.pp-post-thumb img { width: 100%; height: auto; border-radius: 2px; }

.pp-post-list { display: grid; gap: 40px; padding: 44px 0 0; }
.pp-post-card { border-bottom: 1px solid var(--pp-rule); padding-bottom: 36px; }
.pp-post-card:last-child { border-bottom: 0; }
.pp-post-title { font-family: 'Newsreader', Georgia, serif; font-weight: 500; font-size: clamp(24px,3vw,34px); line-height: 1.15; margin: 0 0 6px; }
.pp-post-title a { color: var(--pp-green-900); }
.pp-post-title a:hover { color: var(--pp-green-500); }
.pp-post-meta { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pp-muted); font-weight: 600; margin-bottom: 14px; }
.pp-more { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--pp-green-800); }
.pp-more:hover { color: var(--pp-green-500); }

.pp-page-links { margin-top: 22px; font-weight: 600; }

/* Pagination */
.pagination, .nav-links { display: flex; gap: 8px; flex-wrap: wrap; padding: 44px 0 0; }
.pagination .page-numbers, .nav-links .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px; border: 1px solid var(--pp-rule);
  border-radius: 3px; color: var(--pp-green-800);
}
.pagination .page-numbers.current { background: var(--pp-green-900); color: #fff; border-color: var(--pp-green-900); }
.pagination .page-numbers:hover { border-color: var(--pp-green-500); color: var(--pp-green-500); }

/* Search form */
.search-form { display: flex; gap: 8px; margin-top: 22px; max-width: 460px; }
.search-form .search-field {
  flex: 1; padding: 11px 14px; border: 1px solid var(--pp-rule); border-radius: 3px;
  font-family: 'Archivo', sans-serif; font-size: 16px; background: #fff; color: var(--pp-body);
}
.search-form .search-submit {
  padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pp-green-800); color: #fff; font-family: 'Archivo', sans-serif; font-weight: 600;
}
.search-form .search-submit:hover { background: var(--pp-green-700); }
