/*
Theme Name: PakSindh
Theme URI: https://paksindh.com
Author: PakSindh
Description: Heritage, Culture and Tourism portal theme for paksindh.com (Ajrak-inspired design).
Version: 4.0
Text Domain: paksindh
*/

/* =========================================================
   TOKENS
   ========================================================= */
:root {
    --navy: #0f1f4b;
    --navy-deep: #0b1a3a;
    --red: #b3141b;
    --red-bright: #c4161c;
    --green: #0e7a4b;
    --cream: #faf7f2;
    --card: #ffffff;
    --line: #e6dfd3;
    --text: #1f2937;
    --muted: #6b7280;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --container: 1240px;
    --gutter: 24px;
    --radius: 8px;

    /* Legacy aliases used by single.css and inner templates */
    --accent: #b3141b;
    --accent-hover: #8f1015;
    --primary: #0f1f4b;
    --border-color: #e6dfd3;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #ffffff;
    --card-bg: #ffffff;
    --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--red); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--navy);
    line-height: 1.3;
    margin-top: 0;
}

.icon { width: 1em; height: 1em; flex: 0 0 auto; display: inline-block; vertical-align: -0.125em; }

.wrapper { width: 100%; min-height: 100vh; }

.top-bar, .main-header, .nav-bar, .site-main {
    width: calc(100% - (var(--gutter) * 2));
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
}

.site-main { padding-bottom: 20px; }

/* =========================================================
   TOP BAR
   ========================================================= */
.top-bar {
    margin-top: 14px;
    height: 38px;
    background: var(--navy-deep);
    border-radius: 8px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
}

.breaking-badge {
    background: var(--red);
    color: #fff;
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 18px 0 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    flex: 0 0 auto;
}
.breaking-badge .icon { width: 14px; height: 14px; }

.top-date {
    padding: 0 16px;
    margin-right: 0;
    border-right: 1px solid rgba(255,255,255,.3);
    line-height: 16px;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: 4px;
}

.ticker-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding-left: 16px;
}
.ticker-item {
    position: absolute;
    left: 16px; right: 12px; top: 0; bottom: 0;
    display: flex;
    align-items: center;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease;
}
.ticker-item.is-active { opacity: 1; visibility: visible; }
.ticker-item:hover { color: #fff; text-decoration: underline; }

.top-social {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;
    flex: 0 0 auto;
}
.top-social a { color: #fff; display: inline-flex; font-size: 15px; }
.top-social a:hover { color: #f3b6b9; }

/* =========================================================
   HEADER
   ========================================================= */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 0 14px;
}

.site-logo { flex: 0 0 auto; }
.site-logo a { display: block; line-height: 0; }
.site-logo img.custom-logo { display: block; height: 58px; width: auto; max-width: 100%; }

.header-search {
    display: flex;
    flex: 0 1 440px;
    min-width: 0;
    margin-left: auto;
    margin-right: 8px;
}
.header-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cfd5e1;
    border-right: 0;
    border-radius: 6px 0 0 6px;
    outline: none;
    -webkit-appearance: none;
}
.header-search input[type="search"]:focus { border-color: var(--navy); }
.header-search button {
    width: 52px;
    height: 42px;
    border: 0;
    background: var(--navy);
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}
.header-search button:hover { background: var(--red); }

.auth-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 500;
}
.auth-links .icon { font-size: 26px; color: var(--navy); }
.auth-links a { color: var(--navy); }
.auth-links a:hover { color: var(--red); }
.auth-sep { width: 1px; height: 16px; background: #b9c0cf; }

.nav-toggle {
    display: none;
    width: 42px; height: 42px;
    border: 0; border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

/* =========================================================
   NAV BAR
   ========================================================= */
.nav-bar {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: center;
    height: 46px;
    background: var(--navy);
    border-radius: 4px;
}

.nav-ajrak {
    flex: 0 0 68px;
    background: url('assets/ajrak-pattern.svg') center / 34px 34px repeat;
    border-top: 2px solid var(--navy);
    border-bottom: 2px solid var(--navy);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.nav-ajrak-left { border-radius: 4px 0 0 4px; }
.nav-ajrak-right { border-radius: 0 4px 4px 0; }

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}
.nav-li { position: relative; display: flex; }

.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 18px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-item .chev { width: 12px; height: 12px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: var(--red-bright); color: #fff; }

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    border-top: 3px solid var(--red);
    box-shadow: 0 14px 30px rgba(11,26,58,.18);
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown a {
    display: block;
    padding: 9px 18px;
    font-size: 14px;
    color: var(--text);
    border-left: 3px solid transparent;
}
.dropdown a:hover { background: #f5efe6; color: var(--red); border-left-color: var(--red); }
.dropdown .dropdown-all { font-weight: 700; color: var(--navy); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* =========================================================
   CATEGORY BADGE (shared)
   ========================================================= */
.cat-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--green);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    line-height: 1.2;
    border-radius: 4px;
}

/* =========================================================
   HERO
   ========================================================= */
.hero-area {
    display: grid;
    grid-template-columns: 1fr 1.04fr;
    gap: 14px;
    margin-top: 22px;
    height: 450px;
}

.hero-grid-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 14px;
    min-height: 0;
}
.grid-card-full { grid-column: 1 / -1; }

.hero-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--navy) url('assets/ajrak-pattern.svg') center / 60px repeat;
    min-height: 0;
    color: #fff;
}
.hero-card.no-img { background-blend-mode: multiply; }

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}
.hero-card:hover .hero-img { transform: scale(1.04); }

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
    padding: 22px 64px 20px 24px;
    background: linear-gradient(to top, rgba(8,18,45,.92) 0%, rgba(8,18,45,.55) 42%, rgba(8,18,45,0) 75%);
}

.hero-title { margin: 0; color: #fff; font-weight: 700; letter-spacing: -.2px; }
.hero-title a { color: #fff; }
.hero-title a:hover { color: #fff; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 2; }

.hero-main .hero-title { font-size: 34px; line-height: 1.2; max-width: 440px; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.grid-card-full .hero-title { font-size: 24px; line-height: 1.25; max-width: 440px; }
.grid-card-half .hero-title { font-size: 19px; line-height: 1.25; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    font-size: 13px;
    color: rgba(255,255,255,.92);
}
.grid-card-half .hero-meta { font-size: 12px; gap: 4px 12px; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item .icon { width: 14px; height: 14px; }

.hero-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 36px; height: 36px;
    border: 1.5px solid rgba(255,255,255,.9);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    background: rgba(255,255,255,.08);
    z-index: 1;
    transition: background .2s ease, color .2s ease;
}
.hero-card:hover .hero-arrow { background: #fff; color: var(--navy); }
.grid-card-half .hero-arrow { width: 30px; height: 30px; right: 14px; bottom: 14px; font-size: 14px; }
.grid-card-half .hero-overlay { padding: 16px 52px 14px 18px; gap: 8px; }

/* =========================================================
   SECTION HEAD (ribbon)
   ========================================================= */
.section-latest { margin-top: 34px; }

.section-head {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 18px;
}

.ribbon-title {
    display: flex;
    align-items: stretch;
    height: 40px;
    margin: 0;
    flex: 0 0 auto;
}
.ribbon-pattern {
    width: 62px;
    background: url('assets/ajrak-pattern.svg') center / 32px 32px repeat;
    clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.ribbon-text {
    display: inline-flex;
    align-items: center;
    margin-left: -6px;
    padding: 0 44px 0 34px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
}

.section-line {
    flex: 1 1 auto;
    height: 1px;
    background: #aab2c4;
    margin: 0 18px;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--red);
    white-space: nowrap;
}
.view-all-link:hover { color: var(--navy); }

/* =========================================================
   ARTICLE CARDS
   ========================================================= */
.article-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}
.article-card:hover { box-shadow: 0 10px 26px rgba(11,26,58,.12); transform: translateY(-3px); }

.article-thumb {
    aspect-ratio: 1.72 / 1;
    background: var(--navy) url('assets/ajrak-pattern.svg') center / 48px repeat;
    overflow: hidden;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.article-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 16px 18px; flex: 1 1 auto; }

.article-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
}
.article-title a { color: var(--navy); }
.article-title a:hover { color: var(--red); }

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 12px;
    color: var(--muted);
}
.article-meta .meta-item .icon { width: 13px; height: 13px; }

.article-excerpt {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #5b6472;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--red);
}
.read-more:hover { color: var(--navy); gap: 9px; }

/* =========================================================
   EXPLORE SINDH
   ========================================================= */
.section-explore { margin-top: 40px; }

.explore-head {
    display: flex;
    align-items: center;
}
.explore-head .section-line { margin: 0 22px; background: #8f98ae; }
.explore-head h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    white-space: nowrap;
}
.explore-head .orn { width: 22px; height: 22px; color: var(--navy); }

.explore-sub { text-align: center; margin: 8px 0 20px; color: #4b5563; font-size: 14px; }

.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.explore-card {
    position: relative;
    min-height: 205px;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--navy);
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
}
.explore-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8,18,45,.92), rgba(8,18,45,.55));
}
.explore-card.explore-history:not(.has-img) { background-image: linear-gradient(135deg, #8a6a3d, #3b2d1c); }
.explore-card.explore-culture:not(.has-img) { background-image: url('assets/ajrak-pattern.svg'); background-size: 70px; }
.explore-card.explore-culture:not(.has-img)::before { background: linear-gradient(to top, rgba(8,18,45,.95), rgba(8,18,45,.72)); }
.explore-card.explore-tourism:not(.has-img) { background-image: linear-gradient(135deg, #1d4f7c, #0b1a3a); }

.explore-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 36px 22px 22px;
    width: 100%;
    align-self: flex-end;
}
.explore-icon {
    flex: 0 0 54px;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid rgba(255,255,255,.85);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.explore-copy h3 { margin: 0 0 6px; color: #fff; font-size: 23px; font-weight: 700; }
.explore-copy p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,.94); }
.explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--green);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s ease, gap .2s ease;
}
.explore-btn:hover { background: var(--red); color: #fff; gap: 11px; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    position: relative;
    overflow: hidden;
    margin-top: 44px;
    background: var(--navy-deep);
    color: #fff;
}
.footer-inner, .footer-bottom {
    width: calc(100% - (var(--gutter) * 2));
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 0 18px;
}
.footer-brand img { display: block; height: 44px; width: auto; }

.footer-links { display: flex; flex-wrap: wrap; justify-content: center; }
.footer-links a {
    color: #fff;
    font-size: 13px;
    padding: 0 16px;
    border-left: 1px solid rgba(255,255,255,.4);
    line-height: 14px;
}
.footer-links a:first-child { border-left: 0; }
.footer-links a:hover { color: #f3b6b9; }

.footer-follow { display: flex; align-items: center; gap: 8px; }
.follow-label { font-size: 13px; margin-right: 6px; }
.social-btn {
    width: 30px; height: 30px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    transition: background .2s ease, color .2s ease;
}
.social-btn:hover { background: #fff; color: var(--navy); }

.footer-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 16px 0 20px;
    border-top: 1px solid rgba(255,255,255,.18);
}
.footer-copyright { grid-column: 2; margin: 0; font-size: 12px; color: rgba(255,255,255,.92); }
.footer-motto {
    grid-column: 3;
    justify-self: end;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-size: 15px;
    color: #fff;
}
.footer-motto em { font-style: italic; }
.motto-diamond { color: var(--red-bright); width: 22px; height: 22px; }
.motto-dot { color: rgba(255,255,255,.7); }

.footer-ajrak {
    position: absolute;
    left: 0; bottom: 0;
    width: 92px; height: 92px;
    background: url('assets/ajrak-pattern.svg') left bottom / 34px 34px repeat;
    clip-path: polygon(0 12%, 100% 100%, 0 100%);
    opacity: .95;
    pointer-events: none;
}

/* =========================================================
   INNER PAGES (single, category, search, page, archive, etc.)
   These templates carry their own inline styles; the rules below
   give them the same container, fonts and colours.
   ========================================================= */
.main-content { padding: 22px 0; }
.page-title { font-family: var(--font-serif); }

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 8px;
    margin: 22px 0 16px;
    border-bottom: 3px solid var(--red);
}
.section-title h2 { margin: 0; font-size: 22px; text-transform: uppercase; letter-spacing: .5px; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; }
.post-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
}
.post-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 4px; margin-bottom: 8px; }
.post-card h3 { font-size: 17px; line-height: 1.35; margin: 0; }
.post-card h3 a { color: var(--navy); }
.post-card h3 a:hover { color: var(--red); }
.post-card .post-date { font-size: 12px; color: var(--muted); margin-top: 6px; }

.wide-list { padding: 0; }
.post-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.post-item a { font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--navy); }
.post-item a:hover { color: var(--red); }
.wap-thumb { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.post-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }

.post-content img, .page-content img { height: auto; }

/* =========================================================
   INNER PAGE PARTS
   ========================================================= */
.site-main > :first-child:not(.hero-area) { margin-top: 0; }
.site-main { padding-top: 0; }

.breadcrumbs { font-size: 13px; color: var(--muted); margin: 18px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.breadcrumbs a { color: var(--navy); font-weight: 500; }
.breadcrumbs a:hover { color: var(--red); }
.crumb-sep { font-style: normal; margin: 0 7px; opacity: .5; }

.page-banner { margin-bottom: 22px; }
.page-banner-row { display: flex; align-items: center; min-width: 0; }
.banner-title { max-width: 70%; min-width: 0; font-size: inherit; }
.banner-title .ribbon-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-transform: uppercase; }
.banner-kicker { font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.banner-desc { margin-top: 12px; max-width: 760px; color: #4b5563; font-size: 15px; }
.banner-desc p { margin: 0; }

.article-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.article-thumb { display: block; }

.pagination { margin: 32px 0 8px; }
.pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}
.pagination a.page-numbers:hover { background: var(--red); border-color: var(--red); color: #fff; }
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .dots { border: 0; background: transparent; }

.no-results { text-align: center; padding: 50px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.no-results p { margin: 0 0 16px; font-size: 16px; color: #4b5563; }

/* WordPress default search form */
.search-form { display: flex; max-width: 460px; margin: 0 auto; }
.search-form label { flex: 1 1 auto; display: block; }
.search-form .screen-reader-text { position: absolute; left: -9999px; }
.search-form .search-field { width: 100%; height: 42px; padding: 0 14px; border: 1px solid #cfd5e1; border-right: 0; border-radius: 6px 0 0 6px; font: inherit; font-size: 14px; outline: none; background: #fff; }
.search-form .search-field:focus { border-color: var(--navy); }
.search-form .search-submit { height: 42px; padding: 0 20px; border: 0; background: var(--navy); color: #fff; font: inherit; font-weight: 600; border-radius: 0 6px 6px 0; cursor: pointer; }
.search-form .search-submit:hover { background: var(--red); }

/* Layout with sidebar (single posts) */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 34px; align-items: start; }

.sidebar { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.widget { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.widget-title { margin: 0 0 14px; padding-bottom: 10px; font-size: 18px; border-bottom: 3px solid var(--red); display: inline-block; }
.widget-posts, .widget-cats { list-style: none; margin: 0; padding: 0; }
.widget-posts li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.widget-posts li:last-child { border-bottom: 0; padding-bottom: 0; }
.wp-thumb { flex: 0 0 76px; width: 76px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--navy) url('assets/ajrak-pattern.svg') center / 30px repeat; }
.wp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-title { display: block; font-family: var(--font-serif); font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--navy); }
.wp-title:hover { color: var(--red); }
.wp-date { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.widget-cats a { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.widget-cats li:last-child a { border-bottom: 0; }
.widget-cats a span { min-width: 26px; text-align: center; padding: 0 8px; background: var(--cream); border-radius: 999px; font-size: 12px; color: var(--muted); }
.widget-cats a:hover span { background: var(--red); color: #fff; }

/* Static page */
.page-content { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 920px; }
.entry-thumb { margin-bottom: 20px; border-radius: 8px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }

/* Author header */
.author-card { display: flex; align-items: center; gap: 18px; padding: 20px; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--red); border-radius: var(--radius); }
.author-card .author-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.author-card .author-info { flex: 1 1 auto; min-width: 0; }
.author-card h1 { margin: 0 0 4px; font-size: 26px; }
.author-card p { margin: 0; color: #5b6472; font-size: 14px; }
.author-count { flex: 0 0 auto; padding: 6px 14px; background: var(--navy); color: #fff; border-radius: 999px; font-size: 13px; font-weight: 600; }

/* 404 */
.error-page { text-align: center; padding: 56px 16px 40px; }
.error-code { display: block; font-family: var(--font-serif); font-size: 96px; line-height: 1; font-weight: 800; color: var(--red); }
.error-page h1 { margin: 6px 0 10px; font-size: 32px; }
.error-page p { max-width: 520px; margin: 0 auto 22px; color: #4b5563; }
.error-home { margin-top: 20px; }

/* Sticky nav (desktop), back to top, reading progress */
@media (min-width: 901px) {
    .nav-bar { position: sticky; top: 0; }
    .admin-bar .nav-bar { top: 32px; }
}
.back-top {
    position: fixed;
    right: 20px;
    bottom: 22px;
    z-index: 60;
    width: 44px; height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    box-shadow: 0 6px 18px rgba(11,26,58,.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.back-top .icon { transform: rotate(-90deg); }
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--navy); }

.read-progress { position: fixed; left: 0; top: 0; width: 100%; height: 4px; z-index: 100; background: transparent; }
.admin-bar .read-progress { top: 32px; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--red); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
    .article-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .content-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
    .nav-item { padding: 0 12px; font-size: 13px; }
    .nav-ajrak { flex-basis: 44px; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-main .hero-title { font-size: 28px; }
}

@media (max-width: 900px) {
    :root { --gutter: 16px; }
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .banner-title { max-width: 100%; }
    .banner-kicker { display: none; }
    .page-banner-row .section-line { display: none; }
    .page-content { padding: 20px; }
    .author-card { flex-wrap: wrap; }

    .top-social { display: none; }
    .top-date { border-right: 0; }

    .main-header { flex-wrap: wrap; gap: 12px; }
    .site-logo img.custom-logo { height: 46px; }
    .header-search { order: 3; flex: 1 1 100%; margin: 0; }
    .auth-links { margin-left: auto; }
    .nav-toggle { display: inline-flex; }

    .nav-bar {
        display: none;
        height: auto;
        flex-direction: column;
        border-radius: 8px;
        overflow: hidden;
    }
    .nav-bar.open { display: flex; }
    .nav-ajrak { display: none; }
    .nav-list { flex-direction: column; }
    .nav-li { display: block; border-top: 1px solid rgba(255,255,255,.12); }
    .nav-item { display: flex; padding: 13px 18px; }
    .nav-item .chev { margin-left: auto; }
    .dropdown { display: none; }

    .hero-area { grid-template-columns: 1fr; height: auto; }
    .hero-main { height: 360px; }
    .hero-grid-right { grid-template-rows: 220px 190px; }

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

    .footer-inner { flex-direction: column; text-align: center; }
    .footer-bottom { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
    .footer-copyright, .footer-motto { grid-column: 1; justify-self: center; }
}

@media (max-width: 600px) {
    .auth-links .icon { display: none; }
    .hero-main { height: 320px; }
    .hero-main .hero-title { font-size: 24px; }
    .grid-card-full .hero-title { font-size: 20px; }
    .hero-grid-right { grid-template-columns: 1fr; grid-template-rows: 210px 200px 200px; }
    .grid-card-half .hero-title { font-size: 18px; }

    .ribbon-text { font-size: 17px; padding: 0 34px 0 26px; }
    .ribbon-pattern { width: 40px; }
    .section-line { display: none; }
    .section-head { justify-content: space-between; }
    .article-grid, .article-grid.cols-3 { grid-template-columns: 1fr; }
    .error-code { font-size: 72px; }
    .explore-head .section-line { display: block; margin: 0 12px; }
    .explore-head h2 { font-size: 22px; gap: 8px; }
    .explore-head .orn { width: 16px; height: 16px; }
    .posts-grid { grid-template-columns: 1fr; }
    .wap-thumb { width: 90px; height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
