/* =============================================
   Wow Gallery — Frontend Styles
   ============================================= */

/* ── Category badge pills ── */
.wg-cat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 0;
}

.wg-cat-badge {
  display: inline-block;
  background: none;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 400;
  font-family: "Inter", inherit, sans-serif;
  text-decoration: none;
  border-radius: 0;
  transition:
    background 0.15s,
    transform 0.1s;
  line-height: 1.6;
}

.wg-cat-badge:hover {
  background: none;
  color: var(--text-color);
  text-decoration: underline;
  /* border-bottom: 1px solid rgba(75, 44, 32, 1); */
}

/* ── Taxonomy archive header ── */
.wg-archive-header {
  margin: 32px 0 24px;
  padding-bottom: 16px;
  /* border-bottom: 2px solid #e2e8f0; */
}

.wg-archive-title {
  font-size: 2.5rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-color);
  margin: 0 0 8px;
}

.wg-archive-desc {
  color: #50575e;
  font-size: 15px;
  margin: 0;
}

.wg-archive-children {
  margin-top: 16px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
}

.wg-archive-children a {
  color: var(--text-color);
  border: 1px solid rgba(75, 44, 32, 0.5);
  padding: 4px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 400;
  transition: background 0.25s;
}

.wg-archive-children a:hover {
  background: rgba(75, 44, 32, 0.05);
}

/* ── Gallery archive card grid ── */
.wg-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.wg-archive-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.wg-archive-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  transform: translateY(-3px);
}

.wg-archive-card__thumb {
  display: block;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #f0f6fc;
}

.wg-archive-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.3s;
}

.wg-archive-card:hover .wg-archive-card__thumb img {
  transform: scale(1.04);
}

.wg-archive-card__no-thumb {
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

.wg-archive-card__body {
  padding: 12px 14px 14px;
}

.wg-archive-card__title {
  font-size: 24px;
  color: var(--text-color);
  font-style: italic;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.2;
}

.wg-archive-card__title a {
  color: #1d2327;
  text-decoration: none;
}

.wg-archive-card__title a:hover {
  color: var(--primary-color-hover);
}

/* ── Empty / no-results state ── */
.wg-no-results {
  color: #787c82;
  font-style: italic;
  margin: 24px 0;
}

/* ==============================================
   SINGLE GALLERY ITEM — ECOMMERCE SHOWCASE
   ============================================== */

.wg-single {
  margin: 32px 0 48px;
}

/* Two-column showcase layout */
.wg-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 800px) {
  .wg-showcase {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ── Media column ── */
.wg-showcase__media {
  /* position: sticky; */
  top: 24px;
  min-width: 0;
}

/* ── Primary viewer ── */
.wg-primary-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  user-select: none;
  /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22); */
}

/* ── Primary viewer owl-nav arrows ── */
.wg-primary-viewer .owl-nav {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.wg-primary-viewer .owl-nav button.owl-prev,
.wg-primary-viewer .owl-nav button.owl-next {
  pointer-events: all;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1d24;
  border: 1px solid rgba(75, 44, 32, 0.3) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 10px;
  transition:
    background 0.2s,
    color 0.2s;
}

.wg-primary-viewer .owl-nav button.owl-prev:hover,
.wg-primary-viewer .owl-nav button.owl-next:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--primary-color);
}

.wg-primary-viewer .owl-nav button.owl-prev.disabled,
.wg-primary-viewer .owl-nav button.owl-next.disabled {
  opacity: 0;
  pointer-events: none;
}

.wg-primary-canvas.wg-animating {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wg-primary-canvas img {
  max-width: 100%;
  object-fit: cover;
  object-position: top;
  width: auto;
  height: auto;
  display: block;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.25s ease;
  border-radius: 4px;
}

.wg-primary-canvas img.wg-img-loading {
  opacity: 0;
}

/* Placeholder when no images */
.wg-primary-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #6b7280;
  font-size: 15px;
}

/* ── Thumbnail strip (Owl Carousel) ── */
.wg-thumb-owl {
  margin-top: 14px;
  position: relative;
}

/* Fallback for before Owl initializes, or if it fails */
.wg-thumb-owl:not(.owl-loaded) {
  display: flex;
  gap: 10px;
  overflow: hidden; /* Only show the first 4 items */
}

.wg-thumb-owl:not(.owl-loaded) .wg-thumb-owl__item {
  /* 1/4th of the container, minus the gap offset */
  flex: 0 0 calc(25% - 7.5px);
  width: calc(25% - 7.5px);
}

/* Style the Owl Carousel next/prev arrows */
.wg-thumb-owl .owl-nav {
  margin: 0;
  position: static; /* Let arrows flow outside if needed */
}

.wg-thumb-owl .owl-nav button.owl-prev,
.wg-thumb-owl .owl-nav button.owl-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: #1a1d24;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  padding: 0 !important; /* Override owl default */
}

.wg-thumb-owl .owl-nav button.owl-prev:hover,
.wg-thumb-owl .owl-nav button.owl-next:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.wg-thumb-owl .owl-nav button.owl-prev {
  left: -16px;
}

.wg-thumb-owl .owl-nav button.owl-next {
  right: -16px;
}

/* Thumbnail items */
.wg-thumb-owl__item {
  padding: 4px; /* Give room for box-shadow */
}

.wg-thumb {
  width: 100%;
  aspect-ratio: 1 / 1; /* Keep square thumbnails */
  border: 1px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  background: white;
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
  display: block; /* Make the button fill the owl item */
}

.wg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  pointer-events: none;
}

.wg-thumb:hover {
  /* border-color: #4f8ef7; */
  transform: translateY(-2px);
  /* box-shadow: 0 4px 12px rgba(79, 142, 247, 0.3); */
}

/* .wg-thumb--active {
  border-color: #2271b1;
  box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.35);
} */

/* ── Info column ── */
.wg-showcase__info {
  padding-top: 6px;
}

.wg-single__header {
  margin-bottom: 16px;
}

.wg-single__title {
  font-size: 42px;
  font-weight: 500;
  font-style: italic;
  color: #1d2327;
  margin: 0 0 10px;
  line-height: 1.25;
}

.wg-single__description {
  color: #50575e;
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 24px;
}

.wg-showcase__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.wg-img-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0f6fc;
  border: 1px solid #c5d0dd;
  color: #2271b1;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
}

/* ── Legacy grid (used on archive / non-showcase single) ── */
.wg-single__gallery {
  margin-top: 32px;
}

.wow-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.wow-gallery-item {
  border-radius: 8px;
  overflow: hidden;
  background: #f0f6fc;
  aspect-ratio: 4 / 3;
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}

.wow-gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.wow-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =============================================
   Testimonials Shortcode Styles
   ============================================= */

/* ── Testimonials container ── */
.wg-testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

/* ── Individual testimonial card ── */
.wg-testimonial-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}

.wg-testimonial-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* ── Header with avatar and meta ── */
.wg-testimonial-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

/* ── Avatar styling ── */
.wg-testimonial-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  position: relative;
}

/* Show initial letter when no image */
.wg-testimonial-avatar:not(:has(img))::before {
  content: attr(data-initial);
}

.wg-testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Meta information ── */
.wg-testimonial-meta {
  flex: 1;
  min-width: 0;
}

.wg-testimonial-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.3;
}

/* ── Star rating ── */
.wg-testimonial-stars {
  display: flex;
  gap: 3px;
  font-size: 18px;
  line-height: 1;
}

.wg-star {
  color: #ddd;
  transition: color 0.15s;
}

.wg-star-filled {
  color: #fbbf24;
}

.wg-star-empty {
  color: #e2e8f0;
}

/* ── Testimonial message ── */
.wg-testimonial-message {
  color: #50575e;
  font-size: 15px;
  line-height: 1.6;
}

.wg-testimonial-message p {
  margin: 0 0 12px;
}

.wg-testimonial-message p:last-child {
  margin-bottom: 0;
}

/* ── Empty state ── */
.wg-no-testimonials {
  text-align: center;
  padding: 48px 24px;
  color: #8c8f94;
  font-size: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #ddd;
}

/* ── Responsive adjustments ── */
@media (max-width: 768px) {
  .wg-testimonials {
    grid-template-columns: 1fr;
  }

  .wg-testimonial-item {
    padding: 20px;
  }

  .wg-testimonial-avatar {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .wg-testimonial-name {
    font-size: 16px;
  }

  .wg-testimonial-stars {
    font-size: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .wg-testimonials {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ==============================================
   SELECT2 — Custom theme overrides
   ============================================== */

/* Trigger button */
.select2-container--default .select2-selection--single {
  height: 40px;
  border: 1.5px solid rgba(75, 44, 32, 0.3);
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: normal;
  padding: 0 30px 0 12px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 38px;
  right: 8px;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus
  .select2-selection--single {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(75, 44, 32, 0.1);
  outline: none;
}

/* Dropdown panel */
.select2-dropdown {
  border: 1.5px solid rgba(75, 44, 32, 0.25);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(75, 44, 32, 0.12);
  font-family: inherit;
  font-size: 0.9rem;
}

/* Search box inside dropdown */
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1.5px solid rgba(75, 44, 32, 0.25);
  border-radius: 4px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.select2-container--default
  .select2-search--dropdown
  .select2-search__field:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(75, 44, 32, 0.1);
}

/* Option items */
.select2-container--default .select2-results__option {
  padding: 8px 12px;
  color: var(--text-color);
}

/* Highlighted (hover / keyboard focus) option */
.select2-container--default
  .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--primary-color);
  color: #fff;
}

/* Currently selected option in list */
.select2-container--default .select2-results__option--selected {
  background-color: rgba(75, 44, 32, 0.08);
  color: var(--text-color);
  font-weight: 600;
}

@media (max-width: 600px) {
  .select2-container {
    width: 100% !important;
  }
}

/* ==============================================
   SEARCH PAGE
   ============================================== */

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

.wg-search-page__head {
  margin-bottom: 24px;
}

.wg-search-page__title {
  font-size: 2rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-color);
  margin: 0;
  line-height: 1.25;
}

.wg-search-page__title em {
  font-style: italic;
  color: var(--ornament-color);
}

/* Controls row: search input + category select */
.wg-search-page__controls {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.wg-sp-input-wrapper {
  flex: 1 1 auto;
}

.wg-sp-cat-wrap {
  flex: 0 0 auto;
}

.wg-sp-cat-select {
  height: 42px;
  padding: 0 36px 0 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-color);
  background: #fff
    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' stroke='%234b2c20' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  border: 1px solid var(--primary-color);
  border-radius: 4px 0 0 4px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.wg-sp-cat-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(75, 44, 32, 0.1);
}

/* Autocomplete text-only suggestion list (search page) */
.wg-sp-ac-results {
  border-radius: 8px;
}

.wg-sp-ac-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.wg-sp-ac-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.15s;
}

.wg-sp-ac-item:hover,
.wg-sp-ac-item:focus {
  background: rgba(75, 44, 32, 0.06);
  outline: none;
}

/* Result count / empty state info line */
.wg-search-page__info {
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin: 0 0 16px;
  min-height: 1.2em;
}

/* Grid container: reuse existing wg-archive-grid */
.wg-search-page__grid .wg-archive-grid {
  margin-bottom: 0;
}

/* Excerpt line below title in result cards */
.wg-archive-card__excerpt {
  font-size: 13px;
  color: var(--secondary-color);
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Loading / prompt placeholder states */
.wg-sp-loading,
.wg-sp-prompt {
  color: var(--secondary-color);
  font-size: 0.9rem;
  font-style: italic;
  padding: 24px 0;
  margin: 0;
}

@media (max-width: 600px) {
  .wg-search-page__controls {
    flex-direction: column;
  }

  .wg-sp-input-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .wg-sp-cat-select {
    width: 100%;
    border-radius: 4px 4px 0 0;
  }

  .wg-sp-cat-wrap {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ==============================================
   RELATED GALLERY ITEMS
   ============================================== */

.wg-related-posts {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid #e2e8f0;
  margin-bottom: 48px;
}

.wg-related-posts__title {
  font-size: 1.75rem;
  font-weight: 500;
  font-style: italic;
  color: var(--text-color);
  margin: 0 0 24px;
}
