/*
 * Home page section styling (2026-10): countries, gallery, statistics, testimonials, news.
 * Design only: every rule is scoped to a section id, content and section order are untouched.
 * Loaded from frontend/pages/index.blade.php via @push('styles').
 */
:root {
    --cv-red: #e60000;
    --cv-red-deep: #b80000;
    --cv-ink: #231c1c;
    --cv-muted: #6f6363;
    --cv-line: #ede3e3;
    --cv-blush: #fef2f2;
    --cv-soft: #faf6f6;
    --cv-radius: 18px;
    --cv-radius-sm: 14px;
    --cv-shadow: 0 1px 2px rgba(35, 28, 28, .04), 0 14px 34px -18px rgba(35, 28, 28, .28);
    --cv-shadow-hover: 0 2px 4px rgba(35, 28, 28, .05), 0 26px 50px -22px rgba(35, 28, 28, .42);
}

/* ---------- Hero slider ---------- */
/* Start right under the fixed header (its pill ends 68px from the top) instead of 96–128px. */
#home {
    padding-top: 68px !important;
}

/* Same height for every slide. The template's h-[500px]/md:h-[620px]/lg:h-[760px] are Tailwind-JIT
   classes that the Tailwind 2 CDN build ignores, so each slide took its text's height (436/408/408). */
#home .swiper-slide > div {
    height: 430px !important;
}

@media (min-width: 768px) {
    #home .swiper-slide > div {
        height: 460px !important;
    }
}

@media (min-width: 1024px) {
    #home .swiper-slide > div {
        height: 500px !important;
    }
}

/* ---------- Shared section headings ---------- */
#countries h2,
#testimonials h2,
#news .news-header h2 {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem) !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    letter-spacing: -.01em;
    color: var(--cv-ink) !important;
    margin-top: 0 !important;
}

#countries h2::after,
#testimonials h2::after,
#news .news-header h2::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    margin: 16px auto 0;
    border-radius: 999px;
    background: var(--cv-red);
}

/* ---------- Countries ---------- */
#countries {
    background: #fff !important;
    padding-block: clamp(56px, 7vw, 96px) !important;
}

#countries .grid {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(16px, 2vw, 24px) !important;
}

#countries .grid > a {
    flex: 1 1 320px;
    max-width: 560px;
}

#countries a.group {
    position: relative;
    border-radius: var(--cv-radius) !important;
    border: 1px solid var(--cv-line) !important;
    box-shadow: var(--cv-shadow) !important;
    background: var(--cv-ink);
    transition: transform .3s ease, box-shadow .3s ease !important;
    isolation: isolate;
}

#countries a.group:hover,
#countries a.group:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--cv-shadow-hover) !important;
}

#countries a.group:focus-visible {
    outline: 3px solid var(--cv-red);
    outline-offset: 3px;
}

#countries .grid > a .relative {
    height: clamp(240px, 26vw, 340px) !important;
}

#countries a.group .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(35, 28, 28, .88) 0%, rgba(35, 28, 28, .45) 45%, rgba(35, 28, 28, .05) 100%) !important;
}

#countries a.group h3 {
    font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem) !important;
    font-weight: 800 !important;
}

#countries a.group h3 + p {
    font-size: .9rem !important;
    color: rgba(255, 255, 255, .78) !important;
}

/* the universities count becomes a pill */
#countries a.group .mt-2.text-xs,
#countries a.group .mt-3.inline-flex {
    display: inline-flex !important;
    align-items: center;
    margin-top: 12px !important;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--cv-red) !important;
    color: #fff !important;
    font-size: .8rem !important;
    font-weight: 700;
}

/* flag tile */
#countries a.group .rounded-2xl.bg-white\/95 {
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18) !important;
}

/* featured country */
#countries .mb-6 > a.group .relative {
    height: clamp(260px, 32vw, 420px) !important;
}

/* ---------- Gallery ---------- */
#gallery {
    background: var(--cv-soft) !important;
    padding-block: clamp(56px, 7vw, 96px) !important;
}

#gallery .max-w-2xl span {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem) !important;
    line-height: 1.25 !important;
    font-weight: 800 !important;
    color: var(--cv-ink) !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    flex-direction: column;
}

#gallery .max-w-2xl span::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    margin: 16px auto 0;
    border-radius: 999px;
    background: var(--cv-red);
}

#gallery .gallery-card {
    border-radius: var(--cv-radius-sm) !important;
    border: 1px solid var(--cv-line) !important;
    box-shadow: var(--cv-shadow) !important;
    background: #fff;
    transition: box-shadow .3s ease, transform .3s ease;
}

#gallery .gallery-card:hover {
    box-shadow: var(--cv-shadow-hover) !important;
    transform: translateY(-3px);
}

#gallery .gallery-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

@media (min-width: 768px) {
    /* mosaic: first photo large, the rest fill the grid without gaps */
    #gallery #gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-auto-rows: clamp(150px, 15vw, 210px);
        grid-auto-flow: dense;
        gap: clamp(12px, 1.4vw, 18px) !important;
    }

    #gallery .gallery-item,
    #gallery .gallery-card {
        height: 100% !important;
    }

    #gallery .gallery-item:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }

    /* close the last row for 6, 7 or 8 photos */
    #gallery .gallery-item:nth-child(6):last-child {
        grid-column: 1 / -1;
    }

    #gallery .gallery-item:nth-child(6):nth-last-child(2),
    #gallery .gallery-item:nth-child(7):last-child,
    #gallery .gallery-item:nth-child(8):last-child {
        grid-column: span 2;
    }

    #gallery .gallery-item:nth-child(6):nth-last-child(3) {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    #gallery .gallery-mobile-scroll {
        padding: 6px 2px 18px !important;
        gap: 12px !important;
    }

    #gallery .gallery-mobile-scroll .gallery-item {
        flex: 0 0 82% !important;
        max-width: 82% !important;
    }

    #gallery .gallery-mobile-scroll .gallery-card {
        height: 240px !important;
    }
}

/* ---------- Statistics band ---------- */
#section-counter {
    position: relative;
    padding-block: clamp(56px, 7vw, 88px) !important;
    background-size: cover !important;
    background-position: center !important;
}

#section-counter .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(35, 28, 28, .94) 0%, rgba(35, 28, 28, .86) 55%, rgba(120, 0, 0, .82) 100%) !important;
    opacity: 1 !important;
}

#section-counter .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
}

#section-counter .row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 !important;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--cv-radius);
    background: rgba(255, 255, 255, .04);
    overflow: hidden;
}

#section-counter .counter-wrap {
    max-width: none !important;
    width: auto !important;
    flex: none !important;
    padding: clamp(24px, 3vw, 36px) 16px !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

#section-counter .counter-wrap + .counter-wrap {
    border-inline-start: 1px solid rgba(255, 255, 255, .14);
}

#section-counter .block-18,
#section-counter .text {
    width: 100%;
    justify-content: center;
    text-align: center;
}

#section-counter .text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#section-counter .icon {
    width: 56px !important;
    height: 56px !important;
    display: grid !important;
    place-items: center;
    margin: 0 !important;
    border-radius: 16px !important;
    background: var(--cv-red) !important;
    box-shadow: 0 10px 24px -8px rgba(230, 0, 0, .7);
}

#section-counter .icon span {
    font-size: 28px !important;
    line-height: 1 !important;
    color: #fff !important;
}

#section-counter .icon span::before {
    margin: 0 !important;
    font-size: 28px !important;
}

#section-counter .text strong.number {
    order: 2;
    font-size: clamp(2rem, 1.4rem + 2vw, 3rem) !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
    color: #fff !important;
    font-variant-numeric: tabular-nums;
}

#section-counter .text > span {
    order: 3;
    font-size: .95rem !important;
    text-transform: none !important;
    letter-spacing: 0;
    color: rgba(255, 255, 255, .78) !important;
    line-height: 1.5 !important;
}

@media (max-width: 767px) {
    #section-counter .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #section-counter .counter-wrap + .counter-wrap {
        border-inline-start: 0;
    }

    #section-counter .counter-wrap:nth-child(even) {
        border-inline-start: 1px solid rgba(255, 255, 255, .14);
    }

    #section-counter .counter-wrap:nth-child(n+3) {
        border-top: 1px solid rgba(255, 255, 255, .14);
    }
}

/* ---------- Testimonials ---------- */
#testimonials {
    background: #fff !important;
    padding-block: clamp(56px, 7vw, 96px) !important;
}

#testimonials .testimonial-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 24px 22px !important;
    border-radius: var(--cv-radius) !important;
    border: 1px solid var(--cv-line) !important;
    background: #fff !important;
    box-shadow: var(--cv-shadow) !important;
    transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}

#testimonials .testimonial-card:hover {
    transform: translateY(-4px);
    border-color: #f3caca !important;
    box-shadow: var(--cv-shadow-hover) !important;
}

#testimonials .testimonial-card::before {
    content: "\201D";
    position: absolute;
    top: 6px;
    inset-inline-end: 18px;
    font: 700 72px/1 Georgia, "Times New Roman", serif;
    color: var(--cv-red);
    opacity: .14;
    pointer-events: none;
}

#testimonials .testimonial-text {
    font-size: 1rem !important;
    line-height: 1.9 !important;
    color: var(--cv-ink) !important;
    margin: 0 !important;
}

#testimonials .testimonial-card > .flex {
    padding-top: 16px;
    border-top: 1px solid var(--cv-line);
}

#testimonials .testimonial-card > .flex img,
#testimonials .testimonial-card > .flex > div:first-child:not(:last-child) {
    width: 46px !important;
    height: 46px !important;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--cv-blush);
}

#testimonials .testimonial-card > .flex > div.rounded-full {
    background: var(--cv-blush) !important;
    color: var(--cv-red) !important;
}

#testimonials .testimonial-card .text-sm {
    font-size: .95rem !important;
}

#testimonials .testimonial-card .text-xs {
    color: var(--cv-muted) !important;
}

@media (min-width: 768px) {
    #testimonials .testimonials-scroll {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        gap: clamp(16px, 2vw, 24px) !important;
    }

    #testimonials .testimonial-card {
        min-height: 230px;
    }
}

@media (max-width: 767px) {
    #testimonials .testimonials-scroll {
        padding: 6px 2px 18px !important;
    }

    #testimonials .testimonials-scroll .testimonial-card {
        flex: 0 0 84% !important;
        width: 84% !important;
        min-width: 0 !important;
    }
}

/* ---------- News ---------- */
#news.news-section {
    background: var(--cv-soft) !important;
    padding-block: clamp(56px, 7vw, 96px) !important;
}

#news .news-container {
    max-width: 1280px;
    padding-inline: 16px;
}

#news .news-header {
    margin-bottom: clamp(28px, 4vw, 44px) !important;
}

@media (min-width: 768px) {
    #news .news-track {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: clamp(16px, 2vw, 24px) !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    #news .news-track:has(> .news-card-image:only-child) {
        grid-template-columns: minmax(0, 620px);
        justify-content: center;
    }

    #news .news-card-image {
        width: auto !important;
        min-width: 0 !important;
        flex: none !important;
        height: clamp(320px, 30vw, 400px) !important;
    }
}

#news .news-card-image {
    border-radius: var(--cv-radius) !important;
    border: 1px solid var(--cv-line);
    background: var(--cv-ink) !important;
    box-shadow: var(--cv-shadow) !important;
    transition: transform .3s ease, box-shadow .3s ease;
}

#news .news-card-image:hover {
    transform: translateY(-4px);
    box-shadow: var(--cv-shadow-hover) !important;
}

#news .news-card-overlay {
    background: linear-gradient(to top, rgba(35, 28, 28, .92) 0%, rgba(35, 28, 28, .6) 40%, rgba(35, 28, 28, .12) 75%, rgba(35, 28, 28, 0) 100%) !important;
}

#news .news-card-content {
    padding: clamp(18px, 2.4vw, 26px) !important;
}

#news .news-tag {
    background: var(--cv-red) !important;
    border: 0 !important;
    font-size: .75rem !important;
    padding: 6px 14px !important;
}

#news .news-card-content h3 {
    font-size: clamp(1.25rem, 1rem + .9vw, 1.6rem) !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
}

#news .news-card-footer {
    margin-top: 16px !important;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

#news .news-card-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--cv-ink) !important;
    font-size: .82rem !important;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}

#news .news-card-footer a:hover {
    background: var(--cv-red);
    color: #fff !important;
}

@media (max-width: 767px) {
    #news .news-track {
        padding: 6px 2px 18px !important;
    }

    #news .news-card-image {
        flex: 0 0 84% !important;
        width: 84% !important;
        min-width: 0 !important;
        height: 340px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #countries a.group,
    #gallery .gallery-card,
    #testimonials .testimonial-card,
    #news .news-card-image {
        transition: none !important;
        transform: none !important;
    }
}
