/*
Theme Name: Meadowbrook
Theme URI: https://www.felinefile.com
Author: Mia Torres
Author URI: https://www.felinefile.com
Description: A warm serif theme with soft tinted surfaces, generous rounded corners, and gentle watercolor-inspired accents.
Version: 2.4.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meadowbrook
*/

:root {
    --bg: #faf5ec;
    --fg: #3a362e;
    --muted: #7d8c6f;
    --border: #e8ddcb;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(58, 54, 46, 0.07);
    --accent: #c68f94;
    --accent-deep: #a96e74;
    --sage-tint: #eef1e4;
    --rose-tint: #f8edec;
    --cream-deep: #f3ecdc;
    --surface: #fffdf8;
    --media-ratio: 16 / 9;
    --thumb-ratio: 4 / 3;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: Georgia, "Times New Roman", "Nimbus Roman", serif;
    font-size: 1.0625rem;
    line-height: 1.75;
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.3;
    color: var(--fg);
}

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

body {
    overflow-x: hidden;
}

.entry-title,
.hero-title,
.row-title,
.archive-title,
.related-title,
.entry-content,
.comment-content,
.search-summary h1 {
    overflow-wrap: break-word;
}

/* ---------- Header ---------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 20;
}

.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-title a {
    color: var(--fg);
    text-decoration: none;
}

.site-title a:hover,
.site-title a:focus {
    color: var(--accent-deep);
}

.custom-logo-link img {
    max-height: 56px;
    width: auto;
    display: block;
}

.primary-nav {
    flex: 1 1 auto;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    display: block;
    padding: 10px 14px;
    color: var(--fg);
    text-decoration: none;
    border-radius: calc(var(--radius) / 2);
    font-size: 0.98rem;
}

.primary-menu a:hover,
.primary-menu a:focus {
    background: var(--sage-tint);
    color: var(--fg);
}

.primary-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    box-shadow: var(--shadow);
    display: none;
    z-index: 30;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
    display: block;
}

.primary-menu .sub-menu a {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--fg);
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus {
    background: var(--rose-tint);
    border-color: var(--accent);
}

.icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#menu-toggle {
    display: none;
}

.search-panel {
    display: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.search-panel.is-open {
    display: block;
}

.search-panel-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 24px 22px;
}

/* ---------- Search form ---------- */

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 12px 18px;
    font: inherit;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.search-field:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.search-submit {
    padding: 12px 26px;
    font: inherit;
    color: var(--surface);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.search-submit:hover,
.search-submit:focus {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
}

/* ---------- Layout ---------- */

.site-body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 24px 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: start;
}

.no-sidebar .site-body {
    grid-template-columns: minmax(0, 1fr);
    max-width: 820px;
}

.site-main {
    min-width: 0;
}

/* ---------- Breadcrumb ---------- */

.breadcrumb {
    margin: 0 0 28px;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.breadcrumb .trail {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb .trail:hover,
.breadcrumb .trail:focus {
    color: var(--accent-deep);
    text-decoration: underline;
}

.crumb-sep {
    color: var(--border);
}

.crumb.is-current {
    color: var(--fg);
}

/* ---------- Hero post ---------- */

.hero-post {
    margin: 0 0 40px;
    padding: 28px;
    background: var(--rose-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 28px;
    align-items: center;
}

.hero-media {
    display: block;
    border-radius: calc(var(--radius) - 6px);
}

.hero-image {
    display: block;
    width: 100%;
    aspect-ratio: var(--thumb-ratio);
    object-fit: cover;
    border-radius: calc(var(--radius) - 6px);
}

.hero-title {
    margin: 0 0 10px;
    font-size: 1.9rem;
}

.hero-title a,
.row-title a {
    color: var(--fg);
    text-decoration: none;
}

.hero-title a:hover,
.hero-title a:focus,
.row-title a:hover,
.row-title a:focus {
    color: var(--accent-deep);
}

.post-date {
    margin: 0 0 12px;
    font-size: 0.88rem;
    color: var(--muted);
}

.hero-excerpt p,
.row-excerpt p {
    margin: 0 0 14px;
}

.read-more {
    display: inline-block;
    padding: 9px 22px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--accent-deep);
    text-decoration: none;
    font-size: 0.95rem;
}

.read-more:hover,
.read-more:focus {
    background: var(--accent);
    color: var(--surface);
}

/* ---------- Post rows ---------- */

.post-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin: 0 0 22px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.post-row:nth-child(even) {
    background: var(--sage-tint);
}

.row-media {
    flex: 0 0 210px;
    display: block;
}

.row-image {
    display: block;
    width: 100%;
    aspect-ratio: var(--thumb-ratio);
    object-fit: cover;
    border-radius: calc(var(--radius) - 6px);
}

.row-content {
    min-width: 0;
}

.row-title {
    margin: 0 0 6px;
    font-size: 1.3rem;
}

.row-excerpt {
    font-size: 0.98rem;
}

/* ---------- Archive headers ---------- */

.archive-header {
    margin: 0 0 32px;
    padding: 26px 30px;
    background: var(--sage-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.archive-title {
    margin: 0 0 8px;
    font-size: 2rem;
}

.archive-description p {
    margin: 0;
    color: var(--fg);
}

.search-summary {
    margin: 0 0 32px;
}

.search-summary h1 {
    margin: 0;
    font-size: 2rem;
}

/* ---------- Single post / page ---------- */

.single-post .entry-title,
.page-entry .entry-title,
.not-found-title {
    margin: 0 0 14px;
    font-size: 2.3rem;
}

.entry-meta {
    margin: 0 0 28px;
    font-size: 0.92rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.entry-meta a {
    color: var(--muted);
}

.entry-meta a:hover,
.entry-meta a:focus {
    color: var(--accent-deep);
}

.post-media {
    margin: 0 0 30px;
}

.post-image {
    display: block;
    width: 100%;
    aspect-ratio: var(--media-ratio);
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.entry-content {
    font-size: 1.08rem;
}

.entry-content > p:first-child {
    margin-top: 0;
}

.entry-content h2 {
    margin-top: 1.8em;
}

.entry-content img {
    border-radius: calc(var(--radius) - 4px);
}

.entry-content blockquote {
    margin: 1.6em 0;
    padding: 18px 26px;
    background: var(--rose-tint);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

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

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.6em 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: var(--surface);
}

.table-scroll table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.table-scroll th,
.table-scroll td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    overflow-wrap: normal;
    word-break: normal;
}

.table-scroll th {
    background: var(--sage-tint);
    font-weight: 700;
}

.table-scroll tr:last-child td {
    border-bottom: 0;
}

.article-note {
    margin: 34px 0 0;
    padding: 20px 26px;
    background: var(--cream-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.97rem;
}

.article-note p {
    margin: 0 0 0.8em;
}

.article-note p:last-child {
    margin-bottom: 0;
}

.post-tags {
    margin: 30px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tags a {
    display: inline-block;
    padding: 5px 16px;
    background: var(--sage-tint);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--fg);
    text-decoration: none;
    font-size: 0.88rem;
}

.post-tags a:hover,
.post-tags a:focus {
    background: var(--muted);
    color: var(--surface);
}

.author-bio {
    margin: 34px 0 0;
    padding: 24px 28px;
    background: var(--rose-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.author-avatar img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.author-name {
    margin: 0 0 6px;
    font-size: 1.1rem;
    font-weight: 700;
}

.author-description p {
    margin: 0;
    font-size: 0.96rem;
}

.related-posts {
    margin: 40px 0 0;
}

.related-heading {
    margin: 0 0 18px;
    font-size: 1.45rem;
}

.related-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.related-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}

.related-item .related-thumb {
    display: block;
    margin: 0 0 10px;
}

.related-item img {
    display: block;
    width: 100%;
    aspect-ratio: var(--media-ratio);
    object-fit: cover;
    border-radius: calc(var(--radius) - 8px);
}

.related-title {
    margin: 0 0 4px;
    font-size: 1rem;
    line-height: 1.4;
}

.related-title a {
    color: var(--fg);
    text-decoration: none;
}

.related-title a:hover,
.related-title a:focus {
    color: var(--accent-deep);
}

.related-date {
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Comments ---------- */

.comments-area {
    margin: 48px 0 0;
}

.comments-title,
.comment-reply-title {
    font-size: 1.45rem;
    margin: 0 0 22px;
}

.comment-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin: 18px 0 0;
    padding-left: 28px;
}

.comment-item {
    margin: 0 0 18px;
}

.comment-body {
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: baseline;
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.comment-author {
    font-weight: 700;
}

.comment-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.comment-awaiting {
    margin: 0 0 10px;
    padding: 8px 14px;
    background: var(--cream-deep);
    border-radius: calc(var(--radius) / 2);
    font-size: 0.9rem;
    font-style: italic;
}

.comment-content p {
    margin: 0 0 0.9em;
}

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

.comment-reply-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.9rem;
}

.comment-respond {
    padding: 26px 30px;
    background: var(--sage-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.comment-form label {
    display: block;
    margin: 0 0 6px;
    font-size: 0.95rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 16px;
    font: inherit;
    color: var(--fg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.comment-form .submit {
    padding: 12px 30px;
    font: inherit;
    color: var(--surface);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
}

.comment-form .submit:hover,
.comment-form .submit:focus {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
}

/* ---------- Sidebar ---------- */

.site-sidebar .widget {
    margin: 0 0 26px;
    padding: 24px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.site-sidebar .widget:nth-child(odd) {
    background: var(--sage-tint);
}

.widget-title {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget ul li {
    margin: 0 0 8px;
}

.widget ul li a {
    color: var(--fg);
    text-decoration: none;
}

.widget ul li a:hover,
.widget ul li a:focus {
    color: var(--accent-deep);
    text-decoration: underline;
}

.category-tree ul.children {
    margin: 6px 0 10px;
    padding-left: 20px;
    border-left: 2px solid var(--border);
}

.category-tree ul.children li {
    margin: 0 0 7px;
}

.category-tree ul.children a {
    font-size: 0.93rem;
    color: var(--muted);
}

.category-tree ul.children a:hover,
.category-tree ul.children a:focus {
    color: var(--accent-deep);
}

.widget .search-form {
    flex-direction: column;
}

.widget .search-form .search-field {
    flex: none;
    width: 100%;
}

.widget .search-form .search-submit {
    width: 100%;
}

/* Sidebar modules rendered by the theme use .widget / .widget-title */

/* ---------- Pagination ---------- */

.pagination {
    margin: 36px 0 0;
}

.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) / 2);
    color: var(--fg);
    text-decoration: none;
    font-size: 0.95rem;
}

.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--surface);
}

.pagination a.page-numbers:hover,
.pagination a.page-numbers:focus {
    background: var(--sage-tint);
}

/* ---------- 404 / no results ---------- */

.not-found {
    padding: 40px 36px;
    background: var(--rose-tint);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.not-found .search-form {
    max-width: 460px;
    margin: 24px auto 0;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--cream-deep);
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 44px 24px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 30px;
    margin: 0 0 34px;
}

.footer-heading {
    display: block;
    margin: 0 0 12px;
    font-weight: 700;
    font-size: 1.02rem;
}

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

.footer-links li {
    margin: 0 0 8px;
}

.footer-links a {
    color: var(--fg);
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-links a:hover,
.footer-links a:focus {
    color: var(--accent-deep);
    text-decoration: underline;
}

.footer-base {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--muted);
}

.footer-base p {
    margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 14px;
    }

    .header-actions {
        margin-left: auto;
    }

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

    .primary-nav {
        display: none;
        flex-basis: 100%;
        order: 5;
    }

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

    .primary-menu {
        flex-direction: column;
        padding: 6px 0 12px;
    }

    .primary-menu a {
        padding: 12px 14px;
    }

    .primary-menu .sub-menu {
        position: static;
        min-width: 0;
        border: 0;
        box-shadow: none;
        padding: 0 0 0 18px;
        background: transparent;
    }

    .primary-menu li:hover > .sub-menu,
    .primary-menu li:focus-within > .sub-menu {
        display: none;
    }

    .primary-menu li.sub-open > .sub-menu {
        display: block;
    }

    .site-body {
        grid-template-columns: minmax(0, 1fr);
        padding: 32px 20px 48px;
        gap: 36px;
    }

    .hero-post {
        grid-template-columns: minmax(0, 1fr);
        padding: 22px;
    }

    .post-row {
        flex-direction: column;
        gap: 16px;
    }

    .row-media {
        flex: none;
        width: 100%;
    }

    .single-post .entry-title,
    .page-entry .entry-title,
    .not-found-title {
        font-size: 1.8rem;
    }

    .archive-title,
    .search-summary h1 {
        font-size: 1.7rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .author-bio {
        flex-direction: column;
    }
}
