/*
Theme Name: Meadow
Description: A warm, checklist-inspired classic theme with a right sidebar, card grids and grouped footer columns.
Author: Bayrak Kontrol
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: theme-text
*/

:root {
    --bg: #F8F9FA;
    --fg: #1D3557;
    --muted: #6B7A90;
    --border: #E3E8EF;
    --radius: 10px;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
    --accent: #E63946;
    --accent-dark: #C5283A;
    --surface: #FFFFFF;
    --sidebar-w: 280px;
    --card-gap: 20px;
    --media-ratio: 1200 / 675;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 17px;
    line-height: 1.75;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--fg);
    margin: 0 0 0.6em;
}

p {
    margin: 0 0 1.2em;
}

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

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

.qxwbr-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

.qxwbr-main {
    display: flex;
    gap: 40px;
    padding: 36px 0 56px;
    align-items: flex-start;
}

.qxwbr-content {
    flex: 1 1 auto;
    min-width: 0;
}

.qxwbr-sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
}

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

.qxwbr-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.qxwbr-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
}

.qxwbr-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

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

.qxwbr-flags {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
}

.qxwbr-flags span {
    display: block;
    width: 10px;
    border-radius: 2px 2px 0 0;
}

.qxwbr-flags span:nth-child(1) {
    height: 20px;
    background: var(--accent);
    transform: skewY(-4deg);
}

.qxwbr-flags span:nth-child(2) {
    height: 26px;
    background: var(--fg);
    transform: skewY(3deg);
}

.qxwbr-flags span:nth-child(3) {
    height: 20px;
    background: var(--accent);
    transform: skewY(-4deg);
}

.qxwbr-site-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--fg);
    white-space: nowrap;
}

.qxwbr-site-name:hover {
    color: var(--accent);
    text-decoration: none;
}

.qxwbr-header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qxwbr-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.qxwbr-icon-btn:hover {
    background: var(--accent);
    color: #fff;
}

.qxwbr-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qxwbr-nav-toggle {
    display: none;
}

/* Primary navigation */

.qxwbr-header-nav {
    border-top: 1px solid var(--border);
}

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

.qxwbr-nav > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qxwbr-nav li {
    position: relative;
}

.qxwbr-nav a {
    display: block;
    padding: 13px 16px;
    color: var(--fg);
    font-size: 15px;
    font-weight: 500;
}

@media (min-width: 861px) {
    .qxwbr-header-nav .qxwbr-nav a {
        white-space: nowrap;
    }
}

.qxwbr-nav a:hover {
    color: var(--accent);
    text-decoration: none;
}

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

.qxwbr-nav ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    z-index: 60;
}

.qxwbr-nav li:hover > ul,
.qxwbr-nav li:focus-within > ul,
.qxwbr-nav li.qxwbr-open > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qxwbr-nav ul ul a {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 400;
}

/* Search panel */

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

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

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

.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-field {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    color: var(--fg);
    background: var(--surface);
}

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

.search-submit {
    padding: 11px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-submit:hover {
    background: var(--accent-dark);
}

/* ---------- Hero (text-only, centered) ---------- */

.qxwbr-hero {
    text-align: center;
    padding: 64px 20px 48px;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.qxwbr-hero-flags {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 20px;
}

.qxwbr-hero-flags span {
    display: block;
    width: 14px;
    border-radius: 3px 3px 0 0;
}

.qxwbr-hero-flags span:nth-child(1) {
    height: 28px;
    background: var(--accent);
    transform: skewY(-5deg);
}

.qxwbr-hero-flags span:nth-child(2) {
    height: 38px;
    background: var(--fg);
    transform: skewY(4deg);
}

.qxwbr-hero-flags span:nth-child(3) {
    height: 28px;
    background: var(--accent);
    transform: skewY(-5deg);
}

.qxwbr-hero h1 {
    font-size: 38px;
    margin-bottom: 14px;
}

.qxwbr-hero p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 18px;
}

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

.breadcrumb {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
}

.breadcrumb .trail {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.breadcrumb .crumb {
    color: var(--muted);
}

.breadcrumb a.crumb:hover {
    color: var(--accent);
}

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

/* ---------- Card grid ---------- */

.qxwbr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--card-gap);
}

.qxwbr-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.qxwbr-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.qxwbr-card-media a {
    display: block;
}

.qxwbr-card-media img {
    width: 100%;
    aspect-ratio: var(--media-ratio);
    object-fit: cover;
}

.qxwbr-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

.qxwbr-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.qxwbr-card-meta .qxwbr-chip {
    background: rgba(230, 57, 70, 0.08);
    color: var(--accent);
    border-radius: 999px;
    padding: 2px 12px;
    font-weight: 600;
    font-size: 12px;
}

.qxwbr-card-title {
    font-size: 19px;
    margin: 0;
}

.qxwbr-card-title a {
    color: var(--fg);
}

.qxwbr-card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.qxwbr-card-excerpt {
    color: var(--muted);
    font-size: 15px;
    margin: 0;
}

.qxwbr-card-more {
    margin-top: auto;
}

.qxwbr-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

.qxwbr-btn:hover {
    background: var(--accent-dark);
    color: #fff;
    text-decoration: none;
}

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

.qxwbr-archive-head {
    margin-bottom: 28px;
}

.qxwbr-archive-head h1 {
    font-size: 30px;
}

.qxwbr-archive-head p {
    color: var(--muted);
    margin: 0;
}

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

.qxwbr-pagination {
    margin-top: 32px;
}

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

.qxwbr-pagination .page-numbers {
    display: inline-block;
    min-width: 40px;
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--fg);
    font-size: 14px;
}

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

.qxwbr-pagination a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

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

.qxwbr-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.qxwbr-post-title {
    font-size: 32px;
}

.qxwbr-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 24px;
}

.qxwbr-post-figure {
    margin: 0 0 24px;
}

.qxwbr-post-figure img {
    width: 100%;
    border-radius: var(--radius);
}

.qxwbr-note {
    background: rgba(230, 57, 70, 0.06);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin: 0 0 24px;
    font-size: 15px;
}

.qxwbr-note strong {
    color: var(--accent);
}

.qxwbr-entry {
    overflow-wrap: break-word;
}

.qxwbr-entry h2 {
    font-size: 24px;
    margin-top: 1.6em;
}

.qxwbr-entry h3 {
    font-size: 20px;
    margin-top: 1.4em;
}

.qxwbr-entry ul,
.qxwbr-entry ol {
    padding-left: 1.4em;
    margin: 0 0 1.2em;
}

.qxwbr-entry blockquote {
    margin: 0 0 1.2em;
    padding: 16px 20px;
    border-left: 4px solid var(--border);
    background: var(--bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--muted);
}

.qxwbr-table-scroll {
    overflow-x: auto;
    margin: 0 0 1.2em;
    -webkit-overflow-scrolling: touch;
}

.qxwbr-table-scroll table {
    border-collapse: collapse;
    width: 100%;
    min-width: 480px;
    font-size: 15px;
}

.qxwbr-table-scroll th,
.qxwbr-table-scroll td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.qxwbr-table-scroll th {
    background: var(--bg);
    font-weight: 600;
}

.qxwbr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 0;
}

.qxwbr-tags a {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
}

.qxwbr-tags a:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* Related posts (4 columns) */

.qxwbr-related {
    margin-top: 36px;
}

.qxwbr-related h2 {
    font-size: 22px;
}

.qxwbr-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--card-gap);
}

.qxwbr-related-grid .qxwbr-card-body {
    padding: 14px;
}

.qxwbr-related-grid .qxwbr-card-title {
    font-size: 15px;
}

.qxwbr-related-grid .qxwbr-card-meta {
    font-size: 12px;
}

/* Author bio */

.qxwbr-bio {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-top: 36px;
}

.qxwbr-bio img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.qxwbr-bio-name {
    font-weight: 700;
    margin: 0 0 4px;
}

.qxwbr-bio p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

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

.qxwbr-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: var(--card-gap);
}

.qxwbr-widget h2,
.qxwbr-widget h3 {
    font-size: 17px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    margin-bottom: 14px;
}

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

.qxwbr-widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.qxwbr-widget ul li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.qxwbr-widget ul li a {
    color: var(--fg);
}

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

.qxwbr-widget .qxwbr-recent-date {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

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

.qxwbr-comments {
    margin-top: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}

.qxwbr-comments h2 {
    font-size: 20px;
}

.qxwbr-comments ol.comment-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.qxwbr-comments ol.comment-list ol.children {
    list-style: none;
    padding-left: 28px;
}

.qxwbr-comments .comment-body {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.qxwbr-comments .comment-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
}

.qxwbr-comments .comment-reply-link {
    font-size: 13px;
    font-weight: 600;
}

.qxwbr-comments input[type="text"],
.qxwbr-comments input[type="email"],
.qxwbr-comments input[type="url"],
.qxwbr-comments textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    background: var(--surface);
    color: var(--fg);
}

.qxwbr-comments .submit {
    padding: 11px 26px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.qxwbr-comments .submit:hover {
    background: var(--accent-dark);
}

/* ---------- Page / 404 ---------- */

.qxwbr-page {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.qxwbr-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}

/* ---------- Footer (multi-column grid) ---------- */

.qxwbr-footer {
    background: var(--fg);
    color: #C9D4E3;
    margin-top: 48px;
}

.qxwbr-footer a {
    color: #C9D4E3;
}

.qxwbr-footer a:hover {
    color: #fff;
}

.qxwbr-footer-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 48px 0 32px;
}

.qxwbr-footer-group-title {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}

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

.qxwbr-footer ul li {
    margin-bottom: 8px;
    font-size: 14px;
}

.qxwbr-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 18px 0;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: #93A4BC;
}

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

@media (max-width: 1024px) {
    .qxwbr-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 860px) {
    .qxwbr-main {
        flex-direction: column;
    }

    .qxwbr-sidebar {
        width: 100%;
        flex: 1 1 auto;
    }

    .qxwbr-nav-toggle {
        display: inline-flex;
    }

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

    .qxwbr-header-nav.qxwbr-open {
        display: block;
    }

    .qxwbr-nav > ul {
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
    }

    .qxwbr-nav ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-radius: 0;
        padding: 0 0 0 18px;
        display: none;
    }

    .qxwbr-nav li.qxwbr-open > ul {
        display: block;
    }

    .qxwbr-hero h1 {
        font-size: 28px;
    }
}

@media (max-width: 640px) {
    .qxwbr-grid {
        grid-template-columns: 1fr;
    }

    .qxwbr-related-grid {
        grid-template-columns: 1fr;
    }

    .qxwbr-footer-cols {
        grid-template-columns: 1fr;
    }

    .qxwbr-post,
    .qxwbr-page,
    .qxwbr-comments {
        padding: 22px;
    }

    .qxwbr-post-title {
        font-size: 24px;
    }
}
