:root {
    /*
     * Almonji color identity + modern UI tokens
     * Colors from almonji.com — layout is modern, not a clone of newalmonji.
     */
    --color-primary: #0CA0E6;
    --color-primary-dark: #140185;
    --color-secondary: #23A1D1;
    --color-accent: #FFFF00;
    --color-accent-soft: #E7FAFF;
    --color-bg: #F4FAFC;
    --color-surface: #FFFFFF;
    --color-surface-elevated: #FFFFFF;
    --color-surface-soft: #E1FDFE;
    --color-text: #535B60;
    --color-text-strong: #140185;
    --color-muted: #535B60;
    --color-link: #23A1D1;
    --color-link-alt: #0CA0E6;
    --color-border: #C1DDE6;
    --color-border-soft: #D7E8EF;
    --color-footer: #0CA0E6;
    --color-button-active: #518ACB;
    --radius: 12px;
    --radius-sm: 10px;
    --radius-btn: 10px;
    --radius-input: 12px;
    --shadow-soft: 0 4px 18px rgba(20, 1, 133, .06);
    --shadow-hover: 0 8px 24px rgba(12, 160, 230, .12);
    --transition: 180ms ease;
    --font: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
    --hp-content-width: 1200px;

    /* Backward-compatible aliases */
    --hp-primary: var(--color-primary);
    --hp-primary-dark: var(--color-primary-dark);
    --hp-primary-soft: var(--color-accent-soft);
    --hp-text: var(--color-text);
    --hp-muted: var(--color-muted);
    --hp-border: var(--color-border);
    --hp-bg: var(--color-bg);
    --hp-white: var(--color-surface-elevated);
    --hp-radius: var(--radius);
    --hp-radius-sm: var(--radius-sm);
}

body.hp-body {
    font-family: var(--font);
    line-height: 1.75;
    font-size: 15px;
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    overflow-x: hidden;
}

/* Full-width modern shell (no cramped 1000px column) */
.hp-main {
    background: transparent;
    color: var(--color-text);
    width: 100%;
    max-width: none;
    margin: 0;
    min-width: 0;
}

.hp-body a:focus-visible,
.hp-body button:focus-visible,
.hp-body input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.visually-hidden-locale {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Language bar ---------- */
.hp-langbar {
    background: var(--color-primary);
    border-bottom: 0;
    width: 100%;
}

.hp-langbar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .55rem .85rem;
    min-width: 0;
    max-width: 100%;
    padding: .45rem 0;
}

.hp-langbar__label {
    flex: 0 0 auto;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    opacity: .95;
}

.hp-langbar__scroller {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.hp-langbar__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    gap: .4rem .55rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hp-langbar__item {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.hp-langbar__item + .hp-langbar__item {
    margin-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
}

.hp-langbar__link {
    display: inline-block;
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    padding: .38rem .85rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    white-space: nowrap;
    line-height: 1.25;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.hp-langbar__link:hover,
.hp-langbar__link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .22);
    border-color: rgba(255, 255, 255, .45);
}

.hp-langbar__link.is-active {
    color: var(--color-primary-dark);
    background: var(--color-accent);
    border-color: var(--color-accent);
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(20, 1, 133, .08);
}

/* ---------- Header ---------- */
.hp-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-soft);
    box-shadow: 0 1px 0 rgba(12, 160, 230, .08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hp-header__top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1.25rem;
    row-gap: .75rem;
    min-height: 76px;
    padding: .7rem 0 .55rem;
}

.hp-header__top > .hp-brand {
    grid-column: 1;
    grid-row: 1;
}

.hp-header__top > .hp-search {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
}

.hp-header__top > .hp-header__tools {
    grid-column: 3;
    grid-row: 1;
}

.hp-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    min-width: 0;
}

.hp-brand__mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--color-accent-soft);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

.hp-brand__mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hp-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.hp-brand__name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

.hp-brand__tagline {
    font-size: .72rem;
    color: var(--color-muted);
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hp-header__tools {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-shrink: 0;
}

.hp-search {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    max-width: 440px;
    min-height: 44px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input);
    padding: .2rem .3rem .2rem .85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hp-search:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(12, 160, 230, .15);
    background: var(--color-surface);
}

.hp-search__icon {
    color: var(--color-secondary);
    font-size: .95rem;
    flex-shrink: 0;
}

.hp-search input {
    border: 0;
    background: transparent;
    outline: none;
    flex: 1;
    min-width: 0;
    font-size: .9rem;
    color: var(--color-text);
    height: 36px;
}

.hp-search button {
    border: 0;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-btn);
    padding: .45rem .95rem;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background var(--transition);
}

.hp-search button:hover {
    background: var(--color-button-active);
}

.hp-login {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: .88rem;
    white-space: nowrap;
    padding: .4rem .55rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.hp-login:hover {
    color: var(--color-primary);
    background: var(--color-accent-soft);
}

.hp-burger {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: border-color var(--transition), background var(--transition);
}

.hp-burger:hover {
    border-color: var(--color-primary);
    background: var(--color-accent-soft);
}

.hp-nav {
    border-top: 1px solid var(--color-border-soft);
    background: var(--color-surface);
}

.hp-nav__scroller {
    display: flex;
    align-items: center;
    gap: .1rem;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: .25rem 0 .45rem;
}

.hp-nav__link {
    display: inline-block;
    padding: .55rem .85rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.hp-nav__link:hover {
    color: var(--color-primary);
    background: var(--color-accent-soft);
}

.hp-nav__link.is-active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary);
    font-weight: 700;
}

.hp-nav__item {
    position: relative;
    flex: 0 0 auto;
}

.hp-nav__caret {
    font-size: .7rem;
    margin-inline-start: .15rem;
    opacity: .7;
}

.hp-nav__submenu {
    display: none;
    position: absolute;
    inset-inline-start: 0;
    top: 100%;
    min-width: 180px;
    padding: .4rem 0;
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    z-index: 40;
}

.hp-nav__item:hover > .hp-nav__submenu,
.hp-nav__item:focus-within > .hp-nav__submenu {
    display: block;
}

.hp-nav__sublink {
    display: block;
    padding: .45rem .85rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: .88rem;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition);
}

.hp-nav__sublink:hover,
.hp-nav__sublink.is-active {
    color: var(--color-primary);
    background: var(--hp-primary-soft);
}

.hp-nav__subitem { position: relative; }

.hp-nav__submenu--nested {
    inset-inline-start: 100%;
    top: 0;
}

.hp-nav__subitem:hover > .hp-nav__submenu,
.hp-nav__subitem:focus-within > .hp-nav__submenu {
    display: block;
}

@media (max-width: 991.98px) {
    .hp-burger { display: inline-flex; }

    .hp-header__top {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .hp-header__top > .hp-brand {
        grid-column: 1;
        grid-row: 1;
    }

    .hp-header__top > .hp-header__tools {
        grid-column: 2;
        grid-row: 1;
    }

    .hp-header__top > .hp-search {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        max-width: none;
    }

    .hp-brand__tagline { display: none; }

    .hp-nav {
        display: none;
        border-top: 0;
        padding-bottom: .75rem;
    }

    .hp-nav.is-open { display: block; }

    .hp-nav__scroller {
        flex-direction: column;
        align-items: stretch;
        overflow: visible;
        padding: .35rem 0 0;
        border-top: 1px solid var(--color-border);
    }

    .hp-nav__link {
        padding: .7rem .15rem;
        border-bottom: 1px solid var(--color-border);
    }

    .hp-nav__link.is-active {
        border-bottom-color: var(--color-border);
        box-shadow: inset -.2rem 0 0 var(--color-primary);
    }

    [dir="ltr"] .hp-nav__link.is-active {
        box-shadow: inset .2rem 0 0 var(--color-primary);
    }

    .hp-nav__item,
    .hp-nav__subitem { width: 100%; }

    .hp-nav__submenu,
    .hp-nav__submenu--nested {
        position: static;
        display: none;
        box-shadow: none;
        border: 0;
        padding-inline-start: .75rem;
        min-width: 0;
    }

    .hp-nav__item.is-active > .hp-nav__submenu,
    .hp-nav__item:focus-within > .hp-nav__submenu,
    .hp-nav__subitem.is-active > .hp-nav__submenu,
    .hp-nav__subitem:focus-within > .hp-nav__submenu {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .hp-langbar__inner {
        justify-content: flex-start;
        gap: .4rem .55rem;
        padding: .4rem 0;
    }

    .hp-langbar__label {
        font-size: .72rem;
    }

    .hp-langbar__list {
        justify-content: flex-start;
        gap: .35rem .45rem;
    }

    .hp-langbar__item + .hp-langbar__item {
        margin-inline-start: 0;
        padding-inline-start: 0;
    }

    .hp-langbar__link {
        font-size: .76rem;
        font-weight: 600;
        padding: .32rem .7rem;
    }

    .hp-search button {
        padding: .4rem .65rem;
    }

    .hp-header__top {
        min-height: 0;
        padding: .55rem 0 .5rem;
    }
}

/* ---------- Home body / modern content cards ---------- */
.hp-home {
    background: transparent;
}

.hp-home__body {
    padding: 1.75rem 0 3rem;
    max-width: var(--hp-content-width);
}

.hp-home__main {
    min-width: 0;
    width: 100%;
}

.hp-latest__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0 0 .85rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--color-border-soft);
    min-height: 0;
}

.hp-latest__title,
.hp-section__title,
.hp-aside-block__title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.hp-latest__title::before,
.hp-aside-block__title::before {
    content: "";
    width: 4px;
    height: 1.1em;
    border-radius: 4px;
    background: var(--color-primary);
    flex-shrink: 0;
}

.hp-section__title::before {
    content: "";
    width: 3px;
    height: .95em;
    border-radius: 3px;
    background: var(--color-primary);
    flex-shrink: 0;
}

.hp-latest__title {
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.45rem);
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.35;
}

.hp-boxes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem .7rem;
    align-items: stretch;
}

.hp-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hp-box:hover {
    border-color: rgba(12, 160, 230, .35);
    box-shadow: var(--shadow-hover);
}

.hp-box__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    margin: 0;
    padding: .5rem .7rem .4rem;
    height: auto;
    border-bottom: 1px solid var(--color-border-soft);
    background: var(--color-surface);
}

.hp-box .hp-section__title {
    margin: 0;
    font-size: .86rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--color-primary-dark);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* Homepage main grid (exactly the boxes under .hp-boxes) — subtle title hierarchy only */
.hp-boxes > .hp-box > .hp-box__head {
    padding: .55rem .75rem .48rem;
}

.hp-boxes > .hp-box > .hp-box__head .hp-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #140185;
    line-height: 1.35;
}

.hp-boxes > .hp-box > .hp-box__head .hp-section__title::before {
    width: 3px;
    height: 1em;
    border-radius: 3px;
    background: #0CA0E6;
}

.hp-section__all {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-secondary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    padding: .1rem .25rem;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.hp-section__all:hover {
    color: var(--color-primary-dark);
    background: var(--color-accent-soft);
}

.hp-box__list {
    list-style: none;
    margin: 0;
    padding: .15rem .55rem .25rem;
    flex: 1 1 auto;
    background: transparent;
    min-height: 0;
}

.hp-box__item {
    margin: 0;
    padding: .32rem .1rem;
    border-bottom: 1px solid var(--color-border-soft);
    background-image: none;
}

[dir="ltr"] .hp-box__item {
    padding: .32rem .1rem;
    background-position: initial;
}

.hp-box__item:hover {
    background-color: var(--color-accent-soft);
}

.hp-box__item:last-child {
    border-bottom: 0;
}

.hp-card__title {
    margin: 0;
    font-size: .92rem;
    font-weight: 500;
    line-height: 1.55;
}

.hp-box .hp-card__title {
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.35;
}

.hp-card__title a {
    color: var(--color-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition);
}

.hp-box .hp-card__title a {
    color: var(--color-text-strong);
    font-weight: 600;
    line-height: 1.35;
    max-height: calc(1.35em * 2);
}

.hp-card__title a:hover {
    color: var(--color-primary);
    font-weight: 500;
}

.hp-box .hp-card__title a:hover {
    font-weight: 600;
}

.hp-box__foot {
    margin-top: auto;
    padding: .35rem .7rem .45rem;
    border-top: 1px solid var(--color-border-soft);
    background: transparent;
    min-height: 0;
}

.hp-box__list--monasebat {
    max-height: 18rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hp-box__item--occasion {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.hp-occasion__day {
    flex: 0 0 auto;
    min-width: 1.35rem;
    font-weight: 700;
    font-size: .82rem;
    color: var(--color-secondary);
    line-height: 1.35;
}

.hp-occasion__title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: .82rem;
    line-height: 1.35;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-box__empty {
    padding: .65rem .7rem;
    color: var(--color-muted);
    font-size: .82rem;
    line-height: 1.4;
}

.hp-box__empty p {
    margin: 0;
}

.hp-empty {
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2.25rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.hp-empty__title {
    margin: 0 0 .4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.hp-empty__text {
    margin: 0;
    font-size: .9rem;
    color: var(--color-muted);
}

.hp-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--color-border-soft);
}

@media (max-width: 991.98px) {
    .hp-boxes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .hp-home__body { padding: 1.25rem 0 2.35rem; }

    .hp-boxes {
        grid-template-columns: minmax(0, 1fr);
    }

    .hp-box {
        padding: 0;
    }

    .hp-boxes > .hp-box > .hp-box__head {
        padding: .48rem .65rem .42rem;
    }

    .hp-boxes > .hp-box > .hp-box__head .hp-section__title {
        font-size: 1rem;
    }
}

/* ---------- Homepage widget slots (independent full-width positions) ---------- */
.hp-slot {
    min-width: 0;
    max-width: 100%;
}

/* Hadith of the day — full-width marquee (brand colors only) */
.hp-hadith {
    margin: 0 0 1rem;
    padding: .4rem .75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    box-shadow: none;
    overflow: hidden;
}

.hp-hadith__viewport {
    overflow: hidden;
    max-width: 100%;
}

.hp-hadith__track {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 3rem;
    margin: 0;
    white-space: nowrap;
    will-change: transform;
    animation: hp-hadith-marquee 45s linear infinite;
}

.hp-hadith[dir="rtl"] .hp-hadith__track {
    animation-name: hp-hadith-marquee-rtl;
}

.hp-hadith__text {
    display: inline-block;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-primary-dark);
}

@keyframes hp-hadith-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes hp-hadith-marquee-rtl {
    from { transform: translateX(0); }
    to { transform: translateX(50%); }
}

@media (prefers-reduced-motion: reduce) {
    .hp-hadith__track {
        animation: none;
        white-space: normal;
        flex-wrap: wrap;
    }

    .hp-hadith__text[aria-hidden="true"] {
        display: none;
    }
}

/* Homepage hadith slot — compact strip (current widget may be latest_content) */
.hp-slot--homepage_hadith {
    margin: 0 0 .85rem;
}

/* Homepage strip boxes — the dua (html) box reuses the hadith box look
   (same .hp-box base + the same strip overrides, no duplicated CSS). */
.hp-slot--homepage_hadith > .widget--latest-content.hp-box,
.hp-slot--homepage_dua > .widget--html.hp-box {
    box-shadow: none;
    border-radius: var(--radius-sm);
}

.hp-slot--homepage_hadith > .widget--latest-content.hp-box:hover,
.hp-slot--homepage_dua > .widget--html.hp-box:hover {
    border-color: var(--color-border-soft);
    box-shadow: none;
}

.hp-slot--homepage_hadith > .widget--latest-content .hp-box__list,
.hp-slot--homepage_dua > .widget--html .widget-html__body {
    padding: .35rem .7rem;
}

.hp-slot--homepage_hadith > .widget--latest-content .hp-box__item,
.hp-slot--homepage_dua > .widget--html .widget-html__body p {
    padding: .2rem 0;
    border-bottom: 0;
    margin: 0;
}

.hp-slot--homepage_hadith > .widget--latest-content .hp-box__item:hover {
    background-color: transparent;
}

/* Strip text — hadith title and dua body share one typography. */
.hp-slot--homepage_hadith > .widget--latest-content .hp-card__title,
.hp-slot--homepage_hadith > .widget--latest-content .hp-card__title a,
.hp-slot--homepage_dua > .widget--html .widget-html__body p {
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--color-primary-dark);
}

/* The hadith strip title is display-only (no link affordance). */
.hp-slot--homepage_hadith > .widget--latest-content .hp-card__title,
.hp-slot--homepage_hadith > .widget--latest-content .hp-card__title a {
    cursor: default;
    text-decoration: none;
    pointer-events: none;
}

.hp-slot--homepage_hadith > .widget--hadith-of-day.hp-hadith {
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .hp-slot--homepage_hadith,
    .hp-slot--homepage_dua {
        margin-bottom: .7rem;
    }

    .hp-slot--homepage_hadith > .widget--latest-content .hp-box__list,
    .hp-slot--homepage_dua > .widget--html .widget-html__body {
        padding: .3rem .55rem;
    }

    .hp-slot--homepage_hadith > .widget--latest-content .hp-card__title,
    .hp-slot--homepage_hadith > .widget--latest-content .hp-card__title a,
    .hp-slot--homepage_dua > .widget--html .widget-html__body p {
        font-size: .86rem;
        line-height: 1.4;
    }

    .hp-hadith {
        padding: .35rem .6rem;
        margin-bottom: .75rem;
    }

    .hp-hadith__text {
        font-size: .86rem;
    }
}

/* Dua al-Faraj — full-width card (when text source exists) */
.hp-dua {
    margin: 0 0 1.75rem;
    padding: 1rem 1.1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.hp-dua__body {
    margin: 0;
}

.hp-dua__text {
    margin: 0;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-line;
}

/* Books widget in homepage_books slot reuses .hp-books rail */
.hp-slot--homepage_books > .widget--books.hp-books {
    margin-bottom: 1.75rem;
}

.hp-slot--homepage_books .widget--books .hp-box__head {
    margin-bottom: .65rem;
}

/* ---------- Books (horizontal strip) ---------- */
.hp-books {
    margin: 0 0 1.75rem;
    padding: .85rem .85rem .9rem;
    min-width: 0;
    max-width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.hp-books__rail {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1rem;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(12, 160, 230, .35) transparent;
    padding-block: .1rem;
    padding-inline: .05rem .15rem;
}

.hp-books__rail::-webkit-scrollbar {
    height: 5px;
}

.hp-books__rail::-webkit-scrollbar-track {
    background: transparent;
}

.hp-books__rail::-webkit-scrollbar-thumb {
    background: rgba(12, 160, 230, .35);
    border-radius: 999px;
}

.hp-book {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-decoration: none;
    color: inherit;
    background: var(--color-bg);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: .55rem;
    width: 120px;
    flex: 0 0 120px;
    max-width: 120px;
    min-height: 0;
    scroll-snap-align: start;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    overflow: hidden;
}

.hp-book:hover {
    border-color: rgba(12, 160, 230, .4);
    background: var(--color-surface);
    box-shadow: var(--shadow-hover);
    color: inherit;
    transform: translateY(-2px);
}

.hp-book:focus-visible {
    outline: 2px solid rgba(12, 160, 230, .55);
    outline-offset: 2px;
}

.hp-book__cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--color-accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.hp-book__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hp-book__initial {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.hp-book__title {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.35;
    min-height: calc(1.35em * 2);
    max-height: calc(1.35em * 2);
    color: var(--color-primary-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

@media (max-width: 991.98px) {
    .hp-book {
        width: 108px;
        flex-basis: 108px;
        max-width: 108px;
        padding: .45rem;
    }

    .hp-book__initial {
        font-size: 1.1rem;
    }
}

@media (max-width: 575.98px) {
    .hp-home__body { padding: 1.35rem 0 2.35rem; }

    .hp-books {
        padding: .7rem .65rem .75rem;
        margin-bottom: 1.35rem;
    }

    .hp-books__rail {
        gap: .75rem;
        scrollbar-width: none;
    }

    .hp-books__rail::-webkit-scrollbar {
        display: none;
    }

    .hp-book {
        width: 96px;
        flex: 0 0 96px;
        max-width: 96px;
        padding: .4rem;
    }

    .hp-book:hover {
        transform: none;
    }

    .hp-book__title {
        font-size: .7rem;
    }

    .hp-book__initial {
        font-size: 1rem;
    }
}

/* ---------- Footer ---------- */
.hp-footer {
    background: var(--color-footer);
    color: rgba(255, 255, 255, .92);
    margin-top: 0;
    border-top: 0;
    width: 100%;
}

.hp-footer__top { padding: 2.5rem 0 1.75rem; }

.hp-footer__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 1.75rem 1.5rem;
    max-width: var(--hp-content-width);
    margin: 0 auto;
    padding: 0 12px;
}

.hp-footer__heading {
    margin: 0 0 .85rem;
    font-size: .9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0;
    padding-bottom: .45rem;
    border-bottom: 1px solid rgba(255, 255, 255, .22);
}

.hp-footer__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: #fff;
    text-decoration: none;
    margin-bottom: .65rem;
}

.hp-footer__brand .hp-brand__mark {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    border-color: rgba(255, 255, 255, .28);
}

.hp-footer__brand .hp-brand__name { color: #fff; }

.hp-footer__about {
    margin: 0;
    font-size: .88rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .82);
    max-width: 28rem;
}

.hp-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .45rem;
}

.hp-footer__links a {
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: .88rem;
    transition: color var(--transition), background var(--transition);
    border-radius: 4px;
    padding: 0 .15rem;
}

.hp-footer__links a:hover {
    color: var(--color-accent);
    background: transparent;
}

.hp-footer__social {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.hp-footer__muted {
    color: rgba(255, 255, 255, .55);
}

.hp-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .18);
    padding: .85rem 0;
    text-align: center;
    font-size: .8rem;
    color: rgba(255, 255, 255, .78);
    font-weight: 500;
}

@media (max-width: 991.98px) {
    .hp-footer__grid { grid-template-columns: 1fr 1fr; }
    .hp-footer__col--brand { grid-column: 1 / -1; }
}

@media (max-width: 575.98px) {
    .hp-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Shared internal pages (site shell) ---------- */
.site-main {
    padding: 1.75rem 0 3rem;
    background: transparent;
}

.hp-main > .container,
.hp-main .container {
    max-width: var(--hp-content-width);
}

.site-container { max-width: 1100px; }
.site-container--narrow { max-width: 820px; }

.site-page-header { margin-bottom: 1.35rem; }

.site-page-title {
    margin: 0 0 .35rem;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.35;
}

.site-page-lead {
    margin: 0;
    color: var(--color-muted);
    font-size: .95rem;
}

.site-muted { color: var(--color-muted); }

.site-toolbar .form-control,
.site-toolbar .form-select {
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .92rem;
}

.site-toolbar .form-control:focus,
.site-toolbar .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem rgba(12, 160, 230, .22);
}

.site-btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.site-btn-primary:hover,
.site-btn-primary:focus {
    background: var(--color-button-active);
    border-color: var(--color-button-active);
    color: #fff;
}

.site-breadcrumb .breadcrumb {
    --bs-breadcrumb-divider: "←";
    background: transparent;
    padding: 0;
    font-size: .86rem;
}

.site-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: .5rem;
    padding-right: 0;
    color: var(--color-muted);
}

.site-breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.site-breadcrumb a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.site-breadcrumb .active { color: var(--color-muted); }

.site-article {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem 1.35rem 1.75rem;
    box-shadow: var(--shadow-soft);
}

.site-article__header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.site-article__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-bottom: .65rem;
}

.site-article__heading .site-article__title {
    margin-bottom: 0;
    flex: 1 1 12rem;
}

.site-admin-edit {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
    padding: .35rem .7rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-primary-dark);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.site-admin-edit:hover,
.site-admin-edit:focus {
    background: var(--hp-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    text-decoration: none;
}

.site-admin-edit--compact {
    padding: .3rem .55rem;
    font-size: .78rem;
}

.hp-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
}

.site-article__title {
    margin: 0 0 .65rem;
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.4;
}

.site-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    font-size: .85rem;
    color: var(--color-muted);
}

.content-audio {
    margin: .35rem 0 1rem;
}

.content-audio audio {
    width: 100%;
    max-width: 28rem;
    vertical-align: middle;
}

.content-audio__link {
    margin-top: .35rem;
    font-size: .85rem;
}

.content-audio__link a {
    color: var(--color-primary);
}

.site-article__type {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: var(--hp-primary-soft);
    color: var(--color-primary-dark);
    font-weight: 600;
    font-size: .78rem;
}

.content-field { margin-bottom: 1.25rem; }

.content-field__label {
    font-size: .82rem;
    color: var(--color-muted);
    margin-bottom: .3rem;
    font-weight: 600;
}

.content-summary {
    font-size: 1.08rem;
    color: var(--color-text);
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.content-html {
    font-size: 1rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.content-html img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.content-html p:last-child { margin-bottom: 0; }

.site-card__media {
    margin: -.15rem -.15rem .85rem;
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
    overflow: hidden;
}

.site-card__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
}

.site-card__field {
    font-size: .86rem;
    color: var(--color-muted);
    margin-top: .35rem;
}

.site-pagination .page-link {
    color: var(--color-primary);
    border-color: var(--color-border);
}

.site-pagination .page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.site-pagination .page-link:hover {
    background: var(--hp-primary-soft);
    color: var(--color-primary-dark);
}

@media (max-width: 575.98px) {
    .site-main { padding: 1.15rem 0 2.25rem; }
    .site-article {
        padding: 1.15rem 1rem 1.35rem;
        border-radius: var(--radius-sm);
    }
}

/* Content detail comments — scoped, uses site color tokens */
.content-comments {
    margin-top: 1.15rem;
    padding-top: .95rem;
    border-top: 1px solid var(--color-border-soft);
}

.content-comments__title {
    margin: 0 0 .7rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-strong);
    line-height: 1.3;
}

.content-comments__empty {
    margin: 0 0 .75rem;
    font-size: .88rem;
}

.content-comments__item {
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: .65rem .8rem .7rem;
    margin-bottom: .55rem;
}

.content-comments__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem .55rem;
    min-width: 0;
}

.content-comments__author {
    font-weight: 600;
    font-size: .84rem;
    color: var(--color-text-strong);
}

.content-comments__date {
    font-size: .74rem;
    color: var(--color-muted);
}

.content-comments__badge {
    display: inline-flex;
    align-items: center;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1;
    padding: .18rem .42rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
}

.content-comments__badge--pending {
    background: var(--color-bg);
    color: var(--color-muted);
    border-color: var(--color-border);
}

.content-comments__badge--approved {
    background: var(--color-accent-soft);
    color: var(--color-primary-dark);
    border-color: var(--color-border-soft);
}

.content-comments__badge--rejected {
    background: var(--color-surface-soft);
    color: var(--color-muted);
    border-color: var(--color-border-soft);
}

.content-comments__admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    margin-inline-start: auto;
}

.content-comments__edit-form {
    flex: 1 0 100%;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: flex-end;
    margin-top: .3rem;
}

.content-comments__edit-form[hidden] {
    display: none !important;
}

.content-comments__edit-form .form-control {
    flex: 1 1 12rem;
    min-width: 0;
}

.content-comments__body {
    margin: .4rem 0 0;
    font-size: .9rem;
    line-height: 1.6;
    color: var(--color-text);
}

.content-comments__replies {
    margin-top: .5rem;
    margin-inline-start: .85rem;
    padding-inline-start: .7rem;
    border-inline-start: 2px solid var(--color-border);
}

.content-comments__replies-label {
    margin: 0 0 .35rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-muted);
}

.content-comments__reply {
    background: var(--color-bg);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: .5rem .65rem;
    margin-bottom: .35rem;
}

.content-comments__reply:last-child {
    margin-bottom: 0;
}

.content-comments__btn {
    font-size: .72rem !important;
    font-weight: 600;
    line-height: 1.25;
    padding: .18rem .5rem !important;
    border-radius: 8px;
}

.content-comments__btn--ghost {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.content-comments__btn--ghost:hover,
.content-comments__btn--ghost:focus {
    background: var(--color-accent-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.content-comments__reply-form {
    margin-top: .5rem;
}

.content-comments__reply-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: flex-end;
}

.content-comments__reply-form-row .form-control {
    flex: 1 1 12rem;
    min-width: 0;
}

.content-comments__label {
    font-size: .78rem;
    margin-bottom: .2rem;
    color: var(--color-muted);
}

.content-comments__form-title {
    margin: .85rem 0 .45rem;
    font-size: .92rem;
    font-weight: 700;
    color: var(--color-text-strong);
}

.content-comments__form {
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-sm);
    padding: .7rem .8rem .75rem;
}

.content-comments__form .form-control,
.content-comments__reply-form .form-control {
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .88rem;
}

.content-comments__form .form-control:focus,
.content-comments__reply-form .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .15rem rgba(12, 160, 230, .18);
}

@media (max-width: 575.98px) {
    .content-comments__replies {
        margin-inline-start: .35rem;
        padding-inline-start: .5rem;
    }

    .content-comments__admin {
        margin-inline-start: 0;
        width: 100%;
    }

    .content-comments__reply-form-row .content-comments__btn {
        width: 100%;
    }
}

/* Global search page */
.site-search-page__header {
    margin-bottom: 1.1rem;
}

.site-search-page__lead {
    margin-top: .35rem;
    word-break: break-word;
}

.site-search-page__total {
    display: block;
    margin-top: .25rem;
    color: #64748b;
    font-size: .95rem;
}

.site-search-box__row {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: stretch;
}

.site-search-box__field {
    position: relative;
    flex: 1 1 14rem;
    min-width: 0;
}

.site-search-box__type {
    flex: 0 1 11rem;
    min-width: 8.5rem;
}

.site-search-box__select {
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    min-height: 2.65rem;
}

.site-search-box__select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem rgba(12, 160, 230, .22);
}

.site-search-box__icon {
    position: absolute;
    inset-inline-start: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    pointer-events: none;
    font-size: .95rem;
}

.site-search-box__input {
    padding-inline-start: 2.35rem;
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    min-height: 2.65rem;
}

.site-search-box__input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem rgba(12, 160, 230, .22);
}

.site-search-box__submit {
    flex: 0 0 auto;
    min-height: 2.65rem;
    padding-inline: 1.15rem;
    white-space: nowrap;
}

.site-search-results {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.site-search-result {
    padding: .9rem 0;
    border-bottom: 1px solid var(--color-border);
}

.site-search-result:last-child {
    border-bottom: 0;
}

.site-search-result__title {
    display: inline-block;
    max-width: 100%;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-decoration: none;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

a.site-search-result__title:hover,
a.site-search-result__title:focus {
    color: var(--color-primary);
    text-decoration: underline;
}

a.site-search-result__title:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.site-search-result__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .85rem;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--color-muted);
}

.site-search-result__type {
    display: inline-block;
}

.site-search-result__snippet {
    margin: .35rem 0 0;
    font-size: .92rem;
    color: var(--color-text, #333);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

mark.search-highlight,
.search-highlight {
    background: #ffe08a;
    color: inherit;
    padding: 0 .12em;
    border-radius: .15em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.site-search-result__book {
    margin: 0 0 0.2rem;
    font-size: 0.875rem;
    color: var(--site-muted, #6c757d);
}

.site-search-result__author {
    margin-top: .3rem;
    font-size: .86rem;
    color: var(--color-muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.site-search-chips {
    margin: 0 0 1rem;
}

.site-search-chips__list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-search-chips__item {
    margin: 0;
}

.site-search-chips__chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 100%;
    padding: .3rem .7rem;
    border: 1px solid var(--color-border, #dee2e6);
    border-radius: 999px;
    background: var(--color-surface, #fff);
    color: var(--color-text, #333);
    font-size: .9rem;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

.site-search-chips__chip:hover,
.site-search-chips__chip:focus {
    background: #f1f3f5;
    border-color: var(--color-primary, #0d6efd);
    color: inherit;
    text-decoration: none;
}

.site-search-chips__term {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.site-search-chips__count {
    color: var(--site-muted, #6c757d);
    font-size: .82rem;
    white-space: nowrap;
}

.site-search-chips__chip--phrase .site-search-chips__term {
    font-weight: 700;
}

.site-search-section {
    margin-top: .15rem;
}

.site-search-section--after {
    margin-top: 1.75rem;
}

.site-search-section__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .4rem;
    margin: 0 0 .65rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.35;
}

.site-search-section__count {
    font-size: .88rem;
    font-weight: 500;
    color: var(--color-muted);
}

.site-search-results--chapters .site-search-result--chapter {
    padding-block: 0.85rem;
}

.site-search-results--books .site-search-result--book {
    padding: .75rem 0;
}

.site-search-empty .hp-empty__text {
    margin-top: .35rem;
}

@media (max-width: 575.98px) {
    .site-search-box__row {
        flex-direction: column;
        gap: .55rem;
    }

    .site-search-box__field {
        flex: 1 1 auto;
        width: 100%;
    }

    .site-search-box__type {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .site-search-box__submit {
        width: 100%;
    }

    .site-search-result {
        padding: .75rem 0;
    }

    .site-search-result__title {
        font-size: 1rem;
    }

    .site-search-section--after {
        margin-top: 1.35rem;
    }

    .site-search-page {
        overflow-x: hidden;
    }
}

/* =====================================================================
   ALMONJI 2026 HOMEPAGE REDESIGN
   ---------------------------------------------------------------------
   Appended override layer. Every historical class name is preserved;
   this block only refines the public shell visual layer:
   langbar, header, nav, announcement bar, book carousel, content cards
   and the large wave footer. Internal pages keep the original styles.
   ===================================================================== */

:root {
    --hp-content-width: 1180px;

    /* Content-card pastel tones */
    --tone-sky: #2f9fe0;
    --tone-sky-soft: #e6f4fd;
    --tone-sky-soft2: #d2ebfb;
    --tone-green: #57b558;
    --tone-green-soft: #e9f7ea;
    --tone-green-soft2: #d7f0da;
    --tone-teal: #25b3a6;
    --tone-teal-soft: #e2f6f4;
    --tone-teal-soft2: #cceeeb;
    --tone-amber: #ef9d1f;
    --tone-amber-soft: #fdf2de;
    --tone-amber-soft2: #fae5c4;
    --tone-blue: #3b78e0;
    --tone-blue-soft: #e8f0fd;
    --tone-blue-soft2: #d4e3fb;
    --tone-pink: #ec5f8b;
    --tone-pink-soft: #fce7ef;
    --tone-pink-soft2: #f8d2e0;
    --tone-violet: #8b5cf6;
    --tone-violet-soft: #efe9fe;
    --tone-violet-soft2: #dfd5fd;
    --tone-indigo: #6a5ae0;
    --tone-indigo-soft: #ece9fd;
    --tone-indigo-soft2: #dbd6fc;
}

/* ---------- Language bar (white, pill buttons) ---------- */
.hp-langbar {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border-soft);
}

.hp-langbar__inner {
    padding: .6rem 0;
}

.hp-langbar__label {
    color: var(--color-muted);
    font-weight: 600;
}

.hp-langbar__link {
    color: var(--color-primary-dark);
    /* Very light per-item chip (white → pale cyan) with a whisper-thin border. */
    background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(231, 250, 255, .78) 100%);
    border: 1px solid rgba(12, 160, 230, .16);
    padding: .26rem .7rem;
    box-shadow: none;
    transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.hp-langbar__link:hover,
.hp-langbar__link:focus-visible {
    color: var(--color-primary-dark);
    background: var(--color-accent-soft);
    border-color: rgba(12, 160, 230, .34);
    box-shadow: 0 1px 6px rgba(12, 160, 230, .14);
}

.hp-langbar__link.is-active {
    color: #4a3a00;
    background: var(--color-accent);
    border-color: var(--color-accent);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(255, 201, 0, .38);
}

/* ---------- Header (taller, blue gradient logo, pill search) ---------- */
.hp-header {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border-soft);
    box-shadow: 0 6px 22px rgba(16, 60, 120, .06);
}

.hp-header__top {
    min-height: 82px;
    padding: .9rem 0 .7rem;
    column-gap: 1.5rem;
}

.hp-brand__mark {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #22a7ec 0%, #0b6fc4 100%);
    color: #ffffff;
    border: 0;
    box-shadow: 0 8px 20px rgba(12, 120, 200, .28);
}

.hp-brand__name {
    font-size: 1.16rem;
    font-weight: 800;
    color: var(--color-primary-dark);
}

.hp-brand__tagline {
    font-size: .76rem;
}

.hp-search {
    max-width: 520px;
    min-height: 46px;
    background: #f2f7fb;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: .25rem .3rem .25rem .95rem;
}

.hp-search__icon {
    font-size: 1rem;
}

.hp-search input {
    height: 38px;
    font-size: .92rem;
}

.hp-search button {
    border-radius: 999px;
    padding: .5rem 1.15rem;
    font-size: .84rem;
}

.hp-login {
    font-weight: 600;
}

/* ---------- Main navigation (compact, modern) ---------- */
.hp-nav {
    position: relative;
    /* Keeps the decorative ribbons (z-index 0) below the menu content (z-index 1). */
    isolation: isolate;
    border-top: 1px solid rgba(12, 160, 230, .14);
    /* Modern, abstract background: soft radial glows over a light linear gradient.
       Colours come from the site palette (--color-primary / --color-primary-dark /
       --color-surface-soft / --color-accent-soft) plus one very small yellow accent. */
    background:
        radial-gradient(120% 240% at 100% 0%, rgba(255, 255, 0, .14) 0%, rgba(255, 255, 0, 0) 42%),
        radial-gradient(95% 220% at 0% 0%, rgba(12, 160, 230, .18) 0%, rgba(12, 160, 230, 0) 62%),
        radial-gradient(70% 200% at 50% 100%, rgba(20, 1, 133, .06) 0%, rgba(20, 1, 133, 0) 60%),
        linear-gradient(90deg, #eef9ff 0%, var(--color-surface-soft) 46%, var(--color-accent-soft) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), 0 2px 12px rgba(16, 60, 120, .05);
}

/* Decorative light ribbons: static (no animation), abstract and very low contrast.
   Radial fills keep the shape symmetric, so the effect mirrors correctly in RTL/LTR. */
.hp-nav::before,
.hp-nav::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(12px);
}

/* Cyan light sweep entering from the start edge; leaves the middle of the bar clear. */
.hp-nav::before {
    inset-inline-start: -5%;
    width: 44%;
    transform: rotate(-3deg);
    background: radial-gradient(closest-side, rgba(12, 160, 230, .30) 0%, rgba(12, 160, 230, .12) 58%, rgba(12, 160, 230, 0) 100%);
}

/* Faint violet glow on the opposite edge, plus a whisper of the accent yellow. */
.hp-nav::after {
    inset-inline-end: -6%;
    width: 38%;
    transform: rotate(3deg);
    background:
        radial-gradient(closest-side, rgba(255, 255, 0, .10) 0%, rgba(255, 255, 0, 0) 82%),
        radial-gradient(closest-side, rgba(20, 1, 133, .17) 0%, rgba(20, 1, 133, .06) 60%, rgba(20, 1, 133, 0) 100%);
}

.hp-nav__scroller {
    position: relative;
    z-index: 1;
    gap: .1rem;
    padding: .3rem .35rem;
}

.hp-nav__link {
    position: relative;
    color: #38506b;
    font-size: .88rem;
    font-weight: 600;
    padding: .38rem .58rem;
    margin: .18rem .06rem;
    /* Very light per-item chip (white → pale cyan). The bar background stays untouched. */
    background: linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(231, 250, 255, .70) 100%);
    border: 1px solid rgba(12, 160, 230, .14);
    border-radius: 999px;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.hp-nav__link:hover {
    color: var(--color-primary-dark);
    background: #ffffff;
    border-color: rgba(12, 160, 230, .34);
    box-shadow: 0 2px 10px rgba(12, 160, 230, .16);
}

.hp-nav__link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.hp-nav__link.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-primary) 0%, #0b6fc4 100%);
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(12, 120, 200, .26);
}

/* Minimal accent marker for the active item (logical properties keep it RTL/LTR safe). */
.hp-nav__link.is-active::after {
    content: "";
    position: absolute;
    inset-inline: 34%;
    bottom: .16rem;
    height: 2px;
    border-radius: 2px;
    background: var(--color-accent);
}

@media (max-width: 991.98px) {
    .hp-nav__scroller {
        gap: 0;
        padding: .1rem .2rem .2rem;
    }

    .hp-nav__link {
        padding: .58rem .5rem;
        margin: .1rem 0;
        border-radius: 10px;
    }

    .hp-nav__link.is-active {
        box-shadow: none;
        background: var(--color-primary);
        color: #ffffff;
    }

    /* Keep the phone/tablet panel unchanged: no accent marker, no hover shadow. */
    .hp-nav__link.is-active::after {
        content: none;
    }

    .hp-nav__link:hover {
        box-shadow: none;
    }

    [dir="ltr"] .hp-nav__link.is-active {
        box-shadow: none;
    }
}

/* ---------- Homepage canvas ---------- */
.hp-home {
    background:
        radial-gradient(80% 60% at 100% 0%, rgba(12, 160, 230, .10) 0%, rgba(12, 160, 230, 0) 60%),
        radial-gradient(70% 55% at 0% 2%, rgba(20, 1, 133, .06) 0%, rgba(20, 1, 133, 0) 55%),
        linear-gradient(180deg, #f1f8fd 0%, var(--color-bg) 52%);
}

.hp-home__body {
    padding: 1.5rem 0 3.2rem;
}

/* ---------- "آخرین مطالب" section head ---------- */
.hp-latest__head {
    justify-content: flex-start;
    margin: 2.3rem 0 1.4rem;
    padding: 0;
    border-bottom: 0;
}

.hp-latest__title {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 800;
    color: var(--color-primary-dark);
}

.hp-latest__title::before {
    content: none;
    display: none;
}

.hp-latest__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #22a7ec 0%, #0b6fc4 100%);
    color: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 6px 16px rgba(12, 120, 200, .25);
}

/* ---------- Content card grid ---------- */
.hp-boxes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.35rem 1.15rem;
}

.hp-box {
    --card-accent: var(--color-primary);
    --card-accent-soft: var(--color-accent-soft);
    --card-accent-soft2: #d2ebfb;
    position: relative;
    background: var(--color-surface);
    border: 1px solid rgba(20, 1, 133, .07);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(16, 60, 120, .08);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.hp-box:hover {
    transform: translateY(-3px);
    border-color: rgba(12, 160, 230, .28);
    box-shadow: 0 18px 40px rgba(16, 60, 120, .14);
}

/* Tone palettes bound to card accent variables */
.hp-box.hp-box--sky { --card-accent: var(--tone-sky); --card-accent-soft: var(--tone-sky-soft); --card-accent-soft2: var(--tone-sky-soft2); }
.hp-box.hp-box--green { --card-accent: var(--tone-green); --card-accent-soft: var(--tone-green-soft); --card-accent-soft2: var(--tone-green-soft2); }
.hp-box.hp-box--teal { --card-accent: var(--tone-teal); --card-accent-soft: var(--tone-teal-soft); --card-accent-soft2: var(--tone-teal-soft2); }
.hp-box.hp-box--amber { --card-accent: var(--tone-amber); --card-accent-soft: var(--tone-amber-soft); --card-accent-soft2: var(--tone-amber-soft2); }
.hp-box.hp-box--blue { --card-accent: var(--tone-blue); --card-accent-soft: var(--tone-blue-soft); --card-accent-soft2: var(--tone-blue-soft2); }
.hp-box.hp-box--pink { --card-accent: var(--tone-pink); --card-accent-soft: var(--tone-pink-soft); --card-accent-soft2: var(--tone-pink-soft2); }
.hp-box.hp-box--violet { --card-accent: var(--tone-violet); --card-accent-soft: var(--tone-violet-soft); --card-accent-soft2: var(--tone-violet-soft2); }
.hp-box.hp-box--indigo { --card-accent: var(--tone-indigo); --card-accent-soft: var(--tone-indigo-soft); --card-accent-soft2: var(--tone-indigo-soft2); }

/* Card header: pastel curved background + floating decorative shapes */
.hp-box > .hp-box__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0;
    min-height: 62px;
    padding: .8rem .95rem;
    border-bottom: 0;
    background: linear-gradient(135deg, var(--card-accent-soft) 0%, var(--card-accent-soft2) 100%);
    overflow: hidden;
}

.hp-box > .hp-box__head::after {
    content: "";
    position: absolute;
    inset-inline-end: -34px;
    top: -46px;
    width: 128px;
    height: 128px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    pointer-events: none;
}

.hp-box > .hp-box__head::before {
    content: "";
    position: absolute;
    inset-inline-start: -22px;
    bottom: -50px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    pointer-events: none;
}

.hp-box > .hp-box__head > .hp-box__icon {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #ffffff;
    background: var(--card-accent);
    box-shadow: 0 6px 14px rgba(16, 60, 120, .2);
}

.hp-boxes > .hp-box > .hp-box__head > .hp-section__title {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 1.03rem;
    font-weight: 800;
    color: var(--card-accent);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-boxes > .hp-box > .hp-box__head > .hp-section__title::before {
    content: none;
    display: none;
}

.hp-box > .hp-box__head > .hp-section__all {
    position: relative;
    z-index: 1;
    margin-inline-start: auto;
    padding: .28rem .6rem;
    font-size: .78rem;
    font-weight: 700;
    color: var(--card-accent);
    background: rgba(255, 255, 255, .72);
    border-radius: 999px;
}

.hp-box > .hp-box__head > .hp-section__all:hover {
    color: var(--card-accent);
    background: #ffffff;
}

/* Card body: clean list with tone-coloured bullets */
.hp-box > .hp-box__list {
    margin: 0;
    padding: .6rem .95rem .7rem;
}

.hp-box > .hp-box__list > .hp-box__item {
    position: relative;
    padding: .5rem 0 .5rem 0;
    padding-inline-start: 1.05rem;
    border-bottom: 1px dashed rgba(20, 1, 133, .09);
    background-image: none;
    border-radius: 8px;
}

.hp-box > .hp-box__list > .hp-box__item:hover {
    background-color: rgba(16, 60, 120, .035);
}

.hp-box > .hp-box__list > .hp-box__item::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: .98rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--card-accent);
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px var(--card-accent-soft2);
}

.hp-box > .hp-box__list > .hp-box__item:last-child {
    border-bottom: 0;
}

.hp-box > .hp-box__list .hp-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-box > .hp-box__list .hp-card__title a {
    color: #24344a;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.6;
    max-height: none;
}

.hp-box > .hp-box__list > .hp-box__item:hover .hp-card__title a {
    color: var(--card-accent);
}

.hp-box > .hp-box__foot {
    margin-top: auto;
    padding: .65rem .95rem .85rem;
    border-top: 1px solid rgba(20, 1, 133, .06);
    background: transparent;
}

.hp-box > .hp-box__foot .hp-section__all {
    color: var(--card-accent);
    font-size: .82rem;
    font-weight: 700;
    padding: .1rem .2rem;
}

.hp-box > .hp-box__foot .hp-section__all:hover {
    color: var(--card-accent);
    background: var(--card-accent-soft);
}

/* Occasions variant (monasebat) */
.hp-box > .hp-box__list > .hp-box__item--occasion {
    padding-inline-start: 0;
}

.hp-box > .hp-box__list > .hp-box__item--occasion::before {
    content: none;
}

.hp-occasion__day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    border-radius: 9px;
    background: var(--card-accent-soft);
    color: var(--card-accent);
    font-weight: 800;
    font-size: .8rem;
}

.hp-occasion__title {
    -webkit-line-clamp: 2;
}

/* ---------- Announcement bar (hadith marquee) ---------- */
.hp-slot--homepage_hadith,
.hp-slot--homepage_dua {
    margin: 0 0 1.1rem;
}

.hp-hadith {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 0;
    padding: .8rem 1.1rem;
    background: linear-gradient(90deg, #f7fbfe 0%, #eaf3fa 100%);
    border: 1px solid var(--color-border-soft);
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(16, 60, 120, .05);
}

.hp-hadith__bell {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    background: #ffffff;
    font-size: 1.05rem;
    box-shadow: 0 4px 12px rgba(16, 60, 120, .1);
}

.hp-hadith__viewport {
    flex: 1 1 auto;
    min-width: 0;
}

.hp-hadith__text {
    color: var(--color-primary-dark);
    font-weight: 600;
}

/* ---------- Book carousel ---------- */
.hp-slot--homepage_books {
    margin: 0 0 1.4rem;
}

.hp-books {
    position: relative;
    margin: 0;
    padding: 1.05rem 1.15rem 1.15rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-soft);
    border-radius: 20px;
    box-shadow: 0 16px 38px rgba(16, 60, 120, .09);
    overflow: hidden;
}

.hp-books__stage {
    position: relative;
    display: block;
}

.hp-books__rail {
    gap: .9rem;
    padding: .25rem 2.9rem;
    scrollbar-width: thin;
}

.hp-book {
    width: 132px;
    flex: 0 0 132px;
    max-width: 132px;
    padding: .25rem;
    gap: .6rem;
    background: transparent;
    border: 0;
    border-radius: 14px;
}

.hp-book:hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: translateY(-4px);
}

.hp-book__cover {
    border-radius: 12px;
    border: 0;
    box-shadow: 0 10px 22px rgba(16, 60, 120, .16);
    overflow: hidden;
}

.hp-book__title {
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.hp-books__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 60, 120, .14);
    transition: background var(--transition), color var(--transition), opacity var(--transition);
}

.hp-books__nav--prev {
    inset-inline-start: .5rem;
}

.hp-books__nav--next {
    inset-inline-end: .5rem;
}

.hp-books__nav:hover {
    background: var(--color-primary);
    color: #ffffff;
}

.hp-books__nav:disabled {
    opacity: .35;
    cursor: default;
}

@media (max-width: 575.98px) {
    .hp-books__rail {
        padding-inline: .1rem;
    }

    .hp-books__nav {
        display: none;
    }
}

/* ---------- Footer: blue gradient + waves + mosque ---------- */
.hp-footer {
    position: relative;
    overflow: hidden;
    margin-top: 0;
    border-top: 0;
    color: rgba(255, 255, 255, .94);
    background:
        radial-gradient(120% 130% at 12% 0%, #1f8fd6 0%, rgba(31, 143, 214, 0) 55%),
        linear-gradient(180deg, #12a2e2 0%, #0b86c9 46%, #0a5ea3 100%);
}

/* Wave transition removed: footer top is flat */
.hp-footer__wave {
    display: none;
}

.hp-footer__wave svg {
    display: block;
    width: 100%;
    height: 100%;
}

.hp-footer__wave-bg {
    fill: var(--color-bg);
}

.hp-footer__wave-glow--1 {
    fill: rgba(255, 255, 255, .16);
}

.hp-footer__wave-glow--2 {
    fill: rgba(255, 255, 255, .08);
}

.hp-footer__mosque {
    position: absolute;
    left: 1.5rem;
    bottom: 3.4rem;
    width: min(40vw, 340px);
    z-index: 1;
    color: rgba(255, 255, 255, .16);
    pointer-events: none;
    line-height: 0;
}

.hp-footer__mosque svg {
    display: block;
    width: 100%;
    height: auto;
}

.hp-footer__wordmark {
    position: absolute;
    right: 3.5rem;
    bottom: 4.4rem;
    z-index: 1;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .16);
    pointer-events: none;
    user-select: none;
}

.hp-footer__top {
    position: relative;
    z-index: 2;
    padding: 4rem 0 4.75rem;
}

.hp-footer__grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 2rem 1.75rem;
}

.hp-footer__heading {
    position: relative;
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    padding-bottom: .55rem;
    border-bottom: 1px solid rgba(255, 255, 255, .24);
}

.hp-footer__about {
    color: rgba(255, 255, 255, .84);
}

.hp-footer__brand .hp-brand__mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .16);
    color: #ffffff;
    border-color: rgba(255, 255, 255, .3);
}

.hp-footer__links {
    gap: .55rem;
}

.hp-footer__links a {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, .9);
    font-size: .9rem;
}

.hp-footer__links a::before {
    content: "\f12f";
    font-family: "bootstrap-icons";
    font-size: .68em;
    margin-inline-end: .45rem;
    opacity: .7;
    vertical-align: middle;
}

.hp-footer__links a.hp-footer__social::before {
    content: none;
}

.hp-footer__links a:hover {
    color: #ffffff;
}

.hp-footer__socials {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.1rem;
}

.hp-footer__social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    text-decoration: none;
    transition: background var(--transition), transform var(--transition);
}

.hp-footer__social-icon:hover,
.hp-footer__social-icon:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, .28);
    transform: translateY(-2px);
}

.hp-footer__bottom {
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, .2);
    padding: 1rem 0;
    text-align: center;
    font-size: .82rem;
    color: rgba(255, 255, 255, .84);
}

@media (max-width: 991.98px) {
    .hp-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .hp-footer__col--brand {
        grid-column: 1 / -1;
    }

    .hp-footer__top {
        padding: 3rem 0 3rem;
    }

    .hp-footer__mosque,
    .hp-footer__wordmark {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .hp-footer__grid {
        grid-template-columns: 1fr;
    }

    .hp-footer__top {
        padding: 2.5rem 0 2.5rem;
    }
}

/* ---------- Responsive card grid ---------- */
@media (max-width: 991.98px) {
    .hp-boxes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.1rem .95rem;
    }
}

@media (max-width: 575.98px) {
    .hp-boxes {
        grid-template-columns: minmax(0, 1fr);
    }

    .hp-home__body {
        padding: 1.1rem 0 2.4rem;
    }

    .hp-latest__head {
        margin: 1.7rem 0 1.05rem;
    }

    .hp-books {
        padding: .8rem .75rem .9rem;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-box,
    .hp-book {
        transition: none;
    }
}

/* =====================================================================
   POSITION EFFECTS (generic — independent of widget type)
   ---------------------------------------------------------------------
   Entrance effects (fade and zoom families) wrap the position output of
   WidgetManager::renderSlot(): .hp-effect.hp-effect--{effect}[data-widget-effect]
   `none` renders no wrapper at all, so the default output is untouched.

   `marquee` is different by design: it is emitted by the widget itself around
   its own text region (see widgets/partials/marquee.blade.php) so that only the
   text scrolls and the box/background/border/shadow stay static.
   ===================================================================== */

.hp-effect {
    --hp-effect-duration: .6s;
    --hp-effect-easing: cubic-bezier(.22, .61, .36, 1);
    --hp-marquee-duration: 26s;
    --hp-marquee-gap: 3rem;
}

.hp-effect--fade-up { animation: hp-effect-fade-up var(--hp-effect-duration) var(--hp-effect-easing) both; }
.hp-effect--fade-down { animation: hp-effect-fade-down var(--hp-effect-duration) var(--hp-effect-easing) both; }
.hp-effect--fade-left { animation: hp-effect-fade-left var(--hp-effect-duration) var(--hp-effect-easing) both; }
.hp-effect--fade-right { animation: hp-effect-fade-right var(--hp-effect-duration) var(--hp-effect-easing) both; }
.hp-effect--zoom-in { animation: hp-effect-zoom-in var(--hp-effect-duration) var(--hp-effect-easing) both; }
.hp-effect--zoom-out { animation: hp-effect-zoom-out var(--hp-effect-duration) var(--hp-effect-easing) both; }

@keyframes hp-effect-fade-up {
    from { opacity: 0; transform: translate3d(0, 18px, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes hp-effect-fade-down {
    from { opacity: 0; transform: translate3d(0, -18px, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes hp-effect-fade-left {
    from { opacity: 0; transform: translate3d(18px, 0, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes hp-effect-fade-right {
    from { opacity: 0; transform: translate3d(-18px, 0, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes hp-effect-zoom-in {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: none; }
}

@keyframes hp-effect-zoom-out {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: none; }
}

/* Marquee — continuous CSS-only ticker (overflow + transform + animation).
   Rendered INSIDE a widget, around its own text region only (never around the
   position/wrapper), so the box, its background, border, shadow and padding stay
   static while just the text scrolls. The track holds two identical groups;
   shifting the track by 50% of its own width wraps seamlessly. RTL mirrors both
   the order and the motion through `dir`. */
.hp-effect--marquee {
    overflow: hidden;
    white-space: nowrap;
}

/* A ticker is a single line: forced line breaks inside the marquee would break
   the strip height, so they are not rendered (content itself is untouched). */
.hp-effect--marquee br {
    display: none;
}

.hp-effect--marquee > .hp-effect__track {
    display: inline-flex;
    align-items: center;
    min-width: 100%;
    animation: hp-effect-marquee var(--hp-marquee-duration) linear infinite;
    will-change: transform;
}

.hp-effect--marquee[dir="rtl"] > .hp-effect__track {
    animation-name: hp-effect-marquee-rtl;
}

.hp-effect--marquee > .hp-effect__track > .hp-effect__group {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 100%;
    padding-inline-end: var(--hp-marquee-gap);
}

@keyframes hp-effect-marquee {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

@keyframes hp-effect-marquee-rtl {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(50%, 0, 0); }
}

@media (max-width: 767.98px) {
    .hp-effect {
        --hp-effect-duration: .45s;
        --hp-marquee-duration: 20s;
        --hp-marquee-gap: 2rem;
    }
}

/* Reduced motion: every position effect stops, content stays fully readable and
   the duplicated marquee copy is removed so nothing is shown twice. */
@media (prefers-reduced-motion: reduce) {
    .hp-effect,
    .hp-effect > .hp-effect__track {
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .hp-effect--marquee {
        overflow: visible;
        white-space: normal;
    }

    .hp-effect--marquee > .hp-effect__track {
        display: block;
        width: auto;
        min-width: 0;
        will-change: auto;
    }

    .hp-effect--marquee > .hp-effect__track > .hp-effect__group {
        display: block;
        min-width: 0;
        padding-inline-end: 0;
    }

    .hp-effect--marquee > .hp-effect__track > .hp-effect__group[data-widget-effect-clone] {
        display: none;
    }
}
