/* 
==============================================
  IMAGE COMPONENT STYLES
==============================================
*/

/* Basisstijl voor alle afbeeldingsfiguren */
.image-container {
    margin: 2rem 0;
    width: 100%;
}

.image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* Standaard afronding voor alle afbeeldingen */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Standaard schaduw voor consistentie */
}

.image-container figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

.image-container figcaption.no-source::before {
    content: ""; /* Geen "Bron: " tekst als er geen bron is */
}

/* 1. Ingekaderde, responsive afbeelding */
.img-framed-responsive {
    border: 8px solid var(--background-light-gray);
    padding: 1rem;
    background-color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%; 
    box-sizing: border-box;
}

.img-framed-responsive img {
    border-radius: 0;
    box-shadow: none; /* Verwijder de standaard schaduw als er een frame is */
}

/* 2. Gesplitst scherm: afbeelding en tekst */
.img-split-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--background-light-gray);
    border-radius: var(--border-radius-large);
    border-left: 4px solid var(--primary-purple);
}

.img-split-screen .image-content {
    position: relative;
}

.img-split-screen .image-content img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-split-screen .image-content img.clickable {
    cursor: pointer;
}

.img-split-screen .image-content img.clickable:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.img-split-screen .image-content figcaption {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

.img-split-screen .text-content {
    padding-left: 1rem;
}

.img-split-screen .text-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.img-split-screen .text-content p:last-child {
    margin-bottom: 0;
}

/* Responsive voor split screen */
@media (max-width: 768px) {
    .img-split-screen {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .img-split-screen .text-content {
        padding-left: 0;
        order: 2;
    }
    
    .img-split-screen .image-content {
        order: 1;
    }
}

/* 3. Polaroid-stijl */
.img-polaroid {
    background-color: var(--white);
    border: 1px solid var(--border-color-light);
    padding: 1rem 1rem 3.5rem 1rem; /* Meer padding-bottom voor tekst */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: rotate(-3deg);
    transition: transform 0.2s ease-in-out;
    width: fit-content; /* Breedte aanpassen aan inhoud */
    max-width: 400px; /* Maximale breedte instellen */
    margin-left: 2rem; /* Een beetje ruimte geven */
    position: relative; /* Nodig voor absolute positionering van de figcaption */
}

.img-polaroid img {
    box-shadow: none; /* Verwijder de standaard schaduw voor de polaroid-afbeelding zelf */
}

.img-polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    z-index: 10;
}

.img-polaroid figcaption {
    position: absolute;
    bottom: 1rem; /* Plaats 1rem vanaf de onderkant */
    left: 1rem;
    right: 1rem;
    text-align: center;
    font-style: normal;
    color: var(--dark-gray);
    line-height: 1.4; /* Betere leesbaarheid voor meerdere regels */
}

/* 4. Afbeeldingen Grid */
.image-grid-container {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-grid-container.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.image-grid-container.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.image-grid-container .image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 220px; /* optioneel, voor een minimale hoogte */
    background-color: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius-large);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0 auto;
    display: block;
}

.image-grid-container .image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.image-grid-container .image-container img {
    max-height: 220px;
    max-width: 100%;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.image-caption {
    margin-top: auto;
    padding-top: 0.75rem;
    font-size: 0.9rem;
    color: #555;
    font-style: normal;
    text-align: center;
}

.caption-text {
    display: block;
    margin-bottom: 0.25rem;
}

.caption-source::before {
    content: "Bron: ";
    font-style: italic;
    color: #777;
}

.caption-source {
    display: block;
    font-size: 0.8rem;
    color: #777;
}

.caption-source a {
    color: var(--primary-purple);
    text-decoration: none;
}

.caption-source a:hover {
    text-decoration: underline;
}

/* Responsive media queries voor de grid */
@media (max-width: 768px) {
    .image-grid-container.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .image-grid-container.columns-2,
    .image-grid-container.columns-3 {
        grid-template-columns: 1fr;
    }
}

.img-polaroid {
    background: #fff;
    padding: 1rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
    transform: rotate(-2deg);
    transition: transform 0.2s ease-in-out;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.img-polaroid:hover {
    transform: rotate(2deg) scale(1.05);
}

.img-polaroid img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
}

.img-polaroid figcaption {
    text-align: center;
    font-family: 'Permanent Marker', cursive; /* Zorg ervoor dat dit lettertype is geladen */
    color: #333;
}

/* 
==============================================
  IMAGE POPUP/MODAL STYLES
==============================================
*/

.image-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-popup-content {
    position: relative;
    max-width: 98vw;
    max-height: 98vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 0.75rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.image-popup-overlay.active .image-popup-content {
    transform: scale(1);
}

.image-popup-content img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(98vh - 100px); /* Account for padding and caption - more space for image */
    object-fit: contain;
    border-radius: 4px;
}

.image-popup-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    line-height: 1.4;
}

.image-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 35px;
    height: 35px;
    background-color: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 1001;
}

.image-popup-close:hover {
    background-color: var(--secondary-purple);
    transform: scale(1.1);
}

/* Responsive aanpassingen voor popup */
@media (max-width: 768px) {
    .image-popup-content {
        max-width: 96vw;
        max-height: 96vh;
        padding: 0.5rem;
    }
    
    .image-popup-content img {
        max-height: calc(96vh - 80px);
    }
    
    .image-popup-close {
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
} 