/**
 * Front Page (Landing Page) Styles
 * 
 * @package SKOF_Theme
 */

.front-page {
    /* Container for all sections */
}

/* Common Section Styles */
.section-padding {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background-color: var(--color-bg-light);
}

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

.section-footer {
    margin-top: var(--spacing-lg);
}

/* === 1. HERO SLIDER === */
.hero-section {
    position: relative;
    height: calc(100vh - 220px); /* Viewport minus header (~140px) and stats (~80px) */
    min-height: 500px; /* Minimum height for small screens */
    max-height: 850px; /* Maximum height */
    overflow: hidden;
    /* Explicit dimensions prevent CLS without expensive containment */
}

.hero-slider {
    height: 100%;
    overflow: hidden;
}

/* Base slide styles */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Slide image - LCP optimization */
.hero-slide .slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* ========== TRANSITION EFFECTS ========== */

/* Performance optimization for slider animations
 * REMOVED will-change from all slides - too expensive for main-thread
 * Browser handles opacity/transform efficiently with GPU acceleration
 */

/* Fade Effect (domyślny) */
.hero-slider[data-transition="fade"] .hero-slide {
    transition: opacity 0.8s ease-in-out;
}

/* Slide Effect */
.hero-slider[data-transition="slide"] .hero-slide {
    transform: translateX(100%);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
    opacity: 1;
}

.hero-slider[data-transition="slide"] .hero-slide.active {
    transform: translateX(0);
}

.hero-slider[data-transition="slide"] .hero-slide.prev {
    transform: translateX(-100%);
}

/* Zoom In Effect */
.hero-slider[data-transition="zoom-in"] .hero-slide {
    transform: scale(0.8);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.hero-slider[data-transition="zoom-in"] .hero-slide.active {
    transform: scale(1);
}

/* Zoom Out Effect */
.hero-slider[data-transition="zoom-out"] .hero-slide {
    transform: scale(1.2);
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}

.hero-slider[data-transition="zoom-out"] .hero-slide.active {
    transform: scale(1);
}

/* Crossfade Effect - wyraźniejsze przenikanie */
.hero-slider[data-transition="crossfade"] .hero-slide {
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider[data-transition="crossfade"] .hero-slide.active {
    z-index: 2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(44,62,80,0.8) 0%, rgba(85,103,127,0.6) 100%);
}

/* Container w hero slider - pozycjonowanie absolutne dla idealnego wycentrowania */
.hero-slide > .container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Wyśrodkowanie w poziomie */
    text-align: center; /* Wyśrodkowanie tekstu */
    max-width: 900px; /* Szersze dla wyśrodkowanego tekstu */
    margin: 0 auto; /* Wyśrodkowanie kontenera */
    width: 100%;
    padding: 0 20px;
    color: #fff;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    width: 100%;
    /* Prevent CLS - reserve space for font */
    min-height: 4.2rem; /* 3.5rem * 1.2 line-height */
    font-family: 'Noto Serif', 'Noto Serif Fallback', Georgia, serif;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    width: 100%;
}

/* Support for HTML content in slider */
.hero-title p,
.hero-subtitle p {
    margin: 0;
    display: inline;
}

.hero-title strong,
.hero-subtitle strong {
    font-weight: 700;
}

.hero-title em,
.hero-subtitle em {
    font-style: italic;
}

.hero-title br,
.hero-subtitle br {
    display: block;
    content: "";
    margin: 0.5em 0;
}

/* Inline color/font-size support */
.hero-title span,
.hero-subtitle span {
    display: inline;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.125rem;
}

/* Hero Controls - strzałki po bokach ekranu na środku */
.hero-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.hero-prev,
.hero-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.hero-prev {
    left: 30px;
}

.hero-next {
    right: 30px;
}

.hero-prev:hover,
.hero-next:hover {
    background-color: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-50%) scale(1.1);
}

.hero-prev svg,
.hero-next svg {
    width: 28px;
    height: 28px;
}

/* Smooth scrolling for all sections */
html {
    scroll-behavior: smooth;
}

/* Add smooth transitions to sections */
.front-page section {
    transition: opacity 0.3s ease;
}

/* Performance: Defer rendering of off-screen sections */
.front-page section:not(.hero-section) {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
}

/* === 2. STATISTICS === */
.stats-section {
    padding: 40px 0 20px;
    background-color: #fff;
    color: var(--color-text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.stat-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* Kolor ustawiany inline z Customizera */
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text);
    font-weight: 600;
}

/* === 3. NEWS (Aktualności) === */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.news-thumbnail {
    display: block;
    overflow: hidden;
    position: relative;
    height: 220px;
    background-color: var(--color-bg-light);
    flex-shrink: 0;
}

.news-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-border) 100%);
    color: var(--color-text-light);
}

.news-card:hover .news-thumbnail img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-meta {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.news-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: var(--color-primary);
}

.news-excerpt {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.read-more {
    font-weight: 600;
    color: var(--color-primary-dark);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.3s ease;
    align-self: flex-start;
    margin-top: auto;
}

.read-more:hover {
    gap: 10px;
}

/* === 4. MEDIA === */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.media-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.media-card:hover {
    transform: translateY(-3px);
}

.media-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.media-thumbnail {
    position: relative;
    height: 180px;
    background-color: var(--color-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-border) 100%);
    color: var(--color-text-light);
}

.news-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-border) 100%);
    color: var(--color-text-light);
}

.media-content {
    padding: 15px;
}

.media-content time {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    display: block;
    margin-bottom: 0.5rem;
}

.media-title {
    font-size: 1rem;
    margin: 0;
}

.media-title a {
    color: var(--color-text);
    text-decoration: none;
}

.media-title a:hover {
    color: var(--color-primary);
}

/* === 5. PUBLICATIONS === */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    display: flex;
    gap: 25px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}

.publication-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.publication-icon {
    flex-shrink: 0;
    color: var(--color-primary-dark);
}

.publication-content {
    flex: 1;
}

.publication-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.publication-title a {
    color: var(--color-text);
    text-decoration: none;
}

.publication-title a:hover {
    color: var(--color-primary);
}

.publication-excerpt {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

/* === 6. HISTORY (Timeline) === */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-dot {
    position: absolute;
    left: -38px;
    top: 5px;
    width: 14px;
    height: 14px;
    background-color: var(--color-primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-content {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    flex-shrink: 0;
}

.timeline-title {
    font-size: 1.125rem;
    margin: 0;
    font-weight: 600;
}

.timeline-text {
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9375rem;
}

.timeline-link {
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

/* === 7. TEAM === */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}

.team-member {
    text-align: center;
}

.member-photo {
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    margin-left: auto;
    margin-right: auto;
    border: none !important;
    outline: none !important;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none !important;
    outline: none !important;
}

.member-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-light);
    color: var(--color-text-light);
}

.member-name {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.member-position {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.member-social {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 0.5rem;
}

.member-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-bg-light);
    color: var(--color-text);
    transition: all 0.3s ease;
}

.member-social a:hover {
    background-color: #1877f2;
    color: #fff;
    transform: translateY(-2px);
}

/* Team Show More */
.team-member.hidden-member {
    display: none;
}

.team-toggle-wrapper {
    margin-top: 40px;
}

.btn-show-more-team {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--color-primary-dark);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 125, 0, 0.3);
}

.btn-show-more-team svg {
    transition: transform 0.3s ease;
}

.btn-show-more-team.active svg {
    transform: rotate(180deg);
}

.btn-show-more-team:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(179, 201, 56, 0.4);
}

.btn-show-more-team:active {
    transform: translateY(0);
}

/* === 8. PATRONAGE HONOROWY === */
.patronage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px;
    align-items: stretch;
    justify-items: stretch;
}

.patronage-item {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.patronage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12) !important;
}

.patronage-link {
    display: block;
    text-align: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.patronage-item img,
.patronage-item a img,
.patronage-link img,
.patronage-grid img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    transition: transform 0.3s ease;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.patronage-item a {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.patronage-item:hover img {
    transform: scale(1.05);
    box-shadow: none !important;
}

/* === 9. PARTNERS & 10. SPONSORS === */
.partners-grid,
.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    align-items: center;
}

.partner-item,
.sponsor-item {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.partner-item:hover,
.sponsor-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.partner-link,
.sponsor-link {
    display: block;
    text-align: center;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.partner-item img,
.sponsor-item img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.partner-item a,
.sponsor-item a {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.partner-item:hover img,
.sponsor-item:hover img {
    transform: scale(1.05);
    opacity: 0.85;
    box-shadow: none !important;
}

/* === 11. CTA === */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    text-align: center;
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.cta-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        height: 50vh; /* Adjusted for mobile */
        min-height: 350px; /* Minimum height for small devices */
        max-height: none;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .stats-section {
        padding: 30px 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .news-grid,
    .media-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline {
        padding-left: 40px;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .timeline-date {
        font-size: 1rem;
    }
    
    .timeline-title {
        font-size: 1rem;
    }
    
    .timeline-text {
        font-size: 0.875rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .partners-grid,
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px; /* Smaller min-height for landscape mode */
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-large {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .hero-prev {
        left: 15px;
    }
    
    .hero-next {
        right: 15px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .hero-prev,
    .hero-next {
        width: 45px;
        height: 45px;
    }
    
    .hero-prev {
        left: 10px;
    }
    
    .hero-next {
        right: 10px;
    }
    
    .hero-prev svg,
    .hero-next svg {
        width: 22px;
        height: 22px;
    }
}

/* ========================================
   CLS Prevention - Reserve space for sections
   ======================================== */

/**
 * Min-height dla sekcji zapobiega Cumulative Layout Shift (CLS)
 * Rezerwuje miejsce podczas ładowania treści aby elementy się nie przesuwały
 */

/* Main content container */
#content.site-content {
    min-height: 100vh;
}

/* Statistics Section */
.stats-section {
    min-height: 120px;
}

/* News Section */
.news-section {
    min-height: 700px;
    content-visibility: auto;
    contain-intrinsic-size: 700px;
}

/* Media Section */
.media-section {
    min-height: 600px;
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* Publications Section */
.publications-section {
    min-height: 500px;
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* History/Timeline Section */
.history-section {
    min-height: 600px;
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* Team Section */
.team-section {
    min-height: 800px;
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}

/* Partners/Sponsors Sections */
.partners-section,
.sponsors-section {
    min-height: 400px;
    content-visibility: auto;
    contain-intrinsic-size: 400px;
}

/* Piknik Section */
.piknik-section {
    min-height: 600px;
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* Contact Section */
.contact-section {
    min-height: 700px;
    content-visibility: auto;
    contain-intrinsic-size: 700px;
}

/* Video Section */
.video-section {
    min-height: 600px;
    content-visibility: auto;
    contain-intrinsic-size: 600px;
}

/* Responsive min-heights */
@media (max-width: 768px) {
    .news-section {
        min-height: 1200px;
    }

    .media-section {
        min-height: 1000px;
    }

    .team-section {
        min-height: 1400px;
    }

    .contact-section {
        min-height: 900px;
    }
}
