/* =============================================
   guide-gallery.css — Guide + Gallery Sections
   Riparazioni Ricci — Component Library

   Dependencies: _tokens.css, _base.css
   Provides: .guide-*, .gallery-*, .btn-secondary,
             .section-cta and all responsive breakpoints
   ============================================= */


/* ══════════════════════════════════════════
   SECTION 1: GUIDE — "Risorse e Guide"
   ══════════════════════════════════════════ */
.guide-section {
  background: var(--surface-warm);
  padding: clamp(64px, 10vw, 120px) 0;
}

/* ── Guide Grid ── */
.guide-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 24px;
  align-items: stretch;
}

.guide-small-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Featured Card ── */
.guide-featured {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.guide-featured img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms var(--ease-out);
}

.guide-featured:hover img {
  transform: scale(1.06);
}

.guide-featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.15) 45%, transparent 100%);
  transition: background 350ms var(--ease-out);
}

.guide-featured:hover .guide-featured-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
}

.guide-featured-content {
  position: relative;
  z-index: 2;
  padding: 32px;
  color: #fff;
}

.guide-tag {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.guide-featured-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.25;
}

.guide-featured-content p {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 400px;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: gap 300ms var(--ease-out);
}

.guide-link svg {
  transition: transform 300ms var(--ease-out);
}

.guide-featured:hover .guide-link svg {
  transform: translateX(4px);
}

/* ── Small Card ── */
.guide-small {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px;
  cursor: pointer;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out);
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.guide-small:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.guide-small-thumb {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 1/1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.guide-small-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease-out);
}

.guide-small:hover .guide-small-thumb img {
  transform: scale(1.05);
}

.guide-small-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.guide-small-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate-900);
  line-height: 1.3;
}

.guide-small-body p {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-small-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  margin-top: 2px;
}

/* ── Section CTA ── */
.section-cta {
  text-align: center;
  margin-top: clamp(36px, 5vw, 56px);
}

/* ── Button Secondary ── */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  background: transparent;
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 250ms var(--ease-out), color 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-secondary svg {
  transition: transform 300ms var(--ease-out);
}

.btn-secondary:hover svg {
  transform: translateX(4px);
}


/* ── Guide Responsive — Tablet ── */
@media (max-width: 1023px) {
  .guide-grid {
    grid-template-columns: 1fr 1fr;
  }
  .guide-featured {
    grid-column: 1 / -1;
    min-height: 360px;
  }
  .guide-small-stack {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .guide-small {
    flex: 1 1 calc(50% - 8px);
    min-width: 280px;
  }
}

/* ── Guide Responsive — Mobile ── */
@media (max-width: 767px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .guide-featured {
    min-height: 200px;
  }
  .guide-featured-content h3 {
    font-size: 1.15rem;
  }
  .guide-featured-content p {
    font-size: 13px;
  }
  .guide-small-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .guide-small {
    flex: unset;
    min-width: unset;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }
  .guide-small-thumb {
    display: none;
  }
  .guide-small-body p {
    display: none;
  }
  .guide-small-body h3 {
    font-size: 14px;
  }
  .guide-small-link {
    font-size: 12px;
  }
}

@media (max-width: 479px) {
  .guide-small-stack {
    grid-template-columns: 1fr;
  }
  .guide-small {
    flex-direction: row;
    gap: 12px;
  }
  .guide-small-thumb {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
  }
}


/* ══════════════════════════════════════════
   SECTION 2: GALLERY — "I Nostri Lavori"
   ══════════════════════════════════════════ */
.gallery-section {
  background: var(--surface-cool);
  padding: clamp(64px, 10vw, 120px) 0;
}

/* ── Gallery Grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 260px);
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
}

/* Row 1: item-1 (wide) + item-2 | Row 2: item-3 + item-4 (wide) */
.gallery-item:first-child {
  grid-column: 1 / 3;
}

.gallery-item:nth-child(4) {
  grid-column: 2 / 4;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92);
  transition: filter 350ms var(--ease-out), transform 350ms var(--ease-out);
}

.gallery-item:hover img {
  filter: brightness(1);
  transform: scale(1.03);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 350ms var(--ease-out);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
  transition-duration: 350ms;
}

/* Faster exit */
.gallery-item:not(:hover) .gallery-overlay {
  transition-duration: 250ms;
}

.gallery-item:not(:hover) img {
  transition-duration: 250ms;
}

.gallery-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  color: #fff;
  z-index: 2;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 350ms var(--ease-out), opacity 350ms var(--ease-out);
}

.gallery-item:hover .gallery-info {
  transform: translateY(0);
  opacity: 1;
}

.gallery-item:not(:hover) .gallery-info {
  transition-duration: 250ms;
}

.gallery-info h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.gallery-item:first-child .gallery-info h3 {
  font-size: 20px;
}

.gallery-zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 350ms var(--ease-out), transform 350ms var(--ease-out);
  z-index: 2;
}

.gallery-item:hover .gallery-zoom {
  opacity: 1;
  transform: scale(1);
}

.gallery-item:not(:hover) .gallery-zoom {
  transition-duration: 250ms;
}

/* ── Gallery Responsive — Mobile ── */
@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    gap: 8px;
  }
  .gallery-item:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .gallery-item:nth-child(4) {
    grid-column: 1 / -1;
  }
  .gallery-item {
    aspect-ratio: 4/3;
  }
  .gallery-item:first-child,
  .gallery-item:nth-child(4) {
    aspect-ratio: 16/9;
  }
  .gallery-info h3 {
    font-size: 14px;
  }
  .gallery-item:first-child .gallery-info h3 {
    font-size: 18px;
  }
}
