/*
Theme Name: Yard & Yield
Theme URI: https://yardandyield.com/
Author: Yard & Yield
Author URI: https://yardandyield.com/
Description: A lightweight, accessible editorial WordPress theme for practical self-reliance, productive backyards, food growing, preservation, and honest product guidance.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: yard-and-yield
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

:root {
  --yy-forest: #173c31;
  --yy-forest-dark: #0f2d25;
  --yy-moss: #56704d;
  --yy-sage: #dce5d5;
  --yy-cream: #f7f3e8;
  --yy-paper: #fffdf8;
  --yy-clay: #b85b3f;
  --yy-gold: #dfb64c;
  --yy-ink: #19211e;
  --yy-muted: #5d6963;
  --yy-line: #dfe4df;
  --yy-white: #ffffff;
  --yy-radius-sm: 0.55rem;
  --yy-radius: 1rem;
  --yy-radius-lg: 1.5rem;
  --yy-shadow: 0 18px 45px rgba(18, 50, 40, 0.11);
  --yy-content: 47rem;
  --yy-wide: 75rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--yy-ink);
  background: var(--yy-paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

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

a {
  color: var(--yy-forest);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--yy-clay);
}

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

button,
.button,
.wp-element-button {
  border-radius: 999px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--yy-forest-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.9rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

p,
ul,
ol {
  margin-top: 0;
}

:focus-visible {
  outline: 3px solid var(--yy-gold);
  outline-offset: 3px;
}

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

.screen-reader-text:focus {
  z-index: 100000;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  padding: 0.8rem 1rem;
  clip: auto;
  color: var(--yy-white);
  background: var(--yy-forest-dark);
}

.yy-container {
  width: min(100% - 2rem, var(--yy-wide));
  margin-inline: auto;
}

.yy-narrow {
  width: min(100% - 2rem, var(--yy-content));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(23, 60, 49, 0.1);
  background: rgba(255, 253, 248, 0.94);
  backdrop-filter: blur(14px);
}

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

.site-header__inner {
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.site-branding {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  color: var(--yy-forest-dark);
  text-decoration: none;
}

.site-branding:hover {
  color: var(--yy-forest-dark);
}

.custom-logo {
  width: auto;
  max-height: 3rem;
}

.yy-brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
}

.site-title {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--yy-line);
  color: var(--yy-forest-dark);
  background: var(--yy-white);
  cursor: pointer;
}

.menu-toggle svg {
  width: 1.35rem;
  height: 1.35rem;
}

.primary-menu,
.footer-menu {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-menu a {
  color: var(--yy-ink);
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--yy-clay);
}

.yy-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 10vw, 8.5rem) 0;
  background:
    radial-gradient(circle at 85% 18%, rgba(223, 182, 76, 0.22), transparent 25rem),
    linear-gradient(145deg, var(--yy-cream), #edf2e9);
}

.yy-hero::after {
  position: absolute;
  right: -9rem;
  bottom: -10rem;
  width: 27rem;
  height: 27rem;
  border: 1px solid rgba(23, 60, 49, 0.12);
  border-radius: 50%;
  content: "";
}

.yy-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  grid-template-columns: minmax(0, 1.1fr) minmax(17rem, 0.7fr);
}

.yy-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  color: var(--yy-clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.yy-eyebrow::before {
  width: 2rem;
  height: 2px;
  background: currentColor;
  content: "";
}

.yy-hero h1 {
  max-width: 12ch;
  margin: 0 0 1.25rem;
}

.yy-hero__lede {
  max-width: 42rem;
  margin-bottom: 2rem;
  color: #46534e;
  font-size: clamp(1.12rem, 2vw, 1.32rem);
}

.yy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.yy-button {
  display: inline-flex;
  min-height: 3.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.3rem;
  border: 2px solid var(--yy-forest);
  color: var(--yy-white);
  background: var(--yy-forest);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.yy-button:hover {
  color: var(--yy-white);
  background: var(--yy-forest-dark);
  box-shadow: 0 10px 24px rgba(15, 45, 37, 0.2);
  transform: translateY(-2px);
}

.yy-button--secondary {
  color: var(--yy-forest);
  background: transparent;
}

.yy-button--secondary:hover {
  color: var(--yy-white);
}

.yy-hero__panel {
  padding: clamp(1.6rem, 4vw, 2.6rem);
  border: 1px solid rgba(23, 60, 49, 0.1);
  border-radius: var(--yy-radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--yy-shadow);
}

.yy-hero__panel h2 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
}

.yy-checklist {
  display: grid;
  gap: 0.85rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.yy-checklist li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.65rem;
  color: #3e4a45;
}

.yy-checklist li::before {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  color: var(--yy-white);
  background: var(--yy-moss);
  content: "✓";
  font-size: 0.75rem;
  font-weight: 900;
}

.yy-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.yy-section--tint {
  background: var(--yy-cream);
}

.yy-section__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.yy-section__header h2 {
  max-width: 16ch;
  margin: 0;
}

.yy-section__header p {
  max-width: 34rem;
  margin: 0;
  color: var(--yy-muted);
}

.yy-topic-grid,
.yy-post-grid,
.yy-principles {
  display: grid;
  gap: 1.25rem;
}

.yy-topic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.yy-post-grid,
.yy-principles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.yy-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--yy-line);
  border-radius: var(--yy-radius);
  background: var(--yy-white);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.yy-card:hover {
  border-color: rgba(23, 60, 49, 0.3);
  box-shadow: var(--yy-shadow);
  transform: translateY(-3px);
}

.yy-topic-card {
  display: flex;
  min-height: 15rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  color: inherit;
  text-decoration: none;
}

.yy-topic-card__number {
  color: var(--yy-clay);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.yy-topic-card h3 {
  margin-bottom: 0.55rem;
}

.yy-topic-card p {
  margin: 0;
  color: var(--yy-muted);
  font-size: 0.95rem;
}

.yy-post-card__image {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--yy-sage);
}

.yy-post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.yy-card:hover .yy-post-card__image img {
  transform: scale(1.025);
}

.yy-post-card__body {
  padding: 1.4rem;
}

.yy-post-card__meta,
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  color: var(--yy-muted);
  font-size: 0.82rem;
}

.yy-post-card h3 {
  margin: 0.6rem 0;
}

.yy-post-card h3 a {
  color: inherit;
  text-decoration: none;
}

.yy-post-card p {
  color: var(--yy-muted);
  font-size: 0.96rem;
}

.yy-principle {
  padding: 1.6rem;
}

.yy-principle h3 {
  margin-top: 0;
}

.yy-principle p {
  margin: 0;
  color: var(--yy-muted);
}

.site-main {
  min-height: 55vh;
}

.entry-header,
.archive-header {
  padding: clamp(3.5rem, 8vw, 6rem) 0 2.5rem;
  background: var(--yy-cream);
}

.entry-header__inner,
.archive-header__inner {
  width: min(100% - 2rem, 58rem);
  margin-inline: auto;
}

.entry-title,
.archive-title {
  margin: 0 0 1.2rem;
}

.entry-deck {
  max-width: 44rem;
  color: var(--yy-muted);
  font-size: 1.2rem;
}

.entry-thumbnail {
  width: min(100% - 2rem, 68rem);
  overflow: hidden;
  margin: -0.5rem auto 3rem;
  border-radius: var(--yy-radius-lg);
  box-shadow: var(--yy-shadow);
}

.entry-thumbnail img {
  width: 100%;
  max-height: 44rem;
  object-fit: cover;
}

.entry-content {
  width: min(100% - 2rem, var(--yy-content));
  padding: 3rem 0 5rem;
  margin-inline: auto;
}

.entry-content > * {
  margin-block: 1.35rem;
}

.entry-content > h2,
.entry-content > h3 {
  margin-top: 2.4rem;
}

.entry-content > .alignwide {
  width: min(var(--yy-wide), calc(100vw - 2rem));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

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

.entry-content blockquote {
  padding: 1.2rem 1.4rem;
  border-left: 4px solid var(--yy-gold);
  margin-left: 0;
  color: #39463f;
  background: var(--yy-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
  padding: 0.8rem;
  border: 1px solid var(--yy-line);
  text-align: left;
  vertical-align: top;
}

.entry-content th {
  background: var(--yy-cream);
}

.yy-post-navigation {
  width: min(100% - 2rem, var(--yy-content));
  padding-bottom: 4rem;
  margin-inline: auto;
}

.yy-post-navigation .nav-links {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.yy-post-navigation a {
  display: block;
  height: 100%;
  padding: 1.2rem;
  border: 1px solid var(--yy-line);
  border-radius: var(--yy-radius);
  text-decoration: none;
}

.yy-listing {
  padding: 3rem 0 6rem;
}

.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.pagination .page-numbers {
  display: grid;
  min-width: 2.6rem;
  min-height: 2.6rem;
  place-items: center;
  border: 1px solid var(--yy-line);
  border-radius: 50%;
  text-decoration: none;
}

.pagination .current {
  color: var(--yy-white);
  background: var(--yy-forest);
}

.yy-empty-state {
  padding: 3rem;
  border: 1px dashed var(--yy-moss);
  border-radius: var(--yy-radius);
  text-align: center;
}

.site-footer {
  padding: 4rem 0 2rem;
  color: rgba(255, 255, 255, 0.8);
  background: var(--yy-forest-dark);
}

.site-footer a {
  color: var(--yy-white);
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.25fr 1fr;
}

.site-footer .site-branding {
  color: var(--yy-white);
}

.site-footer__description {
  max-width: 35rem;
  margin-top: 1rem;
}

.footer-menu {
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.9rem;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  margin-top: 3rem;
  font-size: 0.83rem;
}

.site-footer__bottom p {
  margin: 0;
}

@media (max-width: 960px) {
  .yy-topic-grid,
  .yy-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yy-hero__grid {
    grid-template-columns: 1fr;
  }

  .yy-hero__panel {
    max-width: 38rem;
  }
}

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

  .menu-toggle {
    display: inline-flex;
  }

  .site-navigation {
    position: fixed;
    inset: 4.75rem 0 auto;
    display: none;
    max-height: calc(100vh - 4.75rem);
    overflow: auto;
    padding: 1.25rem 1rem 2rem;
    border-bottom: 1px solid var(--yy-line);
    background: var(--yy-paper);
    box-shadow: var(--yy-shadow);
  }

  .admin-bar .site-navigation {
    top: calc(4.75rem + 46px);
  }

  .site-navigation.is-open {
    display: block;
  }

  .primary-menu {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .primary-menu a {
    display: block;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid var(--yy-line);
    font-size: 1.05rem;
  }

  .yy-section__header,
  .site-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .yy-principles,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .footer-menu {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 1rem;
  }

  .yy-topic-grid,
  .yy-post-grid,
  .yy-post-navigation .nav-links {
    grid-template-columns: 1fr;
  }

  .yy-hero {
    padding-top: 3.6rem;
  }

  .yy-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .yy-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
