/**
 * Heritage Landing Page - Rijksstudio Style
 * Pixel-perfect implementation based on rijksmuseum.nl/en/rijksstudio
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --heritage-primary: #0d6efd;
    --heritage-dark: #212529;
    --heritage-gray: #6c757d;
    --heritage-light: #f8f9fa;
    --heritage-border: #dee2e6;
    --heritage-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --heritage-shadow-hover: 0 8px 24px rgba(0,0,0,0.15);
    --heritage-radius: 8px;
    --heritage-radius-pill: 50px;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
.heritage-landing {
    width: 100%;
    overflow-x: hidden;
    background: white;
}

/* Full-bleed adjustments for AtoM wrapper */
body:has(.heritage-landing) #content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

body:has(.heritage-landing) .container,
body:has(.heritage-landing) .container-xxl {
    max-width: none !important;
    padding: 0 !important;
}

/* Fallback for browsers without :has() support */
.heritage-landing-page #content,
.heritage-landing-page #main-column,
.heritage-landing-page #wrapper,
.heritage-landing-page .container-xxl {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.heritage-landing-page #wrapper {
    padding-top: 0 !important;
}

.heritage-landing * {
    box-sizing: border-box;
}

/* Hide default scrollbars for carousels */
.heritage-landing .carousel-track::-webkit-scrollbar,
.heritage-landing .creators-track::-webkit-scrollbar {
    display: none;
}

.heritage-landing .carousel-track,
.heritage-landing .creators-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   Section 1: Hero (Full Viewport)
   ========================================================================== */
.heritage-hero {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.heritage-hero-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.heritage-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.heritage-hero-bg.active {
    opacity: 1;
}

/* Ken Burns effect */
.heritage-hero-bg.kenburns {
    animation: kenburns 20s ease-in-out infinite alternate;
}

@keyframes kenburns {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.1) translate(-2%, -2%);
    }
}

.heritage-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 2;
}

.heritage-hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    width: 90%;
    max-width: 800px;
}

.heritage-hero-tagline {
    font-size: 4rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.heritage-hero-subtext {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Box */
.heritage-search-box {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    overflow: hidden;
    align-items: center;
}

.heritage-search-box input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
    outline: none;
    background: transparent;
    min-width: 0;
}

.heritage-search-box input::placeholder {
    color: #adb5bd;
}

.heritage-search-box button {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: var(--heritage-primary);
    border: none;
    border-radius: 50%;
    margin: 4px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.heritage-search-box button:hover {
    background: #0b5ed7;
    transform: scale(1.05);
}

/* Suggested Searches */
.heritage-suggested-searches {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.8);
}

.heritage-suggested-searches a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 50px;
    display: inline-block;
    transition: all 0.2s ease;
}

.heritage-suggested-searches a:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
}

/* Scroll Indicator */
.heritage-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    z-index: 3;
    text-align: center;
    cursor: pointer;
}

.heritage-scroll-indicator span {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.heritage-scroll-indicator i {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ==========================================================================
   Section 2: Explore By (Category Buttons)
   ========================================================================== */
.heritage-explore-by {
    padding: 3rem 2rem;
    background: var(--heritage-light);
}

.heritage-section-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--heritage-gray);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.heritage-explore-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.heritage-explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1px solid var(--heritage-border);
    border-radius: 50px;
    font-size: 0.9375rem;
    color: var(--heritage-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.heritage-explore-btn i {
    font-size: 1.125rem;
}

.heritage-explore-btn:hover {
    background: var(--heritage-primary);
    color: white;
    border-color: var(--heritage-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.3);
}

/* ==========================================================================
   Section 3: Curated Collections (Rijksstudio Style Cards)
   ========================================================================== */
.heritage-collections {
    padding: 4rem 2rem;
    background: white;
}

.heritage-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.heritage-section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--heritage-dark);
    margin: 0;
}

.heritage-view-all {
    font-size: 0.9375rem;
    color: var(--heritage-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.heritage-view-all:hover {
    text-decoration: underline;
}

/* Carousel */
.heritage-carousel {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.heritage-carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
    padding-left: 2px;
    padding-right: 2px;
}

/* Collection Card - Rijksstudio Style */
.heritage-collection-card {
    flex: 0 0 auto;
    width: 380px;
    background: white;
    border-radius: var(--heritage-radius);
    overflow: hidden;
    box-shadow: var(--heritage-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.heritage-collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--heritage-shadow-hover);
}

/* Card Image Grid - 1 large + 2 small thumbnails */
.heritage-card-images {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    height: 280px;
    background: #eee;
}

.heritage-card-images .main-image {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.heritage-card-images .thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.heritage-card-images .thumb-image:first-of-type {
    grid-column: 2;
    grid-row: 1;
}

.heritage-card-images .thumb-image:last-of-type {
    grid-column: 2;
    grid-row: 2;
}

/* Fallback for single image */
.heritage-card-images.single-image {
    display: block;
}

.heritage-card-images.single-image img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.heritage-card-body {
    padding: 1rem 1.25rem;
}

.heritage-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--heritage-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heritage-card-subtitle {
    font-size: 0.875rem;
    color: var(--heritage-gray);
    margin-bottom: 0.5rem;
}

.heritage-card-count {
    font-size: 0.8125rem;
    color: var(--heritage-primary);
}

/* Carousel Arrows */
.heritage-carousel-arrow {
    position: absolute;
    top: 140px;
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.heritage-carousel-arrow:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

.heritage-carousel-arrow.left {
    left: -24px;
}

.heritage-carousel-arrow.right {
    right: -24px;
}

.heritage-carousel-arrow i {
    font-size: 1.25rem;
    color: var(--heritage-dark);
}

/* Carousel Indicators for Auto-rotation */
.heritage-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.heritage-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--heritage-border);
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.heritage-carousel-dot:hover {
    background: var(--heritage-gray);
    transform: scale(1.2);
}

.heritage-carousel-dot.active {
    background: var(--heritage-primary);
    transform: scale(1.2);
}

/* Auto-rotate pause indicator */
.heritage-carousel-autorotate:hover .heritage-carousel-indicators::after {
    content: '\f04c'; /* pause icon */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: var(--heritage-gray);
    margin-left: 0.5rem;
}

/* ==========================================================================
   Section 4: Browse by Creator
   ========================================================================== */
.heritage-creators {
    padding: 4rem 2rem;
    background: var(--heritage-light);
}

.heritage-creators-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.heritage-creator-card {
    flex: 0 0 auto;
    width: 160px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.heritage-creator-card:hover {
    transform: translateY(-4px);
}

.heritage-creator-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid white;
    box-shadow: var(--heritage-shadow);
}

.heritage-creator-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--heritage-dark);
    margin-bottom: 0.25rem;
}

.heritage-creator-count {
    font-size: 0.8125rem;
    color: var(--heritage-gray);
}

/* ==========================================================================
   Section 5: Interactive Timeline
   ========================================================================== */
.heritage-timeline {
    padding: 4rem 2rem;
    background: white;
}

.heritage-timeline-bar {
    position: relative;
    max-width: 1200px;
    margin: 3rem auto 2rem;
    height: 4px;
    background: var(--heritage-border);
    border-radius: 2px;
}

.heritage-timeline-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--heritage-primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 1;
}

.heritage-timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
}

.heritage-timeline-marker.active {
    background: #0b5ed7;
    transform: translate(-50%, -50%) scale(1.2);
}

.heritage-timeline-label {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.heritage-period-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--heritage-dark);
    display: block;
}

.heritage-period-years {
    font-size: 0.75rem;
    color: var(--heritage-gray);
}

/* Timeline Items Preview */
.heritage-timeline-preview {
    max-width: 1200px;
    margin: 4rem auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.heritage-timeline-item {
    position: relative;
    border-radius: var(--heritage-radius);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}

.heritage-timeline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.heritage-timeline-item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Section 6: Recently Added (Masonry Grid)
   ========================================================================== */
.heritage-recent {
    padding: 4rem 2rem;
    background: var(--heritage-light);
}

.heritage-masonry {
    column-count: 4;
    column-gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.heritage-masonry-item {
    break-inside: avoid;
    margin-bottom: 1rem;
    border-radius: var(--heritage-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.heritage-masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.heritage-masonry-item:hover img {
    transform: scale(1.02);
}

.heritage-masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.heritage-masonry-item:hover .heritage-masonry-overlay {
    opacity: 1;
}

.heritage-masonry-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   Section 7: Help Us Improve (Contributions CTA)
   ========================================================================== */
.heritage-contribute {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.heritage-contribute-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.heritage-contribute-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.heritage-contribute-subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.heritage-cta-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.heritage-cta-card {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    width: 280px;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.heritage-cta-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.25);
}

.heritage-cta-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.heritage-cta-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.heritage-cta-description {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.heritage-cta-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #667eea;
    border-radius: 50px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.heritage-cta-button:hover {
    transform: scale(1.05);
    color: #667eea;
}

/* Leaderboard */
.heritage-leaderboard {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.heritage-leaderboard-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.heritage-leaderboard-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.heritage-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.heritage-leaderboard-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
}

.heritage-leaderboard-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.heritage-leaderboard-points {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ==========================================================================
   Section 8: Footer
   ========================================================================== */
.heritage-footer {
    padding: 3rem 2rem;
    background: var(--heritage-dark);
    color: rgba(255,255,255,0.7);
}

.heritage-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.heritage-footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.heritage-footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.heritage-footer-links a:hover {
    color: white;
}

.heritage-footer-copyright {
    font-size: 0.8125rem;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet: 768px - 1199px */
@media (max-width: 1199px) {
    .heritage-hero-tagline {
        font-size: 3rem;
    }

    .heritage-collection-card {
        width: 320px;
    }

    .heritage-card-images {
        height: 240px;
    }

    .heritage-masonry {
        column-count: 3;
    }

    .heritage-creator-card {
        width: 140px;
    }

    .heritage-creator-avatar {
        width: 100px;
        height: 100px;
    }

    .heritage-carousel-arrow {
        display: none;
    }

    .heritage-timeline-preview {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: below 768px */
@media (max-width: 767px) {
    .heritage-hero {
        height: 80vh;
    }

    .heritage-hero-tagline {
        font-size: 2.5rem;
    }

    .heritage-hero-subtext {
        font-size: 1.125rem;
    }

    .heritage-search-box {
        max-width: 100%;
    }

    .heritage-search-box input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }

    .heritage-search-box button {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .heritage-explore-by {
        padding: 2rem 1rem;
    }

    .heritage-explore-buttons {
        gap: 0.75rem;
    }

    .heritage-explore-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .heritage-collections,
    .heritage-creators,
    .heritage-timeline,
    .heritage-recent,
    .heritage-contribute {
        padding: 3rem 1rem;
    }

    .heritage-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .heritage-section-title {
        font-size: 1.5rem;
    }

    .heritage-collection-card {
        width: 85vw;
        max-width: 340px;
    }

    .heritage-card-images {
        height: 220px;
    }

    .heritage-masonry {
        column-count: 2;
    }

    .heritage-creator-card {
        width: 120px;
    }

    .heritage-creator-avatar {
        width: 80px;
        height: 80px;
    }

    .heritage-cta-cards {
        flex-direction: column;
        align-items: center;
    }

    .heritage-cta-card {
        width: 100%;
        max-width: 320px;
    }

    .heritage-timeline-bar {
        margin: 2rem auto 4rem;
    }

    .heritage-timeline-preview {
        grid-template-columns: repeat(2, 1fr);
    }

    .heritage-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .heritage-footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .heritage-contribute-title {
        font-size: 1.5rem;
    }

    .heritage-contribute-subtitle {
        font-size: 1rem;
    }
}

/* Small Mobile: below 480px */
@media (max-width: 479px) {
    .heritage-hero-tagline {
        font-size: 2rem;
    }

    .heritage-hero-subtext {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .heritage-suggested-searches a {
        margin: 0.25rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.8125rem;
    }

    .heritage-explore-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .heritage-collection-card {
        width: 90vw;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.heritage-hidden {
    display: none !important;
}

.heritage-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
