/* ================================================================
   Adab Friends — Main Stylesheet
   Literary Magazine Theme — Arabic RTL
   ================================================================ */

/* ----------------------------------------------------------------
   1. CSS Variables (Design Tokens)
   ---------------------------------------------------------------- */
:root {
    --primary:        #1B2A4A;
    --primary-dark:   #0f1a2e;
    --primary-light:  #263d6b;
    --secondary:      #8B1A1A;
    --secondary-light:#b52020;
    --accent:         #C9A84C;
    --accent-light:   #dfc06a;
    --bg:             #FAF8F3;
    --bg-dark:        #1B2A4A;
    --surface:        #FFFFFF;
    --surface-alt:    #F5F0E8;
    --text:           #2D2D2D;
    --text-muted:     #6B6B6B;
    --text-light:     #9CA3AF;
    --border:         #E5DDD0;
    --border-dark:    #C8B8A8;

    --font:           'Tajawal', 'Arial', sans-serif;
    --container:      1180px;
    --radius-sm:      4px;
    --radius-md:      8px;
    --radius-lg:      12px;
    --radius-xl:      20px;
    --radius-full:    9999px;
    --shadow-sm:      0 1px 4px rgba(0,0,0,.07);
    --shadow-md:      0 4px 16px rgba(0,0,0,.09);
    --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
    --transition:     0.2s ease;
    --header-height:  70px;
}

/* ----------------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
    direction: rtl;
    text-align: right;
}

a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--secondary-light); }

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

ul, ol { list-style: none; }

button { cursor: pointer; font-family: var(--font); }

input, textarea, select, button {
    font-family: var(--font);
    font-size: 1rem;
}

.adab-hidden { display: none !important; }

/* ----------------------------------------------------------------
   3. Layout
   ---------------------------------------------------------------- */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; padding: 40px 0; }

/* ----------------------------------------------------------------
   4. Typography
   ---------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1.25em; }
p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------
   5. Header
   ---------------------------------------------------------------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    height: var(--header-height);
    gap: 24px;
}

/* Branding */
.site-branding { flex-shrink: 0; }
.site-name-link { display: flex; flex-direction: column; }
.site-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    letter-spacing: -.5px;
}
.site-name:hover { color: var(--secondary); }
.site-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 1px;
}

/* Navigation */
.main-navigation { flex: 1; }
.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}
.nav-menu li { position: relative; }
.nav-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition);
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current-menu-ancestor > a {
    color: var(--secondary);
    background: rgba(139, 26, 26, .06);
}

/* Dropdown */
.nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    padding: 8px 0;
    /* Invisible top bridge so mouse can travel from trigger to menu */
    margin-top: 0;
}
.nav-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 8px;
}
.nav-menu li:hover > .sub-menu { display: block; }
.nav-menu .sub-menu a {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 0;
    color: var(--text);
}
.nav-menu .sub-menu a:hover { background: var(--surface-alt); }
.nav-menu .menu-item-has-children > a::after {
    content: '▾';
    font-size: 10px;
    margin-right: 4px;
}

/* User menu in nav */
.menu-user-item .user-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface-alt);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--primary);
}
.user-menu-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}
.menu-login a {
    background: var(--secondary);
    color: #fff !important;
    border-radius: var(--radius-full);
    padding: 7px 18px !important;
    font-size: 0.875rem !important;
}
.menu-login a:hover { background: var(--secondary-light) !important; }

/* Search Toggle */
.search-toggle {
    background: none;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    flex-shrink: 0;
}
.search-toggle:hover { color: var(--primary); background: var(--surface-alt); }

/* Search Bar */
.header-search-bar {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}
.header-search-bar form {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin-right: auto;
}
.header-search-bar input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 0.9rem;
    background: var(--surface-alt);
    outline: none;
    transition: border-color var(--transition);
    direction: rtl;
}
.header-search-bar input:focus { border-color: var(--accent); }
.header-search-bar button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Mobile Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    border-radius: var(--radius-md);
}
.hamburger-line {
    width: 24px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all var(--transition);
    display: block;
}

/* ── Verified Badge ─────────────────────────────────────────────────────── */
.adab-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    margin-inline-start: 4px;
    line-height: 1;
}
.adab-verified-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
}
/* Larger variant inside headings */
.ap-name .adab-verified-icon,
.author-box-name .adab-verified-icon { width: 22px; height: 22px; }
/* Slightly smaller in post cards / nav */
.post-card-author .adab-verified-icon,
.user-menu-link .adab-verified-icon { width: 14px; height: 14px; }

/* ── Mobile Nav Drawer ──────────────────────────────────────────────────── */

/* Backdrop */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 1000;
    visibility: hidden;
    pointer-events: none;
    transition: background .3s ease, visibility .3s ease;
}
.mobile-nav-overlay.is-open {
    background: rgba(0, 0, 0, .45);
    visibility: visible;
    pointer-events: auto;
}

/* Drawer panel */
.mobile-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.25, .46, .45, .94);
    box-shadow: -6px 0 40px rgba(0, 0, 0, .18);
    overflow: hidden;
}
.mobile-nav-overlay.is-open .mobile-drawer {
    transform: translateX(0);
}

/* Drawer header */
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #ede8e3);
    background: var(--primary, #1a2a4a);
    flex-shrink: 0;
}
.mobile-drawer-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.mobile-drawer-site-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.mobile-drawer-tagline {
    font-size: .68rem;
    color: rgba(255,255,255,.55);
    letter-spacing: .5px;
}

/* Close button */
.mobile-nav-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    flex-shrink: 0;
}
.mobile-nav-close:hover { background: rgba(255,255,255,.22); }

/* Drawer body — scrollable */
.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 0;
}
.mobile-drawer-body::-webkit-scrollbar { width: 4px; }
.mobile-drawer-body::-webkit-scrollbar-track { background: transparent; }
.mobile-drawer-body::-webkit-scrollbar-thumb { background: var(--border, #ddd); border-radius: 4px; }

/* Drawer menu items */
.mobile-drawer-menu {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}
.mobile-drawer-menu li { position: relative; }
.mobile-drawer-menu > li { border-bottom: 1px solid var(--border, #f0ebe6); }
.mobile-drawer-menu > li:last-child { border-bottom: none; }

.mobile-drawer-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    font-size: .975rem;
    font-weight: 600;
    color: var(--text, #2a1f15);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.mobile-drawer-menu a:hover,
.mobile-drawer-menu .current-menu-item > a {
    background: var(--surface-alt, #f8f4f0);
    color: var(--accent, #7a5533);
}

/* Sub-menu */
.mobile-drawer-menu .sub-menu {
    background: var(--surface-alt, #f8f4f0);
    border-top: 1px solid var(--border, #ede8e3);
    display: flex;
    flex-direction: column;
}
.mobile-drawer-menu .sub-menu a {
    padding: 11px 20px 11px 36px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted, #666);
    border-bottom: 1px solid rgba(0,0,0,.04);
}
.mobile-drawer-menu .sub-menu a:hover { color: var(--accent, #7a5533); background: rgba(122,85,51,.06); }
.mobile-drawer-menu .sub-menu li:last-child a { border-bottom: none; }

/* User menu item in drawer */
.mobile-drawer-menu .menu-user-item > a {
    gap: 10px;
    justify-content: flex-start;
}
.mobile-drawer-menu .menu-user-item > a img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Drawer footer */
.mobile-drawer-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border, #ede8e3);
    background: var(--surface, #faf8f5);
    flex-shrink: 0;
}
.mobile-drawer-footer-btn {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: .18s;
    white-space: nowrap;
}
.mobile-drawer-footer-btn--outline {
    border: 1.5px solid var(--accent, #7a5533);
    color: var(--accent, #7a5533);
    background: transparent;
}
.mobile-drawer-footer-btn--outline:hover { background: var(--accent-light, #f5ede4); }
.mobile-drawer-footer-btn--fill {
    background: var(--accent, #7a5533);
    color: #fff;
    border: 1.5px solid transparent;
}
.mobile-drawer-footer-btn--fill:hover { background: var(--accent-dark, #5a3f28); }

/* Hamburger → X animation when menu is open */
#mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.hamburger-line { transition: transform .25s ease, opacity .2s ease; }

/* ----------------------------------------------------------------
   6. Breadcrumbs
   ---------------------------------------------------------------- */
.adab-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.adab-breadcrumbs a { color: var(--text-muted); }
.adab-breadcrumbs a:hover { color: var(--secondary); }
.adab-breadcrumbs span { color: var(--text-light); }

/* ----------------------------------------------------------------
   7. Section Headers
   ---------------------------------------------------------------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.section-title {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title-icon { color: var(--accent); font-size: 0.9em; }
.section-see-all {
    font-size: 0.875rem;
    color: var(--secondary);
    font-weight: 600;
    white-space: nowrap;
}
.section-see-all:hover { color: var(--primary); }

/* ----------------------------------------------------------------
   8. Buttons
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-size: 0.925rem;
    font-weight: 600;
    transition: all var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.btn--primary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn--primary:hover { background: var(--secondary-light); color: #fff; border-color: var(--secondary-light); }
.btn--secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--secondary:hover { background: var(--primary); color: #fff; }
.btn--accent { background: var(--accent); color: var(--primary); }
.btn--accent:hover { background: var(--accent-light); }

/* ----------------------------------------------------------------
   9. Category Badge
   ---------------------------------------------------------------- */
.category-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--surface-alt);
    color: var(--primary);
    border: 1px solid var(--border);
    margin-bottom: 10px;
    transition: all var(--transition);
}
.category-badge:hover { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.category-badge--classical-poetry { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.category-badge--free-verse        { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.category-badge--article           { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.category-badge--story             { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.category-badge--book-review       { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.category-badge--blog-post         { background: #f0fdf4; color: #14532d; border-color: #bbf7d0; }

/* ----------------------------------------------------------------
   10. Hero Section
   ---------------------------------------------------------------- */
.hero-section {
    background: var(--primary);
    padding: 60px 0;
    margin-bottom: 60px;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.hero-no-image { grid-template-columns: 1fr; }
.hero-image { border-radius: var(--radius-xl); overflow: hidden; }
.hero-image img { width: 100%; height: 400px; object-fit: cover; }
.hero-content { color: #fff; }
.hero-content .category-badge {
    background: rgba(255,255,255,.15);
    color: var(--accent);
    border-color: rgba(255,255,255,.2);
}
.hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #fff; margin-bottom: 16px; line-height: 1.25; }
.hero-title a { color: #fff; }
.hero-title a:hover { color: var(--accent); }
.hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    color: rgba(255,255,255,.7);
    flex-wrap: wrap;
}
.hero-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.9);
}
.hero-author img { border-radius: 50%; border: 2px solid rgba(255,255,255,.3); }
.meta-sep { opacity: .5; }
.hero-excerpt { color: rgba(255,255,255,.8); margin-bottom: 24px; line-height: 1.7; }

/* Site Stats Bar (Homepage) */
.site-stats-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    margin-bottom: 60px;
}
.site-stats-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}
.site-stat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}
.site-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    line-height: 0;
}
.site-stat strong {
    font-size: clamp(1.35rem, 3vw, 1.65rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

/* ----------------------------------------------------------------
   11. Post Cards
   ---------------------------------------------------------------- */
.post-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-dark); }
.post-card-image-wrap { position: relative; overflow: hidden; }
.post-card-image-wrap img { width: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-image-wrap img { transform: scale(1.04); }
.post-card-image-link { display: block; }

/* Image heights by size */
.post-card--large .post-card-image-wrap { height: 320px; }
.post-card--medium .post-card-image-wrap { height: 220px; }
.post-card--small .post-card-image-wrap { height: 160px; }

/* Category badge on image */
.post-card-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255,255,255,.9);
    color: var(--primary);
    backdrop-filter: blur(4px);
}
.post-card-no-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--surface-alt);
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 14px,
            rgba(201, 168, 76, 0.035) 14px,
            rgba(201, 168, 76, 0.035) 15px
        ),
        radial-gradient(ellipse at 25% 75%, rgba(139, 26, 26, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 25%, rgba(27, 42, 74, 0.06) 0%, transparent 55%);
}
.post-card-no-image::before {
    content: '\201D';
    position: absolute;
    font-size: clamp(5rem, 14vw, 7rem);
    color: rgba(201, 168, 76, 0.09);
    font-family: Georgia, 'Times New Roman', serif;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    line-height: 1;
    pointer-events: none;
}
.post-card--large .post-card-no-image { height: 320px; }
.post-card--medium .post-card-no-image { height: 220px; }
.post-card--small .post-card-no-image { height: 160px; }
.post-card-no-image-icon {
    position: relative;
    z-index: 1;
    font-size: 1.6rem;
    color: var(--accent);
    opacity: 0.55;
    text-shadow: 0 1px 8px rgba(201, 168, 76, 0.2);
}
.post-card-no-image .post-card-category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}
.post-card-no-image--classical-poetry,
.post-card-no-image--free-verse {
    background-color: #f8f2ea;
}
.post-card-no-image--article,
.post-card-no-image--blog-post {
    background-color: #eef1f6;
}
.post-card-no-image--story {
    background-color: #f5f0e6;
}
.post-card-no-image--book-review {
    background-color: #ede9fe;
}

.post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--primary);
}
.post-card--large .post-card-title { font-size: 1.3rem; }
.post-card-title a { color: var(--primary); }
.post-card-title a:hover { color: var(--secondary); }

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.post-card-author {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}
.post-card-author img { border-radius: 50%; }
.post-card-author:hover { color: var(--secondary); }
.post-card-meta-sep { color: var(--border-dark); }
.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
}
.post-card-read-more {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}
.post-card-read-more:hover { color: var(--primary); gap: 10px; }

/* Magazine Grid */
.posts-magazine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.posts-magazine-grid .post-card--large {
    grid-column: span 2;
    grid-row: span 2;
}
.posts-magazine-grid .post-card--large .post-card-body { padding: 28px; }

/* Regular grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ----------------------------------------------------------------
   12. Featured Authors Section
   ---------------------------------------------------------------- */
.featured-authors-section {
    background: var(--surface-alt);
    padding: 60px 0;
    margin-bottom: 60px;
}
.authors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.authors-grid--full { grid-template-columns: repeat(4, 1fr); }

/* Author Card */
.author-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.author-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-1px); }
.author-card--featured { flex-direction: column; align-items: center; text-align: center; padding: 28px 20px; }
.author-card-avatar img {
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    transition: border-color var(--transition);
}
.author-card:hover .author-card-avatar img { border-color: var(--accent); }
.author-card--featured .author-card-avatar img { border-width: 4px; }
.author-card-info { flex: 1; }
.author-card--featured .author-card-info { width: 100%; }
.author-card-name { font-size: 1rem; color: var(--primary); margin-bottom: 4px; }
.author-card--featured .author-card-name { font-size: 1.1rem; }
.author-card-name a { color: var(--primary); }
.author-card-name a:hover { color: var(--secondary); }
.author-card-specialty {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.author-card-bio {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 12px;
}
.author-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-light);
}
.author-card--featured .author-card-footer { justify-content: center; }
.author-card-posts-count { font-weight: 700; color: var(--secondary); }
.author-card-city { display: flex; align-items: center; gap: 3px; }

/* ----------------------------------------------------------------
   13. Categories Grid
   ---------------------------------------------------------------- */
.categories-section { padding: 60px 0; }
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--surface);
    text-align: center;
    transition: all var(--transition);
    min-height: 100px;
    color: var(--primary);
}
.category-card:hover { border-color: var(--secondary); background: var(--secondary); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-card-name { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.category-card-count { font-size: 0.78rem; opacity: .7; }

/* ----------------------------------------------------------------
   14. Single Post
   ---------------------------------------------------------------- */
.single-post { max-width: 780px; margin: 0 auto; }
.post-header { margin-bottom: 32px; }
.post-title { font-size: clamp(1.5rem, 4vw, 2.2rem); line-height: 1.25; margin-bottom: 16px; color: var(--primary); }
.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.post-meta-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-weight: 600;
}
.post-meta-author img { border-radius: 50%; }
.post-meta-author:hover { color: var(--secondary); }
.tag-pill {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 2px 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all var(--transition);
}
.tag-pill:hover { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.post-thumbnail { border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 36px; }
.post-featured-image { width: 100%; height: 420px; object-fit: cover; }

/* Post Content Styles */
.post-content, .page-content {
    font-size: 1.05rem;
    line-height: 1.95;
    color: var(--text);
}
.post-content p { margin-bottom: 1.4em; }
.post-content h2, .post-content h3, .post-content h4,
.page-content h2, .page-content h3, .page-content h4 {
    margin-top: 2em;
    margin-bottom: .75em;
    color: var(--primary);
}
.post-content ul, .post-content ol,
.page-content ul, .page-content ol {
    padding-right: 24px;
    margin-bottom: 1.4em;
}
.post-content ul, .page-content ul { list-style: disc; }
.post-content ol, .page-content ol { list-style: decimal; }
.post-content li, .page-content li { margin-bottom: .5em; }
.post-content blockquote,
.page-content blockquote {
    border-right: 4px solid var(--accent);
    padding: 16px 24px;
    background: var(--surface-alt);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin: 2em 0;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--primary);
}
.post-content strong { color: var(--primary); font-weight: 700; }
.post-content code {
    background: var(--surface-alt);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: .9em;
    direction: ltr;
    display: inline-block;
}
.post-content pre {
    background: var(--primary);
    color: var(--accent);
    padding: 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    direction: ltr;
    text-align: left;
}
.post-content a { color: var(--secondary); text-decoration: underline; }
.post-content img { border-radius: var(--radius-md); margin: 1.5em 0; }

/* Poetry specific */
.post-content .poem-line { display: block; line-height: 2.4; text-align: center; }

/* Author Box */
.author-box {
    display: flex;
    gap: 24px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin: 48px 0 36px;
    align-items: flex-start;
}
.author-box-avatar img { border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); flex-shrink: 0; }
.author-box-info { flex: 1; }
.author-box-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.author-box-name { font-size: 1.15rem; margin-bottom: 2px; }
.author-box-name a { color: var(--primary); }
.author-box-name a:hover { color: var(--secondary); }
.author-box-spec { font-size: 0.82rem; color: var(--text-muted); display: block; }
.author-box-bio { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 12px; }
.author-box-link { font-size: 0.875rem; font-weight: 700; color: var(--secondary); }
.author-box-link:hover { color: var(--primary); }
.author-box-social { display: flex; gap: 8px; }
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}
.social-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Post Navigation */
/* Read Next Card (Single Post) */
.read-next-card {
    margin: 40px 0 32px;
    padding: 28px 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    border-right: 4px solid var(--accent);
    box-shadow: var(--shadow-md);
}
.read-next-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.read-next-cat {
    display: inline-block;
    font-size: 0.75rem;
    background: rgba(255,255,255,.12);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
    color: rgba(255,255,255,.85);
}
.read-next-title {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    margin-bottom: 18px;
    line-height: 1.45;
}
.read-next-title a { color: #fff; }
.read-next-title a:hover { color: var(--accent); }
.read-next-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    background: var(--accent);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    transition: all var(--transition);
}
.read-next-btn:hover {
    background: var(--accent-light);
    color: var(--primary-dark);
}

.post-navigation { border-top: 1px solid var(--border); padding-top: 28px; margin-bottom: 36px; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; }
.post-navigation .nav-previous, .post-navigation .nav-next { flex: 1; }
.post-navigation a { display: block; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); transition: all var(--transition); }
.post-navigation a:hover { border-color: var(--secondary); }
.post-navigation .nav-label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; }
.post-navigation .nav-title { font-size: 0.9rem; font-weight: 700; color: var(--primary); }

/* ----------------------------------------------------------------
   15. Archive Header
   ---------------------------------------------------------------- */
.archive-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
}
.archive-badge {
    display: inline-block;
    padding: 2px 12px;
    background: var(--secondary);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.archive-title { font-size: 2rem; color: var(--primary); margin-bottom: 8px; }
.archive-description { color: var(--text-muted); max-width: 600px; }
.archive-author-header { display: flex; gap: 20px; align-items: flex-start; }
.archive-author-avatar img { border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.archive-subtitle { color: var(--text-muted); font-size: 1rem; margin-top: 4px; }

/* ----------------------------------------------------------------
   16. Author Profile Page
   ---------------------------------------------------------------- */
/* ==========================================================================
   Author Profile — Design C
   ========================================================================== */

.ap-section {
    padding: 48px 0 0;
}

/* Main card */
.ap-card {
    position: relative;
    display: flex;
    gap: 52px;
    align-items: flex-start;
    background: #fff;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 4px 40px rgba(42,31,21,.07), 0 1px 4px rgba(42,31,21,.05);
    overflow: hidden;
}

/* Decorative radial glow (top-right in RTL = behind avatar) */
.ap-card-deco {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle at 60% 40%, var(--accent-light, #f5ede4) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Avatar column ─────────────────────────────────────────────────────────── */
.ap-avatar-col {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.ap-avatar-wrap {
    position: relative;
    display: inline-block;
}

.ap-avatar-img {
    width: 160px !important;
    height: 160px !important;
    border-radius: 20px !important;
    object-fit: cover;
    display: block;
    box-shadow: 0 12px 36px rgba(42,31,21,.15), 0 0 0 5px rgba(122,85,51,.1);
}

/* Post count badge on avatar */
.ap-post-badge {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent, #7a5533);
    color: #fff;
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 20px;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(122,85,51,.3);
}
.ap-post-badge small { font-size: .68rem; font-weight: 500; opacity: .85; }

/* Social icon buttons */
.ap-social {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.ap-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-alt, #f5f0eb);
    color: var(--text-muted, #999);
    border: 1px solid var(--border, #ede8e3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
    text-decoration: none;
}
.ap-social-btn:hover {
    background: var(--accent, #7a5533);
    color: #fff;
    border-color: var(--accent, #7a5533);
    transform: translateY(-2px);
}
.ap-social-btn--twitter:hover  { background: #000;    border-color: #000; }
.ap-social-btn--instagram:hover { background: #e1306c; border-color: #e1306c; }

/* ── Info column ───────────────────────────────────────────────────────────── */
.ap-info-col {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

/* Tags row */
.ap-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}
.ap-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-main);
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 13px;
    border-radius: 20px;
}
.ap-tag--specialty {
    background: var(--accent-light, #f5ede4);
    color: var(--accent, #7a5533);
}
.ap-tag--city {
    background: var(--surface-alt, #f3ede7);
    color: var(--text-muted, #888);
    font-weight: 500;
}

/* Name */
.ap-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--heading, #1a1208);
    line-height: 1.1;
    margin: 0 0 8px;
    letter-spacing: -.5px;
}
.ap-verified-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    font-weight: 600;
    color: #1d9bf0;
    background: rgba(29,155,240,.08);
    border: 1px solid rgba(29,155,240,.2);
    border-radius: 20px;
    padding: 3px 10px 3px 8px;
    margin: 0 0 20px;
}

/* Bio as styled quote */
.ap-bio-quote {
    position: relative;
    margin: 0 0 28px;
    padding: 0 32px 0 0;
    border: none;
}
.ap-bio-quote::before {
    content: '\201C'; /* opening quotation mark */
    font-size: 6rem;
    line-height: 1;
    color: var(--accent, #7a5533);
    opacity: .18;
    position: absolute;
    top: -20px;
    right: -8px;
    font-family: Georgia, 'Times New Roman', serif;
    pointer-events: none;
}
.ap-bio-text {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text, #3a2d1e);
    font-style: italic;
    margin: 0;
}

/* Engagement stats */
.ap-engagement-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 16px 20px;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.ap-engagement-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.ap-engagement-stat strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.ap-engagement-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Stats row */
.ap-stats-row {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    padding-top: 22px;
    border-top: 1px solid var(--border, #ede8e3);
}
.ap-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 48px;
}
.ap-stat strong {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent, #7a5533);
    line-height: 1;
    font-family: var(--font-main);
}
.ap-stat span {
    font-size: .72rem;
    color: var(--text-muted, #999);
    text-align: center;
    line-height: 1.3;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ap-card {
        flex-direction: column;
        align-items: center;
        padding: 32px 24px 40px;
        gap: 32px;
        text-align: center;
    }
    .ap-bio-quote { padding: 0; }
    .ap-bio-quote::before { right: 50%; transform: translateX(50%); top: -24px; }
    .ap-tags { justify-content: center; }
    .ap-stats-row { justify-content: center; }
    .ap-engagement-row { justify-content: center; }
    .ap-name { font-size: 1.9rem; }
    .ap-post-badge { left: 50%; transform: translateX(-50%); }
}
@media (max-width: 480px) {
    .ap-card { padding: 24px 16px 36px; }
    .ap-name { font-size: 1.6rem; }
}

/* Author Posts */
.author-posts-section { padding: 40px 0; }
.author-likes-section {
    padding: 0 0 48px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.author-view-back {
    padding-top: 32px;
    margin-bottom: -8px;
}
.author-view-back a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}
.author-view-back a:hover { color: var(--secondary); }
.author-section-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}
.author-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    border: 1.5px solid var(--border-dark);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--surface);
    transition: all var(--transition);
}
.author-more-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background: var(--surface-alt);
}
.author-more-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.author-more-btn:hover .author-more-count { color: var(--secondary); }
.author-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    margin-inline-start: 8px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(139, 26, 26, 0.08);
    vertical-align: middle;
}
.author-posts-title { margin-bottom: 24px; }
.category-filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
    cursor: pointer;
}
.filter-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35em;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(0,0,0,.06);
    color: inherit;
    line-height: 1.4;
}
.filter-tab.active, .filter-tab:hover {
    background: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
}
.filter-tab.active .filter-tab-count,
.filter-tab:hover .filter-tab-count {
    background: rgba(255,255,255,.22);
}
.post-filter-item.hidden { display: none; }

/* ----------------------------------------------------------------
   17. Pagination
   ---------------------------------------------------------------- */
.pagination-nav { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.nav-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text);
    transition: all var(--transition);
}
.page-numbers.current { background: var(--secondary); color: #fff; border-color: var(--secondary); font-weight: 700; }
.page-numbers:not(.current):hover { border-color: var(--secondary); color: var(--secondary); }
.page-numbers.dots { border: none; }

/* ----------------------------------------------------------------
   18. Comments
   ---------------------------------------------------------------- */
.comments-section { margin-top: 48px; padding-top: 40px; border-top: 2px solid var(--border); }
.comments-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.comments-count {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}
.comment-list { list-style: none; }
.comment-list .children { margin-right: 40px; margin-top: 0; }
.comment-body {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.comment-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.comment-avatar img { border-radius: 50%; }
.comment-meta { flex: 1; }
.comment-author { font-weight: 700; color: var(--primary); font-size: 0.95rem; }
.comment-date { display: block; font-size: 0.78rem; color: var(--text-muted); }
.comment-actions a {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}
.comment-actions a:hover { color: var(--secondary); }
.comment-awaiting-moderation { color: var(--text-muted); font-style: italic; font-size: 0.875rem; }
.comment-content { font-size: 0.925rem; line-height: 1.75; color: var(--text); }
.comment-content p { margin: 0; }

/* Comment Form */
.comment-respond { margin-top: 40px; }
.comment-reply-title { font-size: 1.3rem; color: var(--primary); margin-bottom: 20px; }
.comment-form { display: flex; flex-direction: column; gap: 16px; }
.comment-field label { display: block; font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 6px; }
.comment-field input, .comment-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.925rem;
    background: var(--surface);
    transition: border-color var(--transition);
    outline: none;
    color: var(--text);
    direction: rtl;
}
.comment-field input:focus, .comment-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,168,76,.1); }
.comment-field textarea { resize: vertical; min-height: 140px; }
.comment-field-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.comment-notes { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.required { color: var(--secondary); }
#submit, .submit {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-full);
    font-size: 0.925rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    align-self: flex-start;
}
#submit:hover { background: var(--secondary-light); }

/* ----------------------------------------------------------------
   19. Auth Pages (Login / Register)
   ---------------------------------------------------------------- */
.site-main:has(.auth-page) { padding: 0; }
.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
}
.auth-page-inner { display: flex; width: 100%; }
.auth-branding {
    width: 42%;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 60px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-branding-content { max-width: 380px; }
.auth-logo-link { display: block; margin-bottom: 40px; }
.auth-logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.5px;
}
.auth-quote blockquote {
    font-size: 1.15rem;
    color: rgba(255,255,255,.8);
    line-height: 1.7;
    font-style: italic;
    border-right: 3px solid var(--accent);
    padding-right: 20px;
    margin-bottom: 36px;
}
.auth-features { display: flex; flex-direction: column; gap: 14px; }
.auth-feature { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.8); font-size: 0.95rem; }
.auth-feature-icon { color: var(--accent); font-size: 1rem; flex-shrink: 0; }
.auth-form-side {
    flex: 1;
    padding: 60px 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.auth-form-box { width: 100%; max-width: 440px; }
.auth-form-title { font-size: 1.8rem; color: var(--primary); margin-bottom: 8px; }
.auth-form-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }
.auth-switch-link { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 20px; }
.auth-switch-link a { color: var(--secondary); font-weight: 600; }

/* Form Styles (shared) */
.adab-form { display: flex; flex-direction: column; gap: 14px; }
.adab-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 6px;
}
.adab-form-group input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 0.925rem;
    background: var(--surface);
    transition: border-color var(--transition);
    outline: none;
    color: var(--text);
    direction: rtl;
}
.adab-form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,168,76,.12); }
.adab-form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; display: block; }
.adab-form-hint--warn { color: #b45309; font-weight: 600; font-size: 0.8rem; }
.adab-form-note {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.adab-form-note p { margin: 0; }
.adab-form-group--checkbox { margin: 16px 0; }
.adab-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text);
    cursor: pointer;
}
.adab-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}
.post-disclaimer {
    margin: 20px 0 0;
    padding: 12px 16px;
    background: var(--surface-alt, #f8f4f0);
    border-right: 3px solid var(--border);
    border-radius: 0 8px 8px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.adab-btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; transition: all var(--transition); }
.adab-btn--primary {
    background: var(--secondary);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}
.adab-btn--primary:hover { background: var(--secondary-light); color: #fff; }
.adab-form-footer { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 14px; }
.adab-form-footer a { color: var(--secondary); font-weight: 600; }
.adab-notice {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-right: 4px solid;
    font-size: 0.9rem;
}
.adab-notice--success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.adab-notice--error   { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.adab-notice--info    { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }

/* WP Login Form Overrides */
.login-extra-links { text-align: center; margin-top: 12px; }
.login-forgot-details { text-align: center; list-style: none; }
.login-forgot-details summary { list-style: none; }
.login-forgot-details summary::-webkit-details-marker { display: none; }
.login-forgot-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-style: dashed;
}
.login-forgot-link:hover { color: var(--secondary); }
.login-forgot-contact {
    margin-top: 12px;
    background: var(--surface-alt, #f8f4f0);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: right;
}
.login-forgot-contact p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}
.login-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    direction: ltr;
    justify-content: flex-end;
}
.login-contact-item:hover { color: var(--accent); }
.login-contact-item--wa { color: #25d366; }
.login-contact-item--wa:hover { color: #128c5e; }
#loginform { display: flex; flex-direction: column; gap: 14px; }
#loginform p { margin: 0; }
#loginform label { font-weight: 600; font-size: 0.875rem; color: var(--text); display: block; margin-bottom: 6px; }
#loginform input[type="text"],
#loginform input[type="password"] {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 14px;
    font-size: 0.925rem;
    background: var(--surface);
    direction: rtl;
    outline: none;
}
#loginform input:focus { border-color: var(--accent); }
#loginform .forgetmenot { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-muted); }
#adab-login-submit {
    background: var(--secondary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: background var(--transition);
}
#adab-login-submit:hover { background: var(--secondary-light); }

/* ----------------------------------------------------------------
   20. Authors Page
   ---------------------------------------------------------------- */
.authors-page-header { margin-bottom: 36px; padding-bottom: 24px; border-bottom: 2px solid var(--border); }
.authors-page-title { font-size: 2rem; color: var(--primary); margin-bottom: 8px; }
.authors-page-subtitle { color: var(--text-muted); }

/* Authors page sections */
.authors-section { margin-bottom: 56px; }
.authors-section--regular { padding-top: 40px; border-top: 2px dashed var(--border); }
.authors-section-header { margin-bottom: 28px; }
.authors-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}
.authors-section--regular .authors-section-title { color: var(--text-muted); font-size: 1.2rem; }
.authors-section-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.authors-filter-bar { margin-bottom: 32px; }
.authors-search-form {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    max-width: 380px;
    background: var(--surface);
}
.authors-search-form input {
    flex: 1;
    border: none;
    padding: 10px 18px;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
    direction: rtl;
    color: var(--text);
}
.authors-search-form button {
    background: none;
    border: none;
    padding: 0 16px;
    color: var(--text-muted);
    cursor: pointer;
}
.authors-search-form button:hover { color: var(--secondary); }

/* ----------------------------------------------------------------
   21. Single Page
   ---------------------------------------------------------------- */
.single-page { max-width: 780px; margin: 0 auto; }
.page-header { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 2px solid var(--border); }
.page-title { font-size: 2rem; }

/* Publication rules page */
.rules-page { display: flex; flex-direction: column; gap: 28px; }
.rules-intro {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    margin: 0;
}
.rules-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 28px 24px;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.04));
}
.rules-block--legal {
    border-color: rgba(122, 85, 51, .25);
    background: linear-gradient(135deg, #fff 0%, var(--surface-alt, #f8f4f0) 100%);
}
.rules-block-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.rules-block--legal .rules-block-title { color: var(--accent, #7a5533); }
.rules-block-lead {
    font-size: .95rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0 0 18px;
    padding: 12px 16px;
    background: rgba(122, 85, 51, .06);
    border-radius: var(--radius-md);
    border-right: 3px solid var(--accent, #7a5533);
}
.rules-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin: 0 !important;
    background: var(--surface-alt, #f8f4f0);
    border-radius: var(--radius-md);
    line-height: 1.7;
    font-size: .95rem;
}
.rules-list li::before {
    content: '';
    position: static;
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--accent, #7a5533);
    flex-shrink: 0;
    margin-top: 0.55em;
}
.rules-block--legal .rules-list li::before { background: var(--primary, #1a2a4a); }
.rules-list li strong { color: var(--primary); font-weight: 700; }

@media (max-width: 480px) {
    .rules-block { padding: 20px 16px; }
    .rules-list li { padding: 12px 14px; font-size: .9rem; gap: 10px; }
}

/* ----------------------------------------------------------------
   22. 404
   ---------------------------------------------------------------- */
.error-404 {
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.error-404-number {
    font-size: 8rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
    margin-bottom: 16px;
}
.error-404-title { font-size: 1.8rem; margin-bottom: 12px; }
.error-404-text { color: var(--text-muted); margin-bottom: 28px; }
.error-404-actions { margin-bottom: 40px; }
.error-404-search { max-width: 360px; margin: 0 auto; }
.error-404-search form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.error-404-search input {
    flex: 1;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 10px 16px;
    font-size: 0.9rem;
    outline: none;
    background: var(--surface);
    color: var(--text);
    direction: rtl;
}
.error-404-search input:focus { border-color: var(--accent); }

/* ----------------------------------------------------------------
   23. No Results
   ---------------------------------------------------------------- */
.no-results, .no-posts-notice {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.no-results p, .no-posts-notice p { font-size: 1.05rem; margin-bottom: 20px; }

/* ----------------------------------------------------------------
   24. Footer
   ---------------------------------------------------------------- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.75);
    padding: 60px 0 0;
    margin-top: 80px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.15fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}
.footer-latest-posts {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.footer-latest-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-latest-item:first-child { padding-top: 0; }
.footer-latest-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.footer-latest-link {
    font-size: 0.82rem;
    color: rgba(255,255,255,.72);
    line-height: 1.55;
    transition: color var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.footer-latest-link:hover { color: var(--accent); }
.footer-latest-date {
    font-size: 0.72rem;
    color: rgba(255,255,255,.35);
}
.footer-site-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    display: block;
    margin-bottom: 6px;
}
.footer-tagline { font-size: 0.8rem; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.footer-about { font-size: 0.875rem; line-height: 1.7; color: rgba(255,255,255,.6); }
.footer-col-title { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
    font-size: 0.875rem;
    color: rgba(255,255,255,.6);
    transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-cat-count { color: rgba(255,255,255,.35); font-size: 0.75rem; }
.footer-cta-text { font-size: 0.875rem; color: rgba(255,255,255,.65); margin-bottom: 14px; line-height: 1.6; }
.footer-cta-btn {
    display: inline-block;
    padding: 9px 22px;
    border: 1.5px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    transition: all var(--transition);
}
.footer-cta-btn:hover { background: var(--accent); color: var(--primary); }
.footer-membership-verified {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: rgba(255,255,255,.75);
    line-height: 1.6;
}
.footer-membership-verified .adab-verified-icon { width: 20px; height: 20px; }
.footer-membership-unverified {
    font-size: 0.875rem;
    color: rgba(255,255,255,.55);
    line-height: 1.6;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}
.footer-bottom-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.footer-copy {
    font-size: 0.82rem;
    color: rgba(255,255,255,.4);
    direction: rtl;
    unicode-bidi: plaintext;
    text-align: center;
}
.footer-credit {
    font-size: 0.78rem;
    color: rgba(255,255,255,.35);
    direction: rtl;
    text-align: center;
}
.footer-credit a { color: rgba(255,255,255,.5); }
.footer-credit a:hover { color: var(--accent); }
.footer-copy a { color: rgba(255,255,255,.55); }
.footer-copy a:hover { color: var(--accent); }
.footer-nav-menu { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-nav-menu a { font-size: 0.82rem; color: rgba(255,255,255,.45); }
.footer-nav-menu a:hover { color: var(--accent); }

/* ----------------------------------------------------------------
   25. Utility & Tag cloud
   ---------------------------------------------------------------- */
.post-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.post-tags .tag-cloud-link {
    display: inline-block;
    padding: 4px 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 3px;
    transition: all var(--transition);
}
.post-tags .tag-cloud-link:hover { background: var(--secondary); color: #fff; border-color: var(--secondary); }

/* ----------------------------------------------------------------
   26. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 1100px) {
    .posts-magazine-grid { grid-template-columns: repeat(2, 1fr); }
    .posts-magazine-grid .post-card--large { grid-column: span 2; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .authors-grid--full { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-image { order: -1; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .authors-grid { grid-template-columns: repeat(2, 1fr); }
    .authors-grid--full { grid-template-columns: repeat(2, 1fr); }
    .auth-branding { width: 36%; padding: 40px 32px; }
    .auth-form-side { padding: 40px 32px; }
}

@media (max-width: 768px) {
    :root { --header-height: 60px; }

    .main-navigation { display: none; }
    .search-toggle { display: none; }
    .mobile-menu-toggle {
        display: flex;
        margin-inline-start: auto; /* push hamburger to the far left in RTL */
    }

    .hero-section { padding: 40px 0; }
    .site-stats-bar { margin-bottom: 40px; padding: 18px 0; }
    .site-stats-inner { gap: 16px; }
    .read-next-card { padding: 22px 20px; }
    .ap-engagement-row { justify-content: center; }
    .hero-inner { gap: 24px; }
    .hero-image img { height: 240px; }

    .posts-magazine-grid { grid-template-columns: 1fr; }
    .posts-magazine-grid .post-card--large { grid-column: span 1; }
    .posts-grid { grid-template-columns: 1fr 1fr; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .authors-grid { grid-template-columns: 1fr 1fr; }
    .authors-grid--full { grid-template-columns: 1fr 1fr; }

    .author-stats { gap: 24px; }

    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

    .auth-page-inner { flex-direction: column; }
    .auth-branding { width: 100%; padding: 40px 24px; min-height: auto; }
    .auth-form-side { padding: 32px 24px; }
    .auth-quote { display: none; }

    .author-box { flex-direction: column; }
    .author-box-top { flex-wrap: wrap; }

    .post-navigation .nav-links { flex-direction: column; }
}

@media (max-width: 480px) {
    .posts-grid { grid-template-columns: 1fr; }
    .authors-grid { grid-template-columns: 1fr; }
    .authors-grid--full { grid-template-columns: 1fr; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { padding: 0 8px; }
    .container { padding: 0 14px; }
    .ap-section { padding: 24px 0 0; }

    /* Footer: 2-column layout even on small screens */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    /* About column spans full width */
    .footer-col--about { grid-column: span 2; }
    .footer-col--latest { grid-column: span 2; }
}

/* ----------------------------------------------------------------
   27. CAPTCHA widget
   ---------------------------------------------------------------- */
.adab-captcha-wrap { margin: 4px 0; }

/* ----------------------------------------------------------------
   28. Content With Sidebar (single post layout)
   ---------------------------------------------------------------- */
.content-with-sidebar { max-width: 800px; margin: 0 auto; }

/* ----------------------------------------------------------------
   29. Accessibility
   ---------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.screen-reader-text {
    border: 0;
    clip: rect(1px,1px,1px,1px);
    height: 1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* ----------------------------------------------------------------
   30. Profile Edit Page
   ---------------------------------------------------------------- */
.profile-edit-page {
    background: var(--bg-alt);
    min-height: calc(100vh - var(--header-height, 72px));
    padding: 40px 0 80px;
}
.profile-edit-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}
.profile-edit-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}
.profile-edit-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-edit-back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    color: var(--text-muted);
    text-decoration: none;
}
.profile-edit-back-link:hover { color: var(--accent); }

/* Card */
.pe-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.pe-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Avatar */
.pe-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.pe-avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.pe-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    display: block;
}
.pe-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    cursor: pointer;
    color: #fff;
}
.pe-avatar-wrap:hover .pe-avatar-overlay { opacity: 1; }
.pe-avatar-spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pe-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: pe-spin .7s linear infinite;
}
@keyframes pe-spin { to { transform: rotate(360deg); } }
.pe-avatar-info p { font-size: .875rem; color: var(--text-muted); margin-bottom: 4px; }
.pe-hint { font-size: .78rem !important; color: var(--text-faint, #aaa) !important; }

/* Form Fields */
.pe-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    flex: 1;
    min-width: 200px;
}
.pe-field--full { flex-basis: 100%; }
.pe-fields-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 0;
}
.pe-field label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary, #4a4545);
    display: flex;
    align-items: center;
    gap: 5px;
}
.pe-required { color: var(--accent); }
.pe-field input[type="text"],
.pe-field input[type="url"],
.pe-field input[type="password"],
.pe-field textarea {
    font-family: var(--font-main);
    font-size: .9rem;
    color: var(--text-primary);
    background: var(--bg-alt, #fafaf9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 9px 12px;
    transition: border-color .2s;
    width: 100%;
    outline: none;
}
.pe-field input:focus,
.pe-field textarea:focus { border-color: var(--accent); background: #fff; }
.pe-field textarea { resize: vertical; min-height: 100px; }

/* Password strength */
.pe-password-strength {
    margin: -4px 0 16px;
}
.pe-strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}
.pe-strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .3s, background .3s;
    width: 0;
}
.pe-strength-label { font-size: .78rem; }

/* Form footer */
.pe-form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
.pe-save-status {
    font-size: .85rem;
    color: var(--accent);
}

/* Buttons */
.pe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: .2s;
}
.pe-btn:disabled { opacity: .5; cursor: not-allowed; }
.pe-btn--primary {
    background: var(--accent);
    color: #fff;
}
.pe-btn--primary:hover:not(:disabled) { background: var(--accent-dark, #5a3f28); }
.pe-btn--secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.pe-btn--secondary:hover:not(:disabled) { background: var(--accent-light, #f5ede4); }

/* Toast */
.pe-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1a1816;
    color: #fff;
    font-family: var(--font-main);
    font-size: .875rem;
    padding: 10px 22px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    white-space: nowrap;
    z-index: 9999;
}
.pe-toast--show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.pe-toast--success { background: #2a6b4d; }
.pe-toast--error   { background: #b03a2e; }

/* Responsive */
@media (max-width: 600px) {
    .pe-card { padding: 20px 18px; }
    .profile-edit-container { padding: 0 14px; }
    .pe-fields-row { flex-direction: column; gap: 0; }
    .pe-form-footer { flex-wrap: wrap; }
}

/* ==========================================================================
   My Writings Page (كتاباتي)
   ========================================================================== */

/* Page wrapper */
.mw-page { padding-top: 32px; padding-bottom: 60px; }

/* ── Page Header ─────────────────────────────────────────────────────────── */
.mw-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.mw-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--heading, #1a1208);
    margin: 0 0 4px;
}
.mw-subtitle {
    font-size: .9rem;
    color: var(--text-muted, #888);
    margin: 0;
}
.mw-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent, #7a5533);
    color: #fff;
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 24px;
    text-decoration: none;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}
.mw-new-btn:hover { background: var(--accent-dark, #5a3f28); transform: translateY(-1px); }

/* ── Stats row ───────────────────────────────────────────────────────────── */
.mw-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.mw-stat-card {
    background: #fff;
    border: 1px solid var(--border, #ede8e3);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: border-color .2s, box-shadow .2s, transform .15s;
    text-align: center;
}
.mw-stat-card:hover {
    border-color: var(--accent, #7a5533);
    box-shadow: 0 2px 12px rgba(122,85,51,.1);
    transform: translateY(-2px);
}
.mw-stat-card--likes { cursor: default; }
.mw-stat-card--likes:hover { transform: none; border-color: var(--border, #ede8e3); box-shadow: none; }
.mw-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent, #7a5533);
    line-height: 1;
}
.mw-stat-label {
    font-size: .78rem;
    color: var(--text-muted, #888);
    font-weight: 500;
}

/* ── Controls: filters + search ─────────────────────────────────────────── */
.mw-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.mw-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mw-filter {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border, #ede8e3);
    border-radius: 20px;
    background: #fff;
    font-family: var(--font-main);
    font-size: .82rem;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: .18s;
}
.mw-filter:hover { border-color: var(--accent, #7a5533); color: var(--accent, #7a5533); }
.mw-filter.active {
    background: var(--accent, #7a5533);
    border-color: var(--accent, #7a5533);
    color: #fff;
}

.mw-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border, #ede8e3);
    border-radius: 24px;
    padding: 6px 14px;
    min-width: 220px;
    color: var(--text-muted, #aaa);
    transition: border-color .2s;
}
.mw-search-wrap:focus-within { border-color: var(--accent, #7a5533); }
.mw-search {
    border: none;
    outline: none;
    font-family: var(--font-main);
    font-size: .875rem;
    background: transparent;
    flex: 1;
    min-width: 0;
    color: var(--text, #2a1f15);
    direction: rtl;
}
.mw-search::placeholder { color: var(--text-muted, #bbb); }

/* ── Posts grid ──────────────────────────────────────────────────────────── */
.mw-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) { .mw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .mw-grid { grid-template-columns: 1fr; } }

/* Override card thumbnail link pointer-events for the my-writings page */
.mw-card-image-wrap { position: relative; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.mw-badge {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
    letter-spacing: .02em;
}
.mw-badge--publish { background: #e8f5ee; color: #2a7a50; }
.mw-badge--draft   { background: #f0f0f0; color: #666; }
.mw-badge--pending { background: #fff6e0; color: #b07a10; }

/* Badge overlaid on thumbnail */
.mw-badge--over {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ── Action bar at card bottom ───────────────────────────────────────────── */
.mw-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #ede8e3);
    flex-wrap: wrap;
}
.mw-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border, #e0dbd5);
    background: transparent;
    font-family: var(--font-main);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted, #777);
    transition: .18s;
    line-height: 1.3;
}
.mw-action-btn--edit  { color: var(--accent, #7a5533); border-color: var(--accent, #7a5533); }
.mw-action-btn--edit:hover  { background: var(--accent-light, #f5ede4); }
.mw-action-btn--view  { color: #2a7a50; border-color: #2a7a50; }
.mw-action-btn--view:hover  { background: #e8f5ee; }
.mw-action-btn--publish { color: #2a7a50; border-color: #2a7a50; }
.mw-action-btn--publish:hover  { background: #e8f5ee; }
.mw-action-btn--publish:disabled { opacity: .5; cursor: not-allowed; }
.mw-action-btn--delete  { color: #b03a2e; border-color: #e0b0ac; margin-right: auto; }
.mw-action-btn--delete:hover  { background: #fdf0ef; border-color: #b03a2e; }

/* ── Empty states ────────────────────────────────────────────────────────── */
.mw-empty-state {
    text-align: center;
    padding: 80px 24px;
}
.mw-empty-icon  { font-size: 3rem; margin-bottom: 16px; }
.mw-empty-title { font-size: 1.4rem; font-weight: 700; color: var(--heading, #1a1208); margin: 0 0 10px; }
.mw-empty-text  { color: var(--text-muted, #888); margin-bottom: 24px; }
.mw-no-results  { text-align: center; padding: 40px 24px; color: var(--text-muted, #888); }

/* ── Delete confirmation modal ───────────────────────────────────────────── */
.mw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 20px;
    animation: fadeInBg .2s ease;
}
.mw-modal-overlay[hidden] { display: none; }

@keyframes fadeInBg {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.mw-modal {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: slideUp .22s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.mw-modal-icon  { font-size: 2.4rem; margin-bottom: 12px; }
.mw-modal-title { font-size: 1.2rem; font-weight: 700; color: var(--heading, #1a1208); margin: 0 0 10px; }
.mw-modal-body  { font-size: .9rem; color: var(--text, #444); line-height: 1.7; margin: 0 0 24px; }
.mw-modal-body strong { color: var(--heading, #1a1208); }
.mw-modal-body small  { color: var(--text-muted, #999); }

.mw-modal-actions { display: flex; gap: 10px; justify-content: center; }
.mw-modal-btn {
    flex: 1;
    max-width: 150px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: .18s;
}
.mw-modal-btn:disabled { opacity: .6; cursor: not-allowed; }
.mw-modal-btn--cancel {
    background: var(--surface, #f6f1ec);
    color: var(--text, #444);
}
.mw-modal-btn--cancel:hover { background: #ede8e3; }
.mw-modal-btn--delete {
    background: #b03a2e;
    color: #fff;
}
.mw-modal-btn--delete:hover:not(:disabled) { background: #8e2e24; }

/* ── Meta likes/comments inline ──────────────────────────────────────────── */
.mw-meta-likes, .mw-meta-comments {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .78rem;
    color: var(--text-muted, #999);
}
.mw-meta-likes svg { color: #e05c6a; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .mw-stats { grid-template-columns: repeat(2, 1fr); }
    .mw-controls { flex-direction: column; align-items: stretch; }
    .mw-search-wrap { min-width: unset; }
    .mw-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .mw-stats { grid-template-columns: repeat(2, 1fr); }
    .mw-title { font-size: 1.5rem; }
}

/* ==========================================================================
   Post Interactions: Like / Comment Count / Share
   ========================================================================== */
.post-interactions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card variant: sits at the bottom of each card */
.post-interactions--card {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border, #ede8e3);
}

/* Single post variant: larger + more prominent */
.post-interactions--single {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border, #ede8e3);
}

.interaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: none;
    background: transparent;
    border-radius: 20px;
    color: var(--text-muted, #888);
    font-family: var(--font-main);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color .18s, background .18s;
    line-height: 1;
    white-space: nowrap;
}
.interaction-btn:hover {
    background: var(--surface-hover, #f3ede7);
    color: var(--text, #2a1f15);
}
.post-interactions--single .interaction-btn {
    font-size: .9rem;
    padding: 7px 13px;
}

/* Like button */
.like-btn { color: var(--text-muted, #888); }
.like-btn:hover { color: #e05c6a; background: #fdf0f2; }
.like-btn.is-liked { color: #e05c6a; }
.like-btn.is-liked .like-icon { fill: #e05c6a; stroke: #e05c6a; }
.like-btn.is-liked:hover { background: #fdf0f2; }

/* Like icon animation on toggle */
.like-btn .like-icon {
    transition: transform .2s cubic-bezier(.17,.67,.52,1.4), fill .18s;
}
.like-btn.is-liked .like-icon {
    transform: scale(1.25);
}

/* Comments link */
.comments-btn { color: var(--text-muted, #888); }
.comments-btn:hover { color: var(--accent, #7a5533); }

/* Share button */
.share-btn { color: var(--text-muted, #888); }
.share-btn .interaction-label { font-size: .78rem; }
.share-btn:hover { color: var(--accent, #7a5533); }

/* Share modal */
body.share-modal-open { overflow: hidden; }
.share-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.share-modal.is-open { display: flex; }
.share-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 26, 46, 0.72);
}
.share-modal__panel {
    position: relative;
    width: min(400px, 100%);
    background: var(--surface, #fff);
    border-radius: 16px;
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.18));
    padding: 28px 24px 24px;
    text-align: center;
    animation: dropFadeIn .2s ease;
}
.share-modal__close {
    position: absolute;
    top: 12px;
    left: 14px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--surface-alt, #f5f0e8);
    color: var(--text-muted, #6b6b6b);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.share-modal__close:hover { background: var(--border, #ede8e3); }
.share-modal__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary, #1B2A4A);
    margin: 0 0 6px;
}
.share-modal__subtitle {
    font-size: .88rem;
    color: var(--text-muted, #6b6b6b);
    margin: 0 0 24px;
}
.share-modal__platforms {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}
.share-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text, #2a1f15);
    transition: transform .15s;
}
.share-platform:hover { transform: translateY(-2px); }
.share-platform__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    color: #fff;
}
.share-platform__label {
    font-size: .78rem;
    font-weight: 500;
}
.share-platform--facebook .share-platform__icon { background: #1877F2; }
.share-platform--whatsapp .share-platform__icon { background: #25D366; }
.share-platform--x .share-platform__icon { background: #000; }
.share-modal__divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--text-muted, #999);
    font-size: .82rem;
}
.share-modal__divider::before,
.share-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border, #ede8e3);
}
.share-modal__copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: 1.5px solid var(--border, #ede8e3);
    border-radius: 999px;
    background: var(--surface, #fff);
    font-family: var(--font-main);
    font-size: .9rem;
    font-weight: 500;
    color: var(--primary, #1B2A4A);
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.share-modal__copy:hover {
    background: var(--surface-hover, #f6f1ec);
    border-color: var(--accent, #C9A84C);
}

@keyframes dropFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Global Toast (used in main.js)
   ========================================================================== */
.adab-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #1a1816;
    color: #fff;
    font-family: var(--font-main);
    font-size: .875rem;
    padding: 10px 22px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 9999;
    white-space: nowrap;
}
.adab-toast a { color: #f9c86a; text-decoration: underline; pointer-events: auto; }
.adab-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.adab-toast--success { background: #2a6b4d; }
.adab-toast--error   { background: #b03a2e; }
.adab-toast--info    { background: #2a4a7a; }

/* ----------------------------------------------------------------
   Notifications
   ---------------------------------------------------------------- */
.header-notifications { position: relative; flex-shrink: 0; }
.notif-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--primary);
    border-radius: var(--radius-full);
    transition: background var(--transition), color var(--transition);
}
.notif-bell-btn:hover { background: var(--surface-alt); color: var(--secondary); }
.notif-bell-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--secondary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}
.notif-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(340px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    overflow: hidden;
}
.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.notif-dropdown-head strong { color: var(--primary); font-size: 0.95rem; }
.notif-dropdown-mark-all {
    border: none;
    background: none;
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}
.notif-dropdown-mark-all:hover { color: var(--primary); }
.notif-dropdown-list {
    max-height: 360px;
    overflow-y: auto;
}
.notif-dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item:hover { background: var(--surface-alt); }
.notif-dropdown-item.is-unread { background: rgba(201, 168, 76, 0.08); }
.notif-dropdown-avatar { border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.notif-dropdown-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-dropdown-label {
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text);
}
.notif-dropdown-time { font-size: 0.72rem; color: var(--text-muted); }
.notif-dropdown-empty,
.notif-dropdown-loading {
    padding: 24px 16px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.notif-dropdown-all {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}
.notif-dropdown-all:hover { background: var(--border); color: var(--primary); }

/* Notifications page */
.notif-page { padding: 40px 0 60px; }
.notif-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.notif-page-title { font-size: 1.8rem; color: var(--primary); margin: 0; }
.notif-mark-all-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}
.notif-mark-all-btn:hover { border-color: var(--secondary); background: var(--surface-alt); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { border-bottom: 1px solid var(--border); }
.notif-item:first-child { border-top: 1px solid var(--border); }
.notif-item-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 12px;
    transition: background var(--transition);
}
.notif-item-link:hover { background: var(--surface-alt); }
.notif-item.is-unread { background: rgba(201, 168, 76, 0.06); }
.notif-item-avatar { border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.notif-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-item-label { font-size: 0.92rem; line-height: 1.55; color: var(--text); }
.notif-item-time { font-size: 0.78rem; color: var(--text-muted); }
.notif-item-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.notif-empty { padding: 48px 20px; text-align: center; }

@media (max-width: 768px) {
    .header-inner { gap: 8px; }
    .notif-dropdown { left: auto; right: 0; }
}
