/*
Theme Name: Arabic Novel Hub
Theme URI: https://example.com/arabic-novel-hub
Author: Arabic Novel Hub
Author URI: https://example.com
Description: A production-ready, RTL-first WordPress theme for publishing and reading Arabic novels. Includes Novel and Chapter custom post types, a warm "library at night" palette, Tajawal and Amiri typography, ad slots, and a clean reading experience inspired by leading novel platforms.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.5
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: arabic-novel-hub
Tags: rtl-language-support, custom-post-types, translation-ready, threaded-comments, featured-images
*/

:root {
    --anh-bg: #14110f;
    --anh-surface: #1c1815;
    --anh-surface-2: #241e1a;
    --anh-border: #3a2f29;
    --anh-text: #f4ead9;
    --anh-muted: #b8a99a;
    --anh-accent: #8b1e3f;
    --anh-accent-hover: #a02649;
    --anh-gold: #d4a14a;
    --anh-radius: 10px;
    --anh-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --anh-font-sans: "Tajawal", "Segoe UI", system-ui, sans-serif;
    --anh-font-serif: "Amiri", "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--anh-bg);
    color: var(--anh-text);
    font-family: var(--anh-font-sans);
    font-size: 16px;
    line-height: 1.7;
    direction: rtl;
    text-align: right;
}

a { color: var(--anh-gold); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--anh-accent-hover); }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(20, 17, 15, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--anh-border);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: var(--anh-font-serif);
    font-size: 1.55rem;
    color: var(--anh-text);
    font-weight: 700;
}
.site-brand__mark {
    width: 36px; height: 36px; border-radius: 8px;
    background: linear-gradient(135deg, var(--anh-accent), #5c1129);
    display: grid; place-items: center;
    color: var(--anh-text); font-weight: 700;
}
.main-nav ul { list-style: none; display: flex; gap: 1.25rem; padding: 0; margin: 0; }
.main-nav a { color: var(--anh-muted); font-weight: 500; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--anh-text); }
.search-form {
    display: flex; gap: .5rem;
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: var(--anh-radius);
    padding: .35rem .6rem;
}
.search-form input {
    background: transparent; border: 0; color: var(--anh-text);
    font-family: inherit; outline: none; min-width: 160px;
}
.search-form button {
    background: var(--anh-accent); color: var(--anh-text);
    border: 0; padding: .35rem .8rem; border-radius: 6px;
    font-family: inherit; cursor: pointer;
}
.search-form button:hover { background: var(--anh-accent-hover); }

/* Hero */
.hero {
    background:
        radial-gradient(1200px 400px at 80% -100px, rgba(139,30,63,.35), transparent 60%),
        linear-gradient(180deg, #1d1612 0%, #14110f 100%);
    border-bottom: 1px solid var(--anh-border);
}
.hero__inner { padding: 3.5rem 0 2.5rem; text-align: center; }
.hero h1 {
    font-family: var(--anh-font-serif);
    font-size: clamp(2rem, 4vw, 3.25rem);
    margin: 0 0 .75rem;
}
.hero p { color: var(--anh-muted); margin: 0 auto; max-width: 640px; }

/* Sections */
.section { padding: 2.25rem 0; }
.section__head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 1.25rem;
}
.section__title {
    font-family: var(--anh-font-serif);
    font-size: 1.5rem; margin: 0;
    border-right: 4px solid var(--anh-accent);
    padding-right: .65rem;
}
.section__more { color: var(--anh-muted); font-size: .9rem; }

/* Novel grid */
.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1.25rem;
}
.novel-card {
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: var(--anh-radius);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}
.novel-card:hover { transform: translateY(-3px); border-color: var(--anh-accent); }
.novel-card__cover { aspect-ratio: 2/3; background: var(--anh-surface-2); overflow: hidden; }
.novel-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.novel-card__body { padding: .75rem .85rem 1rem; }
.novel-card__title {
    font-family: var(--anh-font-serif);
    font-size: 1.05rem; margin: 0 0 .2rem;
    color: var(--anh-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.novel-card__meta { color: var(--anh-muted); font-size: .82rem; }

/* Single novel */
.novel-hero {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.75rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--anh-border);
}
.novel-hero__cover {
    border-radius: var(--anh-radius);
    overflow: hidden;
    box-shadow: var(--anh-shadow);
    aspect-ratio: 2/3;
    background: var(--anh-surface-2);
}
.novel-hero__title {
    font-family: var(--anh-font-serif);
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    margin: 0 0 .5rem;
}
.novel-hero__meta { color: var(--anh-muted); display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1rem; }
.novel-hero__meta span { display: inline-flex; align-items: center; gap: .35rem; }
.badge {
    display: inline-block;
    background: var(--anh-surface-2);
    border: 1px solid var(--anh-border);
    border-radius: 999px;
    padding: .15rem .65rem;
    font-size: .8rem;
    color: var(--anh-muted);
    margin-inline-start: .25rem;
}
.btn {
    display: inline-block;
    background: var(--anh-accent); color: var(--anh-text);
    padding: .65rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    border: 0; cursor: pointer;
    font-family: inherit;
}
.btn:hover { background: var(--anh-accent-hover); color: var(--anh-text); }
.btn--ghost {
    background: transparent;
    border: 1px solid var(--anh-border);
    color: var(--anh-text);
}
.btn--ghost:hover { border-color: var(--anh-accent); }

.chapters { padding: 2rem 0; }
.chapters__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.chapters__list li {
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: 8px;
}
.chapters__list a {
    display: flex; justify-content: space-between; align-items: center;
    padding: .85rem 1rem; color: var(--anh-text);
}
.chapters__list a:hover { background: var(--anh-surface-2); }

/* Reader */
.reader {
    max-width: 760px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.reader__title {
    font-family: var(--anh-font-serif);
    font-size: 1.75rem;
    margin: 0 0 .25rem;
}
.reader__meta { color: var(--anh-muted); margin-bottom: 1.5rem; }
.reader__content {
    font-family: var(--anh-font-serif);
    font-size: 1.15rem;
    line-height: 2;
    color: var(--anh-text);
}
.reader__content p { margin: 0 0 1.1rem; }
.reader-controls {
    position: sticky; bottom: 1rem;
    display: flex; gap: .5rem; justify-content: center;
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: 999px;
    padding: .4rem .6rem;
    width: fit-content; margin: 1.5rem auto;
    box-shadow: var(--anh-shadow);
}
.reader-controls button {
    background: transparent; color: var(--anh-text);
    border: 0; padding: .35rem .7rem; border-radius: 999px;
    cursor: pointer; font-family: inherit;
}
.reader-controls button:hover { background: var(--anh-surface-2); }
.reader-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; }

/* Reading progress */
#anh-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; background: transparent; z-index: 100;
}
#anh-progress > span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--anh-accent), var(--anh-gold));
    width: 0%;
}

/* Ad slots */
.ad-slot {
    background: var(--anh-surface);
    border: 1px dashed var(--anh-border);
    color: var(--anh-muted);
    text-align: center;
    padding: 1rem;
    margin: 1.25rem 0;
    border-radius: var(--anh-radius);
    font-size: .85rem;
}
.ad-slot--sticky-mobile {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 40;
    border-radius: 0;
    border-left: 0; border-right: 0; border-bottom: 0;
    background: rgba(28, 24, 21, 0.95);
}

/* Footer */
.site-footer {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--anh-border);
    color: var(--anh-muted);
    text-align: center;
}

/* Pagination */
.pagination { display: flex; gap: .35rem; justify-content: center; margin: 2rem 0; }
.pagination a, .pagination span {
    padding: .45rem .8rem;
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: 6px;
    color: var(--anh-text);
}
.pagination .current { background: var(--anh-accent); border-color: var(--anh-accent); }

/* Mobile */
@media (max-width: 768px) {
    .site-header__inner { flex-wrap: wrap; }
    .main-nav { order: 3; flex-basis: 100%; }
    .main-nav ul { flex-wrap: wrap; gap: .5rem 1rem; justify-content: center; }
    .main-nav a { font-size: .95rem; }
    .novel-hero { grid-template-columns: 140px 1fr; gap: 1rem; }
    body { padding-bottom: 60px; }
}

/* ---------- Sidebar layout ---------- */
.anh-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2rem;
    margin: 1.5rem auto;
}
.anh-layout__main { min-width: 0; }
.anh-layout__aside .widget {
    background: var(--anh-surface);
    border: 1px solid var(--anh-border);
    border-radius: var(--anh-radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.widget__title {
    font-family: var(--anh-font-serif);
    font-size: 1.1rem; margin: 0 0 .65rem;
    color: var(--anh-text);
    border-right: 3px solid var(--anh-accent);
    padding-right: .5rem;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: .35rem 0; border-bottom: 1px dashed var(--anh-border); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--anh-text); }
.widget a:hover { color: var(--anh-gold); }

/* ---------- Breadcrumbs ---------- */
.anh-breadcrumbs { margin: 1rem 0 .5rem; font-size: .88rem; color: var(--anh-muted); }
.anh-breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.anh-breadcrumbs a { color: var(--anh-muted); }
.anh-breadcrumbs a:hover { color: var(--anh-gold); }
.anh-breadcrumbs__sep { opacity: .5; }

/* ---------- Standard post / archive ---------- */
.anh-post { background: var(--anh-surface); border: 1px solid var(--anh-border); border-radius: var(--anh-radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.anh-post__head { margin-bottom: 1rem; }
.anh-post__thumb { margin: 0 0 1.25rem; border-radius: var(--anh-radius); overflow: hidden; }
.anh-post__tags { margin-top: 1.25rem; }
.anh-post-list { display: grid; gap: 1rem; }
.anh-post-card { display: grid; grid-template-columns: 160px 1fr; gap: 1rem; background: var(--anh-surface); border: 1px solid var(--anh-border); border-radius: var(--anh-radius); padding: 1rem; }
.anh-post-card__thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; background: var(--anh-surface-2); }
.anh-post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.anh-post-card__body p { color: var(--anh-muted); font-size: .95rem; margin: .35rem 0 .85rem; }

/* ---------- Comments ---------- */
.anh-comments { margin-top: 2rem; }
.anh-comments__list { list-style: none; padding: 0; }
.anh-comments .comment-body { background: var(--anh-surface); border: 1px solid var(--anh-border); border-radius: var(--anh-radius); padding: 1rem; margin-bottom: .75rem; }
.anh-comments textarea, .anh-comments input[type="text"], .anh-comments input[type="email"], .anh-comments input[type="url"] {
    width: 100%; background: var(--anh-surface-2); color: var(--anh-text);
    border: 1px solid var(--anh-border); border-radius: 8px; padding: .55rem .7rem; font-family: inherit;
}
.anh-comments .submit { background: var(--anh-accent); color: var(--anh-text); border: 0; padding: .65rem 1.25rem; border-radius: 8px; cursor: pointer; font-family: inherit; }

/* ---------- Footer widgets ---------- */
.site-footer__widgets {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem; text-align: right; margin-bottom: 1.5rem;
}
.site-footer__nav ul { list-style: none; display: flex; gap: 1rem; padding: 0; justify-content: center; flex-wrap: wrap; margin-bottom: .75rem; }
.site-footer__nav a { color: var(--anh-muted); }

/* ---------- EPUB-imported content normalization ---------- */
.reader__content .eip-nav,
.reader__content [style*="background:#f5f5f5"] {
    background: var(--anh-surface) !important;
    border-radius: var(--anh-radius) !important;
    border: 1px solid var(--anh-border);
    padding: .75rem !important;
    margin: 1.25rem 0 !important;
}
.reader__content .eip-nav a,
.reader__content [style*="background:#0073aa"] {
    background: var(--anh-accent) !important;
    color: var(--anh-text) !important;
    border-radius: 6px !important;
    padding: .5rem 1rem !important;
}
.reader__content img { border-radius: 8px; margin: 1rem auto; }
.reader__content h1, .reader__content h2, .reader__content h3 {
    font-family: var(--anh-font-serif); color: var(--anh-text);
}
.reader__content blockquote {
    border-right: 3px solid var(--anh-accent);
    padding: .5rem 1rem;
    background: var(--anh-surface-2);
    border-radius: 6px;
    color: var(--anh-muted);
    margin: 1rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .anh-layout { grid-template-columns: 1fr; }
    .anh-layout__aside { order: 2; }
}
@media (max-width: 600px) {
    .container { padding: 0 .75rem; }
    .site-header__inner { flex-wrap: wrap; gap: .5rem; }
    .search-form input { min-width: 0; flex: 1; }
    .novel-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
    .novel-card__title { font-size: .95rem; }
    .novel-hero { grid-template-columns: 110px 1fr; gap: .85rem; padding: 1.25rem 0; }
    .novel-hero__title { font-size: 1.4rem; }
    .anh-post-card { grid-template-columns: 100px 1fr; }
    .reader { padding: 0 .85rem; }
    .reader__content { font-size: 1.05rem; line-height: 1.95; }
    .reader-controls { width: calc(100% - 1.5rem); justify-content: space-around; }
    .hero__inner { padding: 2rem 0 1.5rem; }
}

/* ---------- Novel hub additions ---------- */
.novel-hero__terms { margin: .5rem 0 1rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.novel-hero__actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.novel-hero__synopsis { margin-top: 1.25rem; font-size: 1rem; color: var(--anh-text); line-height: 1.85; }

.section__sub { color: var(--anh-muted); margin: .25rem 0 1rem; font-size: .92rem; }

.chapters__list { list-style: none; padding: 0; counter-reset: chapter; }
.chapters__list li { margin: 0; }
.chapters__list a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .75rem;
    align-items: center;
    padding: .65rem .85rem;
    border-bottom: 1px dashed var(--anh-border);
    color: var(--anh-text);
    transition: background .15s ease;
}
.chapters__list a:hover { background: var(--anh-surface-2); color: var(--anh-gold); }
.chapters__num { color: var(--anh-gold); font-weight: 600; min-width: 5rem; }
.chapters__name { color: inherit; }
.chapters__date { color: var(--anh-muted); font-size: .85rem; }

.novel-tags { margin: 1.5rem 0; display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.novel-tags .section__title { margin: 0 .5rem 0 0; font-size: 1rem; }

.reader__head { margin-bottom: 1.25rem; }
.reader__novel-link {
    display: inline-flex; align-items: center; gap: .35rem;
    color: var(--anh-gold); font-weight: 600; text-decoration: none;
    background: var(--anh-surface); border: 1px solid var(--anh-border);
    padding: .4rem .75rem; border-radius: 8px;
}
.reader__novel-link:hover { background: var(--anh-surface-2); }
.reader__num { color: var(--anh-gold); font-weight: 700; margin-inline-end: .35rem; }

.reader-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; margin: 1.5rem 0; }
.reader-nav .btn:last-child { justify-self: end; }
.reader-nav .btn:first-child { justify-self: start; }

@media (max-width: 600px) {
    .chapters__list a { grid-template-columns: 1fr; gap: .15rem; padding: .65rem .5rem; }
    .chapters__date { font-size: .8rem; }
    .reader-nav { grid-template-columns: 1fr; }
    .reader-nav .btn { width: 100%; text-align: center; justify-self: stretch !important; }
}

/* =============================================================
   v1.4 — Light-mode default, blog grid, author archive, footer
   ============================================================= */

/* ---- Light skin: full variable override (default) ---- */
body.anh-light {
    --anh-bg:        #f7f1e6;
    --anh-surface:   #ffffff;
    --anh-surface-2: #f1e9d9;
    --anh-border:    #d8cab0;
    --anh-text:      #1f1813;
    --anh-muted:     #6b5d4a;
    --anh-accent:    #6e2a32;
    --anh-gold:      #8a5a1b;
    color: var(--anh-text);
    background: var(--anh-bg);
}
body.anh-light .site-header { background: rgba(255,255,255,.95); border-bottom-color: var(--anh-border); }
body.anh-light .site-brand,
body.anh-light .reader__title,
body.anh-light .novel-hero__title,
body.anh-light .section__title,
body.anh-light .widget__title { color: var(--anh-text); }
body.anh-light .reader__content { color: var(--anh-text); }
body.anh-light a { color: var(--anh-accent); }
body.anh-light a:hover { color: var(--anh-gold); }
body.anh-light .badge { background: var(--anh-surface-2); color: var(--anh-text); border: 1px solid var(--anh-border); }
body.anh-light .btn { color: #fff; }
body.anh-light .btn--ghost { color: var(--anh-accent); }
body.anh-light .reader__novel-link { background: var(--anh-surface); color: var(--anh-accent); border-color: var(--anh-border); }

/* Smooth transition between themes */
body, body * { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

/* ---- Novel card — title + author always visible ---- */
.novel-card { display: flex; flex-direction: column; }
.novel-card__cover { position: relative; }
.novel-card__status {
    position: absolute; top: .5rem; left: .5rem;
    font-size: .72rem; padding: .2rem .5rem;
    background: rgba(0,0,0,.65); color: #fff; border-radius: 6px;
}
.novel-card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.novel-card__title a { color: inherit; text-decoration: none; }
.novel-card__author { margin: .15rem 0 .35rem; font-size: .85rem; color: var(--anh-muted); }
.novel-card__author a { color: inherit; text-decoration: none; }
.novel-card__author a:hover { color: var(--anh-gold); }

/* ---- Blog grid (home.php) ---- */
.blog-cats { display: flex; gap: .35rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.blog-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.blog-card {
    background: var(--anh-surface); border: 1px solid var(--anh-border);
    border-radius: var(--anh-radius); overflow: hidden;
    display: flex; flex-direction: column;
}
.blog-card__cover { display: block; aspect-ratio: 16/9; background: var(--anh-surface-2); }
.blog-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.blog-card__body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.blog-card__title { font-family: var(--anh-font-serif); font-size: 1.15rem; margin: 0; }
.blog-card__title a { color: var(--anh-text); text-decoration: none; }
.blog-card__title a:hover { color: var(--anh-gold); }
.blog-card__meta { color: var(--anh-muted); font-size: .85rem; display: flex; gap: .35rem; }
.blog-card__excerpt { color: var(--anh-muted); margin: 0; font-size: .95rem; line-height: 1.7; }
.btn--sm { padding: .35rem .75rem; font-size: .85rem; align-self: flex-start; }

/* ---- Footer love line ---- */
.site-footer__copy { margin: 0 0 .25rem; }
.site-footer__love {
    margin: 0; padding: .65rem 0 0;
    border-top: 1px dashed var(--anh-border);
    color: var(--anh-gold);
    font-family: var(--anh-font-serif);
    font-size: .95rem;
    letter-spacing: .3px;
}

/* =============================================================
   v1.6 — Sidebar removed; full-width content; light-mode polish
   ============================================================= */

/* Full-width single/archive/page templates (no sidebar) */
.anh-layout {
    display: block;
    max-width: 980px;
    margin-inline: auto;
}
.anh-layout__main { width: 100%; max-width: 100%; }
.anh-layout__aside { display: none; }

/* Tighter, professional homepage section spacing */
.section { margin: 2rem 0 2.5rem; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section__more { color: var(--anh-accent); text-decoration: none; font-weight: 600; }
.section__more:hover { color: var(--anh-gold); }

/* Light-mode: stronger button + control contrast */
body.anh-light .btn,
body.anh-light .search-form button,
body.anh-light .pagination .page-numbers.current {
    background: var(--anh-accent);
    color: #fff;
    border-color: var(--anh-accent);
    box-shadow: 0 2px 6px rgba(110,42,50,.25);
}
body.anh-light .btn:hover,
body.anh-light .search-form button:hover {
    background: #531e25;
    border-color: #531e25;
    color: #fff;
}
body.anh-light .btn--ghost {
    background: transparent;
    color: var(--anh-accent);
    border: 1px solid var(--anh-accent);
    box-shadow: none;
}
body.anh-light .btn--ghost:hover {
    background: var(--anh-accent);
    color: #fff;
}
body.anh-light .pagination .page-numbers {
    color: var(--anh-accent);
    border: 1px solid var(--anh-border);
    background: var(--anh-surface);
}
body.anh-light .pagination .page-numbers:hover { background: var(--anh-surface-2); }
body.anh-light .search-form input[type="search"] {
    background: #fff;
    color: var(--anh-text);
    border: 1px solid var(--anh-border);
}
body.anh-light .search-form input[type="search"]::placeholder { color: var(--anh-muted); }

/* Reader controls: contrast in light mode */
body.anh-light [data-anh-font],
body.anh-light [data-anh-theme],
body.anh-light [data-anh-autoscroll] {
    background: var(--anh-surface);
    color: var(--anh-accent);
    border: 1px solid var(--anh-border);
}
body.anh-light [data-anh-font]:hover,
body.anh-light [data-anh-theme]:hover,
body.anh-light [data-anh-autoscroll]:hover { background: var(--anh-surface-2); }

/* Main nav contrast */
body.anh-light .main-nav a { color: var(--anh-text); }
body.anh-light .main-nav a:hover { color: var(--anh-accent); }
body.anh-light .site-brand__mark { background: var(--anh-accent); color: #fff; }

/* Footer customizer-driven extras */
.site-footer__tagline { margin: .25rem 0 0; color: var(--anh-muted); font-size: .9rem; }
.site-footer__extra   { margin-top: .75rem; }

/* =====================================================
   Comments
   ===================================================== */
.anh-comments{margin:3rem 0 2rem;padding:1.75rem;background:var(--anh-card,#fff);border:1px solid var(--anh-border,#e8e0d2);border-radius:14px;}
.anh-dark .anh-comments{background:#1c1815;border-color:#3a302a;}
.anh-comments .section__title{margin:0 0 1.25rem;font-size:1.4rem;}
.anh-comments__list{list-style:none;padding:0;margin:0 0 1.5rem;}
.anh-comments__list .comment,.anh-comments__list .pingback{padding:1rem 0;border-bottom:1px solid var(--anh-border,#eee3cf);}
.anh-comments__list .children{list-style:none;padding-inline-start:1.5rem;margin-top:.75rem;border-inline-start:2px solid var(--anh-border,#eee3cf);}
.anh-comments__list .comment-author{display:flex;align-items:center;gap:.6rem;margin-bottom:.4rem;font-weight:600;}
.anh-comments__list .comment-author img.avatar{border-radius:50%;}
.anh-comments__list .comment-metadata{font-size:.82rem;opacity:.7;margin-bottom:.5rem;}
.anh-comments__list .comment-content p{margin:.4rem 0;line-height:1.8;}
.anh-comments__list .reply{margin-top:.4rem;}
.anh-comments__list .reply a{font-size:.85rem;color:var(--anh-accent,#a8743a);}
.comment-respond{margin-top:1.5rem;}
.comment-respond .comment-reply-title{font-size:1.15rem;margin:0 0 1rem;}
.comment-form p{margin:0 0 1rem;}
.comment-form label{display:block;font-weight:600;margin-bottom:.35rem;}
.comment-form input[type=text],.comment-form input[type=email],.comment-form input[type=url],.comment-form textarea{width:100%;padding:.65rem .8rem;border:1px solid var(--anh-border,#dfd3bb);border-radius:8px;background:var(--anh-bg,#fff);color:inherit;font:inherit;}
.anh-dark .comment-form input,.anh-dark .comment-form textarea{background:#14110f;border-color:#3a302a;color:#e9d9b8;}
.comment-form textarea{min-height:140px;resize:vertical;}
.comment-form .form-submit input[type=submit]{display:inline-block;padding:.7rem 1.4rem;background:var(--anh-accent,#a8743a);color:#fff;border:0;border-radius:999px;font-weight:600;cursor:pointer;}
.comment-form .form-submit input[type=submit]:hover{filter:brightness(.95);}
.comments-pagination{margin-top:1rem;display:flex;gap:.5rem;flex-wrap:wrap;}
.no-comments{opacity:.7;font-style:italic;}
@media (max-width:600px){
  .anh-comments{padding:1.1rem;}
  .anh-comments__list .children{padding-inline-start:.8rem;}
}
