*{
    box-sizing: border-box;
  }
  
/* Masonry Grid Layout */
.portrait-grid {
    column-count: 3;
    column-gap: 1rem;
    column-fill: balance;
    padding: 0 2% 2rem;
    background-color: #262a2d;
}

.portrait-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.portrait-grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.portrait-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.portrait-grid-item:hover img {
    transform: scale(1.05);
}

/* Mobile - Single Column */
@media (max-width: 768px) {
    .portrait-grid {
      column-count: 1;
      padding: 2rem 3%;
    }
}

/* Tablet - 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
    .portrait-grid {
      column-count: 2;
    }
}

/* Desktop - 3 columns */
@media (min-width: 1025px) {
    .portrait-grid {
      column-count: 3;
    }

    .portrait-grid img {
        border-radius: 4px;
    }
}

/* Image Modal - ensure it appears above header */
.image-modal {
  z-index: 9999;
}


/*PORTRAIT CONTACT SECTION*/
.events-contact-section {
    width: 100%;
    height: 80vh;
    background: url("../images/events/events-contact.webp") center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 5em;
    color: white;
    position: relative;
}

.events-contact-content {
    position: absolute;
    top: 3.4em;
    right: 5em;
    max-width: 35em;
    text-align: center;
}

.events-contact-content h2 {
    font-size: 4em;
    font-weight: 400;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.797);
    margin-bottom: 20px;
    line-height: 1.1;
}

.events-contact-content p{
    font-size: 1.2em;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.3);
}

.events-contact-button {
    background-color: transparent;
    color: white;
    padding: 1em 4em;
    border: 1.5px solid white;
    border-radius: 0.5em;
    cursor: pointer;
    transition: background 0.3s ease;
}

.events-contact-button:hover {
    background-color: #ffffff;
    color: black;
}

/* Mobile optimizations for contact section */
@media (max-width: 1024px) {
    .events-contact-section {
        height: clamp(60vh, 80vh, 90vh);
        background-position: center 30%; /* Better focal point for mobile */
        padding: clamp(1em, 5vw, 3em);
        padding-left: clamp(1em, 5vw, 3em); /* Override desktop padding-left */
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    /* Add dark overlay for better text readability on mobile/tablet */
    .events-contact-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1;
    }

    .events-contact-content {
        position: relative;
        top: auto;
        right: auto;
        max-width: 90%;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        z-index: 2; /* Ensure content is above overlay */
        color: white;
    }

    .events-contact-content h2 {
        font-size: clamp(2em, 8vw, 3.5em);
        margin-bottom: clamp(1em, 4vw, 1.5em);
        color: white;
    }

    .events-contact-content p {
        font-size: clamp(1em, 4vw, 1.2em);
        line-height: 1.5;
        margin-bottom: clamp(1.5em, 6vw, 2em);
        color: white;
    }

    .events-contact-button {
        padding: clamp(0.8em, 4vw, 1em) clamp(2em, 8vw, 4em);
        font-size: clamp(0.9em, 3.5vw, 1em);
        background-color: white;
        color: black;
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .events-contact-section {
        height: clamp(50vh, 70vh, 80vh);
        background-position: center 25%; /* Even better focal point for small screens */
    }

    .events-contact-content {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .events-contact-section {
        height: clamp(45vh, 60vh, 70vh);
        background-position: center 20%; /* Optimal focal point for very small screens */
        padding: clamp(0.5em, 3vw, 1.5em);
    }

    .events-contact-content h2 {
        font-size: clamp(1.8em, 7vw, 2.5em);
        line-height: 1.2;
    }

    .events-contact-content p {
        font-size: clamp(0.9em, 3.5vw, 1.1em);
    }
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5em;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: background-color 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2em;
    padding: 15px 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* Mobile optimizations for modal */
@media (max-width: 768px) {
    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 1.3em;
        padding: 10px;
    }

    .modal-nav {
        font-size: 1.1em;
        padding: 12px 10px;
    }

    .modal-prev {
        left: 15px;
    }

    .modal-next {
        right: 15px;
    }

    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
}