/* Estilos específicos da página galeria.html (o design system está em ../site.css) */

/* ========================================
         HERO SECTION
      ======================================== */
.gallery-hero {
        position: relative;
        /* Altura flexível: cresce com o texto em vez de cortá-lo */
        min-height: 40vh;
        /* Espaço p/ navbar fixa (topo) e respiro até a seção seguinte */
        padding: 96px var(--space-md) var(--space-lg);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: linear-gradient(
          135deg,
          var(--color-primary) 0%,
          var(--color-primary-hover) 100%
        );
      }

.gallery-hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('../../img/area_comun/áreas comuns (29).jpg') center/cover;
        opacity: 0.25;
        z-index: 0;
      }

.gallery-hero-content {
        position: relative;
        z-index: 2;
        text-align: center;
        color: var(--color-text-light);
        padding: 0 var(--space-md);
        max-width: 800px;
      }

.gallery-hero h1 {
        color: var(--color-text-light);
        font-size: clamp(2.25rem, 1.6rem + 4vw, 4.5rem);
        margin-bottom: var(--space-md);
        text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
        animation: fadeInDown 1s ease-out;
      }

.gallery-hero .subtitle {
        font-size: clamp(1.1rem, 2vw, 1.3rem);
        color: var(--color-accent-soft);
        font-family: var(--font-sans);
        font-weight: 400;
        letter-spacing: 0.02em;
        animation: fadeInUp 1s ease-out 0.2s both;
      }

/* ========================================
         FILTROS DE CATEGORIA
      ======================================== */
.filter-section {
        background: linear-gradient(
          135deg,
          var(--color-accent-soft) 0%,
          rgba(232, 227, 213, 0.6) 100%
        );
        padding: var(--space-xl) 0;
        position: sticky;
        top: 70px;
        z-index: 100;
        box-shadow: 0 4px 16px rgba(28, 39, 28, 0.08);
      }

.filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-sm);
        justify-content: center;
        align-items: center;
      }

.filter-btn {
        background: #fff;
        color: var(--color-primary);
        padding: 12px 28px;
        border-radius: 50px;
        font-family: var(--font-sans);
        font-weight: 500;
        font-size: 15px;
        letter-spacing: 0.02em;
        border: 2px solid transparent;
        transition: var(--transition-fast);
        cursor: pointer;
        text-transform: capitalize;
      }

.filter-btn:hover {
        border-color: var(--color-accent-warm);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(28, 39, 28, 0.1);
      }

.filter-btn.active {
        background: linear-gradient(135deg, var(--color-accent-warm) 0%, var(--color-bronze) 100%);
        color: var(--color-primary);
        border-color: var(--color-accent-warm);
        box-shadow: 0 4px 16px rgba(201, 184, 150, 0.3);
      }

/* ========================================
         GALERIA GRID
      ======================================== */
.gallery-section {
        padding: var(--space-2xl) 0;
        background-color: var(--color-neutral-light);
      }

.gallery-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: var(--space-md);
        margin-top: var(--space-xl);
      }

/* Grid Masonry Effect */
.gallery-item {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(28, 39, 28, 0.08);
        transition: var(--transition-smooth);
        background: #fff;
      }

.gallery-item:hover {
        transform: translateY(-8px) scale(1.02);
        box-shadow: 0 16px 48px rgba(28, 39, 28, 0.15);
        z-index: 10;
      }

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

/* Tamanhos variados para efeito masonry */
.gallery-item.tall {
        grid-row: span 2;
      }

.gallery-item.wide {
        grid-column: span 2;
      }

/* Overlay de informação */
.gallery-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(
          to top,
          rgba(28, 39, 28, 0.95) 0%,
          rgba(28, 39, 28, 0.7) 50%,
          transparent 100%
        );
        padding: var(--space-lg) var(--space-md);
        transform: translateY(100%);
        transition: transform 0.3s ease;
      }

.gallery-overlay-title {
        color: var(--color-text-light);
        font-family: var(--font-serif);
        font-size: 1.25rem;
        font-weight: 600;
        margin: 0 0 4px 0;
      }

.gallery-overlay-category {
        color: var(--color-accent-soft);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin: 0;
      }

/* ========================================
         LIGHTBOX MODAL
      ======================================== */
.lightbox-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(28, 39, 28, 0.97);
        z-index: 9999;
        padding: var(--space-md);
        animation: fadeIn 0.3s ease;
      }

.lightbox-modal.active {
        display: flex;
        align-items: center;
        justify-content: center;
      }

.lightbox-content {
        position: relative;
        max-width: 90vw;
        max-height: 90vh;
        animation: zoomIn 0.3s ease;
      }

.lightbox-content img {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 8px;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
      }

.lightbox-close {
        position: absolute;
        top: -40px;
        right: 0;
        background: transparent;
        border: none;
        color: var(--color-text-light);
        font-size: 2rem;
        cursor: pointer;
        transition: var(--transition-fast);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

.lightbox-close:hover {
        color: var(--color-accent-warm);
        transform: rotate(90deg);
      }

.lightbox-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(28, 39, 28, 0.8);
        border: none;
        color: var(--color-text-light);
        font-size: 2rem;
        cursor: pointer;
        width: 60px;
        height: 60px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition-fast);
      }

.lightbox-nav:hover {
        background: var(--color-accent-warm);
        color: var(--color-primary);
      }

.lightbox-prev {
        left: -80px;
      }

.lightbox-next {
        right: -80px;
      }

.lightbox-info {
        position: absolute;
        bottom: -60px;
        left: 0;
        color: var(--color-text-light);
        text-align: center;
        width: 100%;
      }

.lightbox-info h3 {
        color: var(--color-text-light);
        font-size: 1.25rem;
        margin-bottom: 4px;
      }

.lightbox-info p {
        color: var(--color-accent-soft);
        font-size: 0.9rem;
        margin: 0;
      }

/* ========================================
         INSTAGRAM FEED
      ======================================== */
.instagram-section {
        background: var(--color-primary);
        color: var(--color-text-light);
        padding: var(--space-2xl) 0;
      }

.instagram-section h2,
      .instagram-section p {
        color: var(--color-text-light);
      }

.instagram-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--space-sm);
        margin-top: var(--space-xl);
      }

.instagram-item {
        position: relative;
        aspect-ratio: 1;
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        transition: var(--transition-fast);
      }

.instagram-item:hover {
        transform: scale(1.05);
      }

.instagram-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

.instagram-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(28, 39, 28, 0.7);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
      }

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

.instagram-icon {
        color: var(--color-text-light);
        font-size: 2rem;
      }

.btn-instagram {
        background: linear-gradient(135deg, var(--color-accent-warm) 0%, var(--color-bronze) 100%);
        color: var(--color-primary);
        padding: 16px 40px;
        border-radius: 12px;
        font-family: var(--font-sans);
        font-weight: 600;
        font-size: 16px;
        letter-spacing: 0.02em;
        border: none;
        box-shadow: 0 4px 16px rgba(201, 184, 150, 0.3);
        transition: var(--transition-smooth);
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: var(--space-sm);
        margin-top: var(--space-lg);
      }

.btn-instagram:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(201, 184, 150, 0.45);
        color: var(--color-primary);
      }

@keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
      }

@keyframes zoomIn {
        from {
          opacity: 0;
          transform: scale(0.9);
        }
        to {
          opacity: 1;
          transform: scale(1);
        }
      }

/* ========================================
         RESPONSIVIDADE
      ======================================== */
@media (max-width: 992px) {
        .gallery-grid {
          grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        }

        .gallery-item.wide {
          grid-column: span 1;
        }

        .lightbox-prev {
          left: 10px;
        }

        .lightbox-next {
          right: 10px;
        }
      }

@media (max-width: 768px) {
        :root {
          --space-xl: 48px;
          --space-2xl: 64px;
        }

        .gallery-hero {
          min-height: 240px;
          padding-top: 80px;
        }

        .filter-section {
          position: relative;
          top: 0;
        }

        .filter-buttons {
          justify-content: flex-start;
          overflow-x: auto;
          flex-wrap: nowrap;
          padding-bottom: var(--space-sm);
        }

        .filter-btn {
          white-space: nowrap;
        }

        .gallery-grid {
          grid-template-columns: 1fr;
          gap: var(--space-sm);
        }

        .gallery-item.tall {
          grid-row: span 1;
        }

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

/* Celulares */
@media (max-width: 576px) {
        :root {
          --space-xl: 32px;
          --space-2xl: 48px;
        }

        .filter-btn {
          padding: 8px 18px;
          font-size: 14px;
        }

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

        .lightbox-nav {
          width: 44px;
          height: 44px;
          font-size: 1.5rem;
        }
      }
