/* ==========================================================================
   Ganimede Viaggi - Archive Viaggio Stylesheet
   Listings, taxonomy archives, and filter interface
   ========================================================================== */

/* --------------------------------------------------------------------------
   Archive Hero — .gv-archive-hero
   -------------------------------------------------------------------------- */

.gv-archive-hero {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(135deg, var(--c-blue-dark), var(--c-blue));
}

.gv-archive-hero__image {
  position: absolute;
  inset: 0;
  opacity: 0.2;
}

.gv-archive-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gv-archive-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(26, 82, 118, 0.9) 0%,
    rgba(26, 82, 118, 0.6) 50%,
    rgba(26, 82, 118, 0.3) 100%
  );
  z-index: 1;
}

.gv-archive-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px var(--section-px) 40px;
}

/* Breadcrumbs inside archive hero: dark variant */
.gv-archive-hero__content .gv-breadcrumbs {
  padding: 0 0 14px;
}

.gv-archive-hero__content .gv-breadcrumbs a {
  color: rgba(255, 255, 255, 0.6);
}

.gv-archive-hero__content .gv-breadcrumbs a:hover {
  color: #fff;
}

.gv-archive-hero__content .gv-breadcrumbs__item--current {
  color: #fff;
}

.gv-archive-hero__content .gv-breadcrumbs__item + .gv-breadcrumbs__item::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}

/* Category header (taxonomy archive) */
.gv-card-category-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.gv-card-category-header__title {
  font-family: var(--ff-heading);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 12px;
}

.gv-card-category-header__desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 10px;
}

.gv-card-category-header__count {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-orange-light);
}

.gv-archive-hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.gv-archive-hero__tag-bar {
  width: 28px;
  height: 3px;
  border-radius: 4px;
  background: var(--c-orange);
  flex-shrink: 0;
}

.gv-archive-hero__tag-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-orange-light);
}

.gv-archive-hero__title {
  font-family: var(--ff-heading);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.gv-archive-hero__desc {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  max-width: 560px;
  margin-bottom: 0;
}

.gv-archive-hero__count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.gv-archive-hero__count-number {
  color: var(--c-orange-light);
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Filter Bar — .gv-filter-bar
   -------------------------------------------------------------------------- */

.gv-filter-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  padding: 0 var(--section-px);
  transition: top 0.5s var(--ease-out-expo);
}

.admin-bar .gv-filter-bar {
  top: calc(var(--nav-height) + 32px);
}

.gv-filter-bar--scrolled {
  top: var(--nav-height-scrolled);
}

.admin-bar .gv-filter-bar--scrolled {
  top: calc(var(--nav-height-scrolled) + 32px);
}

.gv-filter-bar__inner {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 1320px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Filter Group — .gv-filter-group
   -------------------------------------------------------------------------- */

.gv-filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 24px;
  border-right: 1px solid var(--c-border);
  min-width: 0;
}

.gv-filter-group:last-child {
  border-right: none;
}

.gv-filter-group__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-orange);
  flex-shrink: 0;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Filter Pills — .gv-filter-pills
   -------------------------------------------------------------------------- */

.gv-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.gv-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  background: var(--c-bg);
  font-family: var(--ff-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.3;
}

.gv-filter-pill:hover {
  border-color: var(--c-blue-light);
  color: var(--c-blue);
  background: rgba(var(--c-blue-rgb), 0.06);
}

.gv-filter-pill.is-active,
.gv-filter-pill--active {
  background: linear-gradient(135deg, var(--c-blue), var(--c-blue-light));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(var(--c-blue-rgb), 0.25);
}

.gv-filter-pill.is-active:hover,
.gv-filter-pill--active:hover {
  background: linear-gradient(135deg, var(--c-blue-light), var(--c-blue));
  color: #fff;
}

.gv-filter-pill__count {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.6;
}

.gv-filter-pill.is-active .gv-filter-pill__count {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Filter Select — .gv-filter-select
   -------------------------------------------------------------------------- */

/* When used directly on a <select> element */
select.gv-filter-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7B8D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 12px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  transition: all var(--t-fast);
  outline: none;
  min-width: 180px;
  max-width: 100%;
}

select.gv-filter-select:hover {
  border-color: var(--c-blue);
  background-color: var(--c-surface);
}

select.gv-filter-select:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(var(--c-blue-rgb), 0.1);
  background-color: var(--c-surface);
}

/* Wrapper div variant */
div.gv-filter-select {
  position: relative;
  display: inline-block;
}

div.gv-filter-select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 36px 8px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-bg);
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-ink);
  cursor: pointer;
  transition: all var(--t-fast);
  outline: none;
  min-width: 180px;
}

div.gv-filter-select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7B8D' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

div.gv-filter-select select:hover {
  border-color: var(--c-blue);
}

div.gv-filter-select select:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(var(--c-blue-rgb), 0.1);
}

/* --------------------------------------------------------------------------
   View Toggle
   -------------------------------------------------------------------------- */

.gv-view-toggle {
  display: flex;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.gv-view-toggle__btn {
  width: 38px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface);
  color: var(--c-muted);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 14px;
}

.gv-view-toggle__btn + .gv-view-toggle__btn {
  border-left: 1px solid var(--c-border);
}

.gv-view-toggle__btn:hover {
  color: var(--c-blue);
}

.gv-view-toggle__btn.is-active {
  background: var(--c-bg);
  color: var(--c-ink);
}

/* --------------------------------------------------------------------------
   Sort Select
   -------------------------------------------------------------------------- */

.gv-sort-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gv-sort-select__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Archive Grid — .gv-archive-grid
   -------------------------------------------------------------------------- */

.gv-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: clamp(32px, 4vh, 56px) var(--section-px);
}

/* List view alternative */
.gv-archive-grid--list {
  grid-template-columns: 1fr;
  gap: 16px;
}

.gv-archive-grid--list .gv-card-tour {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.gv-archive-grid--list .gv-card-tour__image {
  aspect-ratio: auto;
  height: 100%;
}

.gv-archive-grid--list .gv-card-tour__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 28px;
}

/* Loading state */
.gv-archive-grid--loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity var(--t-fast);
}

/* Empty state */
.gv-archive-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
}

.gv-archive-empty__icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.3;
}

.gv-archive-empty__title {
  font-family: var(--ff-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 8px;
}

.gv-archive-empty__desc {
  font-size: 15px;
  color: var(--c-muted);
  max-width: 400px;
  margin: 0 auto 24px;
}

/* --------------------------------------------------------------------------
   Pagination — .gv-pagination
   -------------------------------------------------------------------------- */

.gv-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 20px var(--section-px) clamp(48px, 6vh, 80px);
}

.gv-pagination a,
.gv-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: none;
  transition: all var(--t-fast);
}

.gv-pagination a:hover {
  border-color: var(--c-blue);
  color: var(--c-blue);
  background: rgba(var(--c-blue-rgb), 0.04);
}

/* Current page */
.gv-pagination .current,
.gv-pagination span.current {
  background: var(--c-orange);
  border-color: var(--c-orange);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--c-orange-rgb), 0.25);
}

/* Prev/Next arrows */
.gv-pagination .prev,
.gv-pagination .next {
  font-weight: 700;
}

/* Dots separator */
.gv-pagination .dots {
  border: none;
  background: none;
  color: var(--c-muted);
  min-width: auto;
  padding: 0 4px;
}

/* --------------------------------------------------------------------------
   Rete Viaggi Widget — .gv-reteviaggi-widget
   -------------------------------------------------------------------------- */

.gv-reteviaggi-widget {
  padding: var(--section-py) var(--section-px);
  background: var(--c-sand);
  border-top: 1px solid var(--c-border);
}

.gv-reteviaggi-widget__inner {
  max-width: 1200px;
  margin: 0 auto;
}

.gv-reteviaggi-widget__header {
  margin-bottom: 32px;
}

.gv-reteviaggi-widget__embed {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 400px;
}

.gv-reteviaggi-widget__embed iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* --------------------------------------------------------------------------
   Active Filters Summary
   -------------------------------------------------------------------------- */

.gv-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px var(--section-px);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.gv-active-filters__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  flex-shrink: 0;
}

.gv-active-filters__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(var(--c-blue-rgb), 0.08);
  color: var(--c-blue);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.gv-active-filters__tag-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(var(--c-blue-rgb), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  color: var(--c-blue);
  line-height: 1;
}

.gv-active-filters__tag-remove:hover {
  background: var(--c-blue);
  color: #fff;
}

.gv-active-filters__clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--t-fast);
  background: none;
  border: none;
  margin-left: auto;
}

.gv-active-filters__clear:hover {
  color: var(--c-orange);
}

/* --------------------------------------------------------------------------
   Loading Spinner
   -------------------------------------------------------------------------- */

@keyframes gv-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gv-spinner {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.gv-spinner__circle {
  width: 36px;
  height: 36px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-orange);
  border-radius: 50%;
  animation: gv-spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Responsive — Mobile
   -------------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
  .gv-archive-hero {
    min-height: 240px;
  }

  .gv-archive-hero__content {
    padding: 32px 20px;
  }

  .gv-archive-hero__title {
    font-size: clamp(28px, 7vw, 40px);
  }

  .gv-archive-hero__desc {
    font-size: 14px;
    max-width: none;
  }

  .gv-filter-bar {
    padding: 0 16px;
  }

  .gv-filter-bar__inner {
    flex-direction: column;
  }

  .gv-filter-group {
    padding: 14px 0;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
  }

  .gv-filter-group:last-child {
    border-bottom: none;
  }

  .gv-filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .gv-filter-pills::-webkit-scrollbar {
    display: none;
  }

  .gv-filter-pill {
    padding: 5px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  select.gv-filter-select {
    width: 100%;
  }

  .gv-archive-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .gv-archive-grid--list .gv-card-tour {
    grid-template-columns: 1fr;
  }

  .gv-pagination {
    gap: 4px;
    padding: 20px 20px 40px;
  }

  .gv-pagination a,
  .gv-pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .gv-reteviaggi-widget {
    padding: 40px 20px;
  }

  .gv-active-filters {
    padding: 10px 16px;
  }

  .gv-view-toggle {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Tablet
   -------------------------------------------------------------------------- */

@media screen and (min-width: 769px) and (max-width: 1024px) {
  .gv-archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .gv-archive-grid--list .gv-card-tour {
    grid-template-columns: 220px 1fr;
  }
}

/* --------------------------------------------------------------------------
   Responsive — Desktop Large
   -------------------------------------------------------------------------- */

@media screen and (min-width: 1440px) {
  .gv-archive-grid {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
  .gv-filter-bar,
  .gv-active-filters,
  .gv-pagination,
  .gv-reteviaggi-widget {
    display: none;
  }

  .gv-archive-hero {
    min-height: auto;
    background: none;
  }

  .gv-archive-hero__title {
    color: #000;
  }

  .gv-archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
