/* Glavni sadržaj stranice */
.page-content {
  /* Koristimo flexbox za raspored sadržaja */
  display: flex;
  overflow-x: auto; /* Omogućuje horizontalno skrolanje */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* Bolje skrolanje na iOS-u */
  /* Sakrivanje skrolbara za čistiji izgled, ali ostavljanje funkcionalnosti */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  min-height: 100vh;
}

.page-content::-webkit-scrollbar {
  display: none; /* Webkit (Chrome, Safari) */
}

.content-wrapper {
  display: flex;
    /* 🔥 NEW: Vertically center content */
    align-items: center; 
    /* 🔥 NEW: Define the centering area */
    min-height: 600px;
    height: 100vh; 
    padding-left: clamp(40px, 5vw, 80px);
}

/* Tekstualna kolona */
.text-column {
  flex-shrink: 0; /* Sprječava da se smanjuje kad nema mjesta */
  width: clamp(400px, 35vw, 812px);
  min-height: 100vh; /* Osigurava da zauzima cijelu visinu vidljivog dijela ekrana */
  padding-top: clamp(80px, 15vh, 200px); /* Daje prostor ispod navbara */
  padding-right: 100px; /* Razmak između teksta i slika */
  line-height: 1.4; /* Poboljšava čitljivost teksta */
}

.section-title {
  color: inherit;
  font-size: clamp(16px, 2.5vw, 30px);
  margin-bottom: clamp(10px, 3vw, 20px);
  line-height: 1.2;
  font-weight: normal;
  white-space: normal; /* CHANGE from nowrap */
  overflow: hidden;    /* Ensure it respects boundaries */
}

.godina {
    font-size: clamp(12px, 1.5vw, 22px);
    margin-bottom: clamp(20px, 3vw, 40px);
    margin-top: clamp(10px, 3vw, 20px);
}

.text-content p {
    font-family: Montserrat;
    font-size: clamp(12px, 1.1vw, 16px);
    margin-bottom: 1em;
    text-transform: none;
}
.tehnika{
    margin-top: 36px;
    margin-bottom: 0px;
}


/* Galerija slika */
.image-gallery {
  display: flex;
  align-items: center; /* Slike su centrirane po visini */
  gap: 40px; /* Razmak između slika */
  padding-top: clamp(40px, 8vh, 100px);
  padding-right: 80px; /* Desna margina na kraju galerije */
  /* padding-left: 380px; */
}

#image-modal {
height: 100vh;
width: 100vw;
background: rgba(5,5,5,0.92);
z-index: 9999;
position: fixed;
top: 0;
left: 0;
/* 🔥 CRITICAL CHANGE: Set to none by default */
display: none; 
/* The display: flex; for layout is applied by JavaScript when clicking a photo */
flex-direction: column; 
align-items: center;
justify-content: flex-start;
overflow: hidden;
padding-top: clamp(70px, 8vw, 100px);
}

#image-modal > img {
 margin: auto;
 height: auto; /* Allow height to adjust */
 max-height: calc(100% - 100px); /* Max height relative to space below header */
 object-fit: contain; /* Keep image ratio */
}

/* The Close Button */
.close {
  color: #aaaaaa;
  position: absolute;
  font-size: 28px;
  font-weight: bold;
  right: 10px;
  top: 10px;
}

.close:hover,
.close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

#next-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  color: transparent; /* Hide the text, use transparent color */
  background: none; /* No background */
  border: none; /* No border/outline */
  padding: 10px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  z-index: 10000; /* Ensure arrows are above other content if modal has lower z-index */
}

#next-btn::before {
  content: "→"; /* Real right arrow character */
  font-size: 32px; /* Slightly larger for better visibility */
  line-height: 1;
  color: white; /* White arrow */
}

#next-btn:hover::before {
  color: #cccccc; /* Slightly gray on hover for subtle feedback */
}

#prev-btn {
  position: absolute;
  left: 10px;
  top: 50%;
  color: transparent; /* Hide the text, use transparent color */
  background: none; /* No background */
  border: none; /* No border/outline */
  padding: 10px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  z-index: 10000; /* Ensure arrows are above other content if modal has lower z-index */
}

#prev-btn::before {
  content: "←"; /* Real left arrow character */
  font-size: 32px; /* Slightly larger for better visibility */
  line-height: 1;
  color: white; /* White arrow */
}

#prev-btn:hover::before {
  color: #cccccc; /* Slightly gray on hover for subtle feedback */
}
.gallery-image {
  height: clamp(500px, 70vh, 80vh);
  object-fit: cover; /* Osigurava da slike pokrivaju prostor bez deformacija */
  flex-shrink: 0; /* Sprječava da se slike smanjuju */
}

/* =======================================
   MODAL NAVIGATION BAR (OVERLAY HEADER)
   Based on Regular Navbar Spacing
   ======================================= */

/* Hide the old 'x' close button */
#image-modal .close {
  display: none;
}

#modal-nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10001;
  /* Re-use the fluid padding from .navbar */
  padding-top: clamp(20px, 3vw, 30px); 
  box-sizing: border-box;
}

.modal-div-bar {
  /* No need for extra padding here, as the parent .div-bar class already manages left/right padding */
  padding-left: 0;
  padding-right: 0;
}

.modal-nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 20px;
  /* Use the existing fluid left/right padding from .div-bar and .navbar */
  padding: 0 clamp(40px, 5vw, 80px); 
}

/* Base style for all links/text in the modal nav */
#modal-nav a,
#modal-nav span {
  font-family: "Aboreto", cursive;
  /* Re-use the fluid font size from .nav-links a */
  font-size: clamp(12px, 1.2vw, 20px);
  /* Re-use the fluid letter spacing from .nav-links a */
  letter-spacing: clamp(0.5px, 0.1vw, 1px);
  color: white; /* White text on dark modal background */
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Center element: Project Title */
.modal-project-title {
  text-align: center;
  flex-grow: 1; 
  margin: 0 40px; /* Increased margin for better separation */
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500; /* Optional: Make the title stand out a bit */
}

/* Right element: Close button (Nazad) */
#modal-close-btn {
  cursor: pointer;
  text-align: right;
  flex-shrink: 0;
}

#modal-close-btn:hover {
  color: #aaaaaa;
}

#image-modal > img {
 margin: auto;
 height: auto; /* Allow height to adjust */
 max-height: calc(100% - clamp(60px, 12vh, 100px));
 object-fit: contain; /* Keep image ratio */
}

.text-content {
    /* Ensures all lines of text within this div are stretched to fill the full width */
    text-align: justify; 
    
    /* Improves justification by allowing words to break across lines */
    hyphens: auto; 
    
    /* Sets the language for correct hyphenation rules (assuming Serbian/Croatian) */
    -webkit-hyphens: auto; 
    -moz-hyphens: auto;
    /* You may need to specify lang="sr" or similar on the <html> tag for browser compatibility */
}

@media screen and (max-height: 1100px) {
    
    .text-column {
        /*
         * Corrected clamp order: min(400px), preferred(60vw), max(450px) is wrong.
         * Using: min(400px), preferred(50vw), max(812px) for wider text on short screens.
         */
        width: clamp(400px, 50vw, 500px); 
        
        /* 🔥 REMOVED: Font-size here doesn't apply to specific elements. */
        /* font-size: clamp(14px, 2vw, 36px); */
        
        /* Reduced padding right for a slightly tighter fit */
        padding-right: 50px; 
    }

    /* 1. Reduce the main title font size */
    .section-title {
        /* 🔥 NEW: Use vh units (3vh) for vertical scaling, min 14px, max 30px (desktop max) */
        font-size: clamp(14px, 3vh, 30px); 
        /* 🔥 NEW: Use vh for vertical margin */
        margin-bottom: clamp(10px, 1.5vh, 20px);
    }

    /* 2. Reduce the year font size */
    .godina {
        /* 🔥 NEW: Use vh units (1.8vh) for vertical scaling, min 10px, max 22px (desktop max) */
        font-size: clamp(10px, 1.8vh, 22px); 
        /* 🔥 NEW: Use vh for vertical margin */
        margin-bottom: clamp(10px, 2.5vh, 40px);
    }
    
    /* 3. Reduce the paragraph font size */
    .text-content p {
        /* 🔥 NEW: Use vh units (1.5vh) for vertical scaling, min 10px, max 16px (desktop max) */
        font-size: clamp(10px, 1.5vh, 16px); 
        margin-bottom: 0.8em; /* Tighter line spacing */
    }

    /* 4. Reduce the top margin for 'Tehnika' */
    .tehnika {
        /* 🔥 NEW: Use vh for vertical margin */
        margin-top: clamp(15px, 2vh, 36px); 
    }
}

/* =======================================
   RESPONSIVE ADJUSTMENTS FOR MODAL NAV
   (Matching your @media (max-width: 767px) styles)
   ======================================= */
@media screen and (max-width: 767px) {
  #modal-nav {
    /* Match mobile navbar padding */
    padding-top: 15px; 
  }
  
  .modal-nav-links {
    /* Match mobile .div-bar padding */
    padding: 0 10px;
  }

  /* Make sure links are smaller on mobile */
  #modal-nav a,
  #modal-nav span {
    /* Match mobile .nav-links a font-size */
    font-size: 11px;
    letter-spacing: 0.2px;
  }
  
  .modal-project-title {
    /* Reduce margin on mobile */
    margin: 0 15px;
  }

  
}

/* Responsive adjustments for mobile */
@media (max-width: 640px) {
    .slideshow-overlay .hit {
        font-size: 32px;
        width: 40px;
    }
    .slideshow-overlay .hit.left { padding-left: 10px; }
    .slideshow-overlay .hit.right { padding-right: 10px; }
    
    .div-bar2 {
        padding-left: 10px; 
        padding-right: 10px;
    }
}

/* Ensure the arrows scale down on mobile */
@media (max-width: 640px) {
    .slideshow-overlay .hit {
        font-size: 32px;
        width: 40px;
    }
    .slideshow-overlay .hit.left { padding-left: 10px; }
    .slideshow-overlay .hit.right { padding-right: 10px; }
    
    .div-bar2 {
        padding-left: 10px; /* Match mobile content/nav */
        padding-right: 10px;
    }
}

@media screen and (max-width: 767px) {
   
  .navbar {
        position: static !important;
        /* Set top padding to zero, as the .text-column handles the gap */
       
    }
    /* =======================================
       2. PAGE CONTENT STACKING & ALIGNMENT
       ======================================= */
    
    html, body {
        overflow-x: hidden; /* Prevent any horizontal scrolling */
        overflow-y: auto;   /* Enable standard vertical scrolling */
    }
    
    .page-content {
        /* Revert from horizontal flexbox to a standard vertical block flow */
        display: block; 
        overflow-x: hidden; 
        overflow-y: auto;
        padding-left: 0; /* Remove base padding; use content-wrapper padding */
        
        /* 🔥 REMOVE SCROLLBAR HIDING: Allow standard mobile scrollbars */
        scrollbar-width: auto; 
        -ms-overflow-style: auto;
    }
    .page-content::-webkit-scrollbar {
        display: block; 
    }
    
    .content-wrapper {
        /* Vertical stacking with alignment */
        display: block; 
        /* 🔥 ALIGNMENT: 10px matches navbar padding left/right */
        padding-left: 10px; 
        padding-right: 10px; 
        
    }

    /* Text Column forced to take full width and stack */
    .text-column {
        width: 100%; /* Take full width of the wrapper */
        flex-shrink: 1; /* Allow it to shrink */
        min-height: auto; /* Allow height to be auto */
        
        /* 🔥 TOP PADDING: 80px space from navbar */
        padding-top: 80px; 
        padding-right: 0; /* Remove internal right padding */
        padding-left: 0;
        margin-bottom: 20px; /* Space before the gallery starts */
    }
    .section-title {
      margin-top: 0px;
    }
    
    /* =======================================
       3. TEXT SIZING (Title 16px, Paragraphs 12px)
       ======================================= */
    
    /* Title (H2) */
    .section-title {
        font-size: 16px; /* 🔥 Title: 16px */
        margin-bottom: 15px;
        white-space: normal; /* Must wrap on mobile */
        line-height: 1.2;
    }
    
    /* Year */
    .godina {
        font-size: 12px; /* 🔥 Year: 12px */
        margin-bottom: 15px;
    }

    /* Paragraph Text */
    .text-content p {
        font-size: 12px; /* 🔥 Paragraphs: 12px */
        margin-bottom: 1em;
        line-height: 1.5; /* Improved mobile readability */
    }

    /* =======================================
       4. IMAGE GALLERY STACKING
       ======================================= */
    
    .image-gallery {
        /* Force vertical stacking */
        display: flex; 
        flex-direction: column;
        align-items: center; /* Center images */
        gap: 30px;
        padding-top: 80px; /* No padding needed after text column */
        padding-right: 0; /* No right padding needed */
        padding-bottom: 40px; /* Space at the bottom of the page */
    }

    .gallery-image {
        /* Images take full width (minus content-wrapper padding) */
        width: 100%; 
        height: auto; 
        object-fit: contain; /* Ensure the whole image is visible */
        max-height: 55vh; /* Optional: cap image height for tall screens */
    }

  .text-content .tehnika {
    /* Set the bottom margin of the 'Tehnika' line to 0 */
    margin-bottom: 0; 
    /* We keep the default top margin, but ensure no space is added below */
  }
  .text-content .tehnika + p {
    /* Set the top margin of the 'Dimenzije' line to 0 for a complete abutment */
    margin-top: 0; 
  }

  /* Adjust modal header spacing on mobile */
    #image-modal {
        /* Reduce overall top padding to be tight against the header */
        padding-top: 50px; 
    }

    #image-modal > img {
       /* 1. Ensure it respects 10px on L/R */
    width: calc(100% - 20px);
    /* 2. Re-enable auto margin for centering */
    margin: auto; 
    /* 3. Height is full modal height (100vh) - top padding (70px) - bottom margin (10px) */
    max-height: calc(100vh - 60px); /* 70px (top) + 10px (bottom) = 80px */
    height: auto; 
    object-fit: contain;
    }

    /* Optional: Hide arrows if they interfere with touch/swipe experience */
    #next-btn,
    #prev-btn {
        display: block !important; /* Forces them to display */
    top: 50%;
    transform: translateY(-50%);
    }

    .text-content {
    /* Ensures all lines of text within this div are stretched to fill the full width */
    text-align: justify; 
    
    /* Improves justification by allowing words to break across lines */
    hyphens: auto; 
    
    /* Sets the language for correct hyphenation rules (assuming Serbian/Croatian) */
    -webkit-hyphens: auto; 
    -moz-hyphens: auto;
    /* You may need to specify lang="sr" or similar on the <html> tag for browser compatibility */
}
}