/*
Theme Name: Loopway
Theme URI: https://loopway.org
Author: Loopway
Description: A custom WordPress theme for Loopway, a directory of organizations, agencies, and projects keeping reusable materials out of landfills across all 50 states. Includes page templates for a category guide, national directory, state-by-state resource table, a recurring Project of the Month feature, and an Earth Day Award spotlight.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: loopway
*/

/* ==========================================================================
   Loopway — loopway.org
   Circular economy / landfill diversion directory
   ========================================================================== */

:root {
  --green-900: #0f3d2e;
  --green-800: #14513e;
  --green-700: #1a6b52;
  --green-600: #22886a;
  --green-500: #2ba883;
  --green-100: #e5f5ee;
  --green-50:  #f2faf6;
  --gold-500:  #d9a441;
  --gold-600:  #b9842a;
  --ink-900:   #14201c;
  --ink-700:   #3a4a44;
  --ink-500:   #64766f;
  --paper:     #fbfaf6;
  --white:     #ffffff;
  --line:      #dfe8e2;
  --shadow:    0 8px 24px rgba(15, 61, 46, 0.08);
  --radius:    14px;
  --maxw:      1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Avenir, Helvetica, Arial, sans-serif;
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--green-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

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

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

/* ---------- Top banner ---------- */
.topbar {
  background: var(--green-900);
  color: var(--green-100);
  font-size: 0.82rem;
  padding: 6px 0;
  text-align: center;
  letter-spacing: 0.02em;
}
.topbar strong { color: var(--gold-500); }

/* ---------- Header ---------- */
header.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-900);
}
.logo .mark {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--green-500), var(--gold-500), var(--green-700), var(--green-500));
  display: inline-block;
  position: relative;
}
.logo .mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--paper);
}
.logo small {
  display: block;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--ink-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
nav.main-nav a {
  color: var(--ink-700);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}
nav.main-nav a:hover, nav.main-nav a.active {
  background: var(--green-100);
  color: var(--green-800);
  text-decoration: none;
}
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-wrap { flex-wrap: wrap; }
  nav.main-nav ul { gap: 2px; }
  nav.main-nav a { font-size: 0.85rem; padding: 6px 8px; }
}
@media (max-width: 640px) {
  nav.main-nav ul { display: none; width: 100%; flex-direction: column; }
  nav.main-nav ul.open { display: flex; }
  .nav-toggle {
    display: inline-block;
    background: var(--green-700);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
  }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, rgba(217,164,65,0.15), transparent 60%),
    linear-gradient(160deg, var(--green-900), var(--green-700) 75%);
  color: var(--white);
  padding: 64px 0 72px;
}
.hero .container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero h1 { color: var(--white); }
.hero p.lead { color: var(--green-100); font-size: 1.15rem; max-width: 46ch; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.hero-stats .stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}
.hero-stats .stat strong { display: block; font-size: 1.6rem; color: var(--gold-500); font-family: Georgia, serif; }
.hero-stats .stat span { font-size: 0.78rem; color: var(--green-100); }

@media (max-width: 800px) {
  .hero .container { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--gold-500);
  color: var(--ink-900);
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  margin-top: 18px;
  margin-right: 10px;
}
.btn:hover { background: var(--gold-600); text-decoration: none; }
.btn.secondary {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: var(--white);
}
.btn.secondary:hover { background: rgba(255,255,255,0.12); }
.btn.dark { background: var(--green-800); color: white; }
.btn.outline-dark { background: transparent; border: 1.5px solid var(--green-700); color: var(--green-800); }
.btn.outline-dark:hover { background: var(--green-100); text-decoration: none; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--green-50); }
.section-head { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.section-head span.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green-600);
  background: var(--green-100);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card .icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.card ul { margin: 0; padding-left: 1.1em; }
.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-700);
  background: var(--green-100);
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* ---------- Spotlight / Project of the month ---------- */
.spotlight {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  color: var(--white);
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 32px;
  align-items: center;
}
.spotlight .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-500);
  color: var(--ink-900);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.spotlight h2, .spotlight h3 { color: white; }
.spotlight .meta { color: var(--green-100); font-size: 0.9rem; }
.spotlight-figure {
  background: rgba(255,255,255,0.08);
  border: 1px dashed rgba(255,255,255,0.35);
  border-radius: 16px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 4rem;
}
@media (max-width: 800px) {
  .spotlight { grid-template-columns: 1fr; padding: 26px; }
}

/* ---------- Tables ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.data th, table.data td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  vertical-align: top;
}
table.data th {
  background: var(--green-800);
  color: white;
  font-family: Georgia, serif;
  position: sticky;
  top: 0;
}
table.data tr:nth-child(even) td { background: var(--green-50); }
table.data td.state { font-weight: 700; color: var(--green-800); white-space: nowrap; }

.region-block { margin-bottom: 40px; }
.region-block h3 {
  border-bottom: 2px solid var(--gold-500);
  display: inline-block;
  padding-bottom: 4px;
  margin-bottom: 16px;
}

/* ---------- Search / filter bar ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
.filter-bar input, .filter-bar select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  background: white;
}
.filter-bar input { flex: 1; min-width: 220px; }

/* ---------- Timeline (award/flyer history) ---------- */
.timeline { border-left: 3px solid var(--green-500); margin-left: 10px; padding-left: 26px; }
.timeline .item { margin-bottom: 28px; position: relative; }
.timeline .item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold-500);
  border: 3px solid var(--green-50);
}
.timeline .date { font-weight: 700; color: var(--green-700); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Quote ---------- */
blockquote.pull {
  border-left: 4px solid var(--gold-500);
  margin: 20px 0;
  padding: 6px 0 6px 20px;
  font-style: italic;
  color: var(--ink-700);
  font-size: 1.05rem;
}
blockquote.pull cite { display: block; font-style: normal; font-weight: 700; margin-top: 8px; color: var(--green-800); font-size: 0.88rem; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--ink-900);
  color: #cdd8d2;
  padding: 48px 0 22px;
  margin-top: 40px;
}
footer .grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
footer h4 { color: white; font-size: 1rem; margin-bottom: 12px; }
footer a { color: #cdd8d2; }
footer a:hover { color: var(--gold-500); }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 6px; font-size: 0.9rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 30px;
  padding-top: 18px;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: #93a29c;
}
@media (max-width: 800px) {
  footer .grid { grid-template-columns: 1fr 1fr; }
}

.note {
  background: var(--green-50);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-600);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.92rem;
  color: var(--ink-700);
}

.source-list { font-size: 0.82rem; color: var(--ink-500); }
.source-list a { color: var(--ink-500); text-decoration: underline; }

.breadcrumb { font-size: 0.85rem; color: var(--ink-500); margin-bottom: 18px; }
.breadcrumb a { color: var(--green-700); }

/* ---------- Leadership / team card ---------- */
.team-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  align-items: start;
}
.team-photo {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 3 / 4;
}
@media (max-width: 700px) {
  .team-card { grid-template-columns: 1fr; }
  .team-photo { max-width: 220px; }
}

/* ---------- Award banner (one-time recognitions, e.g. EarthX awards) ---------- */
.award-banner {
  position: relative;
  background: linear-gradient(135deg, #fff8ea, #fbead0);
  border: 1px solid #ecd9ab;
  border-radius: 22px;
  padding: 44px;
  overflow: hidden;
}
.award-banner::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,164,65,0.35), transparent 70%);
}
.award-banner .grid { position: relative; z-index: 1; }
.award-banner .ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-500);
  color: var(--ink-900);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 7px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(217,164,65,0.35);
}
.award-banner h2, .award-banner h3 { color: var(--green-900); }
.award-banner .meta { color: var(--green-700); font-weight: 600; }
.award-banner p { color: var(--ink-700); }
.award-banner .award-figure {
  background: linear-gradient(160deg, var(--green-800), var(--green-600));
  border-radius: 18px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: var(--gold-500);
  box-shadow: 0 12px 28px rgba(15,61,46,0.25);
}
.award-banner .mini-stats {
  display: flex;
  gap: 22px;
  margin: 18px 0 20px;
  flex-wrap: wrap;
}
.award-banner .mini-stats div {
  font-size: 0.78rem;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.award-banner .mini-stats strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--green-800);
  text-transform: none;
  letter-spacing: normal;
}
@media (max-width: 800px) {
  .award-banner { padding: 26px; }
}
