@charset "utf-8";

/* ===================================================
   AVIS LUCERA NEWS — Stylesheet Completo
   =================================================== */

:root {
  --avis-red: #E30613;
  --avis-blue: #003366;
  --avis-light-red: #fff0f1;
  --border-color: #d1d1d1;
  --text-main: #1a1a1a;
  --bg: #f5f5f0;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.6;
}

/* ===================================================
   LAYOUT UTILITIES
   =================================================== */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===================================================
   MASTHEAD
   =================================================== */
.masthead {
  background: #fff;
  border-bottom: 5px double var(--text-main);
  padding: 16px 0 28px;
}

.masthead__meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.journal-brand {
  text-align: center;
}

.journal-brand h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1;
  letter-spacing: -2px;
}

.journal-brand h1 span {
  color: var(--avis-red);
}

.journal-brand p {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-weight: 700;
  font-size: 11px;
  color: #666;
  margin-top: 10px;
}

/* ===================================================
   NEWS TICKER
   =================================================== */
.marquee-news {
  background: var(--avis-blue);
  color: #fff;
  padding: 12px 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .marquee-news {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
}

.marquee__track {
  display: flex;
  animation: scroll 25s linear infinite;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .marquee__track {
    animation: scroll 20s linear infinite;
  }
}

@media (max-width: 480px) {
  .marquee__track {
    animation: scroll 18s linear infinite;
  }
}

.news-ticker-item {
  padding: 0 50px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===================================================
   HERO ARTICLE
   =================================================== */
.journal-hero {
  margin-top: 32px;
}

.featured-article {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-article:hover,
.featured-article:focus {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  outline: none;
}

.featured-article__img {
  height: 520px;
  position: relative;
  background: #8B0000;
  overflow: hidden;
}

.featured-article__img.has-image {
  background: #111;
}

.featured-article__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-bg-art {
  position: absolute;
  inset: 0;
}

.drop {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform: rotate(180deg);
}

.d1 { width: 80px; height: 110px; top: 10%; left: 12%; opacity: .12; }
.d2 { width: 50px; height: 70px;  top: 55%; left: 35%; opacity: .08; }
.d3 { width: 120px; height: 160px; top: 5%;  right: 10%; opacity: .1; }
.d4 { width: 40px;  height: 55px;  bottom: 20%; left: 55%; opacity: .14; }
.d5 { width: 65px;  height: 90px;  bottom: 10%; right: 25%; opacity: .09; }

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

.featured-article__content {
  position: absolute;
  bottom: 48px;
  left: 48px;
  right: 48px;
  color: #fff;
}

.featured-article__content h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(24px, 4vw, 50px);
  margin: 14px 0 10px;
  line-height: 1.1;
}

.featured-article__content p {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  max-width: 680px;
}

.read-more {
  display: inline-block;
  margin-top: 16px;
  color: #fff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.featured-article:hover .read-more { color: var(--avis-red); }

/* ===================================================
   MAIN GRID & ENTRIES
   =================================================== */
.journal-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 50px;
  margin-top: 50px;
  margin-bottom: 70px;
}

.section-divider {
  border-bottom: 3px solid var(--text-main);
  margin-bottom: 32px;
  padding-bottom: 8px;
  text-transform: uppercase;
  font-size: 20px;
  letter-spacing: 1px;
}

.news-entry {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 28px;
  padding: 16px 12px;
  margin-left: -12px;
  cursor: pointer;
  border-radius: 4px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.news-entry:last-child { border-bottom: none; }

.news-entry:hover,
.news-entry:focus {
  background: rgba(227, 6, 19, 0.04);
  outline: none;
}

.news-entry__thumb {
  width: 210px;
  height: 145px;
  background: #f0f0f0;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  transition: transform 0.2s ease;
}

.news-entry:hover .news-entry__thumb { transform: scale(1.02); }

.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 52px;
}

.placeholder-img.has-image {
  display: block;
  font-size: 0;
}

.news-entry__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===================================================
   TAGS
   =================================================== */
.category-tag {
  display: inline-block;
  background: #555;
  color: #fff;
  padding: 4px 11px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 2px;
  align-self: flex-start;
}

.tag--lucera { background: var(--avis-red); }
.tag--foggia { background: var(--avis-blue); }
.tag--salute { background: #27ae60; }
.bg-gray { background: #555; }

.news-entry__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.news-entry__body h4 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(15px, 2vw, 22px);
  margin: 10px 0 6px;
  line-height: 1.25;
  color: #111;
}

.news-entry__body p {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.news-entry__body time {
  display: block;
  font-size: 11px;
  color: #888;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.read-more-hint {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--avis-red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================================================
   PAGINATION CONTROLS
   =================================================== */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 35px;
  padding-top: 20px;
  border-top: 2px solid var(--text-main);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn svg {
  transition: transform 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--avis-blue);
  color: #fff;
  border-color: var(--avis-blue);
}

.pagination-btn:hover:not(:disabled)#prevPageBtn svg {
  transform: translateX(-3px);
}

.pagination-btn:hover:not(:disabled)#nextPageBtn svg {
  transform: translateX(3px);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #e8e8e8;
  color: #888;
}

.page-indicator {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #555;
  letter-spacing: 0.8px;
}

/* ===================================================
   SIDEBAR & MINI EVENTS
   =================================================== */
.sidebar-box {
  background: #fff;
  padding: 26px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 28px;
}

.sidebar-box h4 {
  border-bottom: 2px solid var(--avis-red);
  margin-bottom: 18px;
  padding-bottom: 8px;
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 800;
}

.featured-event-box {
  background: var(--avis-light-red) !important;
  border: 2px solid var(--avis-red) !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-event-box:hover,
.featured-event-box:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(227, 6, 19, 0.15);
  outline: none;
}

.featured-event-box h4 {
  color: var(--avis-red);
  margin-top: 10px;
}

.event-details {
  font-size: 13px;
  line-height: 1.7;
  color: #333;
}

.manual-scroll-container {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.manual-scroll-container::-webkit-scrollbar { width: 4px; }
.manual-scroll-container::-webkit-scrollbar-track { background: #f1f1f1; }
.manual-scroll-container::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.manual-scroll-container::-webkit-scrollbar-thumb:hover { background: var(--avis-red); }

.mini-event-item {
  padding: 11px 8px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s ease;
}

.mini-event-item:last-child { border-bottom: none; }

.mini-event-item:hover,
.mini-event-item:focus {
  background: rgba(0, 51, 102, 0.05);
  outline: none;
}

.mini-date {
  background: var(--avis-blue);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 4px 7px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.mini-event-item p {
  font-size: 12px;
  line-height: 1.35;
  color: #444;
}

/* ===================================================
   DETAIL PANEL
   =================================================== */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.panel-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
}

.detail-panel.is-open { transform: translateX(0); }

.panel-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--avis-blue);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-section-label {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.panel-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.panel-close-btn:hover { background: rgba(255,255,255,0.3); }

.panel-hero-img {
  height: 200px;
  background: linear-gradient(135deg, #8B0000 0%, #CC0000 50%, #E30613 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.panel-hero-img.bg-blue { background: linear-gradient(135deg, #001a33 0%, #003366 60%, #0055aa 100%); }
.panel-hero-img.bg-green { background: linear-gradient(135deg, #0f4a1f 0%, #1a7a30 60%, #27ae60 100%); }
.panel-hero-img.bg-gray { background: linear-gradient(135deg, #222 0%, #444 60%, #666 100%); }

.panel-hero-img.has-image {
  background: #111;
}

.panel-hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  z-index: 1;
}

.panel-hero-emoji {
  font-size: 72px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.panel-body { padding: 24px 28px; flex: 1; }
.panel-tag { margin-bottom: 14px; }
.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 4vw, 28px);
  line-height: 1.2;
  color: #111;
  margin-bottom: 14px;
}

.panel-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.panel-meta time {
  font-size: 11px;
  font-weight: 800;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-author { font-size: 12px; font-weight: 700; color: var(--avis-blue); }
.panel-text { font-size: 14px; line-height: 1.8; color: #333; }
.panel-text p { margin-bottom: 14px; }
.panel-text ul {
  margin: 0 0 16px 20px;
  padding: 0;
}
.panel-text li { margin-bottom: 8px; }
.panel-text a {
  color: var(--avis-red);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.panel-text strong { font-weight: 800; color: #111; }
.panel-text em { font-style: italic; color: #444; }
.panel-cta { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-color); }

/* ===================================================
   IMAGE MODAL
   =================================================== */
.image-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.image-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  max-height: 85vh;
  max-width: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.image-modal-close-btn {
  position: absolute;
  top: 30px;
  right: 40px;
  color: white;
  font-size: 48px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 10000;
}

.image-modal-close-btn:hover {
  transform: scale(1.15);
}

.image-modal-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  background: rgba(0, 0, 0, 0.4);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  z-index: 10000;
}

.image-modal-nav-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.image-modal-prev {
  left: 30px;
}

.image-modal-next {
  right: 30px;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 960px) {
  .journal-grid { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 640px) {
  .featured-article__content { left: 20px; right: 20px; bottom: 24px; }
  .news-entry {
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    margin-left: 0;
  }
  .news-entry__thumb {
    width: 104px;
    height: 92px;
  }
  .placeholder-img { font-size: 38px; }
  .detail-panel { width: 100vw; }
  .panel-body { padding: 18px 20px; }
}

@media (max-width: 420px) {
  .news-entry { flex-direction: column; }
  .news-entry__thumb {
    width: 100%;
    height: 160px;
  }
  .placeholder-img { font-size: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .featured-article, .news-entry, .featured-event-box, .mini-event-item, .detail-panel, .panel-overlay {
    transition: none;
  }
}

/* Responsive overrides loaded after responsive-core on this page. */
@media (max-width: 640px) {
  .journal-brand {
    padding-inline: 14px;
  }

  .featured-article__content {
    left: 16px;
    right: 16px;
    bottom: 18px;
  }

  .news-entry {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 12px;
  }

  .news-entry__thumb {
    width: clamp(86px, 28vw, 104px) !important;
    min-width: clamp(86px, 28vw, 104px) !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3;
    flex: 0 0 clamp(86px, 28vw, 104px) !important;
    border-radius: 10px;
  }

  .news-entry__body {
    min-width: 0;
  }

  .news-entry__body h4 {
    font-size: clamp(15px, 4vw, 17px);
    line-height: 1.25;
  }

  .detail-panel {
    position: fixed !important;
    inset: 0 0 0 auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 3001 !important;
  }

  .panel-overlay {
    z-index: 3000 !important;
  }

  .panel-header {
    padding-top: max(14px, env(safe-area-inset-top));
    gap: 12px;
  }

  .panel-close-btn {
    width: auto;
    min-width: 112px;
    height: 42px;
    border-radius: 999px;
    padding: 0 14px;
    gap: 8px;
  }

  .panel-close-btn::after {
    content: "Indietro";
    font-size: 14px;
    font-weight: 800;
  }

  .panel-body {
    padding: 18px 18px max(24px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 390px) {
  .news-entry {
    gap: 10px;
  }

  .news-entry__thumb {
    width: 82px !important;
    min-width: 82px !important;
    flex-basis: 82px !important;
  }
}
