/* ===== فصل نو — cinematic urban theme (Tehran imagery) ===== */

.page-home main {
    overflow-x: hidden;
}

.container-wide {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --- Header (اسکرول معمولی، بدون فیکس) --- */
.ref-header.site-header {
    position: relative;
    z-index: 100;
    background: #f1f5f9;
    border-bottom: none;
    box-shadow: none;
}

.ref-header .header-main {
    position: relative;
    z-index: 5;
    padding: 14px 0 16px;
    background: linear-gradient(180deg, #e8eef5 0%, #f1f5f9 100%);
}

.top-bar {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 50% 120% at 10% 50%, rgba(45, 212, 191, 0.18), transparent 55%),
        radial-gradient(ellipse 40% 100% at 90% 40%, rgba(56, 189, 248, 0.12), transparent 50%),
        linear-gradient(105deg, #071525 0%, #0d2a45 42%, #0a3d42 78%, #0b2438 100%);
    border-bottom: 1px solid rgba(94, 234, 212, 0.12);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
}

.top-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    background-size: 200% 100%;
    animation: topBarSheen 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes topBarSheen {
    0%, 100% { background-position: 100% 0; opacity: 0.4; }
    50% { background-position: 0% 0; opacity: 1; }
}

.top-bar-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(220px, 440px) minmax(180px, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 52px;
    padding: 8px 0;
}

.top-bar-date {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8f4f2;
    font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.06) inset;
}

.top-date-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(145deg, #14b8a6, #0e7490);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
}

.top-date-text:empty::before {
    content: "تاریخ امروز";
    opacity: 0.55;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.top-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
    border: 1px solid rgba(153, 246, 228, 0.35);
    color: #fff;
    font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.top-login:hover {
    color: #fff;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(13, 148, 136, 0.45);
}

.top-social {
    display: flex;
    gap: 7px;
}

.top-social a {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.82);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.top-social a:hover {
    transform: translateY(-2px);
    color: #fff;
}

.top-social a.soc-li:hover {
    background: #0a66c2;
    border-color: #0a66c2;
    box-shadow: 0 6px 16px rgba(10, 102, 194, 0.4);
}

.top-social a.soc-tg:hover {
    background: #229ed9;
    border-color: #229ed9;
    box-shadow: 0 6px 16px rgba(34, 158, 217, 0.4);
}

.top-social a.soc-ig:hover {
    background: linear-gradient(135deg, #f58529, #dd2a7b 50%, #8134af);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(221, 42, 123, 0.4);
}

.top-social a.soc-yt:hover {
    background: #ff0033;
    border-color: #ff0033;
    box-shadow: 0 6px 16px rgba(255, 0, 51, 0.4);
}

.header-search {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 4px 4px 4px 14px;
    box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.05) inset, 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search:focus-within {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(94, 234, 212, 0.45);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.header-search-icon {
    display: flex;
    color: #5eead4;
    flex-shrink: 0;
    opacity: 0.9;
}

.header-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: Vazirmatn, Tahoma, sans-serif;
    font-size: 0.84rem;
    padding: 7px 8px;
    min-width: 0;
    color: #fff;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.48);
}

.header-search input:focus {
    outline: none;
}

.header-search button {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 16px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.header-search button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #fff;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

/* کادر هدر: شیشه ملایم و خوانا */
.header-glass {
    position: relative;
    padding: 16px 20px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 1) inset,
        0 10px 32px rgba(15, 35, 60, 0.08),
        0 2px 8px rgba(15, 35, 60, 0.04);
    overflow: hidden;
}

.header-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.04) 0%, transparent 45%),
        linear-gradient(225deg, rgba(30, 74, 122, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.header-glass > * {
    position: relative;
    z-index: 1;
}

.header-main-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 12px;
    gap: 16px;
}

.ref-logo {
    flex-shrink: 0;
    min-width: 0;
}

.ref-logo-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(145deg, #0f766e, #1e4a7a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
}

.ref-logo .logo-text strong {
    font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
    font-size: 1.65rem;
    color: #0a1f38;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-shadow: none;
}

.ref-logo .logo-text small {
    display: block;
    max-width: 460px;
    font-family: Vazirmatn, Tahoma, sans-serif;
    color: #5b6b7c;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.55;
    margin-top: 4px;
    letter-spacing: 0.01em;
    text-shadow: none;
}

.nav-tabs {
    border-top: 1px solid rgba(15, 35, 60, 0.08);
    background: transparent;
    margin: 0 -4px;
    padding-top: 2px;
}

.nav-tabs-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
    padding: 10px 4px 4px;
}

.nav-tab {
    padding: 10px 15px;
    font-family: Estedad, Vazirmatn, Tahoma, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3348;
    border-radius: 11px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0.01em;
    background: transparent;
    border: 1px solid transparent;
    text-shadow: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-tab:hover {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.12);
    color: #0f766e;
    transform: none;
    box-shadow: none;
}

.nav-tab.is-active {
    background: #0f2744;
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(15, 39, 68, 0.22);
}

.nav-tab.is-active:hover {
    color: #fff;
    background: #0f2744;
}

.nav-tab-icon {
    font-size: 1.05rem;
    opacity: 0.95;
    line-height: 1;
}

.nav-tab-muted {
    color: #64748b;
    font-weight: 500;
    margin-inline-start: auto;
    background: rgba(15, 39, 68, 0.05);
    border-color: rgba(15, 39, 68, 0.06);
}

.nav-tab-muted:hover {
    color: #0f2744;
    background: rgba(15, 39, 68, 0.08);
}

/* ========== HERO SLIDER — full-bleed cinematic ========== */
.hero-slider {
    position: relative;
    min-height: min(92vh, 780px);
    max-height: none;
    height: min(92vh, 780px);
    overflow: hidden;
    background: #071420;
    isolation: isolate;
}

.hero-slides {
    position: relative;
    height: 100%;
    min-height: inherit;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), visibility 1.1s;
    z-index: 1;
}

.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
    position: absolute;
    min-height: 0;
    max-height: none;
}

.hero-slide-media {
    position: absolute;
    inset: -4%;
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    transform: scale(1.08);
    will-change: transform;
}

/* fallback: حتی اگر JS لود نشود، اسلاید فعال زوم دارد */
.hero-slide.is-active .hero-slide-media {
    animation: heroKenBurns 7.2s ease-out forwards;
}

.hero-slide.is-active.ken-restart .hero-slide-media {
    animation: heroKenBurns 7.2s ease-out forwards;
}

@keyframes heroKenBurns {
    from { transform: scale(1.08) translate3d(0, 0, 0); }
    to   { transform: scale(1.18) translate3d(-1.2%, 0.6%, 0); }
}

.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(105deg,
            rgba(4, 14, 28, 0.35) 0%,
            rgba(4, 16, 32, 0.62) 38%,
            rgba(4, 18, 36, 0.88) 100%),
        linear-gradient(180deg,
            rgba(4, 12, 24, 0.45) 0%,
            transparent 32%,
            transparent 58%,
            rgba(4, 12, 24, 0.65) 100%);
    z-index: 1;
}

.hero-slide-grain {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.28;
    pointer-events: none;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.hero-slide-content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: min(560px, calc(100% - 48px));
    margin-inline-start: auto;
    margin-inline-end: clamp(24px, 6vw, 72px);
    padding: 88px 12px 100px 20px;
    color: #fff;
    text-align: right;
    box-sizing: border-box;
}

.hero-slide.is-active .hero-slide-content > * {
    animation: heroRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-slide.is-active .hero-brand { animation-delay: 0.08s; }
.hero-slide.is-active h1 { animation-delay: 0.18s; }
.hero-slide.is-active .hero-lead { animation-delay: 0.28s; }
.hero-slide.is-active .hero-slide-actions { animation-delay: 0.38s; }

@keyframes heroRise {
    from {
        opacity: 0;
        transform: translateY(22px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-brand {
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0 0 14px;
    color: #fff;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
}

.hero-slide-content h1 {
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.96);
    letter-spacing: -0.02em;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.3);
    overflow-wrap: break-word;
    max-width: 22ch;
}

.hero-lead,
.hero-slide-content p.hero-lead {
    font-size: 1.02rem;
    line-height: 1.85;
    opacity: 0.88;
    margin-bottom: 28px;
    font-weight: 500;
    overflow-wrap: break-word;
    max-width: 36ch;
    color: rgba(255, 255, 255, 0.9);
}

.hero-slide-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-hero-solid {
    display: inline-flex;
    align-items: center;
    padding: 13px 28px;
    border-radius: 12px;
    background: #0d9488;
    color: #fff;
    font-weight: 800;
    font-size: 0.94rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(13, 148, 136, 0.35);
    transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

.btn-hero-solid:hover {
    transform: translateY(-2px);
    background: #0f766e;
    box-shadow: 0 14px 32px rgba(13, 148, 136, 0.42);
}

.btn-hero-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    transition: background 0.25s, border-color 0.25s;
}

.btn-hero-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.85);
}

.play-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(8, 20, 36, 0.35);
    backdrop-filter: blur(12px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.hero-arrow:hover {
    background: rgba(13, 148, 136, 0.55);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.04);
}

.hero-arrow-prev { right: 20px; }
.hero-arrow-next { left: 20px; }

.hero-controls {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(280px, 70vw);
}

.hero-dots {
    position: static;
    transform: none;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.hero-dots button {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    transition: transform 0.25s, background 0.25s, width 0.25s;
}

.hero-dots button.is-active {
    background: #fff;
    width: 28px;
    border-radius: 999px;
}

.hero-progress {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.hero-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #5eead4, #fff);
    transform-origin: right center;
    transform: scaleX(0);
    will-change: transform;
}

/* ========== TEHRAN GALLERY ========== */
.tehran-gallery {
    position: relative;
    padding: 72px 0 64px;
    background:
        radial-gradient(ellipse 70% 50% at 80% 0%, rgba(13, 148, 136, 0.08), transparent 55%),
        linear-gradient(180deg, #f4f7fb 0%, #e9eef5 100%);
    overflow: hidden;
}

.tehran-gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230a1f38' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.7;
}

.tehran-gallery-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
    position: relative;
}

.tehran-gallery-eyebrow,
.matrix-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #0d9488;
    margin-bottom: 10px;
}

.tehran-gallery-head h2,
.matrix-section-head h2 {
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 900;
    color: #0a1f38;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.tehran-gallery-head p,
.matrix-section-head p {
    color: #5c6b7f;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 500;
}

.tehran-gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 160px;
    gap: 14px;
    position: relative;
}

.tg-item {
    position: relative;
    grid-column: span 3;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
}

.tg-item.tg-lg {
    grid-column: span 6;
    grid-row: span 2;
}

.tg-item.tg-wide {
    grid-column: span 6;
    grid-row: span 1;
}

.tg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s;
    filter: saturate(1.05) contrast(1.02);
}

.tg-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(4, 14, 28, 0.72) 100%);
    opacity: 0.85;
    transition: opacity 0.35s;
    pointer-events: none;
}

.tg-item figcaption {
    position: absolute;
    bottom: 14px;
    right: 16px;
    left: 16px;
    z-index: 2;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    transform: translateY(4px);
    transition: transform 0.35s;
}

.tg-item:hover img {
    transform: scale(1.08);
    filter: saturate(1.15) contrast(1.05);
}

.tg-item:hover::after {
    opacity: 1;
}

.tg-item:hover figcaption {
    transform: translateY(0);
}

/* ========== 12 SECTIONS MATRIX — image-led editorial ========== */
.home-matrix {
    padding: 64px 0 80px;
    background:
        radial-gradient(ellipse 60% 40% at 10% 0%, rgba(13, 148, 136, 0.07), transparent 55%),
        linear-gradient(180deg, #eef2f7 0%, #f6f8fb 45%, #fff 100%);
}

.matrix-section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 40px;
}

.sections-matrix {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
}

.matrix-card {
    --card-accent: #0d9488;
    background: #fff;
    border: 1px solid rgba(15, 40, 70, 0.06);
    border-radius: 18px;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 18px rgba(10, 31, 56, 0.05);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
}

.matrix-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 48px rgba(10, 31, 56, 0.12);
}

.matrix-card[data-theme="1"] { --card-accent: #1e3a5f; }
.matrix-card[data-theme="2"] { --card-accent: #0f766e; }
.matrix-card[data-theme="3"] { --card-accent: #1d4ed8; }
.matrix-card[data-theme="4"] { --card-accent: #0e7490; }
.matrix-card[data-theme="5"] { --card-accent: #1e40af; }
.matrix-card[data-theme="6"] { --card-accent: #9a3412; }
.matrix-card[data-theme="7"] { --card-accent: #92400e; }
.matrix-card[data-theme="8"] { --card-accent: #115e59; }
.matrix-card[data-theme="9"] { --card-accent: #991b1b; }
.matrix-card[data-theme="10"] { --card-accent: #166534; }
.matrix-card[data-theme="11"] { --card-accent: #1e3a8a; }
.matrix-card[data-theme="12"] { --card-accent: #0c4a6e; }

.matrix-media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0a1f38;
}

.matrix-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s;
    filter: saturate(1.05) contrast(1.03);
}

.matrix-card:hover .matrix-media img {
    transform: scale(1.08);
    filter: saturate(1.12) contrast(1.05);
}

.matrix-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(4, 14, 28, 0.15) 0%, transparent 35%, rgba(4, 14, 28, 0.78) 100%),
        linear-gradient(90deg, transparent 55%, rgba(4, 14, 28, 0.2) 100%);
    pointer-events: none;
    transition: opacity 0.35s;
}

.matrix-card:hover .matrix-shade {
    opacity: 0.92;
}

.matrix-num {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 10px;
    border-radius: 8px;
    line-height: 1;
}

.matrix-caption {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 2;
    padding: 18px 16px 16px;
    color: #fff;
}

.matrix-caption h3 {
    font-size: 1.02rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.35;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.matrix-caption p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.55;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matrix-foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    flex: 1;
    background: #fff;
}

.matrix-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.matrix-links li {
    position: relative;
    padding-right: 12px;
    margin: 0;
}

.matrix-links li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.55em;
    width: 5px;
    height: 1.5px;
    border-radius: 1px;
    background: var(--card-accent);
}

.matrix-links a {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 600;
    line-height: 1.45;
}

.matrix-links a:hover {
    color: var(--card-accent);
}

.matrix-enter {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--card-accent);
    letter-spacing: -0.01em;
    transition: gap 0.25s, color 0.2s;
}

.matrix-enter svg {
    transform: scaleX(-1);
    transition: transform 0.25s;
}

.matrix-card:hover .matrix-enter {
    gap: 10px;
}

.matrix-card:hover .matrix-enter svg {
    transform: scaleX(-1) translateX(3px);
}

.matrix-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 40px;
}

/* --- Footer --- */
.ref-footer.site-footer {
    background:
        linear-gradient(180deg, rgba(7, 20, 36, 0.92), rgba(4, 12, 22, 0.96)),
        url('../images/tehran/tehran-night.jpg') center/cover fixed;
    margin-top: 0;
    padding-top: 64px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

.ref-footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ref-footer-logo strong {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 900;
}

.footer-social {
    display: flex;
    gap: 8px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 800;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.footer-social a:hover {
    border-color: rgba(94, 234, 212, 0.5);
    color: #5eead4;
    background: rgba(94, 234, 212, 0.08);
}

.footer-slogan {
    margin-top: 16px !important;
    color: #5eead4 !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
}

/* --- Inner pages hero --- */
.page-hero {
    position: relative;
    min-height: 340px;
    padding: 72px 0 56px;
    background-image: var(--page-hero-bg);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: -3%;
    background-image: var(--page-hero-bg);
    background-size: cover;
    background-position: center;
    animation: heroKenBurns 14s ease-out forwards;
    z-index: 0;
}

.page-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(105deg, rgba(4, 14, 28, 0.25) 0%, rgba(4, 16, 32, 0.62) 48%, rgba(4, 18, 36, 0.88) 100%),
        linear-gradient(180deg, rgba(4, 12, 24, 0.3) 0%, transparent 40%, rgba(4, 12, 24, 0.45) 100%);
}

.page-hero-content {
    position: relative;
    z-index: 2;
    max-width: min(640px, calc(100% - 40px));
    margin-inline-start: auto;
    margin-inline-end: 28px;
    padding: 0 12px 0 24px;
    color: #fff;
    text-align: right;
    box-sizing: border-box;
    animation: heroRise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-hero-icon {
    font-size: 2.25rem;
    display: block;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.page-hero-meta {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    opacity: 0.85;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.page-hero-content h1 {
    font-size: clamp(1.75rem, 3.4vw, 2.55rem);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
    overflow-wrap: break-word;
}

.page-hero-content p {
    font-size: 1rem;
    line-height: 1.85;
    opacity: 0.92;
    margin-bottom: 22px;
    font-weight: 500;
    overflow-wrap: break-word;
}

.page-hero-feature {
    margin-top: 4px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    max-width: 520px;
    margin-inline-start: auto;
}

.page-hero-feature img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.page-inner .content-section {
    padding: 40px 0 64px;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef2f7 100%);
}

.page-inner .content-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(200, 220, 240, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(15, 40, 80, 0.06);
}

.page-inner .card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(200, 220, 240, 0.9);
    border-radius: 14px;
}

.team-avatar-fallback {
    width: 88px;
    height: 88px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0f766e, #1e4a7a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(15, 118, 110, 0.28);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .sections-matrix {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .tg-item { grid-column: span 4; }
    .tg-item.tg-lg { grid-column: span 8; }
    .tg-item.tg-wide { grid-column: span 8; }
}

@media (max-width: 992px) {
    .top-bar-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 10px 0;
        gap: 12px;
    }
    .top-bar-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-search {
        width: min(100%, 420px);
    }
    .top-bar-date {
        max-width: 100%;
    }
    .sections-matrix {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .hero-slider {
        height: min(78vh, 640px);
        min-height: 520px;
    }
}

@media (max-width: 768px) {
    .header-glass {
        border-radius: 16px;
        padding: 12px 14px;
    }
    .ref-logo .logo-text strong {
        font-size: 1.35rem;
    }
    .ref-logo .logo-text small {
        font-size: 0.7rem;
        max-width: 220px;
    }
    .menu-toggle {
        background: rgba(15, 39, 68, 0.06);
        border-color: rgba(15, 39, 68, 0.12);
    }
    .menu-toggle span {
        background: #0f2744;
    }
    .nav-tabs {
        display: none;
        border-top: none;
    }
    .nav-tabs.open {
        display: block;
        position: absolute;
        right: 12px;
        left: 12px;
        top: calc(100% - 4px);
        background: #fff;
        border: 1px solid rgba(15, 35, 60, 0.1);
        border-radius: 14px;
        box-shadow: 0 16px 40px rgba(10, 25, 45, 0.12);
        z-index: 100;
        padding: 8px;
    }
    .nav-tabs-inner {
        flex-direction: column;
        padding: 8px;
    }
    .nav-tab {
        width: 100%;
        justify-content: flex-start;
    }
    .nav-tab-muted {
        margin-inline-start: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .header-main {
        position: relative;
    }
    .header-glass {
        position: relative;
    }
    .hero-slider {
        height: auto;
        min-height: 560px;
    }
    .hero-slide-content {
        margin-inline-end: 16px;
        max-width: calc(100% - 32px);
        padding: 64px 8px 96px 12px;
    }
    .hero-brand {
        font-size: 2.2rem;
    }
    .hero-arrow {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .hero-arrow-prev { right: 10px; }
    .hero-arrow-next { left: 10px; }
    .sections-matrix {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ref-footer-grid {
        grid-template-columns: 1fr;
    }
    .tehran-gallery-grid {
        grid-auto-rows: 140px;
    }
    .tg-item,
    .tg-item.tg-lg,
    .tg-item.tg-wide {
        grid-column: span 6;
        grid-row: span 1;
    }
    .tg-item.tg-lg {
        grid-row: span 2;
    }
    .page-hero-content {
        max-width: 100%;
        margin-inline-end: 0;
        padding: 0 8px;
    }
    .page-hero-feature {
        max-width: 100%;
    }
    .page-hero-feature img {
        height: 160px;
    }
}

@media (max-width: 480px) {
    .sections-matrix {
        grid-template-columns: 1fr;
    }
    .top-bar-date {
        font-size: 0.75rem;
    }
    .tg-item,
    .tg-item.tg-lg,
    .tg-item.tg-wide {
        grid-column: span 12;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide-media,
    .page-hero::before {
        animation: none !important;
        transform: none !important;
    }
    .hero-slide.is-active .hero-slide-content > * {
        animation: none !important;
    }
}
