/*
Theme Name: Meadow Roost
Theme URI: https://www.coopandcompass.com
Author: Ben Harris
Author URI: https://www.coopandcompass.com
Description: A calm farmstead theme pairing soft sage with smoky terracotta, serif-led editorial typography, flat bordered components, and roomy layouts for practical backyard poultry and small-flock guidance sites.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.8
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: meadow-roost
Tags: blog, right-sidebar, custom-logo, custom-menu, threaded-comments, featured-images
*/

/* ==========================================================================
   1. Tokens & base
   ========================================================================== */

:root {
    --oat: #f7f1e5;
    --paper: #fdfaf5;
    --sage: #7d9070;
    --sage-ink: #55663f;
    --sage-mist: #e9edde;
    --terra: #bd7b58;
    --terra-deep: #9c5f3d;
    --ink: #2f332a;
    --ink-soft: #656853;
    --line: #ddd3bf;
    --radius: 10px;
    --feat-ratio: 3 / 2;
    --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--oat);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.25;
    color: var(--ink);
}

a {
    color: var(--terra-deep);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--sage-ink);
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

figure {
    margin: 0;
}

button {
    font: inherit;
    cursor: pointer;
}

/* Long words never break the layout */
h1, h2, h3, h4, h5, h6, p, li, a, td, th, blockquote, figcaption {
    overflow-wrap: break-word;
}

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

.screen-reader-text:focus {
    width: auto;
    height: auto;
    clip: auto;
    clip-path: none;
    margin: 0;
    padding: 10px 16px;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--sage);
    border-radius: var(--radius);
    z-index: 999;
}

.roost-skip:focus {
    top: 8px;
    left: 8px;
}

.roost-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ==========================================================================
   2. Header — light solid, two-row (brand row + nav row)
   ========================================================================== */

.roost-head {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.roost-brandrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.roost-brand .roost-name {
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
}

.roost-brand .roost-name:hover {
    color: var(--sage-ink);
}

.roost-brand .custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.roost-brand .custom-logo {
    max-height: 56px;
    width: auto;
}

.roost-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.roost-search-toggle,
.roost-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
}

.roost-search-toggle:hover,
.roost-nav-toggle:hover {
    border-color: var(--sage);
    color: var(--sage-ink);
}

.roost-search-toggle svg,
.roost-nav-toggle svg {
    width: 20px;
    height: 20px;
}

.roost-search-panel {
    border-top: 1px dashed var(--line);
    padding-top: 16px;
    padding-bottom: 16px;
}

.roost-search-panel[hidden] {
    display: none;
}

/* ==========================================================================
   3. Primary navigation (mobile first: collapsible; desktop: bar)
   ========================================================================== */

.perch-nav {
    display: none;
    border-top: 1px solid var(--line);
}

.perch-nav.perch-nav--open {
    display: block;
}

.perch-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.perch-menu li {
    margin: 0;
}

.perch-menu a {
    display: block;
    padding: 12px 14px;
    color: var(--ink);
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: var(--radius);
}

.perch-menu a:hover {
    color: var(--sage-ink);
    background: var(--sage-mist);
}

.perch-menu .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.perch-menu .menu-item-has-children > a {
    flex: 1 1 auto;
}

.brood-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 6px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink-soft);
}

.brood-toggle:hover {
    border-color: var(--sage);
    color: var(--sage-ink);
}

.brood-toggle svg {
    transition: transform 0.18s ease;
}

.menu-item-has-children.brood-open > .brood-toggle svg {
    transform: rotate(180deg);
}

.perch-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 4px 14px;
    flex: 0 0 100%;
    display: none;
}

.perch-menu .menu-item-has-children.brood-open > .sub-menu {
    display: block;
}

.perch-menu .sub-menu a {
    font-size: 0.9rem;
    color: var(--ink-soft);
    padding-top: 9px;
    padding-bottom: 9px;
}

.perch-menu .current-menu-item > a,
.perch-menu .current-menu-ancestor > a {
    color: var(--sage-ink);
    font-weight: 600;
}

/* ==========================================================================
   4. Breadcrumb trail
   ========================================================================== */

.trail-crumbs {
    font-size: 0.82rem;
}

.trail-list {
    list-style: none;
    margin: 0;
    padding: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.trail-part {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trail-part + .trail-part::before {
    content: "›";
    color: var(--terra);
}

.trail-part a {
    color: var(--sage-ink);
    text-decoration: none;
}

.trail-part a:hover {
    text-decoration: underline;
}

.trail-part span[aria-current] {
    color: var(--ink-soft);
}

/* ==========================================================================
   5. Layout shell (content + right sidebar)
   ========================================================================== */

.yard-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}

.yard-main--solo,
.yard-main--wide {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 20px 56px;
}

/* ==========================================================================
   6. Homepage hero — category grid
   ========================================================================== */

.meadow-hero {
    padding-bottom: 34px;
}

.meadow-hero-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.meadow-hero-title {
    margin: 0 0 8px;
    font-size: clamp(1.55rem, 6vw, 2rem);
    letter-spacing: 0.01em;
}

.meadow-hero-lede {
    margin: 0;
    max-width: 56ch;
    color: var(--ink-soft);
    font-size: 1.02rem;
}

.meadow-hero-hen {
    display: none;
    flex: 0 0 auto;
    color: var(--sage);
}

.meadow-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.meadow-hero-card {
    display: block;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.meadow-hero-card:hover {
    border-color: var(--sage);
    background: #fffdf8;
}

.meadow-hero-count {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--terra-deep);
    margin-bottom: 6px;
}

.meadow-hero-name {
    margin: 0 0 6px;
    font-size: 1.12rem;
}

.meadow-hero-desc {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.yard-feed-title {
    margin: 0 0 20px;
    padding-top: 22px;
    border-top: 1px dashed var(--line);
    font-size: 1.45rem;
}

/* ==========================================================================
   7. Post list — horizontal thumbnail + text rows
   ========================================================================== */

.flock-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.flock-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.18s ease;
}

.flock-item:hover {
    border-color: var(--sage);
}

.flock-thumb {
    display: block;
    line-height: 0;
}

.flock-thumb-frame {
    display: block;
    aspect-ratio: var(--feat-ratio);
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: var(--sage-mist);
}

.flock-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flock-title {
    margin: 0 0 8px;
    font-size: 1.28rem;
}

.flock-title a {
    color: var(--ink);
    text-decoration: none;
}

.flock-title a:hover {
    color: var(--terra-deep);
}

.flock-meta {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.flock-meta time {
    white-space: nowrap;
}

.flock-cats a {
    color: var(--sage-ink);
    text-decoration: none;
}

.flock-cats a:hover {
    text-decoration: underline;
}

.flock-excerpt {
    font-size: 0.94rem;
    color: var(--ink-soft);
}

.flock-excerpt p {
    margin: 0;
}

.flock-more {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--terra-deep);
    text-decoration: none;
}

.flock-more:hover {
    color: var(--sage-ink);
    text-decoration: underline;
}

.flock-empty {
    padding: 40px 0;
    text-align: center;
}

.flock-empty .scratch-search {
    max-width: 480px;
    margin: 18px auto 0;
}

/* ==========================================================================
   8. Pagination
   ========================================================================== */

.roost-pages,
.peck-pages {
    margin-top: 28px;
}

.roost-pages ul,
.peck-pages ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 0.9rem;
    text-decoration: none;
}

.page-numbers:hover {
    border-color: var(--sage);
    color: var(--sage-ink);
}

.page-numbers.current {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
    font-weight: 600;
}

.page-numbers.dots {
    border: none;
    background: transparent;
    min-width: auto;
    padding: 0 4px;
}

/* ==========================================================================
   9. Sidebar
   ========================================================================== */

.meadow-side {
    font-size: 0.94rem;
}

.side-box {
    margin-bottom: 20px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.side-box-title {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--line);
    font-size: 1.02rem;
}

.side-box ul,
.side-box ol {
    margin: 0;
    padding-left: 20px;
}

.side-box li {
    margin: 7px 0;
}

.side-box li > ul {
    margin-top: 7px;
}

.side-box a {
    color: var(--ink);
    text-decoration: none;
}

.side-box a:hover {
    color: var(--sage-ink);
    text-decoration: underline;
}

.side-box select {
    max-width: 100%;
}

.side-post-list {
    list-style: none;
    padding-left: 0 !important;
}

.side-post-list li {
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--line);
}

.side-post-list li:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.side-post-list a {
    display: block;
    font-weight: 600;
}

.side-post-list time {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 2px;
}

/* ==========================================================================
   10. Single article (centered prose column)
   ========================================================================== */

.nest-article {
    max-width: 780px;
    margin: 0 auto;
}

.nest-article--page {
    max-width: 880px;
}

.nest-cats {
    margin: 0 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nest-cat {
    display: inline-block;
    padding: 4px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sage-ink);
    text-decoration: none;
}

.nest-cat:hover {
    border-color: var(--sage);
    background: var(--sage-mist);
}

.nest-title {
    margin: 0 0 14px;
    font-size: clamp(1.5rem, 5.5vw, 2.05rem);
    line-height: 1.18;
}

.nest-meta {
    margin: 0 0 24px;
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.nest-meta a {
    color: var(--sage-ink);
    text-decoration: none;
}

.nest-meta a:hover {
    text-decoration: underline;
}

.nest-feat {
    margin: 0 0 28px;
}

.nest-feat-frame {
    display: block;
    aspect-ratio: var(--feat-ratio);
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--sage-mist);
}

.nest-feat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nest-toc {
    margin: 0 0 30px;
    padding: 18px 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--sage);
    border-radius: var(--radius);
}

.nest-toc-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage-ink);
}

.nest-toc-list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.92rem;
}

.nest-toc-item {
    margin: 6px 0;
}

.nest-toc-item--h3 {
    margin-left: 18px;
    font-size: 0.88rem;
}

.nest-toc-item a {
    color: var(--ink-soft);
    text-decoration: none;
}

.nest-toc-item a:hover {
    color: var(--terra-deep);
    text-decoration: underline;
}

.nest-content {
    font-size: 1.03rem;
    line-height: 1.75;
}

.nest-content p,
.nest-content ul,
.nest-content ol,
.nest-content blockquote,
.nest-content table,
.nest-content figure {
    margin: 0 0 1.3em;
}

.nest-content h2 {
    margin: 1.9em 0 0.7em;
    font-size: 1.55rem;
    scroll-margin-top: 96px;
}

.nest-content h3 {
    margin: 1.7em 0 0.6em;
    font-size: 1.25rem;
    scroll-margin-top: 96px;
}

.nest-content h4 {
    margin: 1.5em 0 0.5em;
    font-size: 1.1rem;
}

.nest-content a {
    color: var(--terra-deep);
    text-decoration: underline;
}

.nest-content a:hover {
    color: var(--sage-ink);
}

.nest-content blockquote {
    padding: 16px 22px;
    background: var(--paper);
    border-left: 3px solid var(--terra);
    border-radius: var(--radius);
    font-family: var(--serif);
    font-size: 1.08rem;
    color: var(--ink);
}

.nest-content blockquote p:last-child {
    margin-bottom: 0;
}

.nest-content code {
    background: var(--sage-mist);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9em;
}

.nest-content pre {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 0.9rem;
}

.nest-content pre code {
    background: none;
    padding: 0;
}

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

.nest-content th,
.nest-content td {
    padding: 10px 12px;
    border: 1px solid var(--line);
    text-align: left;
}

.nest-content th {
    background: var(--sage-mist);
    font-family: var(--serif);
}

.nest-content .wp-caption,
.nest-content figcaption {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-top: 6px;
}

.nest-note {
    margin: 30px 0 0;
    padding: 4px 0 4px 14px;
    border-left: 3px solid var(--terra);
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.nest-tags {
    margin: 26px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nest-tag {
    display: inline-block;
    padding: 5px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 0.82rem;
    color: var(--sage-ink);
    text-decoration: none;
}

.nest-tag:hover {
    border-color: var(--sage);
    background: var(--sage-mist);
}

.keeper-bio {
    margin: 34px 0 0;
    padding: 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.keeper-avatar {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.keeper-label {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--terra-deep);
}

.keeper-name {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.keeper-text {
    margin: 0;
    font-size: 0.92rem;
    color: var(--ink-soft);
}

/* Related posts */

.kin-related {
    max-width: 780px;
    margin: 40px auto 0;
    padding-top: 28px;
    border-top: 1px dashed var(--line);
}

.kin-title {
    margin: 0 0 18px;
    font-size: 1.3rem;
}

.kin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.kin-card {
    display: block;
    padding: 14px 16px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    transition: border-color 0.18s ease;
}

.kin-card:hover {
    border-color: var(--sage);
}

.kin-thumb {
    display: block;
    aspect-ratio: var(--feat-ratio);
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    background: var(--sage-mist);
    margin-bottom: 10px;
    line-height: 0;
}

.kin-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kin-name {
    display: block;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
}

.kin-card:hover .kin-name {
    color: var(--terra-deep);
}

.kin-date {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

/* ==========================================================================
   11. Archive headers
   ========================================================================== */

.archive-head {
    margin-bottom: 26px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--line);
}

.archive-title {
    margin: 0 0 10px;
    font-size: clamp(1.4rem, 5vw, 1.9rem);
}

.archive-desc {
    color: var(--ink-soft);
    font-size: 0.96rem;
}

.archive-desc p {
    margin: 0 0 0.6em;
}

/* ==========================================================================
   12. Comments
   ========================================================================== */

.peck-comments {
    max-width: 780px;
    margin: 46px auto 0;
    padding-top: 30px;
    border-top: 1px solid var(--line);
}

.nest-article--page + .peck-comments,
.yard-main--wide .peck-comments {
    max-width: 880px;
}

.peck-count {
    margin: 0 0 22px;
    font-size: 1.25rem;
}

.peck-list {
    list-style: none;
    margin: 0 0 26px;
    padding: 0;
}

.peck-list .children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
    border-left: 2px dashed var(--line);
}

.peck-item {
    margin-bottom: 18px;
}

.peck-card {
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.peck-head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
}

.peck-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.peck-name {
    display: block;
    font-family: var(--serif);
    font-style: normal;
    font-weight: 700;
    font-size: 1rem;
}

.peck-name a {
    color: var(--ink);
    text-decoration: none;
}

.peck-name a:hover {
    color: var(--terra-deep);
}

.peck-when {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    text-decoration: none;
}

.peck-when:hover {
    color: var(--sage-ink);
}

.peck-text {
    font-size: 0.95rem;
}

.peck-text p {
    margin: 0 0 0.9em;
}

.peck-text p:last-child {
    margin-bottom: 0;
}

.peck-wait {
    margin: 12px 0 0;
    font-size: 0.84rem;
    color: var(--terra-deep);
}

.peck-actions {
    margin-top: 12px;
    display: flex;
    gap: 16px;
    font-size: 0.84rem;
}

.peck-actions a {
    color: var(--sage-ink);
    font-weight: 600;
    text-decoration: none;
}

.peck-actions a:hover {
    text-decoration: underline;
}

.peck-ping {
    margin-bottom: 10px;
}

.peck-ping-text {
    margin: 0;
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.peck-closed {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.peck-reply-title {
    margin: 0 0 14px;
    font-size: 1.25rem;
}

.peck-hint {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.peck-form .peck-field {
    margin: 0 0 16px;
}

.peck-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.peck-req {
    color: var(--terra-deep);
}

.peck-field--cookies {
    display: flex;
    align-items: center;
    gap: 10px;
}

.peck-field--cookies input {
    width: auto !important;
}

.peck-field--cookies label {
    margin-bottom: 0;
    font-weight: 400;
}

#cancel-comment-reply-link {
    font-size: 0.85rem;
    margin-left: 12px;
}

/* ==========================================================================
   13. Forms & buttons
   ========================================================================== */

.scratch-search {
    display: flex;
    gap: 10px;
    width: 100%;
}

.scratch-label {
    margin: 0;
}

.scratch-field {
    flex: 1 1 auto;
    min-width: 0;
}

.scratch-field,
.peck-field input[type="text"],
.peck-field input[type="email"],
.peck-field input[type="url"],
.peck-field textarea {
    width: 100%;
    padding: 11px 14px;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
}

.scratch-field:focus,
.peck-field input:focus,
.peck-field textarea:focus {
    outline: 2px solid var(--sage);
    outline-offset: 1px;
    border-color: var(--sage);
}

.yolk-btn,
.scratch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    background: var(--sage);
    border: 1px solid var(--sage);
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.yolk-btn:hover,
.scratch-btn:hover {
    background: var(--sage-ink);
    border-color: var(--sage-ink);
    color: #fff;
}

.peck-form .submit {
    margin-bottom: 0;
}

/* ==========================================================================
   14. 404 / empty state
   ========================================================================== */

.empty-coop {
    text-align: center;
    padding: 40px 0 20px;
}

.empty-coop-code {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(3rem, 14vw, 4.5rem);
    line-height: 1;
    color: var(--terra);
}

.empty-coop-title {
    margin: 10px 0 12px;
    font-size: clamp(1.5rem, 6vw, 2rem);
}

.empty-coop-text {
    max-width: 46ch;
    margin: 0 auto;
    color: var(--ink-soft);
}

.empty-coop-search {
    max-width: 480px;
    margin: 24px auto 0;
}

.empty-coop-home {
    margin-top: 22px;
}

/* ==========================================================================
   15. Footer — multi-column grid, deep sage
   ========================================================================== */

.barn-foot {
    background: #3f4a35;
    color: #e9e2cf;
    border-top: 4px solid var(--terra);
    font-size: 0.92rem;
}

.barn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 28px 36px;
    padding: 42px 0 30px;
}

.barn-brand {
    flex: 0 0 100%;
}

.barn-name {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: #f4efe0;
    text-decoration: none;
}

.barn-name:hover {
    color: #fff;
}

.barn-brand .custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.barn-brand .custom-logo {
    max-height: 48px;
    width: auto;
}

.barn-col {
    flex: 0 0 100%;
}

.barn-col-title {
    margin: 4px 0 14px;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b9c4a4;
}

.barn-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.barn-links li {
    margin: 9px 0;
}

.barn-links a {
    color: #e9e2cf;
    text-decoration: none;
}

.barn-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.barn-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 26px;
    justify-content: space-between;
    padding: 18px 0 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.84rem;
    color: #cfc8b0;
}

.barn-copy,
.barn-note {
    margin: 0;
}

/* ==========================================================================
   16. Responsive — larger screens
   ========================================================================== */

@media (min-width: 640px) {
    .meadow-hero-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kin-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .meadow-hero-hen {
        display: block;
        width: 104px;
        height: 104px;
    }

    .barn-col {
        flex: 0 0 calc(50% - 18px);
    }
}

@media (min-width: 960px) {
    .roost-nav-toggle {
        display: none;
    }

    .perch-nav {
        display: block;
    }

    .perch-menu {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0;
    }

    .perch-menu li {
        position: relative;
    }

    .perch-menu a {
        padding: 15px 15px;
        border-radius: 0;
    }

    .perch-menu a:hover {
        background: transparent;
    }

    .perch-menu .menu-item-has-children {
        display: list-item;
    }

    .perch-menu .menu-item-has-children > a::after {
        content: "";
        display: inline-block;
        width: 7px;
        height: 7px;
        margin-left: 9px;
        border-right: 1.6px solid currentColor;
        border-bottom: 1.6px solid currentColor;
        transform: rotate(45deg) translateY(-2px);
    }

    .brood-toggle {
        display: none;
    }

    .perch-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 60;
        min-width: 250px;
        padding: 8px;
        background: var(--paper);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    }

    .perch-menu .menu-item-has-children:hover > .sub-menu,
    .perch-menu .menu-item-has-children:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .perch-menu .sub-menu a {
        border-radius: calc(var(--radius) - 4px);
        padding: 10px 12px;
    }

    .perch-menu .sub-menu a:hover {
        background: var(--sage-mist);
    }

    .yard-shell {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 48px;
    }

    .meadow-hero-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .flock-item {
        grid-template-columns: 224px minmax(0, 1fr);
        gap: 22px;
        align-items: center;
        padding: 18px;
    }

    .kin-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .meadow-hero-hen {
        width: 120px;
        height: 120px;
    }

    .barn-brand {
        flex: 1.6 1 200px;
        min-width: 180px;
    }

    .barn-col {
        flex: 1 1 140px;
        min-width: 130px;
    }

    .peck-list .children {
        padding-left: 34px;
    }
}

/* ==========================================================================
   17. Motion preferences
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .perch-menu .sub-menu,
    .brood-toggle svg,
    .flock-item,
    .meadow-hero-card,
    .kin-card {
        transition: none;
    }
}
