/*
 * main.css — Thiqa Theme
 * Full theme layout: header, ticker, nav, footer, hero, cards.
 * Mobile-first. Builds on design tokens in style.css.
 */

/* ==========================================================================
   TICKER BAR
   ========================================================================== */
.thiqa-ticker {
    height: var(--ticker-height);
    background: linear-gradient(90deg, var(--color-navy-dark) 0%, var(--color-navy) 100%);
    overflow: hidden;
    position: relative;
    z-index: var(--z-ticker);
    border-bottom: 1px solid rgba(191, 161, 99, 0.2);
}

.ticker-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    overflow: hidden;
}

.ticker-label {
    flex-shrink: 0;
    padding-inline: var(--space-4);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-gold);
    text-transform: uppercase;
    border-left: 1px solid rgba(191, 161, 99, 0.3);
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.ticker-track {
    display: flex;
    gap: var(--space-8);
    align-items: center;
    animation: ticker-scroll 40s linear infinite;
    white-space: nowrap;
    padding-inline: var(--space-6);
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.9);
}

.ticker-item__name {
    font-weight: 600;
    color: var(--color-gold-light);
}

.ticker-item__price {
    color: #fff;
    font-family: var(--font-en);
}

.ticker-item__change {
    font-size: var(--font-size-xs);
    font-family: var(--font-en);
}

.ticker-item__change.up {
    color: var(--color-success);
}

.ticker-item__change.down {
    color: var(--color-danger);
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   SITE HEADER
   ========================================================================== */
.thiqa-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    min-height: var(--header-height);
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.thiqa-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.thiqa-header__inner {
    max-width: var(--container-max);
    margin-inline: auto;
    padding: var(--space-3) var(--container-pad);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
}

/* Logo */
.thiqa-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.thiqa-logo img {
    height: 80px;
    width: auto;
    max-width: 100%;
}

.thiqa-logo__text {
    display: flex;
    flex-direction: column;
    margin-right: var(--space-3);
}

.thiqa-logo__text-ar {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-navy);
    line-height: 1;
}

.thiqa-logo__text-en {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-family: var(--font-en);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.thiqa-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.thiqa-nav__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    list-style: none;
    flex-wrap: wrap;
}

.thiqa-nav__list li>a {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
    white-space: nowrap;
}

.thiqa-nav__list li>a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: var(--space-3);
    left: var(--space-3);
    height: 2px;
    background: var(--color-gold);
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transition: var(--transition-fast);
}

.thiqa-nav__list li>a:hover,
.thiqa-nav__list li.current-menu-item>a,
.thiqa-nav__list li.current-menu-ancestor>a {
    color: var(--color-navy);
    background: var(--color-gold-glass);
}

.thiqa-nav__list li>a:hover::after,
.thiqa-nav__list li.current-menu-item>a::after,
.thiqa-nav__list li.current-menu-ancestor>a::after {
    transform: scaleX(1);
}

/* Dropdown Sub-menu */
.thiqa-nav__list li {
    position: relative;
}

.thiqa-nav__list li ul {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-md);
    padding: var(--space-2) 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 100;
}

.thiqa-nav__list li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.thiqa-nav__list li ul li {
    display: block;
    width: 100%;
}

.thiqa-nav__list li ul li > a {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition-fast);
}

.thiqa-nav__list li ul li > a::after {
    display: none; /* Hide the gold underline effect for dropdown items */
}

.thiqa-nav__list li ul li > a:hover {
    background: var(--color-gold-glass);
    color: var(--color-navy);
}

/* Header CTA */
.thiqa-header__cta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Hamburger */
.thiqa-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1.5px solid var(--color-border);
    background: transparent;
    transition: var(--transition-fast);
}

.thiqa-hamburger:hover {
    background: var(--color-gold-glass);
}

.thiqa-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-navy);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.thiqa-hamburger.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.thiqa-hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.thiqa-hamburger.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   MOBILE NAV
   ========================================================================== */
.thiqa-mobile-nav {
    position: fixed;
    top: calc(var(--ticker-height) + var(--header-height));
    right: 0;
    bottom: 0;
    width: 300px;
    background: white;
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: calc(var(--z-header) - 1);
    overflow-y: auto;
    padding: var(--space-6);
}

.thiqa-mobile-nav.is-open {
    transform: translateX(0);
}

.thiqa-mobile-nav__list {
    list-style: none;
}

.thiqa-mobile-nav__list li a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-right: 3px solid transparent;
    transition: var(--transition-fast);
    margin-bottom: var(--space-1);
}

.thiqa-mobile-nav__list li a:hover {
    background: var(--color-gold-glass);
    border-right-color: var(--color-gold);
    color: var(--color-navy);
}

.thiqa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 46, 109, 0.4);
    backdrop-filter: blur(4px);
    z-index: calc(var(--z-header) - 2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.thiqa-overlay.is-visible {
    opacity: 1;
    pointer-events: all;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.thiqa-footer {
    background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-navy) 60%, #003580 100%);
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    overflow: hidden;
}

.thiqa-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold-dark), var(--color-gold), var(--color-gold-light), var(--color-gold));
}

.thiqa-footer::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(191, 161, 99, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.footer-top {
    padding-block: var(--space-16);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-10);
    align-items: start;
}

.footer-brand__logo {
    height: 100px;
    width: auto;
    margin-bottom: var(--space-4);
    filter: brightness(0) invert(1);
}

.footer-brand__desc {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-loose);
    color: rgba(255, 255, 255, 0.65);
    max-width: 280px;
}

.footer-social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition-fast);
    font-size: var(--font-size-base);
    text-decoration: none;
}

.footer-social a:hover {
    background: var(--color-gold);
    color: var(--color-navy);
    transform: translateY(-2px);
}

.footer-col__title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-gold-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid rgba(191, 161, 99, 0.2);
}

.footer-col__links {
    list-style: none;
}

.footer-col__links li {
    margin-bottom: var(--space-3);
}

.footer-col__links a {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-col__links a:hover {
    color: var(--color-gold-light);
    padding-right: var(--space-2);
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.65);
}

.footer-contact-item .icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: var(--color-gold);
    margin-top: 2px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-block: var(--space-5);
}

.footer-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-bottom__copy {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.45);
}

.footer-bottom__links {
    display: flex;
    gap: var(--space-4);
    list-style: none;
}

.footer-bottom__links a {
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-bottom__links a:hover {
    color: var(--color-gold-light);
}

/* ==========================================================================
   LAZY YOUTUBE EMBED
   ========================================================================== */
.yt-embed {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: #000;
}

.yt-embed__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.yt-embed:hover .yt-embed__thumb {
    transform: scale(1.04);
}

.yt-embed__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: var(--transition-fast);
    pointer-events: none;
}

.yt-embed:hover .yt-embed__play {
    transform: translate(-50%, -50%) scale(1.1);
}

.yt-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

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

@media (max-width: 768px) {
    .thiqa-nav {
        display: none;
    }

    .thiqa-hamburger {
        display: flex;
    }

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

    .footer-bottom__inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom__links {
        justify-content: center;
    }
}