.gallery-section {
    padding: 0rem 0%;
    background: var(--dark);
}

.section-header {
    text-align: center;
    margin-bottom: 0rem;
}

.section-header h2 {
    font-size: 2.8rem;
    margin-bottom: 0rem;
    color: var(--white);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--accent);
}

.section-header p {
    color: var(--light-gray);
    max-width: 600px;
    margin: 1.5rem auto 0;
    font-weight: 300;
    letter-spacing: 0.3px;
}
.floating-middlebar {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: -30px 0 30px 0;
    z-index: 20;
}

.middlebar-container {
    background: rgba(255, 255, 255, 0.98);
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    max-width: 1200px;   
    
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
}

.gallery-section {
    padding: 4rem 5% 8rem;
    background: var(--dark);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--white);
}

.section-header p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}
.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem;
    background: #ffffff;
    border-radius: 5rem;
    width: 100%;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 1rem 1rem;
    border-radius: 3px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}


.filter-btn i {
    font-size: 1.2rem;
}

.filter-btn .label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: #000000;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.filter-btn.active .label {
    max-width: 200px;
    opacity: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 1000px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 5px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    filter: grayscale(30%);
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.gallery-overlay {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(30, 30, 30, 0.7), transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h3 {
    color: var(--cream);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: var(--transition);
    transition-delay: 0.1s;
}

.gallery-overlay p {
    color: var(--light-accent);
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: var(--transition);
    transition-delay: 0.2s;
}

.gallery-item:hover .gallery-overlay h3,
.gallery-item:hover .gallery-overlay p {
    transform: translateY(0);
}
.dynamic-title {
    text-align: center;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.dynamic-title.active {
    opacity: 1;
    transform: translateY(0);
}

.dynamic-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    position: relative;
    display: inline-block;
}

.dynamic-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: var(--accent);
}

.dynamic-title p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.modal {
  position: fixed;
  padding-top: 40px;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-card {
    position: relative;
    width: min(420px, 92%);
    max-height: 85vh;

    background: rgba(20, 20, 20, 0.85); /* 🔥 semi glass */
    backdrop-filter: blur(10px);

    border-radius: 18px;
    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow:
        0 25px 80px rgba(0,0,0,.8),
        0 0 0 1px rgba(255,255,255,0.05);

    z-index: 2;
}

/* BODY */
.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-image {
    width: 100%;
    aspect-ratio: 3/4;
    background: #000;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* INFO */
.modal-info {
    padding: 1rem 1.2rem;
}

/* TITLE */
.modal-info h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* DESC */
.modal-info p {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.5;
}

/* CLOSE BUTTON */
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    background: rgba(255,255,255,0.1);
    border: none;
    color: white;

    width: 38px;
    height: 38px;
    border-radius: 50%;

    font-size: 20px;
    cursor: pointer;
    z-index: 3;

    transition: 0.3s;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.6);

  /* 🔥 BLUR UTAMA */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(
    circle at center,
    transparent 40%,
    rgba(0,0,0,0.5) 100%
  );
}

.modal-card {
    animation: modalFade 0.25s ease;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (min-width: 1025px) {

  .modal-card {
    width: min(900px, 90%);
    max-height: 85vh;

    display: grid;
    grid-template-columns: 1.2fr 1fr; 
  }

  .modal-body {
    display: contents; 
  }

  .modal-image {
    height: 100%;
    aspect-ratio: unset; 
  }

  .modal-image img {
    height: 100%;
    object-fit: cover;
  }

  /* 🔥 INFO (UPGRADE TYPOGRAPHY) */
  .modal-info {
    padding: 2.2rem;
    overflow-y: auto;
  }

  .modal-info h3 {
    font-size: 2.2rem;   /* 🔥 BESAR */
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }

  .modal-info p {
    font-size: 1.1rem;   /* 🔥 LEBIH NYAMAN DIBACA */
    line-height: 1.8;
    color: var(--light-gray);
  }

}

@media (max-width: 1024px) {

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .section-header h2 {
    font-size: 2.3rem;
  }

  .middlebar-container {
    max-width: 90%;
  }

.modal-body {
    display: flex;
    flex-direction: column;

    overflow-y: auto; /* 🔥 INI KUNCINYA */
  }

  .modal-image {
    aspect-ratio: 3/4;
    flex-shrink: 0; /* biar gambar gak gepeng */
  }

  .modal-info {
    padding: 1rem;
    overflow-y: auto; /* jaga2 kalau teks panjang */
  }

  .modal-info h3 {
    font-size: 1.2rem;
  }

  .modal-info p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
}

@media (max-width: 768px) {

  .gallery-section {
    padding: 3rem 5% 6rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .filter-btn {
    padding: 0.8rem 0.9rem;
    font-size: 0.9rem;
  }

  .dynamic-title h2 {
    font-size: 2rem;
  }

  .floating-middlebar {
    margin: -20px 0 20px 0;
  }

  .middlebar-container {
    max-width: 95%;
    border-radius: 16px;

    flex-wrap: nowrap; 
    overflow-x: auto;  
    justify-content: flex-start;
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .gallery-filter {
    flex-wrap: nowrap;        
    overflow-x: auto;         
    justify-content: flex-start;
    width: max-content;      
  }

  .gallery-filter::-webkit-scrollbar {
    display: none;
  }

 .modal {
    padding: 20px; /* biar gak mentok layar */
  }

  .modal-card {
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    border-radius: 14px;
  }

  .modal-image {
    aspect-ratio: 3/4; 
  }

  .modal-info {
    padding: 0.9rem 1rem;
  }

  .modal-info h3 {
    font-size: 1.1rem;
  }

  .modal-info p {
    font-size: 0.8rem;
  }

  .modal-close {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {

  .gallery-section {
    padding: 2.5rem 5% 5rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-header h2 {
    font-size: 1.7rem;
  }

  .section-header p {
    font-size: 0.9rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .filter-btn {
    padding: 0.7rem 0.8rem;
    font-size: 0.8rem;
  }

  .filter-btn i {
    font-size: 1rem;
  }

  .gallery-overlay {
    padding: 1rem;
  }

  .gallery-overlay h3 {
    font-size: 0.9rem;
  }

  .gallery-overlay p {
    font-size: 0.75rem;
  }

  .dynamic-title h2 {
    font-size: 1.6rem;
  }

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

  .middlebar-container {
    max-width: 96%;
    padding: 0.4rem;
    gap: 0.4rem;

    overflow-x: auto;
    scrollbar-width: none; 
  }

  .middlebar-container::-webkit-scrollbar {
    display: none; 
  }

  .modal {
    padding: 16px;
  }

  .modal-card {
    max-width: 320px;
    border-radius: 12px;
  }

  .modal-image {
    aspect-ratio: 3/4; 
  }

  .modal-info {
    padding: 0.8rem;
  }

  .modal-info h3 {
    font-size: 1rem;
  }

  .modal-info p {
    font-size: 0.75rem;
  }

  .modal-close {
    top: 8px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

}