/* ============================================
   OM BYPLANLÆGNING - Specifikke styles for om-byplanlaegning.html
   ============================================ */

/* Section titel til venstre */
.section-title {
    text-align: left;
}

/* Fjern margin-bottom fra main-body */
.main-body {
    margin-bottom: 0;
    max-width: 1200px;
}

/* Container section - 800px bredde på skærme over 800px */
@media (min-width: 800px) {
    .container.section {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1200px) {
    .container.section {
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }
    .main-body {
        max-width: 1200px;
    }
    /* Ensure hero section maintains 945px width */
    .main-body:has(.hero:not(:has(.hero-text))) {
        max-width: 945px;
    }
}

/* Wider width for screens larger than 1400px */
@media (min-width: 1401px) {
    .container.section {
        max-width: 1200px;
    }
    .main-body {
        max-width: 1350px;
    }
    /* Ensure hero section maintains 945px width even on larger screens */
    .main-body:has(.hero:not(:has(.hero-text))) {
        max-width: 945px;
    }
}


/* Hero section - egen CSS, samme størrelse som topic slideshows */
.hero {
    margin-top: 25px;
    margin-bottom: 2rem;
    width: 100%;
    min-width: 945px;
    max-width: 945px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 0;
    align-items: start;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

/* Sørg for at hero section kan være 945px bred uafhængigt af main-body begrænsninger */
.main-body:has(.hero:not(:has(.hero-text))) {
    padding-left: 0;
    padding-right: 0;
    max-width: 945px;
}

.hero-slideshow-wrapper {
    position: relative;
    min-width: 300px;
    max-width: 945px;
    width: 100%;
    aspect-ratio: 945 / 458;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    margin: 0 auto;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    padding: 2rem;
    z-index: 6;
}


.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.hero-slide {
    width: 100%;
    height: 100%;
    display: none;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slideshow-prev, .hero-slideshow-next {
    display: none; /* Fjernet navigation piler */
}

/* Introduktionstekst */
.intro-text {
    margin-bottom: 4rem;
    max-width: 800px;
}

.intro-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text);
}

.intro-text p:last-child {
    margin-bottom: 0;
}

/* Byplanlægning topics */
.byplanlaegning-topics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Topic rows - use CSS Grid on topic section to position elements */
.byplanlaegning-topic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: 5rem;
    row-gap: 0;
    border-top: 2px solid var(--line);
    padding-top: 2rem;
}

/* Topic content wrapper - contains both title and description */
.topic-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
}

/* Odd topics (index 0, 2, 4...): text left, slideshow right */
.topic-layout-odd .topic-content-wrapper {
    grid-column: 1;
    grid-row: 1;
}

.topic-layout-odd .topic-project-slideshow {
    grid-column: 2;
    grid-row: 1;
}

/* Even topics (index 1, 3, 5...): slideshow left, text right */
.topic-layout-even .topic-project-slideshow {
    grid-column: 1;
    grid-row: 1;
}

.topic-layout-even .topic-content-wrapper {
    grid-column: 2;
    grid-row: 1;
}

/* View project button - always directly under slideshow */
.topic-layout-odd .view-project-btn {
    grid-column: 2;
    grid-row: 2;
    margin-top: 10px;
}

.topic-layout-even .view-project-btn {
    grid-column: 1;
    grid-row: 2;
    margin-top: 10px;
}

.topic-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    margin: 0;
}

.topic-description p {
    margin: 0;
}

/* Topic project slideshow - samme bredde som hero slideshow */
.topic-project-slideshow {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.topic-slideshow-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 945 / 658;
    background-color: #f5f5f5;
    max-width: 100%;
}

.topic-slideshow-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.topic-slideshow-indicators.visible {
    opacity: 1;
    visibility: visible;
}

.topic-slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-slideshow-slide.active {
    opacity: 1;
    z-index: 1;
}

.topic-slideshow-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topic-slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 50%;
    line-height: 1;
}

.topic-slideshow-nav[style*="display: none"] {
    display: none !important;
}

.topic-slideshow-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.topic-slideshow-prev {
    left: 15px;
}

.topic-slideshow-next {
    right: 15px;
}

.topic-slideshow-expand {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.topic-project-slideshow:hover .topic-slideshow-expand {
    display: flex;
}

.topic-slideshow-expand:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Fullscreen overlay */
.topic-slideshow-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
}

.topic-slideshow-fullscreen-overlay.active {
    display: flex;
}

.topic-slideshow-fullscreen-container {
    position: relative;
    width: min(95vw, 95vh * 16 / 9);
    max-width: 95vw;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    gap: 1.5rem;
}

.topic-slideshow-fullscreen-wrapper {
    position: relative;
    width: 100%;
    height: min(95vh, 95vw * 9 / 16);
    max-height: calc(95vh - 100px); /* Leave space for indicators */
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-container {
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #f5f5f5;
    overflow: hidden;
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-slide.active {
    opacity: 1;
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicators {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    z-index: 10002;
    flex-wrap: nowrap;
    justify-content: flex-start;
    box-sizing: border-box;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicators::-webkit-scrollbar {
    height: 6px;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicators::-webkit-scrollbar-track {
    background: transparent;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicators::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicator-thumbnail {
    width: 80px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background-color: transparent;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicator-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicator-thumbnail.active {
    border-color: var(--accent);
    transform: scale(1.1);
}

.topic-slideshow-fullscreen-container .topic-slideshow-indicator-thumbnail:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-nav {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-minimize {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    border-radius: 4px;
}

.topic-slideshow-fullscreen-wrapper .topic-slideshow-minimize:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.topic-slideshow-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 0;
}

.topic-slideshow-indicator.active {
    background-color: var(--accent);
}

.topic-slideshow-indicator:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* View project button - mindre størrelse */
.view-project-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: var(--text);
    text-decoration: none;
    padding: 0;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.2s ease;
    margin-top: 0.5rem;
    border: none;
    background: none;
}

.view-project-btn::after {
    content: "→";
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.view-project-btn:hover {
    color: var(--accent);
}

.view-project-btn:hover::after {
    transform: translateX(4px);
}

@media (min-width: 1000px) and (max-width: 1200px) {
    .hero {
        min-width: 952PX;
    }
}
@media (min-width: 1200px) {
    .hero {
        min-width: 1152px;
    }

    .hero-slideshow-wrapper {
        max-width: 1200px;
    }
}

/* Mobile responsive */
@media (max-width: 799px) {
    .main-body {
        width: 100%;
    }

    .hero {
        margin-top: 10px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        column-gap: 0;
        row-gap: 0px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 1.75rem;
        padding: 1.5rem;
    }
    
    .hero-slideshow-wrapper {
        grid-row: 1;
        min-width: 0;
        width: 90%;
        margin-left: 5%;
        max-width: 100%;
        aspect-ratio: 16 / 9;
    }
    
    
    
    .intro-text {
        margin-bottom: 3rem;
    }
    
    .byplanlaegning-topics {
        gap: 3rem;
        margin-top: 2rem;
        margin-bottom: 3rem;
    }
    
    .topic-title {
        font-size: 1.5rem;
    }
    
    .topic-description {
        font-size: 1rem;
    }
    
    /* Topics stack vertically on mobile */
    .byplanlaegning-topic {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    /* On mobile, always show title first, then slideshow, then button */
    .topic-layout-odd .topic-content-wrapper,
    .topic-layout-even .topic-content-wrapper {
        grid-column: 1;
        grid-row: 1;
    }
    
    .topic-layout-odd .topic-project-slideshow,
    .topic-layout-even .topic-project-slideshow {
        grid-column: 1;
        grid-row: 2;
    }
    
    .topic-layout-odd .view-project-btn,
    .topic-layout-even .view-project-btn {
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .topic-project-slideshow {
        width: 100%;
        max-width: 100%;
    }
    
    .topic-slideshow-container {
        aspect-ratio: 16 / 9;
    }
    
    .topic-slideshow-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .topic-slideshow-prev {
        left: 10px;
    }
    
    .topic-slideshow-next {
        right: 10px;
    }
    
    .topic-slideshow-expand {
        display: flex !important;
    }
}

