/* ==========================================================================
   Archivio "Travel Experience" (taxonomy-cat_news-travel-experience.php)
   File AUTONOMO: non dipende da segreti.css. Prefisso "te-" per non collidere
   con custom.css ne' con segreti. Mobile-first: base = mobile.
   ========================================================================== */

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

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

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

/* ---------- Badge (continente / etichetta) ---------- */
.te-badge,
.te-badge:hover {
  display: inline-block;
  background: var(--te-red-soft);
  color: var(--te-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.te-btn {
  border: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.te-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;
}

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

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

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

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

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

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

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

.te-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;
}

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

.te-hero__media img {
  aspect-ratio: 5 / 3;
  ;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

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

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

/* Conduttore sotto il titolo, in rosso (equivalente di .st-hero__host in segreti) */
.te-hero__host {
  color: var(--te-red);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 12px;
}

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

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

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

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

/* ---------- Rubriche (continenti) ---------- */
.te-rubriche {
  margin-bottom: 16px;
}

.te-rubriche__head {
  margin-bottom: 12px;
}

.te-rubriche__label {
  display: none;
}

.te-rubriche__reset {
  display: none;
}

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

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

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

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

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

/* Pillole: una sola riga scrollabile in orizzontale, scrollbar nascosta.
   Su mobile nascoste (c'e' la select), compaiono da desktop.
   Il <nav> stesso e' il contenitore flex delle pillole (niente piu' __rows/__row). */
.te-rubriche__list {
  display: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

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

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

.te-select {
  flex: 1;
  width: 100%;
  height: 36px;
  border: 1px solid var(--te-border);
  border-radius: 999px;
  padding: 0 40px 0 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 34px;
  color: var(--te-text);
  background-color: #fff;
  cursor: pointer;
  -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;
}

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

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

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

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

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

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

.te-item {
  border: 1px solid var(--te-border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

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

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

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

.te-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;
}

.te-item__body {
  padding: 12px;
  display: flex;
  flex-direction: column;
}

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

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

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

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

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

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

.te-empty {
  color: var(--te-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. */
.te-pagination {
  margin-top: 32px;
}

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

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

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

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

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

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

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

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

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

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

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

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

  .te-hero__media {
    padding: 0;
  }

  .te-hero__media img {
    width: 100%;
    border-radius: 20px;
    /* Foto contenuta e coerente a prescindere dalla risoluzione del file caricato:
     * rapporto fisso 4:3 e ritaglio centrato invece dell'immagine a piena altezza. */
    aspect-ratio: 5 / 3;
    height: auto;
    object-fit: cover;
    object-position: center;
  }

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

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

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

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

  .te-content {
    padding: 32px;
  }

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

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

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

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

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

  /* Select nascosta, pillole visibili: il <nav> diventa un flex su UNA riga.
   * gap = distanza orizzontale tra le pillole (aumenta per distanziarle di piu'). */
  .te-rubriche__select-form {
    display: none;
  }

  .te-rubriche__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: max-content;
  }

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

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

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

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

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

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

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

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

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

  .te-item__body {
    padding: 0;
  }

  .te-item__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

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

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

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