﻿/* ================= LANGUAGE FONTS ================= */

@font-face {
    font-family: "Jameel Noori Nastaleeq";
    src: url("../fonts/JameelNooriNastaleeq.9245dc7edad1.woff") format("woff");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body.lang-ur {
    font-family: "Jameel Noori Nastaleeq",
                 "Noto Nastaliq Urdu",
                 "Noto Sans Arabic",
                 Tahoma,
                 Arial,
                 sans-serif;
    line-height: 2.1;
}

body.lang-ps {
    font-family: "Noto Sans Arabic",
                 Tahoma,
                 Arial,
                 sans-serif;
}

body.lang-en {
    font-family: Tahoma,
                 Arial,
                 sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f5f8fa;
    color: #243746;
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.9;
}

a {
    text-decoration: none;
}

.container {
    width: min(1180px, 92%);
    margin: 0 auto;
}

/* ================= TOP BAR ================= */

.top-bar {
    background: #0b3558;
    color: #fff;
    font-size: 14px;
}

.top-bar-inner {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.institution-name {
    opacity: 0.95;
}

.language-switcher {
    display: flex;
    gap: 6px;
}

.language-switcher a {
    color: #fff;
    padding: 3px 10px;
    border-radius: 5px;
}

.language-switcher a:hover,
.language-switcher a.active {
    background: #c9a227;
}

/* ================= BRAND ================= */

.brand-area {
    background: #fff;
    border-bottom: 1px solid #e1e8ee;
}

.brand-inner {
    padding: 22px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: inherit;
}

.logo-placeholder {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #c9a227;
    color: #fff;

    font-family: serif;
    font-size: 28px;
    font-weight: bold;

    border: 5px solid #f3ead0;
}

.brand-text h1 {
    margin: 0;
    color: #0b3558;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 700;
}

.brand-text p {
    margin: 3px 0 0;
    color: #65737d;
    font-size: 15px;
}

/* ================= NAVIGATION ================= */

.main-nav {
    background: #145274;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.nav-inner a {
    color: #fff;
    padding: 13px 18px;
    transition: 0.2s ease;
    font-size: 16px;
}

.nav-inner a:hover {
    background: #0b3558;
}

/* ================= HERO ================= */

.hero {
    background:
        linear-gradient(
            135deg,
            rgba(11, 53, 88, 0.98),
            rgba(20, 82, 116, 0.96)
        );

    color: #fff;
    text-align: center;
    padding: 75px 0 85px;
}

.hero-content {
    max-width: 900px;
}

.hero-badge {
    display: inline-block;
    padding: 4px 18px;
    margin-bottom: 12px;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 30px;

    color: #e7cf7a;
    font-size: 16px;
}

.hero h2 {
    margin: 0;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.6;
}

.hero p {
    margin: 8px 0 30px;
    color: #e8f0f5;
    font-size: 19px;
}

/* ================= SEARCH ================= */

.search-box {
    display: flex;
    width: min(780px, 100%);
    margin: 0 auto;

    background: #fff;
    border-radius: 8px;
    padding: 5px;

    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
}

.search-box input[type="text"] {
    flex: 1;
    min-width: 0;

    border: 0;
    outline: 0;

    padding: 13px 18px;

    color: #243746;
    background: transparent;

    font-family: inherit;
    font-size: 17px;
}

.search-box button {
    border: 0;
    border-radius: 6px;

    padding: 11px 28px;

    background: #c9a227;
    color: #fff;

    font-family: inherit;
    font-size: 16px;
    cursor: pointer;

    transition: 0.2s ease;
}

.search-box button:hover {
    background: #a8821f;
}

/* ================= SECTIONS ================= */

.content-section,
.categories-section {
    padding: 60px 0;
}

.categories-section {
    background: #eef4f7;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 28px;
}

.section-label {
    display: block;
    color: #a88320;
    font-size: 14px;
    font-weight: bold;
}

.section-heading h2 {
    margin: 0;
    color: #0b3558;
    font-size: 30px;
}

.view-all {
    color: #145274;
    font-weight: bold;
}

.view-all:hover {
    color: #a88320;
}

/* ================= FATWA CARDS ================= */

.fatwa-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.fatwa-card {
    background: #fff;
    border: 1px solid #dbe5eb;
    border-radius: 10px;

    padding: 24px;

    box-shadow: 0 4px 18px rgba(11, 53, 88, 0.06);

    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fatwa-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(11, 53, 88, 0.12);
}

.fatwa-card-top {
    margin-bottom: 10px;
}

.fatwa-number {
    color: #a88320;
    font-size: 13px;
    font-weight: bold;
}

.fatwa-card h3 {
    margin: 8px 0 10px;
    color: #0b3558;
    font-size: 21px;
}

.fatwa-card p {
    color: #62727e;
    margin: 0 0 18px;
}

.fatwa-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    padding-top: 15px;
    border-top: 1px solid #e7eef3;

    font-size: 14px;
}

.fatwa-card-footer span {
    color: #777;
}

.fatwa-card-footer a {
    color: #145274;
    font-weight: bold;
}

.fatwa-card-footer a:hover {
    color: #a88320;
}

/* ================= EMPTY STATE ================= */

.empty-state {
    grid-column: 1 / -1;

    text-align: center;
    background: #fff;

    border: 1px dashed #c8d5df;
    border-radius: 10px;

    padding: 50px 25px;
}

.empty-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.empty-state h3 {
    margin: 0;
    color: #0b3558;
}

.empty-state p {
    color: #6b7b86;
}

/* ================= CATEGORIES ================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.category-card {
    background: #fff;
    color: #243746;

    text-align: center;

    padding: 25px 18px;

    border-radius: 10px;
    border-bottom: 3px solid #c9a227;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);

    transition: 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-bottom-color: #0b3558;
}

.category-icon {
    color: #c9a227;
    font-size: 25px;
}

.category-card h3 {
    margin: 6px 0;
    color: #0b3558;
}

.category-card span {
    color: #71818c;
    font-size: 13px;
}

/* ================= QUESTION CTA ================= */

.question-cta {
    background: #0b3558;
    color: #fff;
    padding: 55px 0;
}

.question-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.question-cta h2 {
    margin: 3px 0;
    font-size: 30px;
}

.question-cta p {
    margin: 5px 0 0;
    color: #dbe6ee;
}

.cta-button {
    display: inline-block;

    white-space: nowrap;

    background: #c9a227;
    color: #fff;

    padding: 11px 28px;
    border-radius: 7px;

    font-weight: bold;

    transition: 0.2s ease;
}

.cta-button:hover {
    background: #a8821f;
}

/* ================= FOOTER ================= */

.site-footer {
    background: #07263f;
    color: #d9e4ec;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 45px;

    padding: 50px 0;
}

.footer-grid h3 {
    color: #fff;
    margin-top: 0;
}

.footer-grid p {
    margin: 5px 0;
    color: #b9c8d4;
}

.footer-grid a {
    display: block;
    width: fit-content;

    color: #b9c8d4;
    margin: 5px 0;
}

.footer-grid a:hover {
    color: #d9bc55;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    text-align: center;
    color: #aabac7;

    padding: 15px 0;

    font-size: 13px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {

    .fatwa-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}


@media (max-width: 650px) {

    .top-bar-inner {
        flex-direction: column;
        justify-content: center;
        padding: 7px 0;
        gap: 2px;
    }

    .brand-inner {
        padding: 16px 0;
    }

    .brand {
        justify-content: center;
        text-align: center;
    }

    .brand-text h1 {
        font-size: 23px;
    }

    .brand-text p {
        font-size: 12px;
    }

    .logo-placeholder {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        font-size: 22px;
    }

    .nav-inner {
        justify-content: center;
    }

    .nav-inner a {
        padding: 8px 10px;
        font-size: 14px;
    }

    .hero {
        padding: 50px 0 55px;
    }

    .hero h2 {
        font-size: 30px;
    }

    .hero p {
        font-size: 16px;
    }

    .search-box {
        flex-direction: column;
        background: transparent;
        box-shadow: none;
        gap: 8px;
    }

    .search-box input[type="text"] {
        background: #fff;
        border-radius: 7px;
        padding: 13px;
    }

    .search-box button {
        width: 100%;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .fatwa-grid,
    .category-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .question-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .cta-button {
        width: 100%;
        text-align: center;
    }
}


/* ================= HEADER POLISH ================= */

.brand-area {
    background: #ffffff;
    border-bottom: 1px solid #d7e2ea;
    box-shadow: 0 2px 10px rgba(11, 53, 88, 0.06);
}

.brand-inner {
    padding: 20px 0;
}

.brand {
    gap: 20px;
}

.logo-placeholder {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    background: linear-gradient(145deg, #c9a227, #a98216);
    border: 5px solid #f3ead0;
    box-shadow: 0 4px 12px rgba(11, 53, 88, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .logo-placeholder {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(11, 53, 88, 0.20);
}

.brand-text h1 {
    letter-spacing: 0;
}

.brand-text p {
    opacity: 0.9;
}

/* ================= NAVIGATION POLISH ================= */

.main-nav {
    background: #0b3558;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.nav-inner {
    justify-content: center;
}

.nav-inner a {
    position: relative;
    padding: 14px 19px;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-inner a::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 5px;
    height: 2px;
    background: #c9a227;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-inner a:hover {
    background: #145274;
}

.nav-inner a:hover::after {
    transform: scaleX(1);
}

/* ================= MOBILE HEADER POLISH ================= */

@media (max-width: 700px) {

    .brand-inner {
        padding: 15px 0;
    }

    .brand {
        gap: 12px;
    }

    .logo-placeholder {
        width: 62px;
        height: 62px;
        flex: 0 0 62px;
        font-size: 23px;
        border-width: 4px;
    }

    .brand-text h1 {
        font-size: 23px;
    }

    .brand-text p {
        font-size: 13px;
    }

    .nav-inner {
        justify-content: center;
    }

    .nav-inner a {
        padding: 8px 10px;
        font-size: 14px;
    }

    .nav-inner a::after {
        left: 10px;
        right: 10px;
        bottom: 3px;
    }
}

/* ================= PROFESSIONAL LOGO ================= */

.logo-placeholder {
    overflow: hidden;
    background: #ffffff;
    padding: 0;
}

.site-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}
/* =========================================================
   SHARED FATWA META COMPATIBILITY
   Retained for shared/non-detail templates.
   Fatwa Detail styling belongs in fatwa_detail.css.
   ========================================================= */

.fatwa-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    width: 100%;
    max-width: 960px;

    margin: 48px auto 0;
    padding-top: 26px;

    border-top: 1px solid #e1e8ee;
}

.fatwa-category {
    text-align: end;
}

.fatwa-category span {
    display: block;
    margin-bottom: 3px;
    color: #71808a;
    font-size: 13px;
}

.fatwa-category strong {
    color: #145274;
}

@media (max-width: 700px) {

    .fatwa-meta {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 38px;
        padding-top: 22px;
    }

    .fatwa-category {
        text-align: start;
    }
}

/* =========================================================
   END SHARED FATWA META COMPATIBILITY
   ========================================================= */






/* =========================================================
   PROFESSIONAL SEARCH RESULTS PAGE
   ========================================================= */

.search-results-hero {
    background:
        linear-gradient(
            135deg,
            rgba(11, 53, 88, 0.98),
            rgba(20, 82, 116, 0.96)
        );
    color: #fff;
    text-align: center;
    padding: 54px 0 60px;
}

.search-results-hero .page-kicker {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: #e7cf7a;
    font-size: 15px;
}

.search-results-hero h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.6;
}

.search-results-hero p {
    margin: 10px 0 0;
    color: #e3edf3;
    font-size: 18px;
    line-height: 2;
}

.search-results-page {
    min-height: 60vh;
    background: #f5f8fa;
}

.search-results-form {
    margin-bottom: 25px;
}

.search-results-summary {
    margin-bottom: 24px;
    padding: 13px 18px;
    background: #fff;
    border: 1px solid #dbe5eb;
    border-radius: 9px;
    color: #536771;
    box-shadow: 0 3px 14px rgba(11, 53, 88, 0.04);
}

.search-results-grid {
    align-items: stretch;
}

.search-results-grid .fatwa-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.search-results-grid .fatwa-card-top {
    margin: 0;
    padding: 13px 22px;
    background: #f4f7f9;
    border-bottom: 1px solid #e1e8ee;
}

.search-results-grid .fatwa-card h3 {
    margin: 0;
    padding: 22px 22px 10px;
    color: #0b3558;
    font-size: 22px;
    line-height: 1.7;
}

.search-results-grid .fatwa-card h3::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    margin-top: 10px;
    background: #c9a227;
    border-radius: 5px;
}

.search-results-grid .fatwa-card p {
    flex: 1;
    margin: 0;
    padding: 0 22px 20px;
    color: #61727e;
    font-size: 16px;
    line-height: 2.05;
}

.search-results-grid .fatwa-card-footer {
    margin-top: auto;
    padding: 14px 22px;
    background: #fbfcfd;
}

.search-results-page .empty-state {
    width: 100%;
    padding: 65px 25px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(11, 53, 88, 0.05);
}

.search-results-page .empty-icon {
    color: #c9a227;
}

@media (max-width: 650px) {

    .search-results-hero {
        padding: 42px 0 48px;
    }

    .search-results-hero h2 {
        font-size: 30px;
    }

    .search-results-hero p {
        font-size: 16px;
    }

    .search-results-page .content-section {
        padding: 40px 0 55px;
    }

    .search-results-summary {
        font-size: 14px;
    }

    .search-results-grid {
        grid-template-columns: 1fr;
    }

    .search-results-grid .fatwa-card h3 {
        font-size: 21px;
    }
}

/* =========================================================
   END PROFESSIONAL SEARCH RESULTS PAGE
   ========================================================= */


/* =========================================================
   ARABIC NASKH FONT
   ========================================================= */

@font-face {
    font-family: "Noto Naskh Arabic";
    src: url("../fonts/NotoNaskhArabic-Regular.eeff65bdd1ad.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   END ARABIC NASKH FONT
   ========================================================= */





/* =========================================================
   PHASE 6C - SCHOLARLY DAR-UL-IFTA HOMEPAGE
   Banuri-inspired information architecture
   Dar-ul-Ifta Al-Bayan visual identity
   ========================================================= */

.portal-section {
    padding: 58px 0;
}

.portal-featured-section {
    background: #f8fafb;
    border-top: 1px solid #e3eaee;
    border-bottom: 1px solid #e3eaee;
}

.portal-topic-section {
    background: #ffffff;
}

.portal-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
}

.portal-section-heading h2 {
    margin: 2px 0 0;
    color: #0b3558;
    font-size: clamp(27px, 4vw, 34px);
    line-height: 1.6;
}


/* Selected Fatwa list */

.portal-fatwa-list {
    display: grid;
    gap: 16px;
}

.portal-fatwa-row {
    position: relative;

    padding: 22px 25px;

    background: #ffffff;

    border: 1px solid #dfe7ec;
    border-inline-start: 4px solid #145274;
    border-radius: 9px;

    box-shadow:
        0 3px 13px rgba(11, 53, 88, 0.045);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.portal-fatwa-row-featured {
    border-inline-start-color: #c9a227;
}

.portal-fatwa-row:hover {
    transform: translateY(-2px);

    border-color: #cad8e0;

    box-shadow:
        0 8px 24px rgba(11, 53, 88, 0.09);
}

.portal-fatwa-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;

    margin-bottom: 10px;
}

.portal-fatwa-number {
    color: #8a6d19;
    font-size: 13px;
    font-weight: 700;
}

.portal-category-badge {
    display: inline-flex;
    align-items: center;

    padding: 3px 10px;

    background: #eef4f7;
    border-radius: 20px;

    color: #145274;
    font-size: 12px;
    font-weight: 700;
}

.portal-category-badge:hover {
    background: #e2edf2;
}

.portal-fatwa-row h3 {
    margin: 0 0 8px;

    font-size: 22px;
    line-height: 1.75;
}

.portal-fatwa-row h3 a {
    color: #0b3558;
}

.portal-fatwa-row h3 a:hover {
    color: #a88320;
}

.portal-fatwa-row p {
    margin: 0 0 14px;

    color: #61727e;

    font-size: 16px;
    line-height: 2;
}

.portal-fatwa-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;

    padding-top: 12px;

    border-top: 1px solid #eef2f4;

    color: #71818b;
    font-size: 14px;
}

.portal-fatwa-footer a {
    color: #145274;
    font-weight: 700;
}

.portal-fatwa-footer a:hover {
    color: #a88320;
}

.portal-empty-state {
    padding: 25px;

    background: #ffffff;

    border: 1px dashed #ccd8df;
    border-radius: 9px;

    color: #6b7b85;
    text-align: center;
}


/* Topic directory */

.portal-topic-master-heading {
    margin-bottom: 31px;
}

.portal-topic-groups {
    display: grid;
    gap: 27px;
}

.portal-topic-group {
    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dce5ea;
    border-radius: 10px;

    box-shadow:
        0 4px 16px rgba(11, 53, 88, 0.045);
}

.portal-topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 14px 21px;

    background:
        linear-gradient(
            135deg,
            #0b3558,
            #145274
        );

    border-bottom: 3px solid #c9a227;
}

.portal-topic-header h3 {
    margin: 0;

    color: #ffffff;

    font-size: 21px;
    line-height: 1.7;
}

.portal-topic-header a {
    flex-shrink: 0;

    color: #f0dc91;

    font-size: 13px;
    font-weight: 700;
}

.portal-topic-header a:hover {
    color: #ffffff;
}

.portal-topic-links {
    display: grid;
}

.portal-topic-fatwa-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    padding: 15px 21px;

    color: #334a58;

    border-bottom: 1px solid #edf1f3;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}

.portal-topic-fatwa-link:last-child {
    border-bottom: 0;
}

.portal-topic-fatwa-link:hover {
    background: #f7fafb;
    color: #0b3558;
}

.portal-topic-fatwa-title {
    min-width: 0;

    font-size: 17px;
    line-height: 1.9;
}

.portal-topic-fatwa-number {
    flex-shrink: 0;

    color: #8a6d19;

    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
}


/* English direction */

.lang-en .portal-fatwa-row,
.lang-en .portal-topic-group {
    text-align: left;
}

.lang-en .portal-fatwa-row p,
.lang-en .portal-topic-fatwa-title {
    line-height: 1.75;
}


/* Responsive */

@media (max-width: 700px) {

    .portal-section {
        padding: 42px 0;
    }

    .portal-section-heading {
        align-items: flex-start;
        flex-direction: column;
        margin-bottom: 21px;
    }

    .portal-section-heading h2 {
        font-size: 27px;
    }

    .portal-fatwa-row {
        padding: 18px 16px;
    }

    .portal-fatwa-row h3 {
        font-size: 20px;
    }

    .portal-fatwa-row p {
        font-size: 15px;
    }

    .portal-fatwa-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-topic-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 4px;

        padding: 13px 16px;
    }

    .portal-topic-header h3 {
        font-size: 20px;
    }

    .portal-topic-fatwa-link {
        align-items: flex-start;
        flex-direction: column;

        gap: 3px;

        padding: 13px 16px;
    }

    .portal-topic-fatwa-title {
        font-size: 16px;
    }
}

/* =========================================================
   END PHASE 6C
   ========================================================= */


/* PHASE 6C-P HOMEPAGE VISUAL POLISH
   Adaptive layouts for small amounts of real content.
   Scoped to homepage only.
   ========================================================= */

.home-latest-section .fatwa-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(100%, 320px), 1fr)
        );

    align-items: stretch;
}

.home-latest-section .fatwa-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.home-latest-section .fatwa-card p {
    line-height: 2;
}

.home-latest-section .fatwa-card-footer {
    margin-top: auto;
}


.home-categories-section .category-grid {
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(min(100%, 240px), 1fr)
        );
}

.home-categories-section .category-card {
    min-width: 0;
}


/* Keep sparse homepage sections visually balanced */

@media (min-width: 901px) {

    .home-latest-section .fatwa-grid > :only-child {
        grid-column: 1 / -1;
    }

    .home-categories-section .category-grid {
        max-width: 900px;
    }
}


/* Mobile */

@media (max-width: 650px) {

    .home-latest-section .fatwa-grid,
    .home-categories-section .category-grid {
        grid-template-columns: 1fr;
    }

    .home-latest-section .fatwa-card {
        padding: 20px 17px;
    }
}

/* END PHASE 6C-P HOMEPAGE VISUAL POLISH */


/* P4-C3-P Pashto typography foundation */
body.lang-ps {
    font-family: "Noto Naskh Arabic", "Traditional Arabic", Tahoma, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.95;
    direction: rtl;
    text-align: right;
}

body.lang-ps input,
body.lang-ps textarea,
body.lang-ps select,
body.lang-ps button {
    font-family: inherit;
}

body.lang-ps .brand-text h1,
body.lang-ps .hero h2,
body.lang-ps .section-heading h2,
body.lang-ps .question-cta h2,
body.lang-ps .fatwa-card h3,
body.lang-ps .category-card h3 {
    font-family: "Noto Naskh Arabic", "Traditional Arabic", serif;
    font-weight: 700;
    line-height: 1.55;
}

body.lang-ps .nav-inner a,
body.lang-ps .hero p,
body.lang-ps .fatwa-card p,
body.lang-ps .category-card,
body.lang-ps .question-cta p,
body.lang-ps .footer-main,
body.lang-ps .footer-bottom {
    line-height: 1.9;
}


/* P4-C3-P Scheherazade New font faces */
@font-face {
    font-family: "Scheherazade New";
    src: url("../fonts/ScheherazadeNew-Regular.963e2654907d.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scheherazade New";
    src: url("../fonts/ScheherazadeNew-Medium.6207da1cd81f.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scheherazade New";
    src: url("../fonts/ScheherazadeNew-SemiBold.f2821e76c917.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Scheherazade New";
    src: url("../fonts/ScheherazadeNew-Bold.80e0251780bf.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* P4-C3-P FINAL Pashto Scheherazade system */
body.lang-ps {
    font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
    font-weight: 400;
    font-synthesis: none;
    line-height: 1.9;
    direction: rtl;
    text-align: right;
}

body.lang-ps input,
body.lang-ps textarea,
body.lang-ps select,
body.lang-ps button {
    font-family: "Scheherazade New", "Noto Naskh Arabic", serif;
    font-synthesis: none;
}

body.lang-ps .brand-text h1,
body.lang-ps .hero h2,
body.lang-ps .section-heading h2,
body.lang-ps .question-cta h2,
body.lang-ps .fatwa-card h3,
body.lang-ps .category-card h3,
body.lang-ps .portal-section-heading h2,
body.lang-ps .portal-fatwa-row h3,
body.lang-ps .portal-topic-header h3 {
    font-family: "Scheherazade New", "Noto Naskh Arabic", serif;
    font-weight: 700;
    font-synthesis: none;
    line-height: 1.6;
    letter-spacing: 0;
}

body.lang-ps .nav-inner a,
body.lang-ps .view-all,
body.lang-ps .fatwa-card-footer a,
body.lang-ps .search-box button {
    font-weight: 600;
    font-synthesis: none;
}


/* P4-C3-P Fatwa List Pashto readability fix */
body.lang-ps .fatwa-list-hero p {
    font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
    font-size: 21px;
    font-weight: 500;
    font-synthesis: none;
    line-height: 1.95;
    letter-spacing: 0;
    direction: rtl;
    text-align: center;
    font-kerning: normal;
}

body.lang-ps .fatwa-list-page .fatwa-card p {
    font-family: "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
    font-size: 20px;
    font-weight: 400;
    font-synthesis: none;
    line-height: 2.05;
    letter-spacing: 0;
    direction: rtl;
    text-align: right;
    font-kerning: normal;
}


/* =========================================================
   INSTITUTIONAL ABOUT TEASER POLISH
   Homepage-only institutional introduction.
   Scoped and isolated from Fatwa / About page typography.
   ========================================================= */

.institutional-about-teaser {
    padding: 64px 0;
    background:
        linear-gradient(
            180deg,
            #f7fafb 0%,
            #ffffff 100%
        );
    border-bottom: 1px solid #e3eaee;
}

.institutional-about-teaser .section-heading {
    max-width: 900px;
    margin: 0 auto 22px;
}

.institutional-about-teaser .section-heading h2 {
    margin: 2px 0 0;
    color: #0b3558;
    font-size: clamp(29px, 4vw, 36px);
    line-height: 1.7;
}

.institutional-about-teaser-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 36px 34px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dbe5eb;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(11, 53, 88, 0.06);
}

.institutional-about-teaser-content::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: #c9a227;
}

.institutional-about-teaser-content[lang="ur"] {
    font-family:
        "Jameel Noori Nastaleeq",
        "Noto Nastaliq Urdu",
        "Noto Sans Arabic",
        Tahoma,
        Arial,
        sans-serif;
}

.institutional-about-teaser-content p {
    max-width: 780px;
    margin: 0 0 15px;
    color: #304655;
    font-size: 18px;
    line-height: 2.2;
}

.institutional-about-teaser-content p:last-of-type {
    margin-bottom: 22px;
}

.institutional-about-teaser-content strong {
    color: #0b3558;
    font-weight: 700;
}

.about-teaser-link {
    display: inline-block;
    padding: 10px 24px;
    color: #ffffff;
    background: #0b3558;
    border: 1px solid #0b3558;
    border-radius: 7px;
    font-weight: 700;
    line-height: 1.7;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.about-teaser-link:hover {
    color: #ffffff;
    background: #145274;
    border-color: #145274;
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(11, 53, 88, 0.14);
}

.about-teaser-link:focus-visible {
    outline: 3px solid rgba(201, 162, 39, 0.45);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .institutional-about-teaser {
        padding: 54px 0;
    }

    .institutional-about-teaser-content {
        padding: 29px 30px 31px;
    }
}

@media (max-width: 650px) {
    .institutional-about-teaser {
        padding: 42px 0;
    }

    .institutional-about-teaser .section-heading {
        margin-bottom: 18px;
    }

    .institutional-about-teaser .section-heading h2 {
        font-size: 27px;
    }

    .institutional-about-teaser-content {
        padding: 24px 21px 26px;
        border-radius: 9px;
    }

    .institutional-about-teaser-content p {
        font-size: 17px;
        line-height: 2.1;
    }

    .about-teaser-link {
        width: 100%;
        padding: 10px 18px;
        text-align: center;
    }
}

/* END INSTITUTIONAL ABOUT TEASER POLISH */

/* =========================================================
   FOOTER DEVELOPER CREDIT - FDC-2B
   English-only copyright / developer attribution
   ========================================================= */

.footer-copyright[lang="en"],
.footer-developer-credit[lang="en"] {
    display: block;
    font-family: Tahoma, Arial, sans-serif;
    font-synthesis: none;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: center;
    line-height: 1.6;
}

.footer-developer-credit[lang="en"] {
    margin-top: 4px;
    font-size: 12px;
    color: #8fa3b2;
}

/* FOOTER DEVELOPER CREDIT - FDC-2B */

/* ETR-3 ACTIVE ENGLISH TYPOGRAPHY REFINEMENT */
/*
   Active rendered architecture:
   - Home: style.css only
   - Search Results: style.css only
   - home.css remains intentionally untouched/inactive
   - Urdu, Pashto and Arabic typography remain isolated
*/

body.lang-en {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.7;
}

/* Current Home hero */
.lang-en .hero h2 {
    line-height: 1.25;
}

/*
   Shared English section headings.
   Page-specific stylesheets loaded after style.css remain authoritative
   for About/Fatwa List where applicable.
*/
.lang-en .section-heading h2 {
    line-height: 1.3;
}

/*
   Shared English fatwa-card heading baseline.
   Search receives its own explicit contract below.
   Page-specific Fatwa List CSS remains downstream.
*/
.lang-en .fatwa-card h3 {
    line-height: 1.4;
}

/* Search Results */
.lang-en .search-results-hero h2 {
    line-height: 1.25;
}

.lang-en .search-results-grid .fatwa-card h3 {
    line-height: 1.4;
}
