/* ==========================================================================
   O‘ZMMSI — HOMEPAGE
   Color tokens live in brand.css. This file only adds layout tokens.
   ========================================================================== */

:root {
    --mrdi-gray-50: #f8f9fa;
    --mrdi-gray-100: #f1f3f5;
    --mrdi-gray-200: #e9ecef;
    --mrdi-gray-300: #dee2e6;
    /* #6c757d gives only 4.69:1 on white, which is borderline for the 12-13px
       secondary text it is used for. #5c656d raises it to ~5.7:1 (WCAG AA). */
    --mrdi-gray-600: #5c656d;
    --mrdi-gray-800: #343a40;
    --mrdi-radius-sm: 8px;
    --mrdi-radius-md: 14px;
    --mrdi-radius-lg: 20px;
    --mrdi-radius-full: 9999px;
    --mrdi-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --mrdi-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
    --mrdi-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
    --mrdi-transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   0. BO'LIM FON TIZIMI
   Faqat ikki xil bo'lim foni:
   - ochiq: ivory (--uzmmsi-canvas). Oq (--uzmmsi-surface) faqat kartochkada.
   - to'q: lapis + girih (.home-band--dark) — galereya, media, statistika.
   Ketma-ket ikki ochiq bo'lim orasida ingichka chiziq; to'q bo'lim
   tepasida oltin chiziq. Har bir partial <section> ga home-band beradi.
   -------------------------------------------------------------------------- */
.home-band {
    background-color: var(--uzmmsi-canvas);
}

.home-band:not(.home-band--dark) + .home-band:not(.home-band--dark) {
    border-top: 1px solid var(--uzmmsi-line);
}

.home-band--dark {
    background-color: var(--uzmmsi-ink-deep);
    background-image: var(--uzmmsi-girih);
    background-size: 80px 80px;
    background-position: center;
    border-top: 2px solid var(--uzmmsi-gold);
    color: #ffffff;
}

.home-band--dark .section-heading h2 {
    color: #ffffff;
}

.home-band--dark .section-heading p {
    color: rgba(236, 240, 252, 0.75);
}

/* --------------------------------------------------------------------------
   1. HERO / BANNER SECTION
   -------------------------------------------------------------------------- */
#hero.hero {
    margin-top: 35px;
    position: relative;
    background: var(--uzmmsi-bg);
    overflow: hidden;
    --default-color: var(--uzmmsi-text);
    --heading-color: var(--uzmmsi-heading);
}

#hero.hero .hero-carousel,
#hero.hero .carousel-inner {
    width: 100%;
}

#hero.hero .carousel-inner {
    display: grid;
}

#hero.hero .carousel-item {
    grid-area: 1 / 1;
    width: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#hero.hero .carousel-item.active {
    opacity: 1;
}

#hero.hero .hero-container {
    position: relative;
    width: 100%;
    min-height: 520px;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    display: flex;
    align-items: center;
}

#hero.hero .video-background,
#hero.hero .image-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

#hero.hero .image-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
    transition: transform 6s ease;
}

#hero.hero .carousel-item.active .image-background {
    transform: scale(1.08);
}

#hero.hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--uzmmsi-canvas);
    z-index: 1;
}

/* Rasmsiz hero (banner yo'q yoki faqat matnli banner): to'q lapis "sahna",
   girih naqshi va o'ng tomonda katta oltin rozetka — rasm o'rnini bosadi. */
#hero.hero .hero-container:not(:has(.image-background, .video-background)) {
    min-height: 460px;
    aspect-ratio: auto;
    background: var(--uzmmsi-ink-deep);
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-overlay {
    background-color: var(--uzmmsi-ink-deep);
    background-image:
        radial-gradient(ellipse 60% 80% at 78% 50%, rgba(42, 68, 148, 0.55), transparent 70%),
        var(--uzmmsi-girih);
    background-size: auto, 80px 80px;
}

#hero.hero .hero-container:not(:has(.image-background, .video-background))::before {
    content: '';
    position: absolute;
    /* Overlay (z 1) ustida, matn konteyneri (z 2, DOM da keyin) ostida. */
    z-index: 2;
    top: 50%;
    right: 7%;
    width: min(360px, 28vw);
    aspect-ratio: 4 / 5;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.38;
    background-color: var(--uzmmsi-gold);
    -webkit-mask: var(--uzmmsi-emblem) center / contain no-repeat;
    mask: var(--uzmmsi-emblem) center / contain no-repeat;
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .container {
    padding-top: 72px;
    padding-bottom: 80px;
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content h1,
#hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content .hero-title {
    color: #ffffff;
    text-wrap: balance;
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content p:not(.hero-title) {
    color: rgba(236, 240, 252, 0.86);
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-badge {
    background: rgba(195, 170, 55, 0.12);
    border-color: rgba(195, 170, 55, 0.35);
    color: var(--uzmmsi-gold-soft);
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .btn-hero-primary {
    background: var(--uzmmsi-gold);
    color: var(--uzmmsi-ink-deep);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .btn-hero-primary:hover {
    background: #D4BC4E;
    color: var(--uzmmsi-ink-deep);
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .btn-hero-secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

#hero.hero .hero-container:not(:has(.image-background, .video-background)) .btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ffffff;
    color: #ffffff;
}

/* Rasmli/videoli hero: surat toza ko'rinadi. Tepada faqat menyu o'qilishi
   uchun yengil soya; matn bo'lsa (.has-text) pastdan gradient va matn
   pastki chapga tushadi — suratning o'rtasi ochiq qoladi. */
#hero.hero .hero-container:has(.image-background, .video-background) .hero-overlay {
    background: linear-gradient(to bottom, rgba(18, 26, 61, 0.55) 0%, rgba(18, 26, 61, 0) 26%);
}

#hero.hero .hero-container.has-text:has(.image-background, .video-background) {
    align-items: flex-end;
}

#hero.hero .hero-container.has-text:has(.image-background, .video-background) .hero-overlay {
    background:
        linear-gradient(to bottom, rgba(18, 26, 61, 0.55) 0%, rgba(18, 26, 61, 0) 26%),
        linear-gradient(to top, rgba(18, 26, 61, 0.88) 0%, rgba(18, 26, 61, 0.5) 34%, rgba(18, 26, 61, 0) 64%);
}

/* main.css shablonidagi "padding: 180px 0 80px" va telefondagi markazlash
   o'rniga: tepada menyu uchun joy, pastda tezkor xizmatlar kartochkalari
   (-45px) uchun joy; matn har doim chapda. */
#hero.hero .hero-container.has-text:has(.image-background, .video-background) {
    padding: 0;
}

#hero.hero .hero-container.has-text:has(.image-background, .video-background) .container {
    padding-top: 120px;
    padding-bottom: calc(45px + 2.5rem);
}

#hero.hero .hero-container.has-text:has(.image-background, .video-background) .hero-content,
#hero.hero .hero-container.has-text:has(.image-background, .video-background) .hero-content h1,
#hero.hero .hero-container.has-text:has(.image-background, .video-background) .hero-content p {
    text-align: left;
    padding-right: 0;
}

#hero.hero .hero-container.has-text:has(.image-background, .video-background) .hero-content p:not(.hero-title) {
    margin-bottom: 1.5rem;
}

/* Hero pastki oltin chiziq — sahifani "muzey ramkasi" kabi yakunlaydi. */
#hero.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--uzmmsi-gold) 20%, var(--uzmmsi-gold) 80%, transparent);
    z-index: 5;
}

#hero.hero .container {
    position: relative;
    z-index: 2;
    padding-top: 40px;
    padding-bottom: 50px;
}

#hero.hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--uzmmsi-navy-soft);
    border: 1px solid transparent;
    border-radius: var(--mrdi-radius-full);
    color: var(--uzmmsi-navy);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.5px;
}

#hero.hero .hero-badge i {
    color: var(--mrdi-accent);
}

/* Slide heading: <h1> on the first slide, <p class="hero-title"> on the rest
   (only one H1 per page), so both must render identically.
   Display serif — san'at universiteti kayfiyati shu yerdan boshlanadi. */
#hero.hero .hero-content h1,
#hero.hero .hero-content .hero-title {
    font-family: var(--uzmmsi-display);
    font-size: clamp(2.4rem, 5vw, 3.9rem);
    font-weight: 700;
    color: var(--uzmmsi-heading);
    line-height: 1.12;
    margin-bottom: 1.25rem;
    letter-spacing: 0;
    text-shadow: none;
    max-width: none;
}

#hero.hero .hero-content p:not(.hero-title) {
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: var(--uzmmsi-text);
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 2rem;
    text-shadow: none;
}

#hero.hero .cta-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#hero.hero .btn-hero-primary {
    padding: 14px 32px;
    border-radius: var(--mrdi-radius-full);
    background: var(--uzmmsi-navy);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(28, 25, 23, 0.28);
    transition: var(--mrdi-transition);
    border: none;
}

#hero.hero .btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.35);
    color: #ffffff;
    background: var(--uzmmsi-navy-deep);
}

#hero.hero .btn-hero-secondary {
    padding: 13px 28px;
    border-radius: var(--mrdi-radius-full);
    background: #ffffff;
    border: 1.5px solid var(--uzmmsi-navy);
    color: var(--uzmmsi-navy);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--mrdi-transition);
}

#hero.hero .btn-hero-secondary:hover {
    background: var(--uzmmsi-navy-soft);
    border-color: var(--uzmmsi-navy);
    color: var(--uzmmsi-navy);
    transform: translateY(-2px);
}

#hero.hero .carousel-indicators {
    z-index: 4;
    margin-bottom: 1.25rem;
    gap: 8px;
}

#hero.hero .hero-container:has(.image-background, .video-background) .hero-content h1,
#hero.hero .hero-container:has(.image-background, .video-background) .hero-content .hero-title,
#hero.hero .hero-container:has(.image-background, .video-background) .hero-content p:not(.hero-title) {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#hero.hero .carousel-indicators button {
    width: 28px;
    height: 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    transition: var(--mrdi-transition);
}

#hero.hero .carousel-indicators button.active {
    width: 44px;
    background-color: var(--uzmmsi-accent);
}

/* --------------------------------------------------------------------------
   2. QUICK SERVICES SECTION (Interactive Portals)
   -------------------------------------------------------------------------- */
.quick-services {
    margin-top: -45px;
    position: relative;
    z-index: 10;
    padding-bottom: 20px;
}

.quick-services-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.quick-service-card {
    background: var(--uzmmsi-surface);
    border-radius: var(--mrdi-radius-md);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--uzmmsi-line);
    box-shadow: 0 10px 30px rgba(42, 68, 148, 0.08);
    transition: var(--mrdi-transition);
    position: relative;
    overflow: hidden;
}

.quick-service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--uzmmsi-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(42, 68, 148, 0.16);
    border-color: rgba(42, 68, 148, 0.18);
}

.quick-service-card:focus-visible {
    transform: translateY(-6px);
    outline: 2px solid var(--uzmmsi-ink);
    outline-offset: 3px;
}

.quick-service-card:hover::after,
.quick-service-card:focus-visible::after {
    opacity: 1;
}

.quick-service-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--uzmmsi-ink);
    color: #ffffff;
    box-shadow: inset 0 0 0 1.5px var(--uzmmsi-gold);
    transition: var(--mrdi-transition);
}

/* One mark for every portal. The glyph tells them apart; a second hue per
   card would compete with the photograph and the emblem. */
.quick-service-card .quick-service-icon,
.quick-service-card.service-default .quick-service-icon {
    background: var(--uzmmsi-ink);
    color: #ffffff;
}

.quick-service-card:hover .quick-service-icon,
.quick-service-card:focus-visible .quick-service-icon {
    transform: scale(1.08) rotate(-6deg);
    background: var(--uzmmsi-gold);
    color: #1c1917;
    box-shadow: 0 6px 16px rgba(195, 170, 55, 0.45);
}

.quick-service-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--uzmmsi-heading);
    margin-bottom: 0.2rem;
    line-height: 1.25;
}

.quick-service-sub {
    /* 0.75rem = 12px was too small for a supporting label; 0.8rem keeps the
       card compact while staying legible. */
    font-size: 0.8rem;
    color: var(--uzmmsi-text-muted);
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   2b. AFISHA — /events bilan umumiy kartochka (layout.css "EVENT CARD"),
   bu yerda faqat joylashuv: kompyuterda 3 ustun, kichikroqda ro'yxat.
   -------------------------------------------------------------------------- */
.afisha-section {
    padding: 4.5rem 0;
}

.afisha-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.afisha-list > div {
    display: flex;
}

.afisha-list .event-item {
    flex: 1;
}

@media (max-width: 1199.98px) {
    .afisha-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 575.98px) {
    .afisha-section {
        padding: 3.25rem 0;
    }
}

/* --------------------------------------------------------------------------
   3. STATISTICS SECTION (Social Proof)
   -------------------------------------------------------------------------- */
.statistics-section {
    position: relative;
    overflow: hidden;
    padding: 2.75rem 0;
}

.statistics-section::before {
    content: none;
}

.stats-grid {
    display: grid;
    /* Cap the column width instead of letting 1fr stretch it: with only 3
       stats each card was 416px wide for ~105px of content (75% empty).
       The cards now keep a compact size and centre as a group. */
    grid-template-columns: repeat(auto-fit, minmax(170px, 220px));
    justify-content: center;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 1.25rem 1rem;
    background: transparent;
    border-radius: var(--mrdi-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: var(--mrdi-transition);
}

.stat-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(195, 170, 55, 0.45);
}

.stat-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--uzmmsi-gold);
    box-shadow: inset 0 0 0 1.5px var(--uzmmsi-gold);
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
    color: var(--uzmmsi-gold);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --------------------------------------------------------------------------
   3b. MEDIA SECTION — to'q "sahna". Pleer va video kartochkalar umumiy
   (layout.css "MEDIA CARDS"), bu yerda faqat bo'lim joylashuvi.
   -------------------------------------------------------------------------- */
.media-section {
    padding: 4.5rem 0;
}

@media (max-width: 575.98px) {
    .media-section {
        padding: 3rem 0;
    }
}

/* --------------------------------------------------------------------------
   4. ABOUT INSTITUTE & RECTOR SHOWCASE
   -------------------------------------------------------------------------- */
.about-showcase-section {
    padding: 5rem 0;
}

.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--uzmmsi-turquoise-soft);
    color: var(--uzmmsi-turquoise-deep);
    border-radius: var(--mrdi-radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-title {
    font-family: var(--uzmmsi-display);
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    font-weight: 700;
    color: var(--mrdi-dark);
    line-height: 1.18;
    margin-bottom: 1.25rem;
}

.about-lead {
    font-size: 1.05rem;
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.about-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.about-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(42, 68, 148, 0.1);
    color: var(--mrdi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.about-feature-text strong {
    display: block;
    font-size: 0.95rem;
    color: var(--mrdi-dark);
    margin-bottom: 2px;
}

.about-feature-text span {
    font-size: 0.82rem;
    color: var(--mrdi-gray-600);
}

.about-visual-card {
    position: relative;
    border-radius: var(--mrdi-radius-lg);
    overflow: hidden;
    box-shadow: var(--mrdi-shadow-lg);
}

/* Direct child only: the rector avatar inside .about-quote-box is also an
   <img> descendant of this card, and a plain ".about-visual-card img" rule
   has the same specificity as ".about-quote-avatar img" — the later one won
   and stretched the 38px avatar to the card's height. */
.about-visual-card > img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

.about-quote-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: var(--mrdi-radius-md);
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.about-quote-box p {
    font-size: 0.88rem;
    font-style: italic;
    color: #374151;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.about-quote-author {
    display: flex;
    /* flex-start, not center: when the name wraps to two lines the avatar
       must stay aligned with the first line rather than drift to the middle. */
    align-items: flex-start;
    gap: 10px;
}

/* Name and role are block-level so the role always starts on its own line.
   As inline elements the role ran on after a wrapped surname. */
.about-quote-author strong {
    display: block;
    font-size: 0.85rem;
    line-height: 1.25;
    color: var(--mrdi-dark);
}

.about-quote-author span {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--mrdi-gray-600);
}

/* About section button overrides (smaller than hero buttons).
   Hero gold is for the dark banner; on a white section the fill is navy. */
.btn-about-primary {
    padding: 12px 28px;
    font-size: 0.95rem;
    background: var(--uzmmsi-navy);
    color: #ffffff;
    border-radius: var(--mrdi-radius-full);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-about-primary:hover {
    background: var(--uzmmsi-navy-deep);
    color: #ffffff;
}

.btn-about-secondary {
    padding: 11px 24px;
    font-size: 0.95rem;
    background: var(--mrdi-gray-100);
    border-color: var(--mrdi-gray-300);
    color: var(--mrdi-dark);
}

/* Quote author avatar circle */
.about-quote-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--mrdi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 2px; /* optical alignment with the first line of the name */
}

/* Rector photo (from Leadership) fills the avatar circle.
   The !important guards against any wider ".about-visual-card img" style
   winning on specificity and stretching the avatar out of its circle. */
.about-quote-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* --------------------------------------------------------------------------
   5. GALLERY / STUDENT WORKS SECTION — "Muzey zali" qorong'i rejim.
   San'at asarlari oq fonda emas, qorong'i zalda oltin ramkada ko'rinadi.
   -------------------------------------------------------------------------- */
.student-works {
    padding: 5rem 0;
}

.section-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-heading h2 {
    font-family: var(--uzmmsi-display);
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 700;
    color: var(--mrdi-dark);
    margin-bottom: 0.35rem;
    line-height: 1.15;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

/* Mo'yqalam (brush) underline — san'at imzosі. Hamma bo'lim sarlavhasida. */
.section-heading h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--uzmmsi-turquoise), var(--uzmmsi-gold) 60%, rgba(195, 170, 55, 0.15));
}


.section-heading p {
    font-size: 0.95rem;
    color: var(--mrdi-gray-600);
    margin: 0;
}

/* Gallery Filter Chips */
.gallery-filters {
    margin-bottom: 2rem;
}

.gallery-filters .nav-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px;
    border-radius: var(--mrdi-radius-full);
    box-shadow: none;
    width: fit-content;
    backdrop-filter: blur(8px);
}

.gallery-filters .nav-link {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    padding: 8px 20px;
    border-radius: var(--mrdi-radius-full);
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--mrdi-transition);
}

.gallery-filters .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.gallery-filters .nav-link.active {
    background: var(--uzmmsi-gold);
    color: #1c1917;
    box-shadow: 0 4px 12px rgba(195, 170, 55, 0.35);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: var(--mrdi-radius-md);
    overflow: hidden;
    background: #24211e;
    border: 1px solid rgba(195, 170, 55, 0.22);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: var(--mrdi-transition);
}

.gallery-item:hover {
    transform: translateY(-6px);
    border-color: rgba(195, 170, 55, 0.6);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.gallery-item-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #e5e7eb;
}

.gallery-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover .gallery-item-image img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(17, 24, 39, 0.92) 0%, rgba(17, 24, 39, 0.2) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    transition: var(--mrdi-transition);
}

.gallery-overlay .category-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: var(--mrdi-radius-full);
    background: var(--uzmmsi-gold);
    color: #1c1917;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.gallery-overlay h5 {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.gallery-overlay .author {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
    margin: 0;
}

.gallery-overlay .author i {
    color: var(--uzmmsi-gold) !important;
}

/* Qorong'i zalda outline tugma va bo'sh holat matni ko'rinishi uchun. */
.student-works .btn-outline-success {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
}

.student-works .btn-outline-success:hover {
    background: var(--uzmmsi-gold);
    border-color: var(--uzmmsi-gold);
    color: #1c1917;
}

.student-works .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* --------------------------------------------------------------------------
   6. FACULTIES SECTION
   -------------------------------------------------------------------------- */
.faculties-section {
    padding: 5rem 0;
}

.faculty-card {
    background: #ffffff;
    border-radius: var(--mrdi-radius-lg);
    border: 1px solid var(--mrdi-gray-200);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--mrdi-transition);
    box-shadow: var(--mrdi-shadow-sm);
}

.faculty-card:hover {
    transform: translateY(-8px);
    border-color: rgba(42, 68, 148, 0.35);
    box-shadow: var(--mrdi-shadow-lg);
}

.faculty-cover {
    /* 2:1 — matches the 800x400 size recommended in the admin panel, so an
       uploaded cover is shown as-is instead of being cropped to ~3:1.
       aspect-ratio (not a fixed height) keeps the ratio at every breakpoint. */
    aspect-ratio: 2 / 1;
    min-height: 120px; /* keeps room for the 50px floating icon on narrow cards */
    position: relative;
    background: linear-gradient(135deg, var(--uzmmsi-navy), var(--uzmmsi-navy-deep));
    /* No overflow:hidden here — the floating icon deliberately hangs 22px
       below this box, and clipping it here cut the icon in half. The image
       zoom is contained by .faculty-cover-media instead. */
}

/* Wrapper that clips the zooming cover image without clipping the icon. */
.faculty-cover-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--mrdi-radius-lg) var(--mrdi-radius-lg) 0 0;
}

.faculty-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 0.45 asarni yashirardi — endi muqova jonli, matn esa pastki
       body da bo'lgani uchun o'qilishga xalaqit bermaydi. */
    opacity: 0.8;
    transition: transform 0.6s ease, opacity 0.4s ease;
    display: block;
}

.faculty-card:hover .faculty-cover img {
    transform: scale(1.08);
    opacity: 0.95;
}

.faculty-icon-floating {
    position: absolute;
    z-index: 2; /* above .faculty-cover-media, which is also positioned */
    bottom: -22px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--mrdi-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 6px 16px rgba(42, 68, 148, 0.35);
    border: 3px solid #ffffff;
    transition: var(--mrdi-transition);
}

.faculty-card:hover .faculty-icon-floating {
    transform: rotate(-8deg) scale(1.05);
    background: var(--mrdi-primary-dark);
}

.faculty-body {
    padding: 2rem 1.25rem 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.faculty-title {
    font-family: var(--uzmmsi-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--mrdi-dark);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.faculty-desc {
    font-size: 0.85rem;
    color: var(--mrdi-gray-600);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.faculty-stats-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--mrdi-gray-100);
    font-size: 0.82rem;
    color: var(--mrdi-gray-600);
}

.faculty-stats-row span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.faculty-stats-row i {
    color: var(--mrdi-primary);
}

.faculty-footer {
    padding: 0 1.25rem 1.25rem;
}

.btn-faculty-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    border-radius: var(--mrdi-radius-md);
    background: var(--mrdi-gray-50);
    border: 1px solid var(--mrdi-gray-300);
    color: var(--mrdi-dark);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: var(--mrdi-transition);
}

.faculty-card:hover .btn-faculty-detail {
    background: var(--mrdi-primary);
    border-color: var(--mrdi-primary);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   7. NEWS & EVENTS BENTO SECTION
   -------------------------------------------------------------------------- */
.news-events-section {
    padding: 5rem 0;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.bento-card-featured {
    background: #ffffff;
    border-radius: var(--mrdi-radius-lg);
    overflow: hidden;
    box-shadow: var(--mrdi-shadow-sm);
    border: 1px solid var(--mrdi-gray-200);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--mrdi-transition);
}

.bento-card-featured:hover {
    transform: translateY(-6px);
    box-shadow: var(--mrdi-shadow-lg);
}

.featured-img-wrap {
    height: 260px;
    position: relative;
    overflow: hidden;
    background: var(--uzmmsi-navy-deep);
}

.featured-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.bento-card-featured:hover .featured-img-wrap img {
    transform: scale(1.06);
}

.news-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 5px 12px;
    background: var(--mrdi-primary);
    color: #ffffff;
    border-radius: var(--mrdi-radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.featured-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.82rem;
    color: var(--mrdi-gray-600);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.featured-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.featured-title a {
    color: var(--mrdi-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.featured-title a:hover {
    color: var(--mrdi-primary);
}

.featured-excerpt {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-side-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-side-item {
    background: #ffffff;
    border-radius: var(--mrdi-radius-md);
    padding: 1rem;
    border: 1px solid var(--mrdi-gray-200);
    box-shadow: var(--mrdi-shadow-sm);
    display: flex;
    gap: 14px;
    align-items: center;
    transition: var(--mrdi-transition);
}

.news-side-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--mrdi-shadow-md);
    border-color: rgba(42, 68, 148, 0.35);
}

.news-side-thumb {
    width: 90px;
    height: 80px;
    border-radius: var(--mrdi-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: #e5e7eb;
}

.news-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-side-content {
    flex: 1;
    min-width: 0;
}

.news-side-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-side-title a {
    color: var(--mrdi-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.news-side-title a:hover {
    color: var(--mrdi-primary);
}

/* --------------------------------------------------------------------------
   8. FAQ & PARTNERS & USEFUL LINKS
   -------------------------------------------------------------------------- */
.faq-section {
    padding: 5rem 0;
}

.faq-item {
    background: var(--uzmmsi-surface);
    border-radius: var(--mrdi-radius-md);
    border: 1px solid var(--uzmmsi-line);
    margin-bottom: 0.85rem;
    overflow: hidden;
    transition: var(--mrdi-transition);
}

.faq-item.open {
    background: var(--uzmmsi-surface);
    border-color: rgba(42, 68, 148, 0.35);
    box-shadow: var(--mrdi-shadow-md);
}

.faq-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--mrdi-dark);
    text-align: left;
    gap: 12px;
}

.faq-toggle:focus {
    outline: none;
}

.faq-icon-pill {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(42, 68, 148, 0.1);
    color: var(--mrdi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--mrdi-transition);
    flex-shrink: 0;
}

.faq-item.open .faq-icon-pill {
    background: var(--mrdi-primary);
    color: #ffffff;
    transform: rotate(180deg);
}

.faq-content {
    display: none;
    padding: 0 1.5rem 1.25rem;
    color: var(--uzmmsi-text);
    font-size: 0.92rem;
    line-height: 1.6;
}

.faq-item.open .faq-content {
    display: block;
}

/* Partners marquee */
.partners-section {
    padding: 4.5rem 0;
    overflow: hidden;
}

.partners-track-wrap {
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.partners-track {
    display: flex;
    gap: 2.5rem;
    width: max-content;
    animation: marquee-scroll 35s linear infinite;
    will-change: transform;
}

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

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.partner-card {
    width: 180px;
    height: 90px;
    background: var(--uzmmsi-canvas);
    border-radius: var(--mrdi-radius-md);
    border: 1px solid var(--uzmmsi-line);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: var(--mrdi-transition);
    flex-shrink: 0;
}

.partner-card:hover {
    background: var(--uzmmsi-surface);
    border-color: var(--mrdi-primary);
    transform: translateY(-3px);
    box-shadow: var(--mrdi-shadow-md);
}

.partner-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.65;
    transition: var(--mrdi-transition);
}

.partner-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.06);
}

/* Useful resources 4-grid */
.useful-resources-section {
    padding: 4.5rem 0;
}

.useful-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.useful-card {
    background: var(--uzmmsi-surface);
    border-radius: var(--mrdi-radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    border: 1px solid var(--uzmmsi-line);
    box-shadow: var(--mrdi-shadow-sm);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    transition: var(--mrdi-transition);
}

.useful-card:hover {
    transform: translateY(-5px);
    border-color: var(--mrdi-primary);
    box-shadow: var(--mrdi-shadow-md);
}

.useful-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--uzmmsi-canvas);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    transition: var(--mrdi-transition);
}

.useful-card:hover .useful-icon-wrap {
    transform: scale(1.1);
    background: rgba(42, 68, 148, 0.1);
}

.useful-icon-wrap img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.useful-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--mrdi-dark);
    line-height: 1.35;
    margin: 0;
    transition: color 0.2s;
}

.useful-card:hover .useful-title {
    color: var(--mrdi-primary);
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS (Mobile & Tablet Perfection)
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .quick-services-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .useful-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991.98px) {
    #hero.hero .hero-container {
        aspect-ratio: 16 / 10;
        min-height: 460px;
    }

    /* Rasmsiz (zaxira) hero planshetda: main.css shablonidagi "padding: 180px 0 80px"
       va markazlash o'rniga — kontent header ostidan, chapda (tugmalar bilan bir
       chiziqda), matn kengligi cheklangan, o'ng tomon emblem uchun bo'sh. */
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) {
        min-height: 0;
        padding: 0;
        text-align: left;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .container {
        padding-top: 9rem;
        padding-bottom: calc(45px + 3rem);
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content {
        max-width: 34rem;
        margin-bottom: 0;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content h1,
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content p {
        text-align: left;
    }

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

    .about-showcase-section {
        padding: 3.5rem 0;
    }

    .about-visual-card {
        margin-top: 2rem;
    }

    .about-visual-card > img {
        height: 320px;
    }

    /* On a narrow card the quote wraps to ~4 lines and the overlay covered
       most of the photo. Trim the box so the image stays visible. */
    .about-quote-box {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 0.9rem;
    }

    .about-quote-box p {
        font-size: 0.8rem;
        line-height: 1.45;
        margin-bottom: 0.45rem;
    }
}

@media (max-width: 767.98px) {
    #hero.hero {
        margin-top: 25px;
    }

    #hero.hero .hero-container {
        aspect-ratio: auto;
        min-height: 480px;
    }

    #hero.hero .container {
        padding-top: 30px;
        padding-bottom: 50px;
    }

    #hero.hero .cta-buttons {
        gap: 0.75rem;
    }

    /* Telefonda belgi to'liq ko'rinadi (kesilmaydi): o'ng tomonda, vertikal
       markazda; matn ortida qolgani uchun xiraroq. */
    #hero.hero .hero-container:not(:has(.image-background, .video-background))::before {
        top: 50%;
        bottom: auto;
        right: 4%;
        width: min(48vw, 230px);
        transform: translateY(-50%);
        opacity: 0.2;
    }

    /* Rasmsiz (zaxira) hero telefonda: main.css shablonining "padding: 180px"
       va min-height + markazlash 141px bo'sh joy qoldirib, 320px ekranda
       tugmalarni birinchi ekrandan chiqarib yuborardi. Endi kontent qotirilgan
       header ostidan boshlanadi va balandlik kontentga teng. */
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) {
        min-height: 0;
        padding: 0;
        align-items: flex-start;
        text-align: left;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .container {
        /* header (~87px hero ustida) + nafas; pastda tezkor xizmatlar (-30px) uchun joy */
        padding-top: 7.25rem;
        padding-bottom: calc(30px + 2.25rem);
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content,
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content h1,
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content p {
        margin-bottom: 0;
        text-align: left;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-badge {
        align-items: flex-start;
        max-width: 100%;
        padding: 6px 12px;
        font-size: 0.75rem;
        line-height: 1.35;
        letter-spacing: 0;
        margin-bottom: 1rem;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-badge i {
        flex-shrink: 0;
        margin-top: 1px;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content h1,
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content .hero-title {
        font-size: clamp(1.85rem, 8.6vw, 2.5rem);
        margin-bottom: 0.875rem;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .hero-content p:not(.hero-title) {
        font-size: 0.9375rem;
        margin-bottom: 1.5rem;
    }

    /* Ikki tugma yonma-yon: ustma-ust 130px olib, kichik ekranda pastga tushib qolardi */
    /* main.css (576px gacha) ularni ustunga terib, 240px ga cheklardi */
    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .cta-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0.625rem;
    }

    #hero.hero .hero-container:not(:has(.image-background, .video-background)) .cta-buttons a {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        min-width: 0;
        padding: 12px 14px;
    }

    #hero.hero .hero-container.has-text:has(.image-background, .video-background) .container {
        padding-top: 96px;
        padding-bottom: calc(30px + 1.75rem);
    }

    #hero.hero .hero-container.has-text:has(.image-background, .video-background) .cta-buttons {
        flex-direction: row;
        align-items: stretch;
    }

    #hero.hero .hero-container.has-text:has(.image-background, .video-background) .cta-buttons a {
        flex: 1 1 0;
        width: auto;
    }

    #hero.hero .btn-hero-primary,
    #hero.hero .btn-hero-secondary {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    /* Quick services 2 columns on mobile */
    .quick-services {
        margin-top: -30px;
    }

    .quick-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .quick-service-card {
        padding: 1rem 0.75rem;
    }

    .quick-service-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    /* Statistics: keep all three on one row on phones.
       Two columns left a lone card on the second row, which reads as an
       unfinished layout. Type is scaled so the longest label
       ("O'QITUVCHILAR") still fits on a 320px screen. */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-item {
        padding: 0.9rem 0.3rem;
        min-width: 0; /* let grid items shrink instead of overflowing */
    }

    .stat-value {
        font-size: 1.25rem;
        letter-spacing: -0.5px;
    }


    .stat-label {
        font-size: 0.58rem;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .stat-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    /* Gallery mobile chips */
    .gallery-filters {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .gallery-filters .nav-pills {
        display: flex;
        flex-wrap: nowrap;
        white-space: nowrap;
        width: max-content;
        border-radius: var(--mrdi-radius-full);
    }

    .gallery-filters .nav-link {
        padding: 6px 14px;
        font-size: 0.82rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item-image {
        height: 200px;
    }

    .gallery-overlay {
        padding: 0.75rem;
    }

    .gallery-overlay h5 {
        font-size: 0.88rem;
    }

    .gallery-overlay .author {
        font-size: 0.75rem;
    }

    /* About features 1 column */
    .about-features {
        grid-template-columns: 1fr;
    }

    /* Useful links 2 columns */
    .useful-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .useful-card {
        padding: 1.25rem 0.75rem;
        min-height: 140px;
    }

    .useful-icon-wrap {
        width: 46px;
        height: 46px;
    }

    .useful-icon-wrap img {
        width: 30px;
        height: 30px;
    }

    .useful-title {
        font-size: 0.8rem;
    }

}

@media (max-width: 420px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item-image {
        height: 240px;
    }
}

/* --------------------------------------------------------------------------
   ACCESSIBILITY: REDUCED MOTION
   Respect the OS "reduce motion" setting. Without this the partner marquee
   scrolls forever and AOS fades every section in, which is a problem for
   users with vestibular disorders.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .partners-track {
        animation: none !important;
        transform: none !important;
        /* Without the marquee the duplicated logo set would just repeat, so
           let the row wrap and centre instead. */
        flex-wrap: wrap;
        justify-content: center;
    }

    /* AOS adds inline transitions; neutralise them so content is simply there. */
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        animation: none !important;
    }

    .hero-carousel .carousel-item {
        transition: none !important;
    }

    html {
        scroll-behavior: auto !important;
    }
}
