/* Base tokens */
.rev-wrap,
.rev-grid-wrap {
  --rev-bg: #ffffff;
  --rev-text: #000000;
  --rev-font: Georgia, "Times New Roman", Times, serif;
  --rev-title-size: 18px;
  --rev-text-size: 14px;
  --rev-gap: 8px;
  --rev-radius: 12px;
  --rev-shadow: 0 8px 24px rgba(0,0,0,0.08);
  --rev-border: 1px solid rgba(0,0,0,0.20);
  --rev-accent: #1d4692;
  --rev-perview: 4;

  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* SLIDER */
.rev-viewport { overflow: hidden; outline: none; padding: 0; }
.rev-track {
  display: flex;
  gap: var(--rev-gap);
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 0 0 2px;
}
.rev-card {
  box-sizing: border-box;
  flex: 0 0 calc((100% - (var(--rev-gap) * (var(--rev-perview) - 1))) / var(--rev-perview));
  width: calc((100% - (var(--rev-gap) * (var(--rev-perview) - 1))) / var(--rev-perview));
  scroll-snap-align: start;
  background: var(--rev-bg);
  color: var(--rev-text);
  border-radius: var(--rev-radius);
  box-shadow: var(--rev-shadow);
  border: var(--rev-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rev-img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.rev-body { padding: 14px; font-family: var(--rev-font); }
.rev-title { margin: 0 0 8px 0; font-size: var(--rev-title-size); line-height: 1.3; font-weight: 700; color: #000; }
.rev-text  { font-size: var(--rev-text-size); line-height: 1.6; }
.rev-text p:last-child { margin-bottom: 0; }
.rev-text[data-collapsed="true"]  .rev-full   { display: none; }
.rev-text[data-collapsed="false"] .rev-excerpt{ display: none; }

/* Header + nav + CTA */
.rev-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 28px;
}
.rev-nav {
  background: #fff;
  color: #000;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  font-family: var(--rev-font);
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rev-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: var(--rev-accent) !important;
  color: #fff !important;
  border-color: var(--rev-accent) !important;
}
.rev-nav:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.rev-nav:focus-visible { outline: 3px solid rgba(29, 70, 146, 0.35); outline-offset: 2px; }
.rev-nav[disabled] { opacity: 0.4; cursor: not-allowed; }
.rev-nav svg { width: 20px; height: 20px; display: block; }

/* View All CTA (pill link) */
.rev-cta,
.rev-header .rev-cta:link,
.rev-header .rev-cta:visited,
.rev-header .rev-cta:hover,
.rev-header .rev-cta:active,
.rev-header .rev-cta:focus-visible {
  text-decoration: none !important;
}
.rev-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rev-accent);
  background: #fff;
  color: var(--rev-accent);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rev-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  background: var(--rev-accent);
  color: #fff;
  border-color: var(--rev-accent);
}
.rev-cta:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.rev-cta:focus-visible { outline: 3px solid rgba(29, 70, 146, 0.35); outline-offset: 2px; }

/* Icon inside CTA (used on Home CTA) */
.rev-cta .rev-icon {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
}

/* Read more */
.rev-readmore {
  margin-top: 10px;
  background: #fff;
  color: var(--rev-accent);
  border: 1.5px solid var(--rev-accent);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.rev-wrap .rev-readmore:hover,
.rev-grid-wrap .rev-readmore:hover {
  background: var(--rev-accent) !important;
  color: #fff !important;
  border-color: var(--rev-accent) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.rev-readmore:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.rev-readmore:focus-visible { outline: 3px solid rgba(29, 70, 146, 0.35); outline-offset: 2px; }

/* Hide scrollbars on track */
.rev-track { scrollbar-width: none; }
.rev-track::-webkit-scrollbar { display: none; }

/* Hide page titles when shortcode is used (optional) */
body.has-reviews-shortcode .entry-title,
body.has-reviews-shortcode .page-title,
body.has-reviews-shortcode .site-main .page-header,
body.has-reviews-shortcode h1.entry-title,
body.has-reviews-shortcode .post-title,
body.has-reviews-shortcode header.entry-header,
body.has-reviews-shortcode .single-header,
body.has-reviews-shortcode .c-page-title,
body.has-reviews-shortcode .elementor-widget-heading h1.elementor-heading-title,
body.has-reviews-shortcode .elementor-widget-theme-post-title,
body.has-reviews-shortcode .elementor-page-title,
body.has-reviews-shortcode .et_post_meta_wrapper h1,
body.has-reviews-shortcode .et_pb_title_container,
body.has-reviews-shortcode .ast-archive-title,
body.has-reviews-shortcode .inside-article > header.entry-header,
body.has-reviews-shortcode .wp-block-post-title,
body.has-reviews-shortcode [itemprop="headline"] { display: none !important; }

/* Remove padding if inside a block group wrapper */
.wp-block-group__inner-container:has(.rev-wrap) { padding-left: 0 !important; padding-right: 0 !important; }

/* GRID (All Reviews) */
.rev-grid-wrap { width: 100%; }
.rev-grid {
  display: grid;
  gap: var(--rev-gap);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.rev-grid .rev-card {
  flex: initial;
  width: auto;
}

/* Grid footer (Home CTA) */
.rev-grid-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* Cap grid at max 4 columns on wide screens */
@media (min-width: 1200px) {
  .rev-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

body.has-reviews-grid .entry-title,
body.has-reviews-grid .page-title { display: none !important; }
.wp-block-group__inner-container:has(.rev-grid-wrap) { padding-left: 0 !important; padding-right: 0 !important; }
