/* ================================================= */
/* PORTAL BASE — Shared styles for all OIC portals    */
/* Visual language modeled on oic-oci.org              */
/* ================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ————— Design tokens ————— */
:root {
    --portal-accent:       #0d6efd;
    --portal-accent-dark:  #0958d9;
    --portal-accent-light: #dbeafe;

    --portal-text:         #080a0e;
    --portal-text-muted:   #606369;

    --portal-border:       #e1e3e6;
    --portal-bg:           #fafafa;
    --portal-bg-subtle:    #f3f5f7;
    --portal-surface:      #ffffff;

    /* Footer + banner derived from accent — solid dark shade */
    --portal-footer-bg:    color-mix(in srgb, var(--portal-accent) 30%, #062521);
    --portal-banner-bg:    var(--portal-footer-bg);

    --portal-header-bg:    rgba(255,255,255,0.95);
    --portal-shadow-md:    0 10px 28px rgba(0,0,0,.08);
}

/* ————— Base ————— */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--portal-text);
    background: var(--portal-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

a { color: var(--portal-accent); }
a:hover { color: var(--portal-accent-dark); }

/* ================================================= */
/* TOP BANNER — scrolls away (utility + actions)     */
/* ================================================= */

.portal-banner {
    background: var(--portal-banner-bg);
    color: rgba(255,255,255,.8);
    font-size: 12.5px;
    line-height: 1;
}

.portal-banner > .container {
    display: flex;
    align-items: center;
    min-height: 36px;
    gap: 16px;
}

.portal-banner-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.portal-banner-link {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: color .15s ease;
}

.portal-banner-link:hover { color: #fff; }

.portal-banner-sep {
    color: rgba(255,255,255,.25);
    user-select: none;
}

.portal-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
}

.portal-banner-social {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.portal-banner-icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    text-decoration: none;
    border: 0;
    background: transparent;
    border-radius: 4px;
    padding: 0;
    transition: all .15s ease;
}

.portal-banner-icon-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.portal-banner-social-img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    filter: grayscale(1) brightness(1.4) opacity(.7);
    transition: filter .15s ease;
}

.portal-banner-icon-btn:hover .portal-banner-social-img {
    filter: grayscale(0) opacity(1);
}

.portal-banner-divider {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,.15);
}

.portal-banner-lang {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.portal-banner-lang-link {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 11.5px;
    padding: 4px 7px;
    border-radius: 4px;
    line-height: 1;
    transition: all .15s ease;
}

.portal-banner-lang-link:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.portal-banner-lang-link.active {
    color: #fff;
    background: rgba(255,255,255,.18);
    font-weight: 600;
}

/* ================================================= */
/* MAIN HEADER — sticky single bar                   */
/* ================================================= */

.portal-top-header {
    background: var(--portal-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--portal-border);
    position: sticky;
    top: 0;
    z-index: 1040;
}

.portal-top-header > .container {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 72px;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Brand */
.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}
.portal-brand:hover { color: inherit; }

.portal-logo {
    height: 52px;
    width: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.portal-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.portal-brand-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--portal-text);
    letter-spacing: -0.01em;
}

.portal-brand-tagline {
    font-size: 11.5px;
    font-style: italic;
    color: var(--portal-text-muted);
    opacity: .75;
    margin-top: 2px;
}

/* Optional mark beside the brand. It is decoration, and the header has a fixed set of
   links to fit first, so it only appears once the row is wide enough to seat it without
   crowding them. The threshold is set by the widest case rather than by English: the
   Arabic brand carries a much longer tagline and its links are wider, and it is the
   first to run out of room. */
.portal-brand-aside {
    /* As tall as the row will take without the header itself growing: the bar is 72px
       with 8px above and below, so 56px is the ceiling. */
    height: 56px;
    width: auto;
    flex-shrink: 0;
    margin-inline-start: 2px;
}

@media (max-width: 1279.98px) {
    .portal-brand-aside {
        display: block;
        height: 42px;
        width: auto;
        flex-shrink: 0;
        margin-inline-start: 2px;
    }
}
@media (max-width: 575.98px) {
    .portal-brand-aside {
        display: block;
        height: 28px;
        width: auto;
        flex-shrink: 0;
        margin-inline-start: 0;
    }
}

/* Right to left needs more of the row before the mark can come in: the Arabic tagline
   is around twice the width of the English one and the links are wider too, so the
   header runs out of room a good deal earlier. */
@media (max-width: 1499.98px) {
    [dir="rtl"] .portal-brand-aside { display: none; }
}

.portal-header-spacer { flex: 1; }

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Search button in header */
.portal-search-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 16px;
    padding: 0;
    transition: all .15s ease;
}

.portal-search-btn:hover,
.portal-search-btn:focus {
    color: var(--portal-accent);
    background: color-mix(in srgb, var(--portal-accent) 8%, transparent);
}

/* ================================================= */
/* MAIN NAVIGATION                                   */
/* ================================================= */

.portal-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.portal-nav .navbar-nav {
    flex-direction: row;
    gap: 2px;
    align-items: center;
}

.portal-nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-text-muted) !important;
    padding: 8px 12px !important;
    text-decoration: none;
    border-radius: 6px;
    transition: color .15s ease, background-color .15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.portal-nav-link:hover,
.portal-nav-link:focus {
    color: var(--portal-accent) !important;
    background: color-mix(in srgb, var(--portal-accent) 7%, transparent);
}

.portal-nav-link.active {
    color: var(--portal-accent) !important;
    background: color-mix(in srgb, var(--portal-accent) 9%, transparent);
}

.portal-nav-link.dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 1px;
    border-top: 4px solid currentColor;
    border-right: 3px solid transparent;
    border-left: 3px solid transparent;
    border-bottom: 0;
    transition: transform .2s ease;
}

[dir="rtl"] .portal-nav-link.dropdown-toggle::after {
    margin-left: 0;
    margin-right: 6px;
}

.nav-item.dropdown:hover > .portal-nav-link.dropdown-toggle::after,
.nav-item.dropdown.show > .portal-nav-link.dropdown-toggle::after {
    transform: rotate(-180deg);
}

/* Dropdown menu */
.portal-top-header .nav-item.dropdown > .dropdown-menu {
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    background: var(--portal-surface);
    color: var(--portal-text);
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    box-shadow: var(--portal-shadow-md);
    padding: 6px;
    margin-top: 4px;
    min-width: 200px;
    z-index: 1050;
}

@media (min-width: 992px) {
    /* Same as the drawer: the open menu carries .show itself. On a pointer the hover
       rule was covering for this, but a click or the keyboard alone did not open it. */
    .portal-top-header .nav-item.dropdown:hover > .dropdown-menu,
    .portal-top-header .nav-item.dropdown > .dropdown-menu.show,
    .portal-top-header .nav-item.dropdown.show > .dropdown-menu {
        display: block;
    }
    .portal-top-header .nav-item.dropdown > .dropdown-menu {
        margin-top: 0;
    }
}

.portal-top-header .dropdown-item {
    font-size: 13.5px;
    color: var(--portal-text-muted);
    padding: 9px 12px;
    border-radius: 6px;
    transition: all .12s ease;
}

.portal-top-header .dropdown-item:hover,
.portal-top-header .dropdown-item:focus {
    background: color-mix(in srgb, var(--portal-accent) 7%, transparent);
    color: var(--portal-accent);
}

/* Mobile toggle */
.portal-nav-toggle {
    border: 1px solid var(--portal-border);
    background: transparent;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text);
    padding: 0;
}

.portal-nav-toggle:focus {
    outline: 2px solid var(--portal-accent);
    outline-offset: 2px;
}

.portal-nav-toggle .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='currentColor' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile drawer */
.portal-nav-drawer {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.portal-nav-drawer .navbar-nav {
    flex-direction: column;
    padding: 8px 0;
    gap: 0;
}

.portal-nav-drawer .portal-nav-link {
    padding: 10px 16px !important;
    border-radius: 0;
}

.portal-nav-drawer .nav-item.dropdown > .dropdown-menu {
    position: static;
    display: none;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0 0 0 16px;
    background: transparent;
    min-width: 0;
}

/* Bootstrap 5 marks the menu and the toggle, not the item around them - Bootstrap 4 put
   the class on the item, which is what this was written against. Matching the item alone
   meant the drawer's submenus never opened: they took .show and stayed at display: none.
   Both are matched so it holds either way. */
.portal-nav-drawer .nav-item.dropdown > .dropdown-menu.show,
.portal-nav-drawer .nav-item.dropdown.show > .dropdown-menu {
    display: block;
}

/* ================================================= */
/* SEARCH MODAL                                      */
/* ================================================= */

.portal-search-modal .modal-dialog {
    margin-top: 12vh;
}

.portal-search-content {
    background: var(--portal-surface);
    color: var(--portal-text);
    border: 1px solid var(--portal-border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,.18);
    padding: 18px 18px 14px;
}

.portal-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--portal-accent);
    padding-bottom: 10px;
}

.portal-search-icon {
    color: var(--portal-text-muted);
    font-size: 18px;
}

.portal-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--portal-text);
    font-size: 18px;
    font-weight: 500;
    padding: 8px 4px;
}

.portal-search-input::placeholder {
    color: var(--portal-text-muted);
    opacity: .8;
}

.portal-search-submit {
    background: var(--portal-accent);
    color: #fff;
    border: 0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.portal-search-submit:hover {
    background: var(--portal-accent-dark);
}

.portal-search-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    color: var(--portal-text-muted);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.portal-search-close:hover {
    background: var(--portal-bg-subtle);
    color: var(--portal-text);
}

.portal-search-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--portal-text-muted);
}

/* ================================================= */
/* NEWS SLIDER — multi-up, oic-oci.org pattern        */
/* ================================================= */

.portal-news-slider {
    background: #000;
}

.portal-news-swiper {
    position: relative;
    height: 45vh;
    min-height: 320px;
    max-height: 540px;
}

.portal-news-slide {
    position: relative;
    overflow: hidden;
    background: #0a0f1a;
}

.portal-news-slide-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .8s ease;
}

.portal-news-slide:hover .portal-news-slide-img {
    transform: scale(1.04);
}

.portal-news-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.4) 45%, rgba(0,0,0,0) 75%);
    pointer-events: none;
}

.portal-news-slide-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    text-decoration: none;
}

.portal-news-slide-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 22px 28px;
    color: #fff;
    z-index: 2;
    pointer-events: none;
}

.portal-news-slide-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.portal-news-slide-summary {
    font-size: .85rem;
    margin: 8px 0 0;
    color: rgba(255,255,255,.85);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* Right-edge divider between slides on desktop */
.portal-news-slide::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 1px;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .portal-news-slide::after { display: none; }
}

/* Nav buttons — blurred glass discs */
.portal-news-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 0;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .2s ease, opacity .2s ease;
    opacity: .85;
}

.portal-news-btn:hover {
    background: rgba(255,255,255,.32);
    opacity: 1;
}

.portal-news-btn-prev { inset-inline-start: 16px; }
.portal-news-btn-next { inset-inline-end: 16px; }

[dir="rtl"] .portal-news-btn-prev .bi-chevron-left::before { content: "\f285"; } /* chevron-right */
[dir="rtl"] .portal-news-btn-next .bi-chevron-right::before { content: "\f284"; } /* chevron-left */

.portal-news-btn.swiper-button-disabled {
    opacity: .3;
    cursor: not-allowed;
}

/* Pagination — pill dots */
.portal-news-pagination {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.portal-news-pagination .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.55);
    opacity: 1;
    transition: width .2s ease, background .2s ease;
    margin: 0;
}

.portal-news-pagination .swiper-pagination-bullet-active {
    background: #fff;
    width: 28px;
}

/* ================================================= */
/* BREADCRUMB                                        */
/* ================================================= */

.portal-breadcrumb-bar {
    background: var(--portal-bg-subtle);
    border-bottom: 1px solid var(--portal-border);
    padding: 10px 0;
}

.portal-breadcrumb-bar .breadcrumb {
    margin: 0;
    font-size: 13px;
}

.portal-breadcrumb-bar .breadcrumb-item a {
    color: var(--portal-accent);
    text-decoration: none;
}

.portal-breadcrumb-bar .breadcrumb-item.active {
    color: var(--portal-text-muted);
}

/* ================================================= */
/* FOOTER                                            */
/* ================================================= */

.portal-footer {
    background: var(--portal-footer-bg);
    color: #fff;
    font-size: 14px;
}

.portal-footer-main {
    padding: 56px 0 36px;
}

.portal-footer-about-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.portal-footer-logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
    flex-shrink: 0;
    /* Render as solid white silhouette on the dark footer */
    filter: brightness(0) invert(1);
}

.portal-footer-about-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.portal-footer-desc {
    color: rgba(255,255,255,.6);
    font-size: 13.5px;
    line-height: 1.65;
    margin: 0;
}

.portal-footer-heading {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 18px;
    letter-spacing: 0;
    text-transform: none;
    padding: 0;
}

.portal-footer-heading::after { content: none; }

.portal-footer-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-footer-link {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: 14px;
    transition: color .15s ease;
    display: inline-block;
}

.portal-footer-link::before { content: none; }

.portal-footer-link:hover {
    color: #fff;
}

.portal-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-footer-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255,255,255,.6);
    font-size: 14px;
    line-height: 1.5;
}

.portal-footer-contact-row i {
    flex-shrink: 0;
    font-size: 15px;
    margin-top: 2px;
    color: rgba(255,255,255,.6);
}

.portal-footer-contact-row a {
    color: inherit;
    text-decoration: none;
}

.portal-footer-contact-row a:hover {
    color: #fff;
}

/* Email: address on its own line, purpose note underneath */
.portal-footer-email {
    display: flex;
    flex-direction: column;
}

.portal-footer-email-note {
    font-size: 12.5px;
    line-height: 1.4;
    opacity: .75;
    margin-top: 1px;
}

/* Address: each line on its own row, no mid-line wrapping on desktop */
.portal-footer-address {
    display: flex;
    flex-direction: column;
}

.portal-footer-address-line {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .portal-footer-address-line {
        white-space: normal;
    }
}

.portal-footer-social {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.portal-footer-social-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: rgba(255,255,255,.6);
    font-size: 14px;
    text-decoration: none;
    background: transparent;
    transition: all .15s ease;
}

.portal-footer-social-btn:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.portal-footer-social-img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    filter: grayscale(1) brightness(1.4) opacity(.7);
    transition: filter .15s ease;
}

.portal-footer-social-btn:hover .portal-footer-social-img {
    filter: grayscale(0) opacity(1);
}

.portal-footer-bottom {
    padding: 18px 0;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 13px;
    color: rgba(255,255,255,.45);
}

/* ================================================= */
/* RESPONSIVE                                        */
/* ================================================= */

@media (max-width: 991.98px) {
    .portal-logo {
        height: 44px;
        width: 44px;
    }

    .portal-brand-name {
        font-size: 15px;
    }

    .portal-brand-tagline {
        font-size: 10.5px;
    }

    /* Show skyline on tablet/mobile */
    .portal-brand-aside {
        display: block;
        height: 36px;
        width: auto;
        flex-shrink: 0;
        margin-inline-start: 0;
    }
}

@media (max-width: 768px) {
    .portal-brand-tagline {
        display: none;
    }

    .portal-logo {
        height: 40px;
        width: 40px;
    }

    /* Smaller skyline on mobile */
    .portal-brand-aside {
        display: block;
        height: 28px;
        width: auto;
        flex-shrink: 0;
        margin-inline-start: 0;
    }

    .portal-carousel .carousel-inner,
    .portal-carousel .carousel-item img {
        max-height: 320px;
        height: 320px;
    }

    .portal-carousel .carousel-caption {
        padding: 0 5% 36px;
    }

        .portal-carousel .carousel-caption p {
            display: none;
        }

    .portal-footer-main {
        padding: 36px 0 24px;
    }
}
