/* ============================================================
   FESTA SAN SISTO I - ALIFE - CSS Principale
   Colori: Rosso #A60F0F - Oro #D4AC0D - Avorio #FFF7E0
   ============================================================ */

/* --- RESET & BASE --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red:        #A60F0F;
  --red-dark:   #760909;
  --red-light:  #D83A32;
  --gold:       #D4AC0D;
  --gold-dark:  #A87900;
  --gold-light: #FFE9A3;
  --cream:      #FFF7E0;
  --dark:       #2A100E;
  --gray:       #6b6b6b;
  --gray-light: #f5f5f5;
  --border:     rgba(0,0,0,0.1);
  --shadow:     0 2px 12px rgba(0,0,0,0.1);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.18);
  --radius:     14px;
  --radius-sm:  8px;
  --nav-h:      62px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* --- TYPOGRAPHY --- */
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.2; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: var(--red-dark);
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 38px; height: 38px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--dark);
  font-size: 13px;
  flex-shrink: 0;
}
.logo-icon-sm { width: 30px; height: 30px; font-size: 11px; }
.logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: white;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 10px rgba(0,0,0,0.24);
  flex-shrink: 0;
}
.logo-img-sm {
  width: 34px;
  height: 34px;
  border-width: 1px;
}
.nav-public {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-public a {
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.nav-public a:hover,
.nav-public a.active {
  color: var(--gold-light);
  background: rgba(255,255,255,0.1);
}
.logo-nome {
  display: block;
  font-family: 'Playfair Display', serif;
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.logo-sub {
  display: block;
  color: var(--gold-light);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.nav-search input {
  width: 100%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 36px 8px 14px;
  border-radius: 24px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: background .2s, border .2s;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.6); }
.nav-search input:focus {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
}
.search-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: white;
  border-radius: 2px;
  transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu mobile */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--red-dark);
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 12px 16px;
  gap: 4px;
}
.nav-mobile.open { display: flex; }
.nav-mobile-search input {
  width: 100%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}
.nav-mobile-search input::placeholder { color: rgba(255,255,255,0.6); }
.nav-mobile-link {
  display: block;
  color: rgba(255,255,255,0.9);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: background .2s;
}
.nav-mobile-link:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   BOTTONI
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  text-decoration: none;
}
.btn-sm    { padding: 6px 12px; font-size: 12px; }
.btn-lg    { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; border-radius: var(--radius-sm); }

.btn-red          { background: var(--red); color: white; border-color: var(--red); }
.btn-red:hover    { background: var(--red-dark); border-color: var(--dark); }
.btn-gold         { background: var(--gold); color: var(--dark); border-color: var(--gold); }
.btn-gold:hover   { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-outline      { background: none; border-color: var(--border); color: var(--dark); }
.btn-outline:hover { background: var(--gray-light); }
.btn-outline-light { background: none; border-color: rgba(255,255,255,0.4); color: white; }
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }
.btn-whatsapp      { background: #25D366; color: white; border-color: #25D366; }
.btn-whatsapp:hover { background: #1ebe5d; }
.btn-facebook      { background: #1877F2; color: white; border-color: #1877F2; }
.btn-facebook:hover { background: #166fe5; }
.btn-instagram     { background: linear-gradient(135deg, #F58529, #DD2A7B 45%, #8134AF 75%, #515BD4); color: white; border-color: #DD2A7B; }
.btn-instagram:hover { filter: brightness(.96); color: white; }

.badge-red {
  background: var(--red);
  color: white;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
}
.mt-8 { margin-top: 8px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { display: none; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L35 20L50 20L38 29L43 44L30 35L17 44L22 29L10 20L25 20Z' fill='rgba(212,172,13,0.07)'/%3E%3C/svg%3E") repeat;
}
.hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.hero h1 { color: white; font-size: 34px; margin-bottom: 8px; }
.hero h1 span { color: var(--gold-light); }
.hero p { color: rgba(255,255,255,0.75); font-size: 15px; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 32px; justify-content: center; }
.hero-stat .n {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  color: var(--gold-light);
  font-weight: 700;
  display: block;
}
.hero-stat .l {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   FILTRI
   ============================================================ */
.filters {
  background: rgba(255, 247, 224, 0.94);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 150;
  backdrop-filter: blur(10px);
}
.filters-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters-inner::-webkit-scrollbar { display: none; }
.filter-label {
  font-size: 11px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.filter-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  font-size: 12px;
  color: var(--dark);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.filter-btn:hover { border-color: var(--red); color: var(--red); }
.filter-btn.active { background: var(--red); border-color: var(--red); color: white; }
.filter-type {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--red);
  background: none;
  font-size: 12px;
  color: var(--red);
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.filter-type.active { background: var(--red); color: white; }
.filter-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.filter-select {
  padding: 5px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}

/* ============================================================
   GALLERIA MASONRY
   ============================================================ */
.gallery-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px clamp(14px, 1.4vw, 28px) 56px;
  min-height: calc(100vh - var(--nav-h) - 72px);
}
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  grid-auto-rows: 8px;
  grid-auto-flow: dense;
  gap: 16px;
  align-items: start;
}
@media (min-width: 1800px) {
  .masonry { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
}
@media (max-width: 1320px) {
  .masonry { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
}
@media (max-width: 760px) {
  .gallery-wrap { padding: 10px 8px 36px; }
  .masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 6px;
    gap: 10px;
  }
}

.pin {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: none;
}
.pin:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(118, 9, 9, 0.20);
}
.pin:hover .pin-overlay { opacity: 1; }
.pin img, .pin video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: initial;
  background: #ECE7DA;
}
.pin-video-thumb {
  min-height: 220px !important;
  background: #111 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}
.pin-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.30) 42%, rgba(0,0,0,0.02) 72%);
  opacity: 0;
  transition: opacity .22s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 15px;
}
.pin-title {
  color: white;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.pin-autore {
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  margin-bottom: 8px;
}
.pin-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pin-cat {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--gold-light);
  background: rgba(212,172,13,0.22);
  padding: 4px 9px;
  border-radius: 8px;
}
.pin-mobile-info { display: none; }
.pin-like-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}
.pin-like-btn:hover, .pin-like-btn.liked { background: var(--gold); color: var(--dark); }
.pin-badge-anno {
  position: absolute; top: 10px; right: 10px;
  background: rgba(212, 172, 13, 0.94);
  color: var(--dark);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.pin-badge-fixed {
  position: absolute; top: 10px; left: 10px;
  background: rgba(166, 15, 15, 0.96);
  color: white;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(0,0,0,0.24);
}
.pin.is-pinned {
  box-shadow: 0 0 0 2px rgba(212, 172, 13, 0.62), 0 10px 28px rgba(118, 9, 9, 0.14);
}
.pin-badge-tipo {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.58);
  color: white;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}
.pin-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 50px; height: 50px;
  background: rgba(0,0,0,0.62);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 15px;
  pointer-events: none;
  transition: opacity .2s;
}
.pin:hover .pin-play { opacity: 0; }

@media (hover: none) {
  .pin:hover { transform: none; box-shadow: none; }
  .pin-overlay { opacity: 1; }
}

@media (max-width: 760px) {
  .pin {
    overflow: visible;
    border-radius: 0;
  }
  .pin img,
  .pin-video-thumb {
    border-radius: 12px;
    overflow: hidden;
  }
  .pin-video-thumb { min-height: 140px !important; }
  .pin-overlay,
  .pin-badge-tipo {
    display: none;
  }
  .pin-badge-fixed {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }
  .pin-badge-anno {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .pin-mobile-info {
    display: block;
    padding: 7px 2px 2px;
    color: var(--dark);
  }
  .pin-mobile-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pin-mobile-author {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pin-mobile-desc {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.28;
    color: #4b5552;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
  }
  .pin-mobile-actions {
    margin-top: 6px;
    display: flex;
    justify-content: flex-start;
  }
  .pin-mobile-like {
    background: rgba(166, 15, 15, 0.08);
    color: var(--dark);
    padding: 5px 8px;
    font-size: 11px;
    backdrop-filter: none;
  }
  .pin-mobile-like:hover,
  .pin-mobile-like.liked {
    background: var(--gold);
    color: var(--dark);
  }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.empty-state h3 { font-size: 22px; color: var(--dark); margin-bottom: 8px; }
/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lb-content {
  background: white;
  border-radius: 20px;
  max-width: 900px;
  width: 92%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  position: relative;
}
.lb-media {
  flex: 1;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 92vh;
  overflow: hidden;
}
.lb-media img  { width: 100%; height: 100%; object-fit: contain; }
.lb-media video { width: 100%; max-height: 600px; }
.lb-info {
  width: 280px;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.lb-cat {
  display: inline-block;
  background: var(--gold-light);
  color: var(--dark);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 500;
}
.lb-title { font-size: 20px; color: var(--dark); }
.lb-autore { font-size: 12px; color: var(--gray); }
.lb-desc   { font-size: 13px; color: var(--gray); line-height: 1.6; }
.lb-anno   { font-size: 12px; color: var(--gray); }
.lb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background .2s;
  z-index: 10;
}
.lb-close { top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }
.lb-prev  { left: 10px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; }
.lb-next  { right: 290px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--gold-light); }

/* ============================================================
   ALERT / FLASH
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #FCE8E6; color: #760909; border: 1px solid #F2B8B5; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.alert-info    { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }
.alert-close   { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; }
.alert-close:hover { opacity: 1; }

/* ============================================================
   FORM
   ============================================================ */
.form-wrap {
  max-width: 480px;
  margin: 40px auto;
  background: white;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.form-wrap h1 { font-size: 26px; margin-bottom: 6px; }
.form-wrap .subtitle { color: var(--gray); font-size: 14px; margin-bottom: 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border .2s;
  background: white;
  color: var(--dark);
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--red); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.emoji-editor {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}
.emoji-editor:focus-within { border-color: var(--red); }
.emoji-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #FFF7E8;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.emoji-editor-button {
  border: 1px solid rgba(166, 15, 15, 0.22);
  background: white;
  color: var(--red-dark);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.emoji-editor-button:hover { background: var(--gold); color: var(--dark); }
.emoji-editor-counter {
  font-size: 12px;
  color: var(--gray);
  font-weight: 700;
}
.emoji-editor-counter.is-warning { color: #9A6A00; }
.emoji-editor-counter.is-over { color: var(--red); }
.emoji-editor textarea,
.form-group .emoji-editor textarea {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 96px;
  resize: vertical;
}
.emoji-editor textarea:focus,
.form-group .emoji-editor textarea:focus { border-color: transparent; }
.emoji-editor-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 46px;
  z-index: 30;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(42, 16, 14, 0.18);
  overflow: hidden;
}
.emoji-editor-panel emoji-picker {
  width: 100%;
  height: 330px;
  --border-radius: 0;
}
.emoji-editor-loading,
.emoji-editor-note {
  padding: 12px;
  font-size: 12px;
  color: var(--gray);
}
.emoji-fallback-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  padding: 10px;
}
.emoji-fallback-btn {
  border: 0;
  background: #FFF7E8;
  border-radius: 8px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
}
.emoji-fallback-btn:hover { background: var(--gold); }
.emoji-editor-preview {
  min-height: 38px;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
  color: var(--dark);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.emoji-editor-preview.is-empty {
  color: var(--gray);
  font-style: italic;
}
.form-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--gray); }
.form-footer a { color: var(--red); font-weight: 500; }

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.upload-area:hover { border-color: var(--gold); background: #F4F1E6; }
.upload-area input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 14px; color: var(--gray); }
.upload-text small { font-size: 11px; color: #aaa; display: block; margin-top: 4px; }
.preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.preview-item { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; position: relative; background: #eee; }
.preview-item img, .preview-item video { width: 100%; height: 100%; object-fit: cover; }
.preview-item .del-btn {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: white;
  border: none; border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* Progress bar upload */
.progress-wrap { margin-top: 10px; }
.progress-bar {
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 4px;
  width: 0;
  transition: width .3s;
}
.progress-text { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* ============================================================
   PROFILO
   ============================================================ */
.profilo-header {
  background: linear-gradient(135deg, var(--red-dark), #4B0505);
  padding: 40px 20px;
  text-align: center;
  color: white;
}
.profilo-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 12px;
}
.profilo-nome { font-size: 26px; margin-bottom: 4px; }
.profilo-ruolo {
  display: inline-block;
  background: var(--gold);
  color: var(--dark);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 12px;
  border-radius: 12px;
}
.profilo-bio { font-size: 14px; color: rgba(255,255,255,0.75); margin-top: 10px; }
.profilo-stats { display: flex; gap: 24px; justify-content: center; margin-top: 16px; }
.profilo-stat .n { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.profilo-stat .l { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase; }

/* ============================================================
   ADMIN / DASHBOARD
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - var(--nav-h));
}
.admin-sidebar {
  background: var(--dark);
  padding: 20px 0;
}
.admin-sidebar-title {
  color: var(--gold-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 20px 12px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  transition: all .2s;
  position: relative;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.07); color: white; }
.admin-nav-link.active { background: var(--red); color: white; }
.admin-main { padding: 28px; background: var(--cream); }
.admin-title { font-size: 26px; margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .n { font-size: 32px; font-family: 'Playfair Display', serif; color: var(--red); display: block; }
.stat-card .l { font-size: 12px; color: var(--gray); margin-top: 2px; }
.card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card h3 { font-size: 17px; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; background: var(--gray-light); color: var(--gray); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.thumb-sm { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #eee; }
.pin-order-input { width: 58px; height: 31px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font-size: 12px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-admin    { background: #cce5ff; color: #004085; }
.badge-suspended{ background: #FCE8E6; color: #760909; }
.badge-pinned { background: var(--gold); color: var(--dark); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--dark);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 3000;
  transition: transform .3s, opacity .3s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============================================================
   PROGRAMMA FESTA
   ============================================================ */
.programma-page {
  background: var(--cream);
  min-height: calc(100vh - var(--nav-h));
}
.programma-hero {
  background:
    linear-gradient(135deg, rgba(118,9,9,0.96), rgba(166,15,15,0.92) 56%, rgba(42,16,14,0.96)),
    url('../img/programma/arriva-san-sisto-30-luglio-9-agosto.jpg') center/cover;
  color: white;
}
.programma-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 20px;
  min-height: 380px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 310px);
  gap: 28px;
  align-items: center;
}
.programma-kicker {
  display: inline-flex;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.programma-hero h1 {
  font-size: 48px;
  color: white;
  margin-bottom: 10px;
}
.programma-hero p {
  max-width: 650px;
  color: rgba(255,255,255,0.82);
  font-size: 17px;
  line-height: 1.7;
}
.programma-quick {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.programma-hero-poster {
  justify-self: end;
  border-radius: 8px;
  border: 2px solid rgba(255,233,163,0.75);
  background: rgba(255,255,255,0.08);
  padding: 8px;
  box-shadow: var(--shadow-lg);
}
.programma-hero-poster img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 6px;
}
.programma-section,
.programma-band {
  padding: 40px 20px;
}
.programma-band {
  background: #fffdf6;
  border-top: 1px solid rgba(166,15,15,0.12);
  border-bottom: 1px solid rgba(166,15,15,0.12);
}
.programma-section-head,
.programma-grid,
.programma-days,
.programma-posters {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.programma-section-head {
  margin-bottom: 22px;
}
.programma-section-head h2 {
  font-size: 30px;
  color: var(--red-dark);
  margin-bottom: 8px;
}
.programma-section-head p {
  max-width: 760px;
  color: var(--gray);
  font-size: 15px;
}
.programma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
.programma-evento {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  overflow: hidden;
  background: white;
  border: 1px solid rgba(166,15,15,0.13);
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(42,16,14,0.07);
}
.programma-evento-poster {
  grid-template-columns: 108px minmax(0, 1fr) 112px;
}
.programma-evento-img {
  display: block;
  height: 100%;
  min-height: 142px;
  background: #f3ead5;
}
.programma-evento-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.programma-evento-date {
  background: var(--red);
  color: white;
  padding: 14px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.programma-evento-body {
  padding: 14px;
}
.programma-ora {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(212,172,13,0.18);
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.programma-evento h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--dark);
  margin-bottom: 5px;
}
.programma-evento p,
.programma-day p {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.55;
}
.programma-days {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}
.programma-day {
  background: white;
  border: 1px solid rgba(42,16,14,0.1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(42,16,14,0.07);
}
.programma-day header {
  padding: 16px;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
}
.programma-day header span {
  display: block;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.programma-day header h3 {
  color: white;
  font-size: 20px;
  margin-top: 4px;
}
.programma-day-events {
  padding: 12px 16px 16px;
}
.programma-riga {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(42,16,14,0.08);
}
.programma-riga:last-child {
  border-bottom: 0;
}
.programma-riga time {
  color: var(--red-dark);
  font-weight: 900;
  font-size: 13px;
}
.programma-mini-link {
  display: inline-flex;
  margin-left: 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}
.programma-posters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.programma-poster {
  display: block;
  background: white;
  border: 1px solid rgba(42,16,14,0.1);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 3px 14px rgba(42,16,14,0.08);
  transition: transform .2s, box-shadow .2s;
}
.programma-poster:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.programma-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: #f3ead5;
}
.programma-poster span {
  display: block;
  color: var(--red-dark);
  font-weight: 900;
  font-size: 14px;
  margin-top: 10px;
}
.programma-poster small {
  display: block;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 3px;
}
.programma-image-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(24, 8, 6, 0.88);
}
.programma-image-modal.open {
  display: flex;
}
.programma-image-dialog {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: #160807;
  border: 1px solid rgba(255,233,163,0.35);
  box-shadow: var(--shadow-lg);
}
.programma-image-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--red-dark);
  color: white;
}
.programma-image-topbar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.programma-image-topbar button {
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 999px;
  background: var(--gold);
  color: var(--dark);
  font-weight: 900;
  padding: 8px 12px;
  flex-shrink: 0;
}
.programma-image-frame {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}
.programma-image-frame img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 115px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
  background: white;
}
.programma-admin-list {
  display: grid;
  gap: 14px;
}
.programma-admin-card {
  overflow: hidden;
}
.programma-admin-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.programma-admin-head strong {
  display: block;
  color: var(--dark);
  font-size: 15px;
}
.programma-admin-head span {
  display: block;
  color: var(--gray);
  font-size: 12px;
}
.programma-admin-grid {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
}
.programma-admin-preview {
  display: grid;
  align-content: start;
  gap: 8px;
}
.programma-admin-preview img,
.programma-admin-empty {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  background: #f3ead5;
}
.programma-admin-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--dark);
  padding: 28px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-nome { display: block; color: white; font-family: 'Playfair Display', serif; font-size: 15px; }
.footer-citta { display: block; color: var(--gold-light); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.6); font-size: 13px; transition: color .2s; }
.footer-links a:hover { color: white; }
.footer-copy { color: rgba(255,255,255,0.4); font-size: 12px; }

.admin-grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.table-input {
  width: 100%;
  min-width: 70px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
  font: inherit;
  color: var(--dark);
  background: white;
}
.switch-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray);
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 980px) {
  .admin-grid-two { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-public { display: none; }
  .nav-search { display: none; }
  .nav-actions { display: none; }
  .hamburger { display: flex; }

  .hero h1 { font-size: 24px; }
  .hero-stats { gap: 20px; }
  .hero-stat .n { font-size: 24px; }

  .lb-content { flex-direction: column; max-height: 96vh; border-radius: 16px 16px 0 0; position: fixed; bottom: 0; width: 100%; }
  .lb-media { min-height: 250px; max-height: 55vw; }
  .lb-info { width: 100%; padding: 16px; }
  .lb-next { right: 10px; }

  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  .form-row { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }

  .programma-hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 28px 16px;
  }
  .programma-hero h1 {
    font-size: 34px;
  }
  .programma-hero p {
    font-size: 15px;
  }
  .programma-hero-poster {
    justify-self: stretch;
    max-width: 320px;
  }
  .programma-section,
  .programma-band {
    padding: 30px 14px;
  }
  .programma-section-head h2 {
    font-size: 25px;
  }
  .programma-grid,
  .programma-days,
  .programma-posters {
    grid-template-columns: 1fr;
  }
  .programma-evento,
  .programma-evento-poster {
    grid-template-columns: 1fr;
  }
  .programma-evento-img {
    height: auto;
    max-height: 260px;
  }
  .programma-evento-date {
    padding: 10px 12px;
  }
  .programma-riga {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
  }
  .programma-image-modal {
    padding: 0;
  }
  .programma-image-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }
  .programma-image-frame {
    padding: 8px;
  }
  .programma-image-frame img {
    max-height: calc(100vh - 66px);
  }
  .programma-image-topbar button {
    padding: 7px 10px;
    font-size: 12px;
  }
  .programma-admin-grid {
    grid-template-columns: 1fr;
  }
  .programma-admin-preview {
    max-width: 220px;
  }
}
