/* ==========================================================================
   WRITE TYPE — Gallery Specimen Stylesheet
   ========================================================================== */

/* --- Font ARS Maquette Fallback --- */
.font-maquette {
  font-family: 'ARS Maquette', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Gallery Page Layout & Container --- */
.gallery-page-container {
  max-width: 1200px;
  margin: 90px auto 4rem auto;
  padding: 0 2rem;
  z-index: 10;
  position: relative;
}

.gallery-intro {
  margin-bottom: 3rem;
  text-align: left;
}

.gallery-intro h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.gallery-intro p {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-gray);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Control Bar (.gallery-controls) --- */
.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1.2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 0.6rem 0;
  position: relative;
  transition: color 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-theme);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn:hover {
  color: var(--text-light);
}

.filter-btn.active {
  color: var(--gold-theme);
}

.filter-btn.active::after {
  transform: scaleX(1);
}

.view-group {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.view-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--text-gray);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.view-btn:hover {
  color: var(--text-light);
}

.view-btn.active {
  background: var(--gold-theme);
  color: var(--bg-primary);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

/* --- Container Matrix Layouts --- */
#gallery-matrix {
  transition: opacity 0.3s ease;
}

#gallery-matrix.filtering {
  opacity: 0;
}

/* --- View 1: Grid Layout (.gallery-grid-layout) --- */
.gallery-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.gallery-grid-layout .gallery-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: var(--bg-tertiary);
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.gallery-grid-layout .gallery-card-img-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-grid-layout .gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-grid-layout .gallery-card-info-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1rem 1rem 1rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 70%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gallery-grid-layout .gallery-card-category {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-theme);
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.gallery-grid-layout .gallery-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-light);
}

/* Grid card Hover effects */
.gallery-grid-layout .gallery-card:hover {
  border-color: var(--gold-theme);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.18);
  transform: translateY(-4px);
}

.gallery-grid-layout .gallery-card:hover .gallery-card-img {
  transform: scale(1.08);
}

.gallery-grid-layout .gallery-card:hover .gallery-card-info-wrapper {
  opacity: 1;
  transform: translateY(0);
}

/* --- View 2: List Layout (.gallery-list-layout) --- */
.gallery-list-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.gallery-list-layout .gallery-card {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  cursor: pointer;
}

.gallery-list-layout .gallery-card:nth-child(even) {
  flex-direction: row-reverse;
}

.gallery-list-layout .gallery-card-img-wrapper {
  width: 40%;
  min-height: 250px;
  max-height: 320px;
  overflow: hidden;
}

.gallery-list-layout .gallery-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-list-layout .gallery-card-info-wrapper {
  width: 60%;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.gallery-list-layout .gallery-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-dim);
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}

.gallery-list-layout .gallery-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--gold-theme);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
}

.gallery-list-layout .gallery-card-desc {
  font-size: 0.92rem;
  font-weight: 300;
  color: var(--text-gray);
  line-height: 1.6;
}

/* List card Hover effects */
.gallery-list-layout .gallery-card:hover {
  border-color: var(--gold-theme);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.08);
  transform: translateY(-2px);
}

.gallery-list-layout .gallery-card:hover .gallery-card-img {
  transform: scale(1.04);
}

/* Stagger animation delay on loading cards */
.gallery-card:nth-child(1) { animation-delay: 0.05s; }
.gallery-card:nth-child(2) { animation-delay: 0.1s; }
.gallery-card:nth-child(3) { animation-delay: 0.15s; }
.gallery-card:nth-child(4) { animation-delay: 0.2s; }
.gallery-card:nth-child(5) { animation-delay: 0.25s; }
.gallery-card:nth-child(6) { animation-delay: 0.3s; }
.gallery-card:nth-child(7) { animation-delay: 0.35s; }
.gallery-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Native Lightbox Overlay --- */
#gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#gallery-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem;
  border-radius: 4px;
}

.lightbox-close-btn svg {
  width: 20px;
  height: 20px;
}

.lightbox-close-btn:hover {
  color: var(--gold-bright);
  transform: scale(1.05);
}

.lightbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 90%;
  max-height: 85%;
}

.lightbox-img-wrapper {
  max-width: 100%;
  max-height: 60vh;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  background: #000;
  transform: scale(0.95);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#gallery-lightbox.active .lightbox-img-wrapper {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  margin-top: 1.8rem;
  text-align: center;
  max-width: 600px;
  padding: 0 1rem;
}

.lightbox-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-theme);
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.lightbox-title {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.lightbox-desc {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-gray);
  line-height: 1.5;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .gallery-list-layout .gallery-card-info-wrapper {
    padding: 2rem 1.5rem;
  }
  .gallery-list-layout .gallery-card-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-page-container {
    margin-top: 75px;
    padding: 0 1.5rem;
  }
  .gallery-intro h1 {
    font-size: 2.2rem;
  }
  .gallery-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .filter-group {
    gap: 1.25rem;
  }
  .gallery-list-layout .gallery-card, 
  .gallery-list-layout .gallery-card:nth-child(even) {
    flex-direction: column;
  }
  .gallery-list-layout .gallery-card-img-wrapper,
  .gallery-list-layout .gallery-card-info-wrapper {
    width: 100%;
  }
  .gallery-list-layout .gallery-card-info-wrapper {
    padding: 1.5rem;
  }
  .lightbox-title {
    font-size: 1.5rem;
  }
  .lightbox-close-btn {
    top: 1rem;
    right: 1rem;
  }
}

/* --- Global Footer Actions --- */
.global-footer-actions {
  background: #000000;
  padding: 6rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-actions-wrapper {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer-action-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: #ffffff;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.footer-action-title span {
  color: #d4af37;
}

.footer-action-btn-group {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 2.2rem;
  background: #080808;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #ffffff;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  text-transform: uppercase;
}

.footer-action-btn:hover {
  background: #d4af37;
  color: #000000;
  border-color: #d4af37;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.35);
}

.footer-action-btn svg {
  transition: transform 0.3s;
}

.footer-action-btn:hover svg {
  transform: translateX(3px);
}

.footer-credits {
  margin-top: 5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ==========================================================================
   CSS-BASED MINI DOCUMENT PREVIEW MOCKUP
   ========================================================================== */
.document-preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1c1c1c 0%, #0d0d0d 100%) !important;
  overflow: hidden;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.document-preview-frame::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 110px;
  background: #fdfbf7;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transform: rotate(-4deg) translateY(6px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s, border-color 0.4s;
  background-image: 
    linear-gradient(to right, #d4af37 0%, #d4af37 100%),
    linear-gradient(to right, #e4dec8 0%, #e4dec8 100%),
    linear-gradient(to right, #e4dec8 0%, #e4dec8 100%),
    linear-gradient(to right, #e4dec8 0%, #e4dec8 100%);
  background-size: 
    40px 6px,
    60px 3px,
    50px 3px,
    35px 3px;
  background-position: 
    10px 15px,
    10px 30px,
    10px 40px,
    10px 50px;
  background-repeat: no-repeat;
}

.document-card:hover .document-preview-frame::before {
  transform: rotate(0deg) scale(1.08) translateY(-2px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
  border-color: #d4af37;
}

.doc-placeholder-icon {
  position: relative;
  z-index: 2;
  width: 30px !important;
  height: 30px !important;
  margin-top: 35px; /* Spinge l'icona in basso per farla sembrare un sigillo */
  color: #d4af37 !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  opacity: 0.95;
}

.document-card:hover .doc-placeholder-icon {
  transform: scale(1.1) translateY(-2px);
  filter: drop-shadow(0 8px 16px rgba(212, 175, 55, 0.35));
}

