/* Homepage Styles */
/* CSS variables are defined in design-system.css */

/* ═══════════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.hp-hero {
    position: relative;
    height: 70vh;
    /* Reduced from 80vh */
    min-height: 500px;
    /* Reduced from 600px */
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    text-align: center;
    padding: var(--hero-padding-top-desktop) 0 var(--hero-padding-bottom-desktop);
}

.hp-hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}

.hp-hero-bg-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--cta-bg);
    z-index: 0;
}

.hp-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hp-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hp-hero-label {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.hp-hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-inverse);
    letter-spacing: -0.02em;
    text-wrap: balance;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.hp-hero-title .text-highlight {
    color: var(--primary);
}

.hp-hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.35rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    animation: scrollIndicatorAnim 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scrollIndicatorAnim {
    0% {
        transform: translate(-50%, 0);
        opacity: 0.4;
    }

    50% {
        transform: translate(-50%, 15px);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 0);
        opacity: 0.4;
    }
}

.scroll-indicator svg {
    width: 60px;
    height: 60px;
    fill: var(--text-inverse);
}

/* Hero Divider */
.hero-divider {
    position: absolute;
    top: 92px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--container-width, 1280px) - 40px);
    max-width: calc(100% - 40px);
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════
   SPLITTER SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.hp-splitter {
    background-color: transparent;
    width: 100%;
    position: relative;
    /* Context for pagination */
}

.hp-splitter-container {
    display: flex;
    flex-wrap: wrap;
    box-shadow: var(--shadow-xl);
    background-color: var(--dark-hero);
    /* Unified background */
    align-items: stretch;
    /* Ensure full height for dividers */
}

.hp-splitter-item {
    flex: 1;
    min-width: 300px;
    padding: 60px 40px;
    /* Reduced vertical padding from section-spacing */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.hp-splitter-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hp-splitter-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dark overlay for readability when image is visible */
.hp-splitter-bg::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.hp-splitter-item:hover .hp-splitter-bg {
    opacity: 0.25;
    /* Subtler hover effect */
}

.hp-splitter-candidates {
    background-color: transparent;
    /* Removed specific bg */
    color: var(--text-inverse);
}

.hp-splitter-companies {
    background-color: transparent;
    /* Removed specific bg */
    color: var(--text-inverse);
}

/* Divider Styling */
.hp-splitter-divider {
    width: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    /* Subtle divider like footer */
    align-self: inherit;
    /* Stretch with container */
    margin: 40px 0;
    /* Add vertical spacing so it doesn't touch edges if preferred, or remove for full height */
}

.hp-splitter-content {
    max-width: 550px;
    /* Increased from 400px */
    position: relative;
    z-index: 1;
    /* Ensure content is above background */
}

.hp-splitter-icon {
    margin-bottom: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    /* Glassy background */
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hp-splitter-item:hover .hp-splitter-icon {
    background-color: var(--primary);
    transform: translateY(-2px);
}

.hp-splitter-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--primary);
    transition: all 0.3s ease;
}

.hp-splitter-item:hover .hp-splitter-icon svg,
.hp-splitter-item:hover .hp-splitter-icon path {
    fill: var(--dark-hero);
    /* Dark icon on orange background for contrast */
}

.hp-splitter-icon path {
    fill: var(--primary);
    transition: all 0.3s ease;
}

.hp-splitter-title-link {
    text-decoration: none;
}

.hp-splitter-title-link:hover {
    text-decoration: none;
}

.hp-splitter-item h2 {
    font-size: var(--h3-size);
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 0;
    color: var(--text-inverse);
}

.hp-splitter-item p {
    font-size: var(--font-size-base);
    line-height: 1.6;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Buttons */
.btn-yellow {
    background-color: var(--primary);
    color: var(--dark);
    border: none;
}

.btn-yellow:hover {
    background-color: var(--primary-hover);
    color: var(--dark);
}

/* ═══════════════════════════════════════════════════════════════════════
   INTRO SECTION (Zig-Zag)
   ═══════════════════════════════════════════════════════════════════════ */

.hp-intro {
    background-color: var(--bg-surface);
    padding: var(--section-spacing-desktop) 0;
}

.hp-intro-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

/* Reverse Layout */
.hp-intro-reverse-container {
    flex-direction: row-reverse;
}

.hp-intro-text-col {
    flex: 1;
}

.hp-intro-img-col {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hp-intro-img-col img {
    width: 521px;
    /* Fixed width as requested */
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}

.section-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: var(--h2-size);
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 0;
    /* Ensure no top margin */
    line-height: 1.2;
}

.section-title-sm {
    margin-top: 0;
    text-wrap: balance;
}

.section-title .text-highlight {
    color: var(--primary);
}

.hp-intro-desc {
    font-size: var(--font-size-md);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   LATEST OFFERS & PARTNERS
   ═══════════════════════════════════════════════════════════════════════ */

.hp-offers {
    background-color: #F9FAFB;
    /* Updated background color */
}

/* Fix gradient to match new background */
.hp-offers::after {
    background: linear-gradient(to bottom, rgba(249, 250, 251, 0), #F9FAFB);
}

/* Remove double wrapping/padding from job slider shortcode */
.hp-offers .job-container {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Remove double wrapping/padding from job slider shortcode */

/* Reposition Slider Navigation */
.hp-offers {
    position: relative;
    z-index: 5;
}

.hp-offers .container,
.hp-offers .job-container,
.hp-offers .related-jobs-slider-wrapper {
    overflow: visible !important;
}

/* Reposition Slider Navigation - Flexbox Layout */
.hp-offers .related-jobs-slider {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    /* Push arrows to edges */
    align-items: center !important;
    padding-bottom: 20px !important;
    /* Bottom spacing */
    overflow: hidden !important;
}

.hp-offers .related-jobs-slider .swiper-wrapper {
    flex: 0 0 100% !important;
    width: 100% !important;
    order: 1 !important;
    margin-bottom: 30px !important;
    /* Space between slides and controls */
}

.hp-offers .related-jobs-slider .swiper-button-prev {
    position: static !important;
    order: 2 !important;
    margin: 0 !important;
    /* Remove margin to stick to edge */
    transform: none !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.hp-offers .related-jobs-slider .swiper-pagination {
    position: static !important;
    order: 3 !important;
    width: auto !important;
    margin: 0 auto !important;
    /* Center pagination in remaining space */
    display: flex !important;
    align-items: center !important;
    z-index: 100 !important;
}

.hp-offers .related-jobs-slider .swiper-button-next {
    position: static !important;
    order: 4 !important;
    margin: 0 !important;
    /* Remove margin to stick to edge */
    transform: none !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Reset wrapper padding */
.hp-offers .related-jobs-slider-wrapper {
    padding-bottom: 0;
}

/* Adjust gradient overlay to stop above the controls */
/* Controls height approx 50px + 30px margin = 80px */
.hp-offers .related-jobs-slider-wrapper::after {
    display: block !important;
    content: '';
    position: absolute;
    top: 0;
    bottom: 80px;
    /* Stop before the controls area */
    right: 0;
    width: 30px;
    /* Reduced width as requested */
    z-index: 50;
    pointer-events: none;
    background: linear-gradient(to left, #F9FAFB 20%, rgba(249, 250, 251, 0) 100%);
}

.hp-offers .job-card {
    width: 300px;
    /* Fixed width for slider cards */
    max-width: 100%;
}

@media (max-width: 767px) {
    .hp-offers .job-meta {
        font-size: 0.8rem;
        /* Smaller font on mobile */
        gap: 0.5rem;
        /* Smaller gap */
    }

    .hp-offers .job-meta svg {
        width: 14px;
        height: 14px;
    }
}

.hp-offers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 767px) {
    .hp-offers-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hp-offers-header .section-title-sm {
        margin-bottom: 0;
    }

    .hp-offers-header .btn-primary,
    .hp-offers-header .btn-secondary,
    .hp-offers-header .btn-ghost,
    .hp-offers-header a.button {
        /* Target any button inside */
        width: 100%;
        text-align: center;
        order: 10;
        margin-top: 1rem;
    }
}

.section-padding {
    padding: var(--section-spacing-desktop) 0;
}

.hp-partners {
    background-color: var(--bg-surface);
    overflow: hidden;
    padding: var(--section-spacing-desktop) 0;
}

.section-title-sm {
    margin-top: 0.5rem;
}

.text-yellow {
    color: var(--primary);
}

.hp-partners-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 40px 0;
    /* Mask for smooth fade edges */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.hp-partners-track {
    display: flex;
    width: max-content;
    animation: scroll 40s linear infinite;
}

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

.hp-partner-item {
    height: 48px;
    width: auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hp-partner-item img {
    width: auto !important;
    height: 100% !important;
    object-fit: contain !important;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.hp-partner-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-25%);
        /* Move by 1/4 of total width (since we have 4 sets) */
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   COUNTER SECTION
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   COUNTER SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.hp-counter {
    background-color: var(--bg-surface);
    padding: var(--section-spacing-desktop) 0;
}

.hp-counter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    margin: 0 auto;
}

.hp-counter-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    /* Fixed height for alignment */
}

/* Desktop Dividers (Right side of 1, 2, 3) */
.hp-counter-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 60px;
    width: 1px;
    background-color: #E2E8F0;
    /* Light border color */
}

.hp-counter-number-wrapper {
    font-size: clamp(4rem, 10vw, 7rem);
    /* Responsive size */
    font-weight: 700;
    color: var(--bg-muted, #f3f4f6);
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    user-select: none;
    white-space: nowrap;
    letter-spacing: -0.02em;
    /* Tighten slightly */
}



.hp-counter-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text, #161615);
    /* Dark text */
    position: relative;
    z-index: 1;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 1023px) {
    .hero-divider {
        top: 68px;
    }
}

@media (max-width: 991px) {
    .hp-hero-title {
        font-size: 2.5rem;
    }

    .hp-intro-container,
    .hp-intro-reverse-container {
        flex-direction: column;
        gap: 40px;
    }

    /* Reset reverse on mobile to keep image/text order consistent if needed, 
       or keep it reversed. Usually standard stacking is preferred. */
    .hp-intro-reverse-container {
        flex-direction: column;
        /* Stack vertically like normal */
    }

    /* Counter: 2 columns on tablet */
    .hp-counter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Reset desktop dividers */
    .hp-counter-item::after {
        display: none;
    }

    /* Tablet Dividers: Right side of odd items (1, 3...) */
    .hp-counter-item:nth-child(odd)::after {
        display: block;
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        height: 60px;
        width: 1px;
        background-color: #E2E8F0;
    }

    .section-padding {
        padding: var(--section-spacing-mobile) 0;
    }

    .hp-partners,
    .hp-counter {
        padding: var(--section-spacing-mobile) 0;
    }
}

@media (max-width: 767px) {

    /* Hero */
    .hp-hero {
        height: auto;
        min-height: 600px;
        padding: var(--hero-padding-top-mobile) 0 var(--hero-padding-bottom-mobile);
    }

    .hp-hero-title {
        font-size: 2.5rem;
    }

    .scroll-indicator {
        display: none;
    }

    .hp-hero-label {
        display: none;
    }

    .hero-divider {
        width: calc(100% - 30px);
    }

    /* Splitter - Mobile Slider */
    .hp-splitter-container {
        display: flex;
        flex-direction: row;
        /* Horizontal layout for slider */
        flex-wrap: nowrap;
        /* Prevent wrapping */
        overflow-x: auto;
        /* Enable horizontal scroll */
        scroll-snap-type: x mandatory;
        /* Snap to slides */
        gap: 0;
        /* No gap needed if items are full width or specifically sized */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Hide scrollbar Firefox */
        padding-bottom: 0;
        /* Removed position relative to let pagination be relative to section if needed */
    }

    /* Mobile Pagination */
    .hp-splitter-pagination {
        display: flex;
        justify-content: center;
        gap: 8px;
        position: absolute;
        bottom: 25px;
        /* Fixed spacing as requested */
        left: 0;
        width: 100%;
        z-index: 10;
        pointer-events: none;
        /* Let touches pass through */
    }

    .hp-splitter-dot {
        width: 8px;
        height: 8px;
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .hp-splitter-dot.active {
        background-color: var(--primary);
        width: 24px;
        border-radius: 4px;
        /* Pill shape for active */
    }

    .hp-splitter-container::-webkit-scrollbar {
        display: none;
        /* Hide scrollbar Chrome/Safari */
    }

    .hp-splitter-divider {
        display: none;
        /* Hide divider on mobile */
    }

    .hp-splitter-item {
        flex: 0 0 85%;
        /* Show part of next slide to encourage scrolling */
        min-width: 85%;
        scroll-snap-align: center;
        padding: 60px 20px;
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        /* Optional subtle separator between slides */
    }

    .hp-splitter-item:last-child {
        border-right: none;
    }

    /* Counter */
    .hp-counter {
        display: none;
    }

    /* Counter: Inherit Grid from 991px (2 cols) until 479px */
    .hp-counter-grid {
        /* No change needed here, keeps 2 cols from 991px rule */
        gap: 0;
        /* Ensure no gap for dividers to work */
    }

    .hp-counter-item {
        width: 100%;
        height: 120px;
        /* Keep fixed height for alignment */
        padding: 0;
    }

    .hp-counter-item:not(:last-child)::after {
        /* Reset from desktop/tablet rules if needed */
        display: none;
    }


}

@media (max-width: 479px) {

    /* Counter: 1 column on mobile */
    .hp-counter-grid {
        grid-template-columns: 1fr;
    }

    /* Reset tablet dividers */
    .hp-counter-item::after,
    .hp-counter-item:nth-child(odd)::after {
        display: none;
    }

    /* Mobile Dividers: Top side of all except first */
    .hp-counter-item:not(:first-child)::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        /* Full width divider */
        max-width: 200px;
        /* Or keep it small like 60px if preferred, user said "oddelovač" */
        height: 1px;
        background-color: #E2E8F0;
    }

    /* User asked to remove gap between divider and number. 
       Since number is centered, reducing height brings top divider closer. */
    .hp-counter-item {
        height: auto;
        /* Allow auto height for content */
        padding: 20px 0;
        /* Add padding instead of fixed height */
        justify-content: center;
        /* Center horizontally */
        text-align: center;
        /* Center text */
        flex-direction: column;
        /* Stack if needed, but flex row usually ok. Text align handles it */
    }

    .hp-counter-label {
        margin-top: 5px;
        /* Adjust spacing */
        text-align: center;
        /* Enforce centering */
        justify-content: center;
    }

    .hp-counter-number-wrapper {
        position: relative;
        /* Remove absolute centering for mobile to stack naturally */
        top: auto;
        left: auto;
        transform: none;
        margin-bottom: 0;
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* Mobile Only Utility */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }

    .hp-scroll-btn {
        margin-top: 1.5rem;
        background-color: var(--primary);
        color: var(--dark);
        border: none;
    }

    .hp-scroll-btn svg {
        width: 20px;
        height: 20px;
        margin-left: 0.5rem;
    }

    /* Homepage Job Card Tweaks */
    .hp-offers .job-card {
        padding: 1.5rem !important;
    }

    .hp-offers .job-card .job-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }

    .hp-offers .job-card .job-meta {
        margin-bottom: 0.75rem !important;
        gap: 0.5rem !important;
    }

    .hp-offers .job-card .meta-item {
        padding: 0.25rem 0.5rem !important;
        font-size: 0.75rem !important;
    }

    .hp-offers .job-card .meta-item svg {
        width: 14px !important;
        height: 14px !important;
    }

    .hp-offers .job-card .job-desc {
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
}