/* ==========================================================================
   MRDI.UZ — HOMEPAGE MASTER STYLESHEET (home.css)
   Kamoliddin Behzod nomidagi Milliy rassomlik va dizayn instituti
   ========================================================================== */

:root {
    --mrdi-primary: #09915e;
    --mrdi-primary-dark: #076d47;
    --mrdi-primary-light: #0dd69a;
    --mrdi-primary-glow: rgba(9, 145, 94, 0.2);
    --mrdi-accent: #d4af37;
    --mrdi-dark: #1a252f;
    --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);
}

/* --------------------------------------------------------------------------
   1. HERO / BANNER SECTION
   -------------------------------------------------------------------------- */
#hero.hero {
    margin-top: 35px;
    position: relative;
    background: #111827;
    overflow: hidden;
}

#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: linear-gradient(
        100deg,
        rgba(10, 20, 15, 0.88) 0%,
        rgba(10, 20, 15, 0.7) 50%,
        rgba(10, 20, 15, 0.4) 100%
    );
    z-index: 1;
}

#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: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--mrdi-radius-full);
    color: #fff;
    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. */
#hero.hero .hero-content h1,
#hero.hero .hero-content .hero-title {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    max-width: none;
}

#hero.hero .hero-content p:not(.hero-title) {
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 2rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

#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: linear-gradient(135deg, var(--mrdi-primary) 0%, var(--mrdi-primary-light) 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(9, 145, 94, 0.35);
    transition: var(--mrdi-transition);
    border: none;
}

#hero.hero .btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(9, 145, 94, 0.45);
    color: #ffffff;
}

#hero.hero .btn-hero-secondary {
    padding: 13px 28px;
    border-radius: var(--mrdi-radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    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: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
}

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

#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(--mrdi-primary-light);
}

/* --------------------------------------------------------------------------
   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: #ffffff;
    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 rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: var(--mrdi-transition);
    position: relative;
    overflow: hidden;
}

.quick-service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mrdi-primary), var(--mrdi-primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quick-service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(9, 145, 94, 0.15);
    border-color: rgba(9, 145, 94, 0.2);
}

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

.quick-service-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    transition: var(--mrdi-transition);
}

.quick-service-card:nth-child(1) .quick-service-icon { background: #e8f5e9; color: #2e7d32; }
.quick-service-card:nth-child(2) .quick-service-icon { background: #e3f2fd; color: #1565c0; }
.quick-service-card:nth-child(3) .quick-service-icon { background: #fff3e0; color: #e65100; }
.quick-service-card:nth-child(4) .quick-service-icon { background: #f3e5f5; color: #7b1fa2; }
.quick-service-card:nth-child(5) .quick-service-icon { background: #e0f2f1; color: #00695c; }
.quick-service-card:nth-child(6) .quick-service-icon { background: #fbe9e7; color: #d84315; }

/* Generic fallback color for cards beyond the 6th or without a custom color_class */
.quick-service-card.service-default .quick-service-icon { background: #e8f5e9; color: #2e7d32; }

.quick-service-card:hover .quick-service-icon {
    transform: scale(1.1) rotate(-4deg);
}

.quick-service-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--mrdi-dark);
    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(--mrdi-gray-600);
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   3. STATISTICS SECTION (Social Proof)
   -------------------------------------------------------------------------- */
.statistics-section {
    background: linear-gradient(135deg, #09915e 0%, #0a734b 100%);
    position: relative;
    overflow: hidden;
    padding: 2.75rem 0;
    color: #ffffff;
}

.statistics-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    pointer-events: 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: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--mrdi-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: var(--mrdi-transition);
}

.stat-item:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}

.stat-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    font-size: 1.2rem;
    color: #ffffff;
}

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

.stat-value::after {
    content: '+';
    font-size: 1.2rem;
    margin-left: 2px;
    opacity: 0.85;
}

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

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

.about-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: rgba(9, 145, 94, 0.08);
    color: var(--mrdi-primary);
    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-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--mrdi-dark);
    line-height: 1.25;
    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(9, 145, 94, 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) */
.btn-about-primary {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.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
   -------------------------------------------------------------------------- */
.student-works {
    background: #f8f9fa;
    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-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 800;
    color: var(--mrdi-dark);
    margin-bottom: 0.35rem;
}

.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: #ffffff;
    padding: 6px;
    border-radius: var(--mrdi-radius-full);
    box-shadow: var(--mrdi-shadow-sm);
    width: fit-content;
}

.gallery-filters .nav-link {
    border: none;
    background: transparent;
    color: var(--mrdi-gray-600);
    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: var(--mrdi-primary);
    background: rgba(9, 145, 94, 0.08);
}

.gallery-filters .nav-link.active {
    background: var(--mrdi-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(9, 145, 94, 0.3);
}

/* 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: #ffffff;
    box-shadow: var(--mrdi-shadow-sm);
    transition: var(--mrdi-transition);
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--mrdi-shadow-lg);
}

.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: rgba(9, 145, 94, 0.9);
    color: #ffffff;
    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;
}

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

.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(9, 145, 94, 0.3);
    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, #1f2937, #111827);
    /* 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;
    opacity: 0.45;
    transition: transform 0.6s ease;
    display: block;
}

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

.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(9, 145, 94, 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-size: 1.15rem;
    font-weight: 700;
    color: var(--mrdi-dark);
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.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 {
    background: #f8f9fa;
    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: #111827;
}

.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(9, 145, 94, 0.3);
}

.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;
    background: #ffffff;
}

.faq-item {
    background: #f8f9fa;
    border-radius: var(--mrdi-radius-md);
    border: 1px solid var(--mrdi-gray-200);
    margin-bottom: 0.85rem;
    overflow: hidden;
    transition: var(--mrdi-transition);
}

.faq-item.open {
    background: #ffffff;
    border-color: rgba(9, 145, 94, 0.3);
    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(9, 145, 94, 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: #4b5563;
    font-size: 0.92rem;
    line-height: 1.6;
}

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

/* Partners marquee */
.partners-section {
    padding: 4rem 0;
    background: #ffffff;
    border-top: 1px solid var(--mrdi-gray-200);
    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: #f8f9fa;
    border-radius: var(--mrdi-radius-md);
    border: 1px solid var(--mrdi-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: var(--mrdi-transition);
    flex-shrink: 0;
}

.partner-card:hover {
    background: #ffffff;
    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;
    background: #f8f9fa;
}

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

.useful-card {
    background: #ffffff;
    border-radius: var(--mrdi-radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    border: 1px solid var(--mrdi-gray-200);
    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(--mrdi-gray-50);
    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(9, 145, 94, 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;
    }

    .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;
    }

    #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-value::after {
        font-size: 0.8rem;
    }

    .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;
    }
}
