/**
 * Card avvisi (alert) e novità (news) — portale client
 * Usato sia nella sezione completa di tickets.php che nella hero compatta di index.php.
 *
 * Palette scelta: Avvisi = arancio/rosso caldo  |  Novità = viola brand
 *   --notice-alert-start: #ff5722  --notice-alert-end: #ff9800
 *   --notice-news-start:  #7c5cff  --notice-news-end:  #a78bfa
 *
 * File: osta/css/client-portal-news-glass.css
 */

/* ── Token palette ──────────────────────────────────────────────────────────── */

body.client-side {
  --notice-alert-start: #ff5722;
  --notice-alert-end:   #ff9800;
  --notice-alert-bg:    rgba(255, 87, 34, 0.10);
  --notice-alert-border:rgba(255, 120, 60, 0.30);
  --notice-alert-glow:  rgba(255, 87, 34, 0.20);

  --notice-news-start:  #7c5cff;
  --notice-news-end:    #a78bfa;
  --notice-news-bg:     rgba(124, 92, 255, 0.10);
  --notice-news-border: rgba(167, 139, 250, 0.30);
  --notice-news-glow:   rgba(124, 92, 255, 0.20);
}

/* ── Wrapper a due colonne ──────────────────────────────────────────────────── */

.portal-tickets-news-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2.5rem 0 0;
  container-type: inline-size;
}

@media (max-width: 768px) {
  .portal-tickets-news-wrap {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ── Colonna ────────────────────────────────────────────────────────────────── */

.portal-tickets-news-col {
  border-radius: var(--portal-chrome-radius, 18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 22, 42, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s;
}

.portal-tickets-news-col--avvisi {
  border-color: var(--notice-alert-border);
  box-shadow:
    0 0 0 1px rgba(255, 87, 34, 0.08),
    0 8px 32px rgba(255, 87, 34, 0.10),
    inset 0 1px 0 rgba(255, 120, 60, 0.12);
}

.portal-tickets-news-col--novita {
  border-color: var(--notice-news-border);
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.08),
    0 8px 32px rgba(124, 92, 255, 0.10),
    inset 0 1px 0 rgba(167, 139, 250, 0.12);
}

/* ── Titolo sezione ────────────────────────────────────────────────────────── */

.portal-tickets-news-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.portal-tickets-news-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 1.15em;
  border-radius: 2px;
  flex-shrink: 0;
}

.portal-tickets-news-col--avvisi .portal-tickets-news-title::before {
  background: linear-gradient(180deg, var(--notice-alert-start) 0%, var(--notice-alert-end) 100%);
}

.portal-tickets-news-col--novita .portal-tickets-news-title::before {
  background: linear-gradient(180deg, var(--notice-news-start) 0%, var(--notice-news-end) 100%);
}

.portal-tickets-news-title__text {
  line-height: 1.2;
}

/* ── Lead ───────────────────────────────────────────────────────────────────── */

.portal-tickets-news-lead {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* ── Lista card ─────────────────────────────────────────────────────────────── */

.portal-tickets-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* ── Card ───────────────────────────────────────────────────────────────────── */

.portal-tickets-news-card {
  border-radius: calc(var(--portal-chrome-radius, 18px) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
}

.portal-tickets-news-col--avvisi .portal-tickets-news-card {
  background: var(--notice-alert-bg);
  border-color: var(--notice-alert-border);
}

.portal-tickets-news-col--avvisi .portal-tickets-news-card:hover {
  background: rgba(255, 87, 34, 0.15);
  border-color: rgba(255, 120, 60, 0.45);
  transform: translateY(-1px);
}

.portal-tickets-news-col--novita .portal-tickets-news-card {
  background: var(--notice-news-bg);
  border-color: var(--notice-news-border);
}

.portal-tickets-news-col--novita .portal-tickets-news-card:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: rgba(167, 139, 250, 0.45);
  transform: translateY(-1px);
}

.portal-tickets-news-card[data-mp-notice] {
  cursor: pointer;
}

.portal-tickets-news-card[data-mp-notice]:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 2px;
}

/* ── Card header ────────────────────────────────────────────────────────────── */

.portal-tickets-news-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

/* ── Badge tipo/priorità ────────────────────────────────────────────────────── */

.portal-tickets-news-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.portal-tickets-news-col--avvisi .portal-tickets-news-badge--type {
  background: rgba(255, 87, 34, 0.2);
  color: #ffb74d;
  border: 1px solid rgba(255, 87, 34, 0.35);
}

.portal-tickets-news-col--novita .portal-tickets-news-badge--type {
  background: rgba(124, 92, 255, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.portal-tickets-news-badge--priority-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.portal-tickets-news-badge--priority-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* ── Titolo e testo card ────────────────────────────────────────────────────── */

.portal-tickets-news-subtitle {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.45;
  color: #cbd5e1;
  margin: 0 0 0.45rem;
}

.portal-tickets-news-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 0 0 0.35rem;
  line-height: 1.35;
}

.portal-tickets-news-text {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
}

.portal-tickets-news-body p:last-child { margin-bottom: 0; }

/* ── Data ───────────────────────────────────────────────────────────────────── */

.portal-tickets-news-date {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.4rem;
  display: block;
}

/* ── CTA link ───────────────────────────────────────────────────────────────── */

.portal-tickets-news-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s;
}

.portal-tickets-news-cta::after { content: ' ↗'; font-size: 0.75em; }
.portal-tickets-news-cta:hover { opacity: 0.8; }

.portal-tickets-news-col--avvisi .portal-tickets-news-cta { color: #ffb74d; }
.portal-tickets-news-col--novita .portal-tickets-news-cta { color: #c4b5fd; }

/* ── Footer card (link scopri di più) ─────────────────────────────────────── */

.portal-tickets-news-card__footer {
  margin-top: 0.5rem;
}

/* ── Stato vuoto ────────────────────────────────────────────────────────────── */

.portal-tickets-news-empty {
  padding: 1rem;
  text-align: center;
}

.portal-tickets-news-empty__text {
  font-size: 0.83rem;
  color: #475569;
  font-style: italic;
}

/* ── Filtro ricerca (toolbar) — liquid glass: vassoio + campo stratificato ─── */

.portal-news-toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: calc(var(--portal-chrome-radius, 18px) - 2px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 42%, transparent 76%),
    rgba(6, 14, 32, 0.48);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 26px rgba(0, 6, 22, 0.38);
}

.portal-tickets-news-col--avvisi .portal-news-toolbar {
  border-color: rgba(255, 140, 100, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 170, 130, 0.1),
    0 8px 28px rgba(255, 72, 24, 0.16);
}

.portal-tickets-news-col--novita .portal-news-toolbar {
  border-color: rgba(167, 139, 250, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(200, 190, 255, 0.1),
    0 8px 28px rgba(92, 58, 220, 0.18);
}

.portal-news-search {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0 2.65rem 0 1.05rem;
  box-sizing: border-box;
  height: 42px;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(100, 130, 168, 0.55);
  color: #f8fafc;
  caret-color: var(--portal-chrome-accent, #a8dcff);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(0, 8, 20, 0.35);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(8, 16, 32, 0.78);
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 40%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 55%),
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24'%3E%3Cpath fill='%23a8dcff' fill-opacity='0.92' d='M9.5%2C3A6.5%2C6.5 0 0%2C1 16%2C9.5C16%2C11.11 15.41%2C12.59 14.44%2C13.73L14.71%2C14H15.5L20.5%2C19L19%2C20.5L14%2C15.5V14.71L13.73%2C14.44C12.59%2C15.41 11.11%2C16 9.5%2C16A6.5%2C6.5 0 0%2C1 3%2C9.5A6.5%2C6.5 0 0%2C1 9.5%2C3M9.5%2C5C7%2C5 5%2C7 5%2C9.5C5%2C12 7%2C14 9.5%2C14C12%2C14 14%2C12 14%2C9.5C14%2C7 12%2C5 9.5%2C5Z' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position:
    0 0,
    0 0,
    right 0.72rem center;
  background-size:
    auto,
    auto,
    1.1rem;
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32),
    0 2px 14px rgba(0, 10, 28, 0.42);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    transform 0.18s ease;
}

.portal-tickets-news-col--avvisi .portal-news-search {
  border-color: rgba(255, 149, 110, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 205, 180, 0.16),
    inset 0 -1px 0 rgba(100, 36, 14, 0.38),
    0 2px 16px rgba(255, 82, 40, 0.18);
}

.portal-tickets-news-col--novita .portal-news-search {
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(218, 208, 255, 0.14),
    inset 0 -1px 0 rgba(42, 24, 100, 0.38),
    0 2px 16px rgba(108, 72, 224, 0.2);
}

.portal-news-search::placeholder {
  color: rgba(203, 213, 225, 0.72);
  font-style: normal;
  font-weight: 400;
}

.portal-news-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 1.12rem;
  width: 1.12rem;
  margin-right: 0.2rem;
  cursor: pointer;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23cbd5e1' d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.88;
}

.portal-news-search::-webkit-search-cancel-button:hover {
  opacity: 1;
}

.portal-tickets-news-col--avvisi .portal-news-search:hover {
  border-color: rgba(255, 180, 130, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 190, 0.18),
    inset 0 -1px 0 rgba(120, 40, 12, 0.35),
    0 4px 20px rgba(255, 87, 34, 0.22);
}

.portal-tickets-news-col--novita .portal-news-search:hover {
  border-color: rgba(196, 181, 253, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(225, 218, 255, 0.16),
    inset 0 -1px 0 rgba(56, 32, 120, 0.36),
    0 4px 20px rgba(124, 92, 255, 0.24);
}

.portal-tickets-news-col--avvisi .portal-news-search:focus,
.portal-tickets-news-col--avvisi .portal-news-search:focus-visible {
  border-color: rgba(255, 175, 128, 0.82) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 228, 210, 0.18),
    inset 0 -1px 0 rgba(140, 48, 18, 0.32),
    0 4px 26px rgba(255, 100, 50, 0.3),
    0 0 0 3px rgba(255, 130, 72, 0.38) !important;
}

.portal-tickets-news-col--novita .portal-news-search:focus,
.portal-tickets-news-col--novita .portal-news-search:focus-visible {
  border-color: rgba(196, 181, 255, 0.88) !important;
  box-shadow:
    inset 0 1px 0 rgba(235, 230, 255, 0.16),
    inset 0 -1px 0 rgba(56, 32, 130, 0.38),
    0 4px 26px rgba(124, 92, 255, 0.32),
    0 0 0 3px rgba(139, 120, 255, 0.42) !important;
}

@media (max-width: 768px) {
  .portal-news-toolbar {
    padding: 0.5rem 0.6rem;
  }

  .portal-news-search {
    min-height: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 16px;
  }

  .portal-news-search::placeholder {
    font-size: 16px;
  }
}

/* ── Hero compatta (index.php) ─────────────────────────────────────────────── */

.mp-notices-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
  container-type: inline-size;
}

@media (max-width: 650px) {
  .mp-notices-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.mp-notices-hero__col {
  position: relative;
  isolation: isolate;
  contain: paint;
  border-radius: var(--portal-chrome-radius, 18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 22, 42, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  padding: 1.1rem 1.25rem;
  transition: border-color 0.2s;
}

.mp-notices-hero__col--alert {
  border-color: var(--notice-alert-border, rgba(255, 120, 60, 0.30));
  box-shadow: 0 4px 20px rgba(255, 87, 34, 0.08), inset 0 1px 0 rgba(255, 120, 60, 0.12);
}

.mp-notices-hero__col--news {
  border-color: var(--notice-news-border, rgba(167, 139, 250, 0.30));
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.08), inset 0 1px 0 rgba(167, 139, 250, 0.12);
}

.mp-notices-hero__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mp-notices-hero__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.mp-notices-hero__title-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mp-notices-hero__col--alert .mp-notices-hero__title-dot {
  background: linear-gradient(135deg, var(--notice-alert-start), var(--notice-alert-end));
}

.mp-notices-hero__col--news .mp-notices-hero__title-dot {
  background: linear-gradient(135deg, var(--notice-news-start), var(--notice-news-end));
}

.mp-notices-hero__count {
  font-size: 10px;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 100px;
}

.mp-notices-hero__col--alert .mp-notices-hero__count {
  background: rgba(255, 87, 34, 0.2);
  color: #ffb74d;
  border: 1px solid rgba(255, 87, 34, 0.35);
}

.mp-notices-hero__col--news .mp-notices-hero__count {
  background: rgba(124, 92, 255, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.mp-notices-hero__list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.mp-notices-hero__item {
  padding: 0;
  margin: 0;
}

.mp-notices-hero__item-btn {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s;
}

.mp-notices-hero__item-btn:hover,
.mp-notices-hero__item-btn:focus-visible {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  outline: none;
}

.mp-notices-hero__item-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.35);
}

.mp-notices-hero__empty {
  font-size: 0.78rem;
  color: #475569;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.mp-notices-hero__link {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.18s;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  margin: -0.35rem -0.5rem;
  box-sizing: border-box;
  border-radius: 10px;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.12);
}

.mp-notices-hero__link::after { content: ' →'; }
.mp-notices-hero__link:hover { opacity: 0.75; }
.mp-notices-hero__link:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.mp-notices-hero__col--alert .mp-notices-hero__link { color: #ffb74d; }
.mp-notices-hero__col--news  .mp-notices-hero__link { color: #c4b5fd; }
