/* =====================================================
   INIZIATIVE PAGE – stili aggiuntivi
   Dipende da style.css (variabili, reset, utility)
   ===================================================== */

/* ─── PAGE HERO ──────────────────────────────────────── */
.page-hero {
  position: relative;
  padding-top: calc(68px + 64px);
  padding-bottom: 0;
  overflow: hidden;
  background: var(--white);
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background: var(--white);
  pointer-events: none;
}
.page-hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-bottom: 56px;
}
.page-hero-content h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--secondary);
}
.page-hero-content .hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 560px;
  line-height: 1.7;
}

/* ─── TAB NAV ────────────────────────────────────────── */
.ini-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ini-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(255,255,255,.7);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  backdrop-filter: blur(6px);
}
.ini-tab:hover {
  background: var(--white);
  color: var(--text);
  border-color: var(--honey);
}
.ini-tab.active {
  background: var(--honey);
  color: var(--white);
  border-color: var(--honey);
  box-shadow: 0 4px 16px rgba(232,160,32,.3);
}
.tab-icon { font-size: 1rem; }

/* ─── FILTER BAR ─────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  border-bottom: 1px solid #e0e0e0;
}
.filter-btn {
  position: relative;
  padding: 0 0 12px;
  border: none;
  margin-bottom: -1px;
  font-size: 1.1rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  transition: var(--transition);
  cursor: pointer;
}
.filter-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.filter-btn:hover { color: var(--amber); }
.filter-btn:hover::after { transform: scaleX(1); }
.filter-btn.active {
  color: var(--amber);
}
.filter-btn.active::after { transform: scaleX(1); }

/* ─── COMUNICAZIONI LIST ─────────────────────────────── */
.comms-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comm-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.comm-card:hover { border-color: var(--honey); box-shadow: var(--shadow); }

.comm-card.comm-featured {
  border-color: var(--honey);
  background: linear-gradient(135deg, #fff8ed, var(--white));
  grid-template-columns: 180px 1fr;
}

.comm-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}
.comm-badge {
  display: inline-block;
  background: var(--honey);
  color: var(--white);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  width: fit-content;
}
.comm-cat {
  font-size: .78rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1.4;
}
.comm-date {
  font-size: .82rem;
  color: var(--text-muted);
}

.comm-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.35;
  color: var(--secondary);
}
.comm-body p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}
.comm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.comm-link { font-size: .88rem; font-weight: 600; color: var(--amber); }
.comm-link:hover { text-decoration: underline; }

/* ─── CORSI GRID ─────────────────────────────────────── */
.corsi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.corso-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.corso-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.corso-card-top { padding: 20px 20px 0; }

.corso-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  aspect-ratio: 3/2;
  background: var(--beige);
}
.corso-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 2.5rem;
}
.thumb-label {
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-body);
}
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition);
}
.corso-thumb:hover .thumb-overlay { opacity: 1; }

.corso-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.corso-level {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.level-base  { background: #e8f5e9; color: #2e7d32; }
.level-inter { background: #fff3e0; color: #e65100; }
.level-adv   { background: #fce4ec; color: #c62828; }

.corso-status {
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.status-open   { background: #e8f5e9; color: #2e7d32; }
.status-closed { background: #f5f5f5; color: #757575; }

.corso-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.corso-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--secondary);
  line-height: 1.3;
}
.corso-card-body > p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.corso-details {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 4px;
  font-size: .85rem;
  margin-bottom: 20px;
  flex: 1;
}
.corso-details dt { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.corso-details dd { color: var(--text); }

.corso-card-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── NEWS GRID (stesso stile delle card news in homepage) ─── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.news-grid .corso-card {
  background: none;
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
}
.news-grid .corso-card[hidden] { display: none; }
.news-grid .corso-card:hover { transform: none; box-shadow: none; }
.news-grid .corso-thumb-wrap {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.news-grid .corso-thumb {
  position: static;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: 0;
  border-radius: 0;
  background: #f0efeb;
  transition: transform var(--transition);
}
.news-grid .corso-card:hover .corso-thumb { transform: scale(1.05); }
.news-grid .corso-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
  line-height: 1.3;
}
.news-grid .corso-card p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.news-grid .corso-card .news-link { margin-top: auto; }

@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ─── CONCORSO ───────────────────────────────────────── */
.concorso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 64px;
  align-items: start;
}

.concorso-hero-card {
  background: linear-gradient(135deg, #fff8ed, #fffdf7);
  border: 1.5px solid var(--honey);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.concorso-badge-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.concorso-year-badge {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--amber);
  background: rgba(232,160,32,.15);
  padding: 4px 14px;
  border-radius: 50px;
}
.concorso-status-badge {
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.concorso-hero-card h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--secondary);
}
.concorso-hero-card > p {
  font-size: .95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 24px;
}
.concorso-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.concorso-highlights li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .92rem;
  color: var(--text);
}
.ch-icon { font-size: 1.1rem; flex-shrink: 0; }

/* documenti */
.concorso-docs { padding-top: 8px; }
.concorso-docs h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--secondary);
}
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.doc-item:hover { border-color: var(--honey); box-shadow: var(--shadow); }
.doc-icon { font-size: 1.6rem; flex-shrink: 0; }
.doc-info { flex: 1; }
.doc-info strong { display: block; font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.doc-info span { font-size: .82rem; color: var(--text-muted); }
.doc-dl {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--beige);
  border-radius: 50%;
  font-size: 1rem;
  font-weight: 700;
  color: var(--amber);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.doc-item:hover .doc-dl { background: var(--honey); color: var(--white); }

/* ─── GALLERY ────────────────────────────────────────── */
.gallery-section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
}
.gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.gallery-header h3 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--secondary);
}
.gallery-desc { font-size: .92rem; color: var(--text-muted); }
.gallery-year-tag {
  font-size: .8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 50px;
  background: var(--beige);
  color: var(--amber);
  border: 1px solid var(--border);
  white-space: nowrap;
  align-self: flex-start;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition);
  background: none;
  padding: 0;
}
.gallery-item:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.gallery-item img { transition: transform var(--transition); }
.gallery-item:hover img { transform: scale(1.05); }

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.gp-1 { background: linear-gradient(135deg, #f5e6c8, #edd99a); }
.gp-2 { background: linear-gradient(135deg, #e8d4b0, #d4b978); }
.gp-3 { background: linear-gradient(135deg, #f0e0c0, #e8c870); }
.gp-4 { background: linear-gradient(135deg, #ddd0b0, #c8a850); }
.gp-5 { background: linear-gradient(135deg, #ede4cc, #d8c088); }
.gp-6 { background: linear-gradient(135deg, #f8ecd4, #ecd080); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  font-size: .78rem;
  font-weight: 600;
  color: var(--white);
}

/* ─── LIGHTBOX ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lb-img-wrap {
  position: relative;
  max-width: min(1200px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-placeholder {
  width: 600px;
  max-width: 80vw;
  aspect-ratio: 4/3;
  background: #2a2520;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
/* the [hidden] attribute must win over the display:flex above */
.lb-placeholder[hidden] { display: none; }
#lb-img { border-radius: var(--radius); max-height: 84vh; max-width: 100%; width: auto; }
.lb-caption { color: rgba(255,255,255,.75); font-size: .9rem; font-weight: 500; }
.lb-nav {
  background: rgba(255,255,255,.12);
  color: var(--white);
  border-radius: 50%;
  width: 48px; height: 48px;
  font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(255,255,255,.12);
  color: var(--white);
  border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  border: none;
  cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.25); }

/* ─── CORSI PROMO BANNER ─────────────────────────────── */
.corsi-promo {
  display: flex;
  align-items: center;
  gap: 28px;
  background: linear-gradient(135deg, #fff8ed, #fffdf7);
  border: 1.5px solid var(--honey);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  flex-wrap: wrap;
}
.corsi-promo-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
}
.corsi-promo-body {
  flex: 1;
  min-width: 200px;
}
.corsi-promo-tag {
  font-size: .78rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.corsi-promo-body h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--secondary);
}
.corsi-promo-body p {
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.corsi-promo-btn { flex-shrink: 0; }

@media (max-width: 600px) {
  .corsi-promo { padding: 24px 20px; }
  .corsi-promo-btn { width: 100%; text-align: center; }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 960px) {
  .concorso-grid { grid-template-columns: 1fr; }
  .corsi-grid { grid-template-columns: 1fr; }
  .comm-card { grid-template-columns: 140px 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .comm-card { grid-template-columns: 1fr; gap: 12px; }
  .comm-card.comm-featured { grid-template-columns: 1fr; }
  .comm-aside { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .ini-tabs { gap: 6px; }
  .ini-tab { padding: 8px 16px; font-size: .82rem; }
  .concorso-hero-card { padding: 24px; }
  .lb-nav { display: none; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .filter-bar { gap: 6px; }
}

/* ─── Immagini reali in gallery e corso-thumb ────────────── */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.corso-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
