/* ==========================================================================
   VIGILI DEL FUOCO - TEMPORARY LANDING & NEWS PORTAL
   Style System - Pure CSS, Modern & Responsive
   ========================================================================== */

:root {
  --vff-red-primary: #7A0C16;
  --vff-red-dark: #5B060F;
  --vff-red-light: #9B1D27;
  --vff-gold: #F0B429;
  --vff-gold-dark: #C59B27;
  --vff-gold-light: #FDF3D8;
  --vff-tricolor-green: #009246;
  --vff-tricolor-white: #FFFFFF;
  --vff-tricolor-red: #CE2B37;
  
  --bg-page: #F3F4F6;
  --bg-card: #FFFFFF;
  --text-main: #1F2937;
  --text-muted: #4B5563;
  --text-light: #6B7280;
  --border-color: #E5E7EB;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--vff-red-primary);
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  color: var(--vff-red-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header & Institutional Banner
   ========================================================================== */

.site-header {
  background: #FFFFFF;
  border-bottom: 2px solid var(--vff-red-primary);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar {
  background: #1A1A24;
  color: #E2E8F0;
  font-size: 0.8125rem;
  padding: 0.35rem 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tricolor-strip {
  display: inline-flex;
  height: 6px;
  width: 48px;
  border-radius: 2px;
  overflow: hidden;
  margin-right: 8px;
  vertical-align: middle;
}
.tricolor-green { background-color: var(--vff-tricolor-green); flex: 1; }
.tricolor-white { background-color: var(--vff-tricolor-white); flex: 1; }
.tricolor-red   { background-color: var(--vff-tricolor-red); flex: 1; }

.header-main {
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo-img {
  height: 56px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-link:hover {
  color: var(--vff-red-primary);
  background-color: #FEE2E2;
}

.btn-admin-header {
  background-color: var(--vff-red-primary);
  color: #FFFFFF !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--vff-red-dark);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-admin-header:hover {
  background-color: var(--vff-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Notice Banner (Migration info)
   ========================================================================== */

.migration-banner {
  background: linear-gradient(90deg, #5B060F 0%, #7A0C16 100%);
  color: #FFFFFF;
  padding: 0.85rem 0;
  box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.2);
}

.migration-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.migration-tag {
  background-color: var(--vff-gold);
  color: #1A1A24;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.migration-text {
  font-size: 0.9rem;
  flex: 1;
}

/* ==========================================================================
   Hero: Sezione "In Primo Piano"
   ========================================================================== */

.section-primo-piano {
  padding: 2.5rem 0 2rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--vff-red-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 24px;
  background-color: var(--vff-gold);
  border-radius: 2px;
}

.featured-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid #E2E8F0;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  transition: box-shadow 0.3s ease;
}

.featured-card:hover {
  box-shadow: var(--shadow-xl);
}

@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
}

.featured-media {
  background-color: #0F172A;
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.media-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.featured-card:hover .media-container img {
  transform: scale(1.02);
}

.video-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  background: #000;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-badge-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.5px;
}

.badge-featured {
  background: linear-gradient(135deg, #7A0C16 0%, #9B1D27 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-video {
  background-color: #DC2626;
  color: #FFFFFF;
}

.badge-photos {
  background-color: rgba(15, 23, 42, 0.85);
  color: #F8FAFC;
  backdrop-filter: blur(4px);
}

/* Gallery thumbnails strip on featured item */
.featured-thumbs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #111827;
  overflow-x: auto;
}

.featured-thumb-btn {
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 60px;
  height: 42px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.2s;
}

.featured-thumb-btn:hover, .featured-thumb-btn.active {
  opacity: 1;
  border-color: var(--vff-gold);
}

.featured-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-content {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 0.85rem;
  font-weight: 500;
}

.featured-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--vff-red-dark);
  margin-bottom: 1.25rem;
}

.featured-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  white-space: pre-line;
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--vff-red-primary);
  background-color: #FEE2E2;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #FECACA;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}

.btn-read-more:hover {
  background-color: var(--vff-red-primary);
  color: #FFFFFF;
}

/* ==========================================================================
   News Grid Section
   ========================================================================== */

.section-all-news {
  padding: 1.5rem 0 4rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-media-wrap {
  position: relative;
  height: 210px;
  background-color: #1E293B;
  overflow: hidden;
}

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

.news-card:hover .card-media-wrap img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-date {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--vff-red-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #F1F5F9;
  padding-top: 1rem;
}

.btn-card-details {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--vff-red-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-card-details:hover {
  text-decoration: underline;
  color: var(--vff-red-dark);
}

/* ==========================================================================
   Modal / Lightbox
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: #F8FAFC;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-title-wrap {
  flex: 1;
  padding-right: 1.5rem;
}

.modal-date {
  font-size: 0.875rem;
  color: var(--vff-red-primary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--vff-red-dark);
}

.modal-close-btn {
  background: #E2E8F0;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background-color: var(--vff-red-primary);
  color: #FFFFFF;
}

.modal-body {
  padding: 1.75rem;
}

.modal-media-section {
  margin-bottom: 1.5rem;
}

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

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s;
  height: 160px;
}

.gallery-item:hover {
  transform: scale(1.03);
}

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

.modal-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-main);
  white-space: pre-line;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background-color: #1A1A24;
  color: #CBD5E1;
  border-top: 4px solid var(--vff-red-primary);
  padding: 2.5rem 0 1.5rem;
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-brand h3 {
  color: #FFFFFF;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
  color: #94A3B8;
}

.footer-bottom a {
  color: #E2E8F0;
}

.footer-bottom a:hover {
  color: var(--vff-gold);
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.alert-warning {
  background-color: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}
.alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}
.alert-info {
  background-color: #E0F2FE;
  color: #075985;
  border: 1px solid #BAE6FD;
}
.alert-success {
  background-color: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}
