/*
Theme Name: Ahmady Theme
Theme URI: https://ahmady.org
Description: Modern standalone theme for ahmady.org — Urdu Islamic educational site with RTL support, dark mode, and Google Translate.
Author: MindRoasterMir
Author URI: https://ahmady.org
Version: 1.0.0
Text Domain: ahmady-theme
Tags: rtl-language, one-column, custom-menu, custom-logo, translation-ready
Text Direction: rtl
*/

/* ===== Mehr Nastaliq Web Font (Self-hosted) ===== */
@font-face {
    font-family: 'Mehr Nastaliq Web';
    src: url('./fonts/mehr.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS Variables ===== */
:root {
    --primary: #003004;
    --primary-light: #004d07;
    --primary-dark: #001d02;
    --secondary: #532DF5;
    --secondary-light: #6b44f7;
    --accent: #D1345B;
    --accent-light: #e04a6e;
    --dark: #070707;
    --body-text: #6E7A84;
    --light: #F8FCFC;
    --white: #ffffff;
    --gray-100: #f7f7f7;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-urdu: 'Mehr Nastaliq Web', 'Noto Nastaliq Urdu', serif;
    --font-en: 'Roboto', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-urdu);
    color: var(--dark);
    background: var(--light);
    line-height: 1.8;
    overflow-x: hidden;
}

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

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Global Form Controls — Urdu Font ===== */
input,
textarea,
select,
button,
.form-control {
    font-family: var(--font-urdu) !important;
    direction: rtl;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
    cursor: pointer;
}

/* ===== Header / Navigation ===== */
.header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
    font-family: var(--font-urdu);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-urdu);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--body-text);
    font-weight: 500;
    position: relative;
    font-family: var(--font-urdu);
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
    background: rgba(0, 48, 4, 0.06);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 16px;
    left: 16px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
}

.nav-search {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 8px;
}

.nav-search:hover {
    background: var(--gray-200);
}

.nav-search svg {
    width: 18px;
    height: 18px;
    stroke: var(--body-text);
}

/* ===== Language Switcher ===== */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.lang-label {
    font-size: 1.1rem;
    font-family: var(--font-urdu);
}

.lang-select {
    padding: 4px 24px 4px 8px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--dark);
    font-family: var(--font-en);
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8.5L1 3.5h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 10px;
    transition: var(--transition);
}

.lang-select:hover {
    border-color: var(--primary);
}

.lang-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(83, 45, 245, 0.15);
}

.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Main Content Area ===== */
.site-content {
    padding-top: 72px;
    min-height: 60vh;
}

/* ===== Section Headers ===== */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h1,
.section-header h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--body-text);
    font-size: 1rem;
    margin-bottom: 16px;
}

.section-header .line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    margin: 0 auto;
}

/* ===== Post Cards (Archive/Search) ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin-bottom: 48px;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.post-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.post-thumb {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-thumb .placeholder-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.15);
}

.post-thumb .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: var(--white);
    border-radius: 50px;
    font-size: 0.8rem;
}

.post-content {
    padding: 20px;
}

.post-content h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.8;
}

.post-content h3 a:hover {
    color: var(--primary);
}

.post-content p {
    font-size: 0.9rem;
    color: var(--body-text);
    line-height: 1.8;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--gray-600);
    font-family: var(--font-en);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Single Post ===== */
.single-post-header {
    padding: 120px 0 48px;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.single-post-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(83, 45, 245, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.single-post-header .container {
    position: relative;
    z-index: 1;
}

/* Two-column header inner wrapper */
.single-post-header-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

/* Portrait layout — thumbnail on right (RTL), info on left */
.single-post-header-inner.layout-portrait {
    grid-template-columns: 280px 1fr;
}

/* Landscape layout — stacked: thumbnail full-width above, info below */
.single-post-header-inner.layout-landscape {
    grid-template-columns: 1fr;
}

/* Thumbnail column */
.single-post-thumb-col {
    display: flex;
    justify-content: center;
}

.single-post-thumb-col figure {
    margin: 0;
    max-width: 100%;
}

.featured-image-inline {
    width: 100%;
    max-width: 280px;
    height: auto;
    max-height: 380px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.single-post-thumb-col figcaption {
    text-align: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    font-family: var(--font-urdu);
}

/* Landscape thumbnail — wider, above title */
.layout-landscape .single-post-thumb-col {
    order: -1;
}

.layout-landscape .featured-image-inline {
    max-width: 600px;
    max-height: 340px;
}

/* Info column (title + meta) */
.single-post-info-col {
    text-align: center;
}

.single-post-header h1 {
    font-family: var(--font-urdu);
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    color: var(--white);
    margin-bottom: 16px;
    line-height: 1.5;
    font-weight: 700;
}

.single-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-en);
    flex-wrap: wrap;
}

.single-post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ===== Related Posts Section ===== */
.related-posts-section {
    padding: 60px 0;
    background: var(--gray-100);
    border-top: 3px solid var(--primary);
}

.related-posts-title {
    font-family: var(--font-urdu);
    font-size: 1.8rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 32px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.related-thumb {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--gray-200);
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.related-card:hover .related-thumb img {
    transform: scale(1.05);
}

.related-thumb.no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: rgba(255, 255, 255, 0.5);
}

.related-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.related-cat {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--secondary);
    background: rgba(83, 45, 245, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
    font-family: var(--font-urdu);
    align-self: flex-start;
}

.related-info h3 {
    font-family: var(--font-urdu);
    font-size: 1rem;
    color: var(--dark);
    margin: 0;
    line-height: 1.6;
    font-weight: 600;
}

.related-date {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-family: var(--font-en);
}

.related-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray-600);
    font-family: var(--font-urdu);
    font-size: 1.1rem;
}

.single-post-content {
    padding: 60px 0;
}

.single-post-content .entry-content {
    max-width: 800px;
    margin: 0 auto;
    font-family: var(--font-urdu);
    font-size: 1.05rem;
    line-height: 2;
}

.single-post-content .entry-content h2 {
    font-family: var(--font-urdu);
    font-size: 1.6rem;
    color: var(--dark);
    margin: 40px 0 16px;
    line-height: 1.6;
}

.single-post-content .entry-content h3 {
    font-family: var(--font-urdu);
    font-size: 1.3rem;
    color: var(--dark);
    margin: 32px 0 12px;
    line-height: 1.6;
}

.single-post-content .entry-content p {
    font-family: var(--font-urdu);
    margin-bottom: 20px;
    color: var(--body-text);
}

.single-post-content .entry-content img {
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.single-post-content .entry-content a {
    color: var(--primary);
    text-decoration: underline;
}

.single-post-content .entry-content ul,
.single-post-content .entry-content ol {
    margin: 16px 0;
    padding-right: 24px;
}

.single-post-content .entry-content li {
    margin-bottom: 8px;
    color: var(--body-text);
}

.single-post-content .entry-content blockquote {
    font-family: var(--font-urdu);
    border-right: 4px solid var(--primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--gray-100);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

/* ===== YouTube Playlist Embeds (converted from [youtube_playlist_gallery]) ===== */
.youtube-playlist-embed {
    margin: 32px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.youtube-playlist-embed iframe {
    display: block;
    width: 100%;
    border: none;
    border-radius: var(--radius-md);
}

/* ===== PDF Embeds (converted from [pdfviewer]) ===== */
.pdf-embed {
    margin: 32px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--gray-100);
}

.pdf-embed iframe {
    display: block;
    width: 100%;
    border: none;
    border-radius: var(--radius-md);
}

/* ===== PDF.js Embeds (new viewer) ===== */
.pdfjs-embed {
    margin: 32px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--gray-100);
}

.pdfjs-embed iframe {
    display: block;
    width: 100%;
    border: none;
    border-radius: var(--radius-md);
}

/* ===== Responsive embeds ===== */
@media (max-width: 600px) {
    .youtube-playlist-embed iframe {
        height: 300px;
    }
    
    .pdf-embed iframe,
    .pdfjs-embed iframe {
        height: 400px;
    }
}

/* ===== Rich Embed Previews (replaces hidden wp-embed iframes) ===== */
.wp-block-embed {
    margin: 32px 0 !important;
    position: relative !important;
    visibility: visible !important;
    height: auto !important;
    width: 100% !important;
}

.wp-block-embed iframe.wp-embedded-content {
    display: none !important;
}

.wp-block-embed__wrapper {
    display: none !important;
}

.theme-embed-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    background: var(--white);
    transition: var(--transition);
}

.theme-embed-card.loading {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-embed-loading {
    font-family: var(--font-urdu);
    color: var(--gray-600);
    font-size: 0.95rem;
    padding: 24px;
}

.theme-embed-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.theme-embed-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.theme-embed-thumb {
    width: 140px;
    min-width: 140px;
    height: 140px;
    overflow: hidden;
    flex-shrink: 0;
}

.theme-embed-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.theme-embed-card:hover .theme-embed-thumb img {
    transform: scale(1.05);
}

.theme-embed-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.theme-embed-cat {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--secondary);
    background: rgba(83, 45, 245, 0.08);
    padding: 2px 10px;
    border-radius: 20px;
    font-family: var(--font-urdu);
    align-self: flex-start;
}

.theme-embed-title {
    font-family: var(--font-urdu);
    font-size: 1rem;
    color: var(--dark);
    margin: 0;
    line-height: 1.6;
    font-weight: 600;
}

.theme-embed-excerpt {
    font-family: var(--font-urdu);
    font-size: 0.85rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.theme-embed-cta {
    font-family: var(--font-urdu);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
    display: inline-block;
}

.theme-embed-card:hover .theme-embed-cta {
    color: var(--secondary);
}

/* Embed card without thumbnail — full width info */
.theme-embed-card .theme-embed-info:only-child {
    padding: 20px;
}

/* Dark mode for embed cards */
body.dark-mode .theme-embed-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

body.dark-mode .theme-embed-title {
    color: #f0f0f0;
}

body.dark-mode .theme-embed-excerpt {
    color: #a0a0a0;
}

body.dark-mode .theme-embed-cat {
    background: rgba(83, 45, 245, 0.2);
    color: #8b7aff;
}

body.dark-mode .theme-embed-cta {
    color: #4ade80;
}

body.dark-mode .theme-embed-card:hover {
    border-color: #4ade80;
}

/* Responsive embed cards */
@media (max-width: 600px) {
    .theme-embed-link {
        flex-direction: column;
    }

    .theme-embed-thumb {
        width: 100%;
        min-width: 100%;
        height: 160px;
    }

    .theme-embed-info {
        padding: 14px;
    }

    .theme-embed-title {
        font-size: 0.95rem;
    }
}

/* ===== Post Tags ===== */
.post-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.post-tags a {
    display: inline-block;
    padding: 4px 12px;
    margin: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--body-text);
    transition: var(--transition);
}

.post-tags a:hover {
    background: var(--primary);
    color: var(--white);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 0;
    margin-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.pagination a {
    padding: 10px 24px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--body-text);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== Search Form ===== */
.search-form-wrapper {
    padding: 120px 0 40px;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 40%, var(--primary-light) 100%);
    position: relative;
    overflow: hidden;
}

.search-form-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(83, 45, 245, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.search-form-wrapper .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.search-form-wrapper h1 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 24px;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

/* Search input wrapper — positions mic button inside the input */
.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input[type="search"] {
    width: 100%;
    flex: 1;
    padding: 14px 56px 14px 20px !important;
}

.search-input-wrapper .search-mic-btn {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    height: auto;
    padding: 6px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
}

.search-input-wrapper .search-mic-btn:hover {
    color: var(--white);
    background: transparent;
}

.search-input-wrapper .search-mic-btn.recording {
    color: #ef4444;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    color: var(--white);
    font-family: var(--font-urdu);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.search-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-form input[type="search"]:focus {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

.search-form button {
    padding: 14px 28px;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-urdu);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--gray-100);
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--gray-600);
    font-family: var(--font-en);
    direction: ltr;
    text-align: left;
}

.breadcrumbs a {
    color: var(--primary);
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
    color: var(--gray-300);
}

/* ===== Sidebar ===== */
.sidebar {
    padding: 40px 0;
}

.sidebar .widget {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar .widget h2,
.sidebar .widget h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

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

.sidebar .widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

.sidebar .widget ul li:last-child {
    border-bottom: none;
}

.sidebar .widget ul li a:hover {
    color: var(--primary);
    padding-right: 4px;
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-dark);
    padding: 60px 0 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 12px;
}

.footer-brand p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.8;
    margin-bottom: 16px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--white);
}

.footer-col h4 {
    font-size: 1rem;
    color: var(--white);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--white);
    padding-right: 4px;
}

.footer-bottom {
    padding: 24px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-en);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== Dark Mode Toggle ===== */
.dark-toggle {
    position: fixed;
    bottom: 90px;
    left: 24px;
    z-index: 999;
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.dark-toggle:hover {
    transform: scale(1.1);
}

.dark-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 48, 4, 0.3);
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(83, 45, 245, 0.4);
}

.back-to-top:active {
    transform: translateY(0);
}

body.dark-mode .back-to-top {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark-mode .back-to-top:hover {
    background: var(--secondary);
    color: #fff;
}

/* ===== Admin Bar Offset ===== */
body.admin-bar .back-to-top {
    bottom: 48px;
}

body.admin-bar .dark-toggle {
    bottom: 114px;
}

/* ===== WhatsApp Plugin Override (qlwapp) ===== */
/* Move WhatsApp button to bottom-left, below dark mode toggle */
.qlwapp {
    right: auto !important;
    left: 24px !important;
    bottom: 24px !important;
}

.qlwapp__button {
    right: auto !important;
    left: 0 !important;
}

/* ===== Floating Buttons Layout ===== */
/* Left side (bottom to top): WhatsApp (24px), Dark mode (90px) */
/* Right side (bottom): Back-to-top (24px) */

/* ===== Dark Mode ===== */
body.dark-mode {
    --light: #0a0a0a;
    --white: #141414;
    --dark: #f0f0f0;
    --body-text: #a0a0a0;
    --gray-100: #1a1a1a;
    --gray-200: #2a2a2a;
    --gray-300: #333;
}

body.dark-mode .header {
    background: rgba(20, 20, 20, 0.95);
    border-bottom-color: #2a2a2a;
}

body.dark-mode .nav-search {
    background: #2a2a2a;
}

body.dark-mode .nav-search svg {
    stroke: #a0a0a0;
}

body.dark-mode .mobile-toggle span {
    background: #f0f0f0;
}

body.dark-mode .lang-select {
    background: #2a2a2a;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .post-card {
    border-color: #2a2a2a;
}

body.dark-mode .sidebar .widget {
    border-color: #2a2a2a;
}

body.dark-mode .sidebar .widget h2,
body.dark-mode .sidebar .widget h3 {
    border-bottom-color: #4ade80;
}

body.dark-mode .pagination a {
    border-color: #2a2a2a;
}

body.dark-mode .pagination a:hover {
    border-color: #4ade80;
    color: #4ade80;
}

body.dark-mode .related-posts-section {
    background: #111;
    border-top-color: #4ade80;
}

body.dark-mode .related-posts-title {
    color: #4ade80;
}

body.dark-mode .related-card {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

body.dark-mode .related-info h3 {
    color: #f0f0f0;
}

body.dark-mode .related-cat {
    background: rgba(83, 45, 245, 0.2);
    color: #8b7aff;
}

body.dark-mode .single-post-content {
    background: #0a0a0a;
}

body.dark-mode .single-post-content .entry-content h2,
body.dark-mode .single-post-content .entry-content h3 {
    color: #f0f0f0;
}

body.dark-mode .single-post-content .entry-content p {
    color: #a0a0a0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: var(--font-urdu);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--white);
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--gray-100);
}

.btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--white);
}

.btn-outline:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.btn-green {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-green:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

/* ===== Section ===== */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--gray-100);
}

/* ===== 404 Page ===== */
.error404 {
    text-align: center;
    padding: 120px 0 60px;
}

.error404 h1 {
    font-size: 6rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.error404 p {
    font-size: 1.2rem;
    color: var(--body-text);
    margin-bottom: 32px;
}

/* ===== Search Overlay ===== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 48, 4, 0.95);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    width: 100%;
    max-width: 700px;
    padding: 0 20px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-overlay.active .search-overlay-inner {
    transform: translateY(0);
}

.search-overlay-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.search-overlay-form input[type="search"] {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-family: var(--font-ur);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    direction: rtl;
    outline: none;
    transition: border-color 0.2s;
}

.search-overlay-form input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-overlay-form input[type="search"]:focus {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

.search-overlay-form button[type="submit"] {
    padding: 16px 28px;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-ur);
    cursor: pointer;
    white-space: nowrap;
}

.search-overlay-form button[type="submit"]:hover {
    background: var(--gray-100);
}

.search-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.search-close:hover {
    color: var(--white);
}

/* Microphone Button */
.search-mic-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-mic-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.search-mic-btn.recording {
    color: #ef4444;
    animation: micPulse 1.5s ease-in-out infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Search Toolbar (Roman Urdu toggle) */
.search-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 12px;
}

.roman-urdu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-en);
}

.roman-urdu-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    transition: var(--transition);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.roman-urdu-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--secondary);
}

.roman-urdu-toggle input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 500;
}

.toolbar-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-ur);
    direction: rtl;
}

/* Search Suggestions */
.search-suggestions {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--body-text);
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--gray-50);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-title {
    font-family: var(--font-ur);
    font-size: 0.95rem;
    direction: rtl;
}

.suggestion-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: var(--font-ur);
    white-space: nowrap;
    margin-right: 12px;
}

.suggestion-view-all {
    display: block;
    padding: 14px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-family: var(--font-ur);
    background: var(--gray-50);
    transition: background 0.15s;
}

.suggestion-view-all:hover {
    background: var(--gray-100);
}

.suggestion-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--gray-500);
    font-family: var(--font-ur);
}

/* ===== Search Filters ===== */
.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 20px 24px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid var(--gray-200);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--body-text);
    font-family: var(--font-ur);
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    font-family: var(--font-ur);
    font-size: 0.85rem;
    color: var(--body-text);
    cursor: pointer;
    outline: none;
    direction: rtl;
}

.filter-group select:focus {
    border-color: var(--primary);
}

.clear-filters {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-ur);
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s;
}

.clear-filters:hover {
    background: rgba(209, 52, 91, 0.1);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .nav {
        display: none;
        position: fixed;
        top: 72px;
        right: 0;
        left: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        padding: 24px;
        gap: 4px;
        overflow-y: auto;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        width: 100%;
        padding: 14px 16px;
        font-size: 1.05rem;
    }

    .mobile-toggle {
        display: flex;
    }

    .lang-switcher {
        margin-left: 0;
        margin-top: 12px;
        justify-content: center;
    }

    .nav.open .lang-switcher {
        display: flex;
    }

    .lang-select {
        width: 100%;
        max-width: 150px;
    }

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

    .posts-grid {
        grid-template-columns: 1fr;
    }

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

/* ===== Comments Section ===== */
.comments-wrapper {
    margin: 40px 0;
    padding: 32px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.comments-header h3 {
    font-size: 1.4rem;
    color: var(--body-text);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    font-family: var(--font-urdu);
}

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

.comment-list li {
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-200);
}

.comment-list li:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.comment-author-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-author-info strong {
    color: var(--body-text);
    font-family: var(--font-urdu);
    font-size: 1rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--gray-500);
    font-family: var(--font-en);
    direction: ltr;
}

.comment-content {
    padding: 12px 0;
    color: var(--body-text);
    font-family: var(--font-urdu);
    line-height: 1.8;
}

.comment-reply {
    margin-top: 8px;
}

.comment-reply a {
    color: var(--secondary);
    text-decoration: none;
    font-family: var(--font-urdu);
    font-size: 0.9rem;
    font-weight: 600;
}

.comment-reply a:hover {
    color: var(--primary);
}

.comment-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    font-family: var(--font-urdu);
}

.comment-navigation a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

.comment-navigation a:hover {
    color: var(--primary);
}

/* Comment Form */
.comment-reply-title {
    font-size: 1.3rem;
    color: var(--body-text);
    margin-bottom: 20px;
    font-family: var(--font-urdu);
}

.comment-reply-title small a {
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
}

.comment-form p {
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--body-text);
    font-family: var(--font-urdu);
    font-weight: 600;
    font-size: 0.95rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--body-text);
    font-family: var(--font-urdu);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    direction: rtl;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: var(--primary);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-form-cookies-consent label {
    display: inline;
    font-weight: 400;
    font-size: 0.9rem;
}

.form-submit {
    margin-top: 20px;
}

.form-submit input[type="submit"],
.comment-form button[type="submit"] {
    padding: 12px 32px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-urdu);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.form-submit input[type="submit"]:hover,
.comment-form button[type="submit"]:hover {
    background: var(--secondary);
}

.must-log-in {
    padding: 24px;
    text-align: center;
    background: rgba(0, 48, 4, 0.05);
    border-radius: var(--radius-sm);
    color: var(--body-text);
    font-family: var(--font-urdu);
    font-size: 1rem;
}

.must-log-in a {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
}

.must-log-in a:hover {
    color: var(--primary);
}

.no-comments {
    text-align: center;
    color: var(--gray-500);
    font-family: var(--font-urdu);
    padding: 24px;
}

/* Dark mode comments */
body.dark-mode .comments-wrapper {
    background: var(--dark-card);
    border-color: var(--dark-border);
}

body.dark-mode .comment-list li {
    border-bottom-color: var(--dark-border);
}

body.dark-mode .comment-form input[type="text"],
body.dark-mode .comment-form input[type="email"],
body.dark-mode .comment-form input[type="url"],
body.dark-mode .comment-form textarea {
    background: var(--dark-input);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

body.dark-mode .must-log-in {
    background: rgba(83, 45, 245, 0.1);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

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

    /* Single post header — stack on tablet */
    .single-post-header-inner.layout-portrait {
        grid-template-columns: 1fr;
    }

    .featured-image-inline {
        max-width: 400px;
        max-height: 300px;
    }

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

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .single-post-header {
        padding: 100px 0 32px;
    }

    .single-post-header h1 {
        font-size: 1.4rem;
    }

    .single-post-meta {
        flex-direction: column;
        gap: 8px;
    }

    .featured-image-inline {
        max-width: 100%;
        max-height: 220px;
    }

    .related-posts-section {
        padding: 40px 0;
    }

    .related-posts-title {
        font-size: 1.4rem;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 1.5rem;
    }

    .comments-wrapper {
        padding: 20px 16px;
        margin: 24px 0;
    }

    .comment-form p {
        margin-bottom: 12px;
    }

    .comment-navigation {
        flex-direction: column;
        gap: 8px;
    }
}
