/* ==========================================
   FONT FAMILIES
   ========================================== */
.monsieur-la-doulaise-regular {
    font-family: "Monsieur La Doulaise", cursive;
    font-weight: 400;
    font-style: normal;
}

.crimson-text-regular {
    font-family: "Crimson Text", serif;
    font-weight: 400;
    font-style: normal;
}

.crimson-text-semibold {
    font-family: "Crimson Text", serif;
    font-weight: 600;
    font-style: normal;
}

.crimson-text-bold {
    font-family: "Crimson Text", serif;
    font-weight: 700;
    font-style: normal;
}

.dawning-of-a-new-day-regular {
    font-family: "Dawning of a New Day", cursive;
    font-weight: 400;
    font-style: normal;
}

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    --bgBoja: #F5F5F5;
    --green: #4E6555;
    --lighter-green: #5f816a;
    --header-footer: #EDEDED;
    --darkgrey: #101010;
    --black: #000000;
    --white: #FFFFFF;
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */
body {
    margin: 0;
    background-color: var(--bgBoja);
    text-align: center;
}

a {
    text-decoration: none;
    cursor: pointer;
}

/* ==========================================
   HEADER
   ========================================== */
header {
    background-color: var(--header-footer);
    width: 100%;
    top: 0;
    z-index: 999;
    position: sticky;
    padding: 30px 0 7px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
}

header a {
    text-decoration: none;
    color: var(--black);
    font-family: "Crimson Text", serif;
    font-size: 15px;
    padding: 0 15px;
    cursor: pointer;
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    margin: 0 auto;
    position: relative;
}

.hero img {
    width: 100%;
    height: auto;
    z-index: 0;
}

/* ==========================================
   PAPER BACKGROUNDS
   ========================================== */
.paper {
    background: url('../static_img/paper.png') no-repeat center;
    background-size: cover;
    width: 100%;
    margin-top: -70px;
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.paper-two {
    background: url('../static_img/paper-cropped.png') no-repeat center;
    background-size: cover;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    top: 0;
}

/* ==========================================
   NAMES AND DATES
   ========================================== */
.names {
    font-family: "Monsieur La Doulaise", cursive;
    font-size: 40px;
    font-weight: 400;
    text-align: center;
    margin-top: 3rem;
}

.names-two {
    font-family: "Monsieur La Doulaise", cursive;
    font-size: 43px;
    font-weight: 400;
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.date {
    font-size: 12px;
    margin: 15px 0 20px;
    color: var(--black);
}

/* ==========================================
   DECORATIVE FLOWERS
   ========================================== */
.flowers, .flowers-two, .flowers-three {
    position: relative;
    display: flex;
}

.flowers img, .flowers-two img, .flowers-three img {
    position: absolute;
    z-index: 3;
}

/* Main page flowers */
.flowers img {
    width: 45%;
}

.flower-left {
    left: 0;
    top: -4rem;
}

.flower-right {
    right: 0;
    top: 0.5rem;
}

/* Upload page flowers */
.leave-left {
    left: 0;
    top: -3rem;
    width: 25%;
}

.flower-left-two {
    left: -0.5rem;
    top: 7rem;
    width: 35%;
}

.leave-right {
    right: 0;
    top: -2.5rem;
    width: 20%;
}

.flower-right-two {
    right: -0.5rem;
    top: 6.5rem;
    width: 40%;
}

/* Gallery page flowers */
.bottom-left {
    left: 0;
    bottom: -3rem;
    width: 30%;
}

.bottom-right {
    right: 0;
    bottom: -3rem;
    width: 20%;
}

/* ==========================================
   WELCOME AND TEXT SECTIONS
   ========================================== */
.welcome-text, .upload-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: space-around;
    align-items: center;
    margin-top: 4rem;
}

.welcome {
    font-size: 36px;
    width: 60%;
    font-family: "Dawning of a New Day", cursive;
    margin-bottom: 15px;
}

.upload-text p {
    font-size: 38px;
    width: 65%;
    font-family: "Dawning of a New Day", cursive;
    margin-bottom: 40px;
    margin-top: 20px;
}

.subtext {
    font-size: 13px;
    font-family: "Crimson Text", serif;
    color: var(--darkgrey);
    width: 65%;
    margin: 15px 0 5px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.upload {
    background-color: #4a5c4e;
    color: white;
    padding: 10px 15px;
    font-size: 15px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin: 1rem 0;
    font-family: "Crimson Text", serif;
    z-index: 4;
}

.upload:hover {
    background-color: #3a4a3e;
    cursor: pointer;
}

.load-more-btn {
    background-color: #4a5c4e;
    color: white;
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid rgb(255, 255, 255); 
    border-radius: 30px;
    cursor: pointer;
    font-family: "Crimson Text", serif;
    transition: background-color 0.3s, color 0.3s;
  }

  .load-more-btn:hover {
    background-color: #3a4a3e;
    cursor: pointer;
  }

  .load-more-btn:active {
    background-color: #2d3a2f;
    color: #d6d6d6;
    transform: scale(0.97);
  }

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form {
    text-align: center;
    margin: 0 auto;
}

.input-name {
    background-color: var(--white);
    border: 2px solid var(--green);
    border-radius: 30px;
    padding: 5px 8px;
}

.input-file {
    color: var(--green);
    width: 200px;
}

/* ==========================================
   GALLERY
   ========================================== */
.gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-img {
    width: 170px;
    height: 230px;
    border-radius: 5px;
}

.gallery-naslov p {
    font-size: 36px;
    font-family: "Dawning of a New Day", cursive;
    margin: 25px auto 20px;
}

.pictures {
    width: 100%;
    height: 200px;
}

.thanks {
    margin-bottom: 20px;
    width: 100%;
}

.thanks p {
    text-align: center;
    width: 60%;
    margin: 0 auto;
}

/* ==========================================
   GALLERY GRID SYSTEM
   ========================================== */
/* ==========================================
   GALLERY GRID SYSTEM (RESPONSIVE FLEX VERSION)
   ========================================== */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  
  padding: 0 4px;
  margin: 30px auto;
  max-width: 1200px;
}

/* Each gallery-item behaves like a responsive column cell */
.gallery-item {
  flex: 1 1 calc(25% - 8px); /* 4 columns by default */
  max-width: calc(25% - 8px);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: var(--delay, 0s);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

/* Make media-container scale nicely */
.media-container {
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  background: #f8f8f8;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .gallery-item {
    flex: 1 1 calc(20% - 8px); /* 3 columns */
    max-width: calc(20% - 8px);
  }
}

@media (max-width: 800px) {
  .gallery-item {
    flex: 1 1 calc(50% - 8px); /* 2 columns */
    max-width: calc(50% - 8px);
  }
}




/* ==========================================
   MEDIA ITEMS
   ========================================== */


.media-item {
  width: 100%;
  height: 100%;
  object-fit: cover; /* crops images to fill the space */
  display: block;
  transition: all 0.3s ease;
}


.media-item:hover {
    filter: brightness(1.08) contrast(1.1) saturate(1.1);
}

.media-item:focus {
    outline: 3px solid #d4c5b0;
    outline-offset: 2px;
}

.media-container {
  aspect-ratio: 3 / 4; /* you can tweak: 1/1 for square, 4/3 for landscape */
  width: 100%;
  overflow: hidden;
  border-radius: 5px;
  background: #f8f8f8;
}

/* ==========================================
   VIDEO OVERLAY
   ========================================== */
.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-size: 28px;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.video-overlay::before {
    content: '▶';
    margin-left: 3px;
}

.media-container:hover .video-overlay {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.15);
    color: #6b5940;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* ==========================================
   PLACEHOLDER STYLES
   ========================================== */
.placeholder-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #faf9f7 0%, #f2f1ed 50%, #e8e6e0 100%);
    border: 1px solid #d4c5b0;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    font-size: 16px;
    margin: 10px;
    opacity: 0.8;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.placeholder-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(212, 197, 176, 0.1) 10px,
        rgba(212, 197, 176, 0.1) 20px
    );
}

.placeholder-image:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 115, 85, 0.15);
}

.placeholder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.placeholder-text {
    font-style: italic;
    text-align: center;
    color: #8b7355;
    font-size: 16px;
    line-height: 1.5;
    max-width: 400px;
}

/* ==========================================
   LOADING STATES
   ========================================== */
.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #8b7355;
    font-style: italic;
    font-size: 18px;
    background: linear-gradient(135deg, #faf9f7 0%, #f2f1ed 100%);
    border-radius: 8px;
    margin: 20px;
}

.loading-message::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #d4c5b0;
    border-top: 2px solid transparent;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

.load-more-container {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
}

.end-message {
    text-align: center;
    color: #8b7355;
    font-style: italic;
    font-size: 16px;
    padding: 20px;
    opacity: 0.8;
}

/* ==========================================
   LIGHTBOX
   ========================================== */
.lightbox {

    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin: auto; /* ✅ Ensures true centering */
}

.lightbox-close {
    z-index: 10001;
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-close:focus {
    outline: 3px solid #d4c5b0;
    outline-offset: 2px;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    font-size: 12px;
    padding: 15px 0;
    color: var(--darkgrey);
    font-family: "Crimson Text", serif;
    box-shadow: 0 -6px 8px rgba(0, 0, 0, 0.3);
}

.footer-img, .footer-img-two {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */
.pozadina {
    background-color: var(--bgBoja);
    transform: translateY(-100%) scale(0);
    width: 100%;
}

.pozadina.prikazan {
    transform: translateY(0) scale(1);
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Mobile - 340px and up */
@media (min-width: 340px) {
    .names-two {
        margin-bottom: 2.5rem;
    }
}

/* Mobile - 345px and up */
@media (min-width: 345px) {
    .welcome {
        margin: 30px 0 25px;
    }
    
    .flowers img {
        width: 43%;
    }
}

/* Mobile - 360px and up */
@media (min-width: 360px) {
    .flower-left {
        top: -5rem;
    }
    
    .flower-right {
        top: -1rem;
    }
    
    .subtext {
        width: 80%;
    }
    
    .upload {
        font-size: 16px;
        margin: 2rem 0;
    }
    
    .flower-left-two {
        left: 0;
        top: 8rem;
        width: 35%;
    }
    
    .flower-right-two {
        right: 0;
        top: 8rem;
        width: 40%;
    }
}

/* Mobile - 370px and up */
@media (min-width: 370px) {
    .names {
        font-size: 42px;
    }
    
    .welcome {
        margin-bottom: 20px;
    }
    
    .upload-btn {
        padding: 10px 20px;
        margin: 0 0 1rem;
    }
    
    .names-two {
        font-size: 47px;
        margin-bottom: 3rem;
    }
    
    .leave-left {
        top: -3.5rem;
    }
    
    .leave-right {
        top: -3rem;
    }
}

/* Mobile - 390px and up */
@media (min-width: 390px) {
    .names {
        font-size: 45px;
    }
    
    .welcome {
        margin: 40px 0 30px;
    }
    
    .names-two {
        font-size: 50px;
    }
    
    .upload-text p {
        margin-bottom: 60px;
    }
}

/* Mobile - 410px and up */
@media (min-width: 410px) {
    .names-two {
        margin-bottom: 3.5rem;
    }
    
    .welcome {
        margin: 50px 0 40px;
    }
}

/* Mobile - 425px and up */
@media (min-width: 425px) {
    .names {
        font-size: 47px;
        margin: 60px 0 50px;
    }
    
    .date {
        font-size: 14px;
    }
    
    .welcome {
        font-size: 40px;
    }
    
    .subtext {
        font-size: 16px;
    }
    
    .upload {
        font-size: 20px;
    }
    
    .names-two {
        font-size: 53px;
    }
    
    .leave-left {
        top: -4rem;
    }
    
    .leave-right {
        top: -3.5rem;
    }
}

/* Mobile - 480px and up */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0 6px;
    }
    
    .gallery-item:nth-child(5n+2) {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .gallery-item:nth-child(11n+4) {
        grid-column: span 1;
        grid-row: span 2;
    }
    
    .placeholder-image {
        height: 200px;
        font-size: 14px;
    }
}

/* Tablet - 768px and up */
@media (min-width: 768px) {
    .names {
        font-size: 55px;
    }
    
    .date {
        font-size: 18px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        padding: 0 10px;
    }
    
    .video-overlay {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* Desktop - 1024px and up */
@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        padding: 0 12px;
    }
}

/* Large Desktop - 1400px and up */
@media (min-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
        padding: 0 15px;
    }
}
