/**
 * Global Spacing Fixes
 * This file contains fixes for common spacing issues on the website,
 * particularly focusing on removing unwanted gaps between navigation and content
 */

/* Remove unwanted space between navigation and hero sections */
.main-navigation + .hero-section,
.main-navigation + section,
.main-navigation + div,
.main-navigation + main,
.top-bar + .hero-section,
.top-bar + section,
.top-bar + div,
.top-bar + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix for hero media spacing */
.hero-media {
    margin-top: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.hero-media img {
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    object-position: center !important;
    object-fit: cover !important;
}

/* Hero image position fix */
.hero-media::before {
    z-index: 2 !important;
}

.hero-media img {
    position: relative !important;
    z-index: 1 !important;
}

/* English country-style typography adjustments */
.hero-content h2 {
    font-family: 'Georgia', serif !important;
    line-height: 1.3 !important;
    margin-bottom: 1.5rem !important;
}

.hero-content p {
    line-height: 1.7 !important;
    margin-bottom: 2rem !important;
}

.hero-buttons .btn {
    font-family: 'Georgia', serif !important;
    letter-spacing: 0.03em !important;
    padding: 0.75rem 1.5rem !important;
    min-width: 140px !important;
    text-align: center !important;
}

/* Fix spacing for all page templates */
body {
    margin: 0 !important;
    padding: 0 !important;
}

main{
    margin-top: -50px !important;
}

article, section {
    margin-top: -15px !important;
}

/* Override any inline styles that might cause spacing */
[style*="margin-top"] {
    margin-top: 0 !important;
}

/* Special fixes for mobile */
@media (max-width: 768px) {
    /* Tighter connection between navigation and content on mobile */
    .hero-section, 
    .page-header,
    .tcl-style-header,
    .gallery-hero,
    .avnl-style-header,
    .career-page .current-vacancies,
    .rti-page .rti-content,
    .cvo-page .cvo-content,
    main > section:first-child,
    main > div:first-child,
    main > article:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Fix for image sections on mobile */
    .hero-media,
    .page-header img,
    .gallery-hero img {
        margin: 0 auto !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* Hero content center alignment on mobile */
    .hero-content {
        text-align: center !important;
        padding: 2rem 1.5rem !important;
        margin: 0 auto !important;
    }
    
    .hero-content h2, 
    .hero-content p {
        padding-right: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .hero-buttons {
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    /* Fix for specific templates that have known spacing issues */
    .career-page,
    .rti-page,
    .cvo-page,
    .hr-page,
    .board-page {
        margin-top: 0 !important;
    }
    
    /* Ensure content flows directly after navigation */
    .main-navigation {
        margin-bottom: 0 !important;
    }
}

/* Button z-index fix for all devices */
.hero-buttons {
    position: relative !important;
    z-index: 20 !important;
}

.hero-buttons .btn {
    position: relative !important;
    z-index: 20 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
}

.hero-buttons .btn-primary {
    background-color: var(--secondary) !important;
}

.hero-buttons .btn-outline {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* Fix for content overflow */
.hero-section {
    overflow: visible !important;
}

.hero-slide {
    overflow: visible !important;
}

/* Content size and overflow handling */
@media (max-width: 768px) {
    /* Fix layout for large content */
    .hero-section {
        min-height: auto !important;
        height: auto !important;
        max-height: none !important;
    }
    
    .hero-slide {
        height: auto !important;
        min-height: auto !important;
        position: relative !important;
    }
    
    .hero-controls {
        position: relative !important;
        bottom: 0 !important;
        margin: 20px auto !important;
    }
    
    /* Stack buttons on mobile */
    .hero-buttons {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .hero-buttons .btn {
        width: 80% !important;
        max-width: 250px !important;
        margin: 0.5rem 0 !important;
    }
    
    /* Add padding to content */
    .hero-content {
        padding-bottom: 20px !important;
    }
}

/* Fix for extra space below hero media */
.hero-credentials,
.hero-stats,
.hero-controls {
    margin-top: 0 !important;
}

/* Fix for slide 2 content alignment issues */
.hero-content div pre,
.hero-content div .tw-data-text,
.hero-content div .Y2IQFc[lang="hi"] {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    max-width: 100% !important;
    font-family: inherit !important; /* Use default font for Hindi */
    line-height: 1.6 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    display: block !important;
    width: 100% !important;
}

/* Fix for Hindi text in the second slide */
span[lang="hi"] {
    font-family: inherit !important;
    line-height: 1.7 !important;
    text-align: left !important;
    display: inline-block !important;
    width: 100% !important;
}

/* Remove default pre styling */
pre {
    white-space: normal !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: inherit !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Adjust spacing for slide content */
.hero-slide {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.hero-content {
    padding: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Controls positioning */
.hero-controls {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    z-index: 30 !important;
    margin: 0 !important;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    .hero-slide {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .hero-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 1.5rem !important;
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    /* Center Hindi text on mobile */
    .hero-content div pre,
    .hero-content div .tw-data-text,
    .hero-content div .Y2IQFc[lang="hi"],
    span[lang="hi"] {
        text-align: center !important;
        margin: 0 auto !important;
        max-width: 100% !important;
    }
    
    /* Fix for translated text element widths */
    #tw-target-text {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
        text-align: center !important;
    }
    
    .hero-controls {
        position: relative !important;
        bottom: 0 !important;
        margin-top: 1rem !important;
    }
}

/* Ensure translated text is properly contained */
#tw-target-text {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
}

.hero-content .content-last-updated {
    margin-bottom: 1rem !important;
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.8) !important;
    text-align: left !important;
}

.hero-content div {
    margin-bottom: 1.5rem !important;
    text-align: left !important;
}

/* Eliminate excess space below hero media */
.hero-slide {
    display: grid !important;
    gap: 0 !important;
}

@media (max-width: 768px) {
    /* Fix for centered content on mobile */
    .hero-content div pre,
    .hero-content div .tw-data-text,
    .hero-content .content-last-updated,
    .hero-content div {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Fix spacing between elements */
    .hero-buttons {
        margin-top: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Controls positioning fix */
    .hero-controls {
        position: relative !important;
        bottom: 0 !important;
        margin: 1rem auto !important;
        padding-bottom: 1rem !important;
    }
    
    /* Remove extra space at bottom */
    .hero-credentials {
        display: none !important;
    }
}

/* Hidden credential fix */
.hero-credentials {
    position: relative !important;
    bottom: 0 !important;
    right: auto !important;
    margin: 0 auto !important;
    left: 0 !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Hero Section Fixes */
.hero-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    max-width: 100vw !important;
}

.hero-slider {
    margin-top: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    max-width: 100vw !important;
}

.hero-slide {
    align-items: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
}

.hero-content {
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 15px !important;
    padding-left: 15px !important;
}

.hero-description {
    width: 100% !important;
    max-width: 100% !important;
}

.hero-media {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.hero-media img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Slider Controls Fix */
.slick-slider {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.slick-list {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.slick-track {
    width: 100% !important;
    max-width: 100% !important;
}

.slick-slide {
    width: 100% !important;
    max-width: 100% !important;
}

/* Hindi Text Fixes */
.hero-content div pre, 
.hero-content div .tw-data-text {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    display: block !important;
    margin: 0 !important;
}

.hero-content .Y2IQFc[lang="hi"] {
    display: inline !important;
    white-space: normal !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    width: 100% !important;
    text-align: left !important;
}

#tw-target-text {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.content-last-updated {
    font-size: 0.8rem !important;
    display: block !important;
    margin-top: 0.5rem !important;
    color: #666 !important;
}

/* Mobile Specific Fixes */
@media (max-width: 767px) {
    .hero-content {
        text-align: center !important;
        padding: 20px !important;
    }
    
    .hero-content div pre, 
    .hero-content div .tw-data-text {
        text-align: center !important;
    }
    
    .hero-slide {
        grid-template-columns: 1fr !important;
    }
    
    .hero-buttons {
        justify-content: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
}

/* Desktop Layout */
@media (min-width: 768px) {
    .hero-slide {
        grid-template-columns: 1fr 1fr !important;
    }
    
    .hero-content {
        padding-right: 20px !important;
    }
}

/* Slick Slider Fixes */
.slick-dots {
    bottom: 15px !important;
    z-index: 5 !important;
}

.slick-dots li button:before {
    font-size: 12px !important;
    color: white !important;
    opacity: 0.7 !important;
}

.slick-dots li.slick-active button:before {
    color: white !important;
    opacity: 1 !important;
}

.slider-controls {
    position: absolute !important;
    bottom: 20px !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 auto !important;
}

.slider-controls button {
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    border: none !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 5px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.slider-controls button:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Remove slick button focus outline or replace with accessible focus style */
.slick-prev:focus, .slick-next:focus {
    outline: none !important;
}

.slick-prev:focus-visible, .slick-next:focus-visible {
    outline: 2px solid #1B4332 !important;
}

/* Mobile adjustments for slider controls */
@media (max-width: 767px) {
    .slider-controls button {
        width: 30px !important;
        height: 30px !important;
    }
    
    .slick-dots {
        bottom: 5px !important;
    }
} 