/*
Theme Name: Environmental Defense Blogs
Theme URI: https://environmentaldefenseblogs.org/
Author: Codex
Author URI: https://openai.com/
Description: A classic PHP WordPress editorial theme for environmental reporting, conservation explainers, climate action notes, and field-blog publishing.
Version: 1.0.2
Requires at least: 5.8
Tested up to: 6.6
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: environmental-defense-blogs
*/

:root {
  --bfn-bg: #eef4ec;
  --bfn-bg-soft: #f8f3e8;
  --bfn-paper: #fffdf6;
  --bfn-ink: #17211b;
  --bfn-muted: #657167;
  --bfn-border: rgba(23, 33, 27, 0.14);
  --bfn-border-strong: rgba(23, 33, 27, 0.26);
  --bfn-copper: #b86135;
  --bfn-copper-dark: #8e4728;
  --bfn-blue: #2c7890;
  --bfn-green: #285f43;
  --bfn-radius: 8px;
  --bfn-pill: 999px;
  --bfn-shell: 1180px;
  --bfn-shadow: 0 18px 48px rgba(32, 60, 43, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bfn-bg);
  color: var(--bfn-ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--bfn-blue);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.screen-reader-text,
.bfn-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bfn-skip-link:focus {
  z-index: 1000;
  top: 14px;
  left: 14px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  border-radius: var(--bfn-pill);
  background: var(--bfn-green);
  color: #fff;
  font-weight: 800;
}

.bfn-shell {
  width: min(100% - 40px, var(--bfn-shell));
  margin: 0 auto;
}

.bfn-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--bfn-border);
  background: rgba(255, 253, 246, 0.94);
  backdrop-filter: blur(18px);
}

body.admin-bar .bfn-site-header {
  top: 32px;
}

.bfn-header-shell {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr) auto;
  grid-template-areas: "brand nav action";
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 12px 0;
}

.bfn-primary-nav {
  grid-area: nav;
  min-width: 0;
  overflow: visible;
}

.bfn-menu-list,
.bfn-footer-menu-list {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bfn-primary-nav .bfn-menu-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.bfn-primary-nav .bfn-menu-list > li {
  min-width: 0;
}

.bfn-primary-nav .bfn-menu-list > li:nth-child(n+5) {
  display: none;
}

.bfn-menu-list a {
  display: inline-flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-pill);
  background: #fff;
  color: var(--bfn-ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bfn-menu-list a:hover,
.bfn-menu-list a:focus {
  border-color: var(--bfn-green);
  background: var(--bfn-green);
  color: #fff;
}

.bfn-brand {
  grid-area: brand;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.bfn-logo-frame {
  display: grid;
  width: 72px;
  height: 72px;
  min-width: 72px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(40, 95, 67, 0.28);
  border-radius: 50%;
  background: var(--bfn-green);
  box-shadow: 0 10px 28px rgba(40, 95, 67, 0.18);
}

.bfn-logo-frame img,
.bfn-logo-image,
.custom-logo-link img,
img.custom-logo {
  width: 72px !important;
  height: 72px !important;
  max-width: 72px !important;
  max-height: 72px !important;
  object-fit: contain !important;
}

.bfn-brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border: 2px solid #f8f3e8;
  border-radius: 50%;
}

.bfn-brand-mark span,
.bfn-brand-mark::before,
.bfn-brand-mark::after {
  position: absolute;
  content: "";
  display: block;
  background: #f8f3e8;
}

.bfn-brand-mark span {
  left: 14px;
  top: 4px;
  width: 3px;
  height: 22px;
}

.bfn-brand-mark::before {
  left: 7px;
  top: 13px;
  width: 18px;
  height: 3px;
  transform: rotate(-28deg);
}

.bfn-brand-mark::after {
  right: 5px;
  top: 7px;
  width: 10px;
  height: 7px;
  border-radius: 10px 10px 0 10px;
  transform: rotate(-20deg);
}

.bfn-brand-name {
  overflow: hidden;
  color: var(--bfn-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bfn-header-actions {
  grid-area: action;
  justify-self: end;
}

.bfn-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--bfn-green);
  border-radius: var(--bfn-pill);
  background: var(--bfn-green);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.bfn-button:hover,
.bfn-button:focus {
  border-color: var(--bfn-blue);
  background: var(--bfn-blue);
  color: #fff;
}

.bfn-button-outline {
  border-color: var(--bfn-border-strong);
  background: transparent;
  color: var(--bfn-ink);
}

.bfn-button-outline:hover,
.bfn-button-outline:focus {
  border-color: var(--bfn-blue);
  background: #fff;
  color: var(--bfn-blue);
}

.bfn-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--bfn-border);
  border-radius: 50%;
  background: #fff;
  color: var(--bfn-ink);
}

.bfn-menu-toggle span:not(.screen-reader-text) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
}

.bfn-main {
  min-height: 60vh;
}

.bfn-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--bfn-copper);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bfn-kicker::before {
  content: "";
  display: inline-block;
  width: 34px;
  height: 2px;
  background: currentColor;
}

.bfn-hero {
  padding: 86px 0 72px;
  background: linear-gradient(180deg, #f8f3e8 0%, var(--bfn-bg) 100%);
}

.bfn-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 54px;
}

.bfn-hero-brand {
  display: none;
}

.bfn-hero-title,
.bfn-section-title,
.bfn-page-title,
.bfn-entry-title,
.bfn-card-title,
.bfn-footer-title {
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: 0;
}

.bfn-hero-title {
  max-width: 680px;
  margin: 0;
  font-size: 78px;
  font-weight: 700;
  line-height: 0.96;
}

.bfn-hero-text {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--bfn-muted);
  font-size: 19px;
}

.bfn-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.bfn-visual-stack {
  position: relative;
  min-height: 520px;
}

.bfn-visual-main,
.bfn-visual-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-radius);
  background: var(--bfn-paper);
  box-shadow: var(--bfn-shadow);
}

.bfn-visual-main img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.bfn-visual-card {
  position: absolute;
  width: 220px;
  right: 26px;
  bottom: -24px;
}

.bfn-visual-card + .bfn-visual-card {
  width: 180px;
  right: auto;
  left: -28px;
  bottom: 42px;
}

.bfn-visual-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.bfn-category-strip {
  border-top: 1px solid var(--bfn-border);
  border-bottom: 1px solid var(--bfn-border);
  background: var(--bfn-paper);
}

.bfn-category-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 18px;
  padding-bottom: 18px;
  list-style: none;
}

.bfn-category-list a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-pill);
  color: var(--bfn-ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.bfn-category-list a:hover,
.bfn-category-list a:focus {
  border-color: var(--bfn-green);
  background: var(--bfn-green);
  color: #fff;
}

.bfn-featured,
.bfn-image-band,
.bfn-listing {
  padding: 78px 0;
}

.bfn-section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
  margin-bottom: 32px;
}

.bfn-section-title {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
}

.bfn-section-text {
  max-width: 680px;
  color: var(--bfn-muted);
  font-size: 17px;
}

.bfn-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.bfn-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-radius);
  background: var(--bfn-paper);
  box-shadow: 0 16px 40px rgba(32, 60, 43, 0.09);
}

.bfn-card-media {
  display: block;
  background: #dfeade;
}

.bfn-card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.bfn-card-body {
  display: grid;
  gap: 13px;
  padding: 22px;
}

.bfn-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--bfn-copper);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bfn-card-category {
  color: var(--bfn-green);
}

.bfn-card-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
}

.bfn-card-excerpt {
  margin: 0;
  color: var(--bfn-muted);
}

.bfn-read-link {
  justify-self: start;
  color: var(--bfn-blue);
  font-size: 13px;
  font-weight: 900;
}

.bfn-image-band {
  background: var(--bfn-bg-soft);
}

.bfn-image-band-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 34px;
  align-items: center;
}

.bfn-image-band-grid > img {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-radius);
  box-shadow: var(--bfn-shadow);
}

.bfn-image-band-copy {
  max-width: 620px;
}

.bfn-image-band-copy p:last-child {
  color: var(--bfn-muted);
  font-size: 18px;
}

.bfn-listing-header {
  width: min(100% - 40px, var(--bfn-shell));
  margin: 0 auto 36px;
}

.bfn-page-title {
  max-width: 920px;
  margin: 0;
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
}

.bfn-entry {
  padding: 72px 0;
}

.bfn-entry-header {
  width: min(100% - 40px, 880px);
  margin: 0 auto 38px;
}

.bfn-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  color: var(--bfn-copper);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bfn-entry-title {
  margin: 0;
  font-size: 70px;
  font-weight: 700;
  line-height: 1;
}

.bfn-entry-content,
.bfn-page-content {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  color: #26332a;
  font-size: 19px;
  line-height: 1.78;
}

.bfn-entry-content > *,
.bfn-page-content > * {
  margin-top: 0;
  margin-bottom: 24px;
}

.bfn-entry-content h2,
.bfn-entry-content h3,
.bfn-page-content h2,
.bfn-page-content h3 {
  margin-top: 44px;
  color: var(--bfn-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.bfn-entry-content h2,
.bfn-page-content h2 {
  font-size: 38px;
}

.bfn-entry-content h3,
.bfn-page-content h3 {
  font-size: 30px;
}

.bfn-entry-content a,
.bfn-page-content a {
  color: var(--bfn-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bfn-entry-content img,
.bfn-page-content img {
  border-radius: var(--bfn-radius);
}

.bfn-entry-content blockquote,
.bfn-page-content blockquote {
  margin: 34px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--bfn-copper);
  color: var(--bfn-ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 26px;
  line-height: 1.3;
}

.alignwide {
  width: min(100vw - 40px, 1040px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.wp-caption,
figcaption {
  color: var(--bfn-muted);
  font-size: 13px;
}

.bfn-entry-footer,
.bfn-post-nav,
.bfn-pagination {
  width: min(100% - 40px, 880px);
  margin: 36px auto 0;
}

.bfn-entry-footer a {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 6px 12px;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-pill);
  background: var(--bfn-paper);
  color: var(--bfn-green);
  font-size: 13px;
  font-weight: 800;
}

.bfn-pagination {
  text-align: center;
}

.bfn-empty {
  width: min(100% - 40px, var(--bfn-shell));
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--bfn-border);
  border-radius: var(--bfn-radius);
  background: var(--bfn-paper);
}

.bfn-site-footer {
  border-top: 1px solid var(--bfn-border);
  background: #173325;
  color: #eff7ed;
}

.bfn-footer-cta {
  width: min(100% - 40px, 780px);
  margin: 0 auto;
  padding: 70px 0;
  text-align: center;
}

.bfn-footer-cta .bfn-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.bfn-footer-cta .bfn-brand-name {
  color: #eff7ed;
}

.bfn-footer-title {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
}

.bfn-footer-cta p {
  max-width: 620px;
  margin: 18px auto 28px;
  color: rgba(239, 247, 237, 0.76);
}

.bfn-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 44px;
  align-items: start;
  width: min(100% - 40px, var(--bfn-shell));
  margin: 0 auto;
  padding: 34px 0;
  border-top: 1px solid rgba(239, 247, 237, 0.16);
}

.bfn-footer-heading {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bfn-footer-menu-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
  align-items: start;
}

.bfn-footer-menu-list li {
  min-width: 0;
}

.bfn-footer-menu-list a {
  display: inline;
  color: rgba(239, 247, 237, 0.78);
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.bfn-footer-note {
  max-width: 520px;
  margin: 0;
  color: rgba(239, 247, 237, 0.78);
}

.bfn-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 40px, var(--bfn-shell));
  margin: 0 auto;
  padding: 22px 0 34px;
  border-top: 1px solid rgba(239, 247, 237, 0.16);
  color: rgba(239, 247, 237, 0.68);
  font-size: 13px;
}

@media (max-width: 1020px) {
  body.admin-bar .bfn-site-header {
    top: 46px;
  }

  .bfn-header-shell {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "nav nav";
  }

  .bfn-header-actions {
    display: none;
  }

  .bfn-menu-toggle {
    display: block;
    grid-area: toggle;
  }

  .bfn-primary-nav {
    display: none;
    width: 100%;
  }

  .bfn-site-header.is-open .bfn-primary-nav {
    display: block;
  }

  .bfn-menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .bfn-primary-nav .bfn-menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bfn-menu-list a {
    white-space: normal;
  }

  .bfn-hero-grid,
  .bfn-section-header,
  .bfn-image-band-grid,
  .bfn-footer-grid {
    grid-template-columns: 1fr;
  }

  .bfn-hero-title,
  .bfn-entry-title {
    font-size: 56px;
  }

  .bfn-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .bfn-shell,
  .bfn-entry-header,
  .bfn-entry-content,
  .bfn-page-content,
  .bfn-entry-footer,
  .bfn-post-nav,
  .bfn-pagination,
  .bfn-listing-header,
  .bfn-empty {
    width: min(100% - 32px, var(--bfn-shell));
  }

  .bfn-header-shell {
    min-height: 76px;
  }

  .bfn-logo-frame {
    width: 58px;
    height: 58px;
    min-width: 58px;
  }

  .bfn-logo-frame img,
  .bfn-logo-image,
  .custom-logo-link img,
  img.custom-logo {
    width: 58px !important;
    height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
  }

  .bfn-brand-name {
    max-width: 180px;
    font-size: 22px;
  }

  .bfn-hero,
  .bfn-featured,
  .bfn-image-band,
  .bfn-listing,
  .bfn-entry {
    padding: 52px 0;
  }

  .bfn-hero-title,
  .bfn-page-title,
  .bfn-entry-title,
  .bfn-section-title,
  .bfn-footer-title {
    font-size: 40px;
  }

  .bfn-hero-text,
  .bfn-section-text,
  .bfn-entry-content,
  .bfn-page-content {
    font-size: 17px;
  }

  .bfn-visual-stack {
    min-height: auto;
  }

  .bfn-visual-main img {
    height: 330px;
  }

  .bfn-visual-card {
    display: none;
  }

  .bfn-category-list,
  .bfn-menu-list,
  .bfn-card-grid {
    grid-template-columns: 1fr;
  }

  .bfn-primary-nav .bfn-menu-list {
    grid-template-columns: 1fr;
  }

  .bfn-hero-actions,
  .bfn-button {
    width: 100%;
  }

  .bfn-footer-bottom {
    flex-direction: column;
  }
}
