/**
 * CIPT & AHS — Homepage Custom Styles
 *
 * Animations and component styles that complement Tailwind CSS.
 *
 * @package CIPT
 */

/* ─── GLOBAL RESETS ──────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* ─── CUSTOM SCROLLBAR ───────────────────────── */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #eef2f7;
}

::-webkit-scrollbar-thumb {
    background: #0a1f3f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #166534;
}

/* ─── NOTICE TICKER ──────────────────────────── */
@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

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

.ticker-content {
    animation: ticker-scroll 30s linear infinite;
}

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

/* ─── HERO SLIDER ────────────────────────────── */
.slide {
    will-change: opacity;
}

/* ─── COUNTER ANIMATION ──────────────────────── */
.counter {
    display: inline-block;
}

/* ─── LINE CLAMP UTILITY ─────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── DROPDOWN MENUS ─────────────────────────── */
nav .group:hover>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

nav .group>ul {
    transform: translateY(8px);
    transition: all 0.2s ease;
}

/* ─── SMOOTH SCROLL ──────────────────────────── */
html {
    scroll-behavior: smooth;
}

/* ─── SECTION FADE-IN ANIMATION ──────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* ─── ACCREDITATION CARD ICON PULSE ──────────── */
@keyframes subtle-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.accreditation-card:hover .card-icon {
    animation: subtle-pulse 1s ease-in-out infinite;
}

/* ─── RECRUITER LOGO MARQUEE ─────────────────── */
@keyframes recruiter-slide {
    0% {
        transform: translateX(0);
    }

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

.recruiter-marquee-wrapper {
    position: relative;
    display: flex;
}

.recruiter-marquee-wrapper::before,
.recruiter-marquee-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
}

.recruiter-marquee-wrapper::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.recruiter-marquee-wrapper::after {
    right: 0;
    background: linear-gradient(to left, #fff, transparent);
}

.recruiter-marquee-content {
    animation: recruiter-slide 20s linear infinite;
}

.recruiter-marquee-wrapper:hover .recruiter-marquee-content {
    animation-play-state: paused;
}

/* ─── GALLERY OVERLAY ────────────────────────── */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 31, 63, 0);
    transition: background 0.3s ease;
}

.gallery-item:hover::after {
    background: rgba(10, 31, 63, 0.4);
}

/* ─── RESPONSIVE ADJUSTMENTS ─────────────────── */
@media (max-width: 1024px) {
    #hero-slider {
        height: 380px;
    }
}

@media (max-width: 768px) {
    #hero-slider {
        height: 320px;
    }

    #hero-slider h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 640px) {
    #hero-slider {
        height: 280px;
    }

    .ticker-content {
        animation-duration: 20s;
    }
}

/* ─── FOCUS STYLES FOR ACCESSIBILITY ─────────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #d4a017;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ─── SKIP TO CONTENT (a11y) ─────────────────── */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: 8px 16px;
    background: #166534;
    color: #fff;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}