/*
 * Front homepage styles.
 *
 * The component rhythm follows UAE Design System guidance: clear hierarchy,
 * reusable cards and controls, readable contrast, keyboard focus, and responsive
 * spacing. This project keeps its existing Bootstrap-era assets isolated; these
 * scoped rules provide equivalent grid behavior without globally restyling the
 * shared portal header or footer.
 */
.front-home {
    --home-navy: var(--aj-navy, #12304d);
    --home-navy-deep: var(--aj-navy-deep, #0b2239);
    --home-gold: var(--aj-gold, #b68a35);
    --home-gold-bright: var(--aj-gold-light, #d1ae65);
    --home-gold-strong: var(--aj-gold-strong, #92722a);
    --home-gold-soft: var(--aj-gold-soft, #f4ecd8);
    --home-ink: #263548;
    --home-muted: #5c6c7d;
    --home-line: #dfe5eb;
    --home-surface: #fff;
    --home-soft: #f5f7f9;
    --home-radius: 16px;
    display: grid;
    gap: 12px;
    margin-top: -32px;
    min-width: 0;
    overflow-x: clip;
    color: var(--home-ink);
}

.front-home *,
.front-home *::before,
.front-home *::after { box-sizing: border-box; }

.front-home a { color: inherit; }
.front-home button,
.front-home summary { font: inherit; }
.front-home :focus-visible {
    outline: 3px solid #175d96;
    outline-offset: 3px;
    border-radius: 5px;
}

/* Latest-news ticker: desktop only, with opposite readable directions by locale. */
.home-news-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 4px 12px;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 10px;
    background: var(--home-surface);
    box-shadow: 0 3px 12px rgb(18 48 77 / 4%);
}
.home-news-ticker__label {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    color: var(--home-navy);
    font-size: .83rem;
    font-weight: 700;
}
.home-news-ticker__label i { color: var(--home-gold); }
.home-news-ticker__viewport { flex: 1; overflow: hidden; direction: ltr; }
.home-news-ticker__track {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 22px;
    animation: home-ticker-left 48s linear infinite;
    will-change: transform;
}
.home-news-ticker__item { display: inline-flex; align-items: center; gap: 11px; color: #35465a; font-size: .86rem; text-decoration: none; white-space: nowrap; }
.home-news-ticker a.home-news-ticker__item:hover, .home-news-ticker a.home-news-ticker__item:focus-visible { color: var(--home-gold); text-decoration: underline; text-underline-offset: 3px; }
.home-news-ticker__item > span { color: var(--home-gold-bright); font-size: 1.2rem; }
.home-news-ticker:hover .home-news-ticker__track,
.home-news-ticker:focus-within .home-news-ticker__track { animation-play-state: paused; }
html[lang="ar"] .home-news-ticker__track { animation-name: home-ticker-right; }
@keyframes home-ticker-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes home-ticker-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* Banner carousel: preserve each source image's proportions inside a rounded frame. */
.home-banner {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-block: 0;
    margin-inline: calc(50% - 50vw);
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(115deg, var(--home-navy-deep) 0%, var(--home-navy) 58%, var(--home-gold-strong) 150%);
    isolation: isolate;
}
.home-banner__slides {
    position: relative;
    width: 100%;
    height: clamp(320px, 32vw, 480px);
}
.home-banner__slide {
    position: absolute;
    inset: 0;
    display: grid;
    width: 100%;
    height: 100%;
    align-items: end;
    overflow: hidden;
    border-radius: inherit;
    background: linear-gradient(115deg, var(--home-navy-deep) 0%, var(--home-navy) 58%, var(--home-gold-strong) 150%);
    isolation: isolate;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(12px, 0, 0);
    transition: opacity .7s ease, transform .7s ease, visibility 0s linear .7s;
}
.home-banner__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
}
.home-banner__image {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.home-banner__shade {
    position: absolute;
    z-index: 1;
    inset: 0;
    background: linear-gradient(0deg, rgb(4 22 39 / 78%) 0%, rgb(4 22 39 / 28%) 36%, transparent 72%);
}
.home-banner__caption {
    position: relative;
    z-index: 2;
    width: min(100% - 10vw, 1450px);
    margin: 0 auto;
    padding-block: clamp(34px, 5vw, 72px);
    color: #fff;
    text-align: start;
}
.home-banner__eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--home-gold-bright); font-size: .9rem; font-weight: 700; }
.home-banner__caption h1 { max-width: 760px; margin: 0; color: #fff; font-size: clamp(1.8rem, 4vw, 3.6rem); font-weight: 700; line-height: 1.45; text-shadow: 0 2px 18px rgb(0 0 0 / 20%); }
.home-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.home-button:hover { text-decoration: none; }
.front-home a.home-button--banner { margin-top: 23px; border-color: var(--home-gold); color: var(--home-gold-strong); background: var(--home-gold-soft); }
.front-home a.home-button--banner:hover { color: #fff; background: var(--home-gold-strong); }
.home-banner__controls {
    position: absolute;
    z-index: 3;
    inset-inline: 0;
    bottom: 18px;
    display: flex;
    width: min(100% - 40px, 1450px);
    align-items: center;
    justify-content: space-between;
    margin-inline: auto;
    pointer-events: none;
}
.home-banner__controls button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 55%);
    border-radius: 50%;
    color: #fff;
    background: rgb(7 30 50 / 48%);
    cursor: pointer;
    pointer-events: auto;
}
.home-banner__controls button:hover { background: rgb(7 30 50 / 85%); }
.home-banner__indicators { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.home-banner__indicators button { width: 10px; height: 10px; padding: 0; border: 0; background: rgb(255 255 255 / 55%); }
.home-banner__indicators button[aria-current="true"] { width: 26px; border-radius: 8px; background: var(--home-gold); }

/* Section heading and tab navigation. */
.front-home__section {
    min-width: 0;
    padding: clamp(20px, 3.2vw, 34px);
    border: 1px solid var(--home-line);
    border-top: 4px solid var(--home-gold-bright);
    border-radius: var(--home-radius);
    background: var(--home-surface);
    box-shadow: 0 8px 26px rgb(18 48 77 / 4%);
}
.home-section-heading { display: flex; min-width: 0; align-items: center; gap: 16px; margin-bottom: 20px; }
.home-section-heading__icon {
    display: grid;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--home-navy);
    font-size: 1.25rem;
}
.home-section-heading__copy { min-width: 0; }
.home-section-heading h2 { margin: 0; color: var(--home-navy); font-size: clamp(1.2rem, 2.4vw, 1.7rem); font-weight: 700; line-height: 1.45; }
.home-section-heading p { margin: 3px 0 0; color: var(--home-muted); font-size: .88rem; line-height: 1.6; }
.home-section-heading__all { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; margin-inline-start: auto; color: var(--home-gold-strong) !important; font-size: .85rem; font-weight: 700; text-decoration: none; }
.home-section-heading__all:hover { text-decoration: underline; }
.home-service-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    overflow-x: auto;
    border-bottom: 1px solid var(--home-line);
    scrollbar-width: thin;
}
.home-service-tabs__tab {
    position: relative;
    display: inline-flex;
    min-height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border: 0;
    color: #536274;
    background: transparent;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}
.home-service-tabs__tab::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; content: ""; }
.home-service-tabs__tab:hover { color: var(--home-navy); }
.home-service-tabs__tab.is-active { color: var(--home-gold-strong); font-weight: 700; }
.home-service-tabs__tab.is-active::after { background: var(--home-gold); }
.home-service-panel[hidden],
.home-news-panel[hidden] { display: none; }

/* Bootstrap-like responsive service grid and the legacy service-card anatomy. */
.home-service-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.home-service-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 285px;
    flex-direction: column;
    align-items: center;
    padding: 19px 14px 14px;
    border: 1px solid var(--home-line);
    border-radius: 13px;
    background: #fff;
    text-align: center;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.home-service-card::before { position: absolute; inset: 0 0 auto; height: 3px; border-radius: 13px 13px 0 0; background: var(--home-gold-bright); content: ""; opacity: 0; transition: opacity .16s ease; }
.home-service-card:hover { transform: translateY(-2px); border-color: var(--home-gold); box-shadow: 0 10px 24px rgb(18 48 77 / 9%); }
.home-service-card:hover::before { opacity: 1; }
.home-service-card__icon { display: grid; flex: 0 0 52px; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: var(--home-gold-strong); background: var(--home-gold-soft); font-size: 1.3rem; }
.home-service-card__icon img { display: block; width: 50px; height: 50px; object-fit: contain; }
.home-service-card__title { display: -webkit-box; min-height: 2.9em; overflow: hidden; margin: 12px 0 5px; color: var(--home-navy); font-size: .9rem; font-weight: 700; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-service-card__summary { display: -webkit-box; min-height: 3.2em; overflow: hidden; margin: 0 0 12px; color: var(--home-muted); font-size: .73rem; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.home-service-card__actions { display: flex; width: 100%; flex-wrap: nowrap; gap: 5px; justify-content: center; margin-top: auto; }
.front-home .home-service-card__actions .home-button { box-sizing: border-box; min-width: 0; flex: 1 1 0; padding-inline: 6px; font-size: .68rem; white-space: normal; overflow-wrap: anywhere; }
.front-home .home-service-card__actions .home-button > i { flex: 0 0 auto; }
.front-home .home-service-card__actions .home-button > span { min-width: 0; }
.front-home .home-service-card__actions .home-button--primary { flex-basis: 0; border-color: var(--home-gold-strong); color: #fff; background: var(--home-gold-strong); }
.front-home .home-service-card__actions .home-button--primary:hover { color: #fff; filter: brightness(.92); }
.home-button--secondary { flex: 1 1 90px; border-color: #c9d1d9; color: var(--home-navy); background: #fff; cursor: pointer; }
.home-button--secondary:hover { border-color: var(--home-gold); background: var(--home-gold-soft); }
.home-service-card__details { position: relative; display: contents; }
.home-service-card__details > summary { list-style: none; }
.home-service-card__details > summary::-webkit-details-marker { display: none; }
.home-service-card__details > p { position: absolute; z-index: 5; top: calc(100% - 3px); right: 8px; left: 8px; margin: 0; padding: 13px; border: 1px solid var(--home-line); border-radius: 10px; color: var(--home-ink); background: #fff; box-shadow: 0 10px 28px rgb(18 48 77 / 15%); font-size: .8rem; line-height: 1.7; text-align: start; }
.home-service-card__visits { margin-top: 11px; color: #637183; font-size: .72rem; font-variant-numeric: tabular-nums; }
.home-service-card__visits i { margin-inline-end: 4px; color: var(--home-gold); }
.home-empty-state { margin: 0; padding: 22px; border: 1px dashed #cbd4dd; border-radius: 10px; color: var(--home-muted); background: var(--home-soft); text-align: center; }

/* Month selector and news-card timeline. */
.home-news-section { padding-bottom: clamp(24px, 3.2vw, 36px); }
.home-news-months { position: relative; display: flex; align-items: flex-start; gap: 0; margin: 0 0 20px; padding: 11px 8px 7px; overflow-x: auto; border: 1px solid var(--home-line); border-radius: 14px; background: linear-gradient(180deg, #fff, #fbfcfd); scrollbar-width: thin; scrollbar-color: #c7ad75 #edf0f3; scroll-snap-type: x proximity; }
.home-news-months::before { position: absolute; top: 22px; right: 35px; left: 35px; height: 2px; background: linear-gradient(90deg, #e8edf2, #d9c89e, #e8edf2); content: ""; pointer-events: none; }
.home-news-months__tab { position: relative; z-index: 1; display: flex; min-width: 0; min-height: 76px; flex: 1 1 0; flex-direction: column; align-items: center; gap: 6px; padding: 0 9px 5px; border: 0; border-radius: 10px; color: #536274; background: transparent; font-size: .76rem; font-weight: 600; cursor: pointer; scroll-snap-align: center; }
.home-news-months__marker { display: block; width: 13px; height: 13px; flex: 0 0 13px; margin: 5px 0 2px; border: 2px solid #c7ad75; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #fff; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.home-news-months__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-news-months__tab:hover { color: var(--home-navy); }
.home-news-months__tab:hover .home-news-months__marker { transform: scale(1.12); border-color: var(--home-gold-strong); }
.home-news-months__tab.is-active { color: var(--home-gold-strong); font-weight: 750; }
.home-news-months__tab.is-active .home-news-months__marker { transform: scale(1.12); border-color: var(--home-gold-strong); background: var(--home-gold-strong); box-shadow: 0 0 0 4px #f5ecd8; }
.home-news-empty { display: flex; min-height: 150px; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 24px; border: 1px dashed #d5dde5; border-radius: 13px; color: var(--home-muted); background: #fafbfd; text-align: center; }
.home-news-empty i { color: var(--home-gold); font-size: 1.1rem; }
.home-news-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-news-card { min-width: 0; overflow: hidden; border: 1px solid var(--home-line); border-radius: 13px; background: #fff; transition: transform .16s ease, box-shadow .16s ease; }
.home-news-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(18 48 77 / 8%); }
.home-news-card__media { position: relative; display: grid; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; background: linear-gradient(135deg, #eff2f4, #f8f6f0); text-decoration: none; }
.home-news-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.home-news-card__fallback { color: var(--home-gold); font-size: 2rem; }
.home-news-card__media time { position: absolute; inset-inline-start: 10px; bottom: 10px; z-index: 1; padding: 5px 9px; border-radius: 6px; color: #fff; background: rgb(11 34 57 / 88%); font-size: .7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.home-news-card__body { display: flex; min-height: 210px; flex-direction: column; align-items: flex-start; padding: 14px; text-align: start; }
.home-news-card__body h3 { display: -webkit-box; overflow: hidden; margin: 0 0 8px; font-size: .88rem; font-weight: 700; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.home-news-card__body h3 a { color: var(--home-navy); text-decoration: none; }
.home-news-card__body h3 a:hover { color: var(--home-gold-strong); text-decoration: underline; }
.home-news-card__body p { display: -webkit-box; overflow: hidden; margin: 0 0 12px; color: var(--home-muted); font-size: .76rem; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.home-news-card__more { display: inline-flex; align-items: center; gap: 7px; margin-top: auto; color: var(--home-gold-strong) !important; font-size: .78rem; font-weight: 700; text-decoration: none; }
.home-news-card__more:hover { text-decoration: underline; }

@media (max-width: 1199px) {
    .home-service-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .home-news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .home-service-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-banner__slides { height: clamp(280px, 36vw, 400px); }
    .home-news-months__tab { min-width: 78px; flex: 0 0 auto; }
}
@media (max-width: 767px) {
    /* Preserve the earlier mobile decision: no carousel, no empty slider gap. */
    .home-banner { display: none; }
    .home-news-ticker { display: none; }
    .front-home { margin-top: 0; }
}
@media (max-width: 575px) {
    .front-home { gap: 18px; }
    .front-home__section { padding: 18px 14px; border-radius: 13px; }
    .home-section-heading { align-items: flex-start; gap: 11px; margin-bottom: 16px; }
    .home-section-heading__icon { flex-basis: 42px; width: 42px; height: 42px; border-radius: 11px; font-size: 1.05rem; }
    .home-section-heading h2 { font-size: 1.08rem; }
    .home-section-heading p { font-size: .75rem; }
    .home-section-heading__all { max-width: 108px; align-self: center; gap: 5px; font-size: .72rem; text-align: end; }
    .home-service-tabs { margin-inline: -3px; margin-bottom: 15px; }
    .home-service-tabs__tab { min-height: 44px; padding-inline: 12px; font-size: .78rem; }
    .home-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .home-service-card { min-height: 270px; padding: 15px 9px 12px; border-radius: 11px; }
    .home-service-card__icon { flex-basis: 44px; width: 44px; height: 44px; font-size: 1.1rem; }
    .home-service-card__icon img { width: 42px; height: 42px; }
    .home-service-card__title { margin-top: 10px; font-size: .78rem; }
    .home-service-card__summary { font-size: .68rem; }
    .home-service-card__actions { gap: 5px; }
    .home-button { min-height: 39px; padding: 7px 8px; font-size: .68rem; }
    .front-home .home-service-card__actions .home-button { padding-inline: 4px; font-size: .6rem; }
    .home-service-card__visits { font-size: .66rem; }
    .home-news-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .home-news-card { display: grid; grid-template-columns: minmax(95px, 34%) minmax(0, 1fr); }
    .home-news-card__media { min-height: 100%; aspect-ratio: auto; }
    .home-news-card__body { min-height: 190px; padding: 12px; }
    .home-news-card__body h3 { font-size: .8rem; }
    .home-news-card__body p { font-size: .7rem; }
    .home-news-months { margin-bottom: 14px; padding-inline: 5px; border-radius: 12px; }
    .home-news-months::before { right: 28px; left: 28px; }
    .home-news-months__tab { min-width: 70px; min-height: 70px; padding-inline: 7px; font-size: .7rem; }
    .home-news-empty { min-height: 115px; padding: 18px 12px; font-size: .84rem; }
}
@media (max-width: 360px) {
    .home-service-grid { grid-template-columns: minmax(0, 1fr); }
    .home-service-card { min-height: 0; }
    .home-service-card__title { min-height: 0; }
    .home-news-card { grid-template-columns: minmax(80px, 30%) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .front-home *, .front-home *::before, .front-home *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Homepage-only loading veil; other routes never render this component. */
.home-page-loader{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:24px;background:rgba(247,248,250,.96);backdrop-filter:blur(14px);opacity:1;visibility:visible;transition:opacity .45s ease,visibility .45s ease;animation:home-loader-safety 6.5s forwards}
.home-page-loader.is-leaving{animation:none;opacity:0;visibility:hidden;pointer-events:none}
.home-page-loader__card{display:flex;width:min(100%,340px);flex-direction:column;align-items:center;padding:34px 30px 30px;border:1px solid rgba(182,138,55,.18);border-radius:24px;background:rgba(255,255,255,.94);box-shadow:0 22px 70px rgba(18,48,77,.12),0 3px 12px rgba(18,48,77,.04);text-align:center;animation:home-loader-arrive .5s cubic-bezier(.2,.8,.2,1) both}
.home-page-loader__seal{position:relative;display:grid;width:100px;height:100px;place-items:center;margin-bottom:18px;border:1px solid rgba(182,138,55,.14);border-radius:50%;background:radial-gradient(circle,#fff 48%,#fbf8f0 100%);box-shadow:inset 0 0 0 7px rgba(182,138,55,.045)}
.home-page-loader__seal img{position:relative;z-index:1;width:60px;height:68px;object-fit:contain}
.home-page-loader__orbit{position:absolute;inset:4px;border:2px solid transparent;border-top-color:var(--home-gold);border-right-color:rgba(182,138,55,.24);border-radius:50%;animation:home-loader-orbit 1.5s linear infinite}
.home-page-loader__orbit::after{position:absolute;top:9px;right:8px;width:6px;height:6px;border-radius:50%;background:var(--home-gold-bright);box-shadow:0 0 10px rgba(182,138,55,.5);content:""}
.home-page-loader__brand{display:grid;gap:4px;margin:0;color:var(--home-navy);line-height:1.5}
.home-page-loader__brand strong{font-size:1.1rem;font-weight:800;letter-spacing:.02em}
.home-page-loader__brand span{color:#8a7550;font-size:.62rem;font-weight:700;letter-spacing:.16em}
.home-page-loader__message{margin:15px 0 17px;color:var(--home-muted);font-size:.82rem;font-weight:600;line-height:1.7}
@keyframes home-loader-orbit{to{transform:rotate(360deg)}}
@keyframes home-loader-arrive{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes home-loader-safety{0%,90%{opacity:1;visibility:visible;pointer-events:auto}100%{opacity:0;visibility:hidden;pointer-events:none}}
@media(prefers-reduced-motion:reduce){.home-page-loader *,.home-page-loader::before,.home-page-loader::after{animation:none!important;transition:none!important}}
