/**
 * GCrane - Casi Studio & Report Interventi Tecnici
 * Master Stylesheet: Pagina Catalogo (Griglia Caselle) + Pagina Singolo Caso Studio (Completa)
 * Stile industriale coordinato con gcranecompany.com
 */

/* ==========================================================================
   HERO / BANNER CASI STUDIO
   ========================================================================== */
.case-hero {
  background: linear-gradient(135deg, #0b101b 0%, #111827 50%, #0d131f 100%);
  color: #ffffff;
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--color-primary, #009640);
}

.case-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(0, 150, 64, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 150, 64, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  opacity: 0.6;
}

.case-hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.case-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 150, 64, 0.15);
  border: 1px solid rgba(0, 150, 64, 0.5);
  color: #10b981;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px rgba(0, 150, 64, 0.2);
}

.case-hero-title {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.case-hero-subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 760px;
  margin: 0 auto;
}

/* ==========================================================================
   PAGINA CATALOGO: GRIGLIA CASELLE CASI STUDIO (.case-grid)
   ========================================================================== */
.case-catalog-section {
  padding: 4rem 0 5.5rem;
  background-color: #f8fafc;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

/* LA CASELLA / TILE */
.case-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.case-tile:hover {
  transform: translateY(-6px);
  border-color: #cbd5e1;
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 150, 64, 0.1);
}

.case-tile.is-active {
  cursor: pointer;
}

.case-tile.is-pending {
  opacity: 0.85;
  background: #fafafa;
}

.case-tile-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.case-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.case-tile:hover .case-tile-media img {
  transform: scale(1.06);
}

.case-tile-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.badge-urgent {
  background: #dc2626;
  color: #ffffff;
}

.badge-upcoming {
  background: #475569;
  color: #f8fafc;
}

.case-tile-date {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.case-tile-body {
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.case-tile-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary, #009640);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.45rem;
}

.case-tile-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.case-tile:hover .case-tile-title {
  color: var(--color-primary, #009640);
}

.case-tile-desc {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.case-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary, #009640);
}

.case-tile-footer svg {
  transition: transform 0.2s ease;
}

.case-tile:hover .case-tile-footer svg {
  transform: translateX(4px);
}

/* ==========================================================================
   PAGINA SINGOLO CASO STUDIO (ARTICOLO DETTAGLIATO)
   ========================================================================== */
.case-single-section {
  padding: 3rem 0 5rem;
  background: #ffffff;
}

.case-single-container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Pulsante Torna Indietro */
.case-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
  margin-bottom: 1.75rem;
  padding: 0.45rem 0.85rem;
  background: #f1f5f9;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.case-back-link:hover {
  background: var(--color-primary, #009640);
  color: #ffffff;
}

/* Intestazione Articolo */
.case-single-header {
  margin-bottom: 2.25rem;
}

.case-single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.case-badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-id { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-red { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.badge-green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.case-single-title {
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.case-single-lead {
  font-size: 1.15rem;
  color: #475569;
  line-height: 1.6;
  border-left: 4px solid var(--color-primary, #009640);
  padding-left: 1.25rem;
  background: #f8fafc;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 0 8px 8px 0;
}

/* Scheda Specifiche / Key Facts */
.case-quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.fact-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fact-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fact-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.fact-value.danger { color: #dc2626; }
.fact-value.success { color: #16a34a; }

/* Galleria Immagini nel Caso Studio (1 o più immagini) */
.case-single-gallery {
  margin-bottom: 3rem;
}

.case-featured-image {
  margin-bottom: 2.5rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  background: #0f172a;
}

.case-featured-image img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  display: block;
}

.case-featured-caption {
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

.gallery-section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.gallery-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-media img,
.gallery-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-media img,
.gallery-item:hover .gallery-media svg {
  transform: scale(1.03);
}

.gallery-caption {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.45;
  background: #ffffff;
}

/* Corpo del Testo */
.case-article-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #334155;
  margin-bottom: 3.5rem;
}

.case-article-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 2.25rem 0 1rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.case-article-content p {
  margin-bottom: 1.15rem;
}

.case-article-content ul {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
}

.case-article-content li {
  margin-bottom: 0.75rem;
}

/* Box Allerta Critica (Nota Bene) */
.case-alert-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 1.65rem 1.85rem;
  margin: 2.5rem 0;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
  position: relative;
  overflow: hidden;
}

.case-alert-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background: #d97706;
}

.case-alert-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #92400e;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.case-alert-text {
  font-size: 0.98rem;
  color: #78350f;
  line-height: 1.65;
  margin: 0;
}

/* Sezione FAQ Dedicate a Questo Caso */
.case-single-faqs {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 2.25rem;
  margin-bottom: 3.5rem;
}

.case-faqs-intro {
  margin-bottom: 1.75rem;
}

.case-faqs-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary, #009640);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  display: block;
}

.case-faqs-h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.case-faq-details {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.case-faq-details[open] {
  border-color: var(--color-primary, #009640);
  box-shadow: 0 4px 12px rgba(0, 150, 64, 0.08);
}

.case-faq-summary {
  padding: 1.15rem 1.35rem;
  font-weight: 700;
  font-size: 1rem;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  gap: 1rem;
}

.case-faq-summary::-webkit-details-marker {
  display: none;
}

.case-faq-plus {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--color-primary, #009640);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.case-faq-details[open] .case-faq-plus {
  background: var(--color-primary, #009640);
  color: #ffffff;
  transform: rotate(180deg);
}

.case-faq-body {
  padding: 0 1.35rem 1.35rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #475569;
  border-top: 1px solid transparent;
}

.case-faq-details[open] .case-faq-body {
  border-top-color: #f1f5f9;
  padding-top: 1rem;
}

/* Call to Action Bottom Box */
.case-single-cta {
  background: #0f172a;
  color: #ffffff;
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.case-cta-title {
  font-size: 1.45rem;
  font-weight: 800;
}

.case-cta-desc {
  font-size: 1rem;
  color: #94a3b8;
  max-width: 650px;
}

.case-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn-primary-case {
  background: var(--color-primary, #009640);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 150, 64, 0.3);
}

.btn-primary-case:hover {
  background: #007a34;
  transform: translateY(-2px);
}

.btn-phone-case {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-phone-case:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Stampa */
@media print {
  .topbar, .main-nav, .main-footer, .case-back-link, .case-single-cta, #crane-hook-container {
    display: none !important;
  }
  .case-single-section {
    padding: 0 !important;
  }
}
