/* ==========================================================================
   Archivio "Segreti in Tavola" (archive-segreti.php)
   Prefisso "st-" per non collidere con custom.css. Mobile-first: base = mobile.
   ========================================================================== */

.st-page {
  --st-red: #c0143c;
  --st-red-dark: #9e0f31;
  --st-red-soft: #fbe9ed;
  --st-text: #2b2b2b;
  --st-muted: #6f6f6f;
  --st-border: #ececec;
  --st-bg: #f4f3f0;
  --st-radius: 16px;

  background: var(--st-bg);
  padding: 16px 0 32px;
  color: var(--st-text);
}

/* ---------- Card generica ---------- */
.st-card {
  background: #fff;
  border-radius: var(--st-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  margin-bottom: 16px;
  overflow: hidden;
}

/* ---------- Badge (rubrica / etichetta) ---------- */
.st-badge,
.st-badge:hover {
  display: inline-block;
  background: var(--st-red-soft);
  color: var(--st-red);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- Bottoni ---------- */
#btnGoToPage.st-btn {
  border: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}

.st-btn:hover,
.st-btn:focus {
  text-decoration: none;
}

.st-btn:focus-visible {
  outline: 2px solid var(--st-red);
  outline-offset: 3px;
}

.st-btn--primary {
  background: var(--st-red);
  color: #fff;
}

.st-btn--primary:hover,
.st-btn--primary:focus {
  background: var(--st-red-dark);
  color: #fff;
}

.st-btn--outline {
  background: #fff;
  color: var(--st-red);
  border: 2px solid var(--st-red);
}

.st-btn--outline:hover,
.st-btn--outline:focus {
  background: var(--st-red);
  color: #fff;
}

/* Icona play in un cerchio */
.st-btn__icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.st-btn__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 3px 0 3px 5px;
  border-color: transparent transparent transparent currentColor;
}

/* Freccia "v" del bottone Guarda tutti */
.st-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

/* ==========================================================================
   1. HERO
   ========================================================================== */
.st-hero__media {
  padding: 16px 16px 0;
}

.st-hero__media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.st-hero__body {
  padding: 16px;
  text-align: center;
}

.st-hero__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 4px;
  color: var(--st-text);
}

.st-hero__host {
  color: var(--st-red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 12px;
}

.st-hero__desc {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--st-muted);
  margin-bottom: 16px;
}

.st-hero__desc p:last-child {
  margin-bottom: 0;
}

.st-hero .st-btn {
  width: 100%;
}

/* ==========================================================================
   2. CONTENUTI
   ========================================================================== */
.st-content {
  padding: 16px;
}

/* ---------- Rubriche ---------- */
.st-rubriche {
  margin-bottom: 16px;
}

/* Su mobile: solo ricerca e select; etichetta e reset compaiono da desktop */
.st-rubriche__head {
  margin-bottom: 12px;
}

.st-rubriche__label {
  display: none;
}

.st-rubriche__reset {
  display: none;
}

/* ---------- Ricerca ---------- */
.st-search {
  position: relative;
  width: 100%;
}

.st-search__input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  padding: 0 40px 0 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--st-text);
  background: #fff;
  -webkit-appearance: none;
}

.st-search__input:focus {
  outline: none;
  border-color: var(--st-red);
  box-shadow: 0 0 0 3px var(--st-red-soft);
}

.st-search__btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--st-red);
  cursor: pointer;
}

.st-search__reset {
  display: inline-block;
  margin: -8px 0 16px;
  font-size: 12px;
  color: var(--st-red);
}

/* Pillole: le 2 righe scorrono insieme in orizzontale, scrollbar nascosta.
   Su mobile sono nascoste (c'è la select), compaiono da desktop. */
.st-rubriche__list {
  display: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.st-rubriche__list::-webkit-scrollbar {
  display: none;
}

.st-rubriche__rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: max-content;
}

.st-rubriche__row {
  display: flex;
  gap: 2px;
}

/* ---------- Select rubriche (solo mobile) ---------- */
.st-rubriche__select-form {
  display: flex;
  gap: 8px;
}

/* Stesso aspetto di .st-search__input: se cambi uno, aggiorna anche l'altro */
.st-select {
  flex: 1;
  width: 100%;
  height: 36px;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  padding: 0 40px 0 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 34px;
  color: var(--st-text);
  background-color: #fff;
  cursor: pointer;
  /* Freccia nativa sostituita da una SVG rossa */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c0143c' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.st-select:focus {
  outline: none;
  border-color: var(--st-red);
  box-shadow: 0 0 0 3px var(--st-red-soft);
}

.st-pill {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--st-muted);
  background: #fff;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}

.st-pill:hover,
.st-pill:focus {
  color: var(--st-red);
  border-color: var(--st-red);
  text-decoration: none;
}

.st-pill.is-active {
  background: var(--st-red);
  border-color: var(--st-red);
  color: #fff;
}

.st-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--st-text);
  margin: 0 0 16px;
}

/* ---------- Lista news ---------- */
.st-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Su mobile ogni news è una card separata */
.st-item {
  border: 1px solid var(--st-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.st-item__media {
  position: relative;
  display: block;
  background: #eee;
}

.st-item__media img {
  display: block;
  width: 100%;
  object-fit: cover;
}

/* Play centrato sull'immagine (decorativo) */
.st-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  background: var(--st-red);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

.st-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
}

/* Colonna flex: permette di spingere lo sponsor in fondo */
.st-item__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.st-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.st-item__date {
  font-size: 14px;
  color: var(--st-muted);
  font-weight: 500;
}

.st-item__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
}

.st-item__title a {
  color: var(--st-red);
  text-decoration: none;
}

.st-item__title a:hover,
.st-item__title a:focus {
  text-decoration: underline;
}

.st-item__excerpt {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--st-muted);
  margin: 0;
  /* Max 2 righe con "..." */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Sponsor: in basso a destra della riga ---------- */
.st-sponsor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  /* in fondo al body... */
  align-self: flex-end;
  /* ...e a destra */
  padding-top: 12px;
}

.st-sponsor__label {
  font-size: 9px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--st-muted);
}

.st-sponsor__link {
  display: inline-flex;
}

.st-sponsor__link:focus-visible {
  outline: 2px solid var(--st-red);
  outline-offset: 2px;
}

.st-sponsor img {
  display: block;
  /* Limiti su entrambi i lati: i loghi hanno proporzioni molto diverse */
  max-height: 28px;
  max-width: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.st-empty {
  color: var(--st-muted);
  font-weight: 400;
}

/* ---------- Paginatore ----------
   Bottoni stilizzati dalle classi del tema (.nav-next/.nav-previous/.nav-disabled
   in custom.css e device.css), come in taxonomy-cat_news.php. */
.st-pagination {
  margin-top: 32px;
}

.st-pagination__count {
  padding: 0 8px;
  font-weight: 700;
  color: var(--st-text);
  white-space: nowrap;
}

.st-pagination .nav-next,
.st-pagination .nav-previous {
  font-size: 12px;
  text-decoration: none;
  padding: 10px;
}

.st-pagination .nav-next:focus-visible,
.st-pagination .nav-previous:focus-visible {
  outline: 2px solid var(--st-red);
  outline-offset: 3px;
}

.st-pagination .nav-disabled {
  padding: 10px;
  font-size: 12px;
  cursor: default;
}

/* Aggiornamento AJAX in corso */
.st-results {
  transition: opacity .2s;
}

.st-results.is-loading,
.st-rubriche__list.is-loading {
  opacity: .5;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .st-results {
    transition: none;
  }
}

/* "Guarda tutti" (disattivato nel template, conservato) */
.st-more {
  text-align: center;
  margin-top: 24px;
}

/* ==========================================================================
   DESKTOP (>= 768px, breakpoint "md" di Bootstrap)
   ========================================================================== */
@media (min-width: 768px) {
  .st-pagination .nav-disabled {
    font-size: 16px;
  }

  .st-pagination .nav-next,
  .st-pagination .nav-previous {
    font-size: 16px;
    text-decoration: none;
  }

  .st-page {
    padding: 32px 0 48px;
  }

  .st-card {
    margin-bottom: 24px;
  }

  /* Hero: immagine a sinistra, testo a destra (allineato a sinistra) */
  .st-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 32px;
    padding: 32px;
  }

  .st-hero__media {
    padding: 0;
  }

  .st-hero__media img {
    width: 100%;
    border-radius: 20px;
  }

  .st-hero__body {
    padding: 0;
    text-align: left;
  }

  .st-hero__title {
    font-size: 34px;
  }

  .st-hero__host {
    font-size: 14px;
  }

  .st-hero .st-btn {
    width: auto;
  }

  .st-content {
    padding: 32px;
  }

  .st-rubriche__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
  }

  .st-rubriche__label-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .st-rubriche__reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--st-muted);
    text-decoration: none;
    white-space: nowrap;
  }

  .st-rubriche__reset:hover,
  .st-rubriche__reset:focus {
    color: var(--st-red);
    text-decoration: underline;
  }

  .st-rubriche__label {
    display: inline;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--st-red);
  }

  /* Select nascosta, pillole visibili */
  .st-rubriche__select-form {
    display: none;
  }

  .st-rubriche__list {
    display: block;
  }

  .st-search {
    max-width: 320px;
  }

  .st-section-title {
    font-size: 24px;
    margin: 24px 0;
  }

  /* Lista: righe con immagine a sinistra e separatore */
  .st-list {
    gap: 0;
  }

  .st-item {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 24px;
    border: 0;
    border-radius: 0;
    padding: 24px 0;
    border-bottom: 1px solid var(--st-border);
  }

  .st-item:first-child {
    padding-top: 0;
  }

  .st-item:last-child {
    border-bottom: 0;
  }

  .st-item__media {
    border-radius: 8px;
    overflow: hidden;
  }

  .st-item__media img {
    aspect-ratio: 16 / 9;
  }

  .st-play {
    width: 44px;
    height: 44px;
  }

  .st-item__body {
    padding: 0;
  }

  /* Badge e data uno sotto l'altro */
  .st-item__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .st-item__date {
    font-weight: 700;
    color: var(--st-text);
  }

  .st-item__title {
    font-size: 18px;
  }

  .st-item__excerpt {
    font-size: 13px;
  }
}
