/* Gemstone Questions v1.1 - theme-proof, responsive styles.
   Every rule is scoped under .gq-resource-page so the theme's generic
   button / input / h2 styles cannot break the layout. */

:root {
  --gq-navy: #183d53;
  --gq-hi: #214e69;
  --gq-or: #ef8d64;
  --gq-text: #ffffff;
  --gq-soft: #d7ebf2;
  --gq-search-bg: #ffffff;
  --gq-search-text: #14222e;
  --gq-topic-space: 20px;
  --gq-radius: 10px;
  --gq-rule: rgba(255, 255, 255, 0.22);
  --gq-serif: "Young Serif", Georgia, "Times New Roman", serif;
  --gq-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ---------- Base ---------- */
.gq-resource-page,
.gq-resource-page *,
.gq-resource-page *::before,
.gq-resource-page *::after {
  box-sizing: border-box;
}

.gq-resource-page {
  background: var(--gq-navy);
  color: var(--gq-text);
  font-family: var(--gq-sans);
  font-size: 17px;
  line-height: 1.6;
  padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 32px) clamp(40px, 7vw, 80px);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.gq-resource-page .gq-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0;
}

.gq-resource-page .gq-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reset every button inside the widget so theme styles can't leak in
   (Hello Elementor & similar set white-space:nowrap, borders and a pink
   hover/focus background on ALL buttons). */
.gq-resource-page button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-block;
  margin: 0;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  height: auto;
  width: auto;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
  text-decoration: none;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  line-height: inherit;
  white-space: normal;
  word-break: normal;
  cursor: pointer;
}

/* Neutralise the theme's hover / focus / active colours. Component rules
   below (e.g. .gq-topic-toggle:hover) have higher specificity and win. */
.gq-resource-page button:hover,
.gq-resource-page button:focus,
.gq-resource-page button:active {
  background-color: transparent;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}

.gq-resource-page h2 {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.gq-resource-page ul,
.gq-resource-page li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gq-resource-page button:focus-visible,
.gq-resource-page a:focus-visible {
  outline: 3px solid var(--gq-or);
  outline-offset: 3px;
}

/* ---------- Search ---------- */
.gq-resource-page .gq-search-wrap {
  position: relative;
  max-width: 760px;
  margin: 0;
}

.gq-resource-page .gq-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 0 12px 0 24px;
  background: var(--gq-search-bg);
  color: var(--gq-search-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.gq-resource-page .gq-search-field > svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  stroke: var(--gq-navy);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.gq-resource-page .gq-search-field input[type="search"],
.gq-resource-page .gq-search-field input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 8px 0 0;
  background: transparent;
  color: var(--gq-search-text);
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  outline: 0;
  font: inherit;
  font-size: 1.05rem;
  line-height: 48px;
}

.gq-resource-page .gq-search-field input::placeholder {
  color: rgba(20, 34, 46, 0.65);
  opacity: 1;
}

.gq-resource-page .gq-search-field input::-webkit-search-decoration,
.gq-resource-page .gq-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.gq-resource-page .gq-search-field:focus-within {
  outline: 3px solid rgba(239, 141, 100, 0.8);
  outline-offset: 3px;
}

.gq-resource-page .gq-search-clear {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--gq-navy);
  font-size: 1.5rem;
  line-height: 40px;
  text-align: center;
}

.gq-resource-page .gq-search-clear[hidden] {
  display: none;
}

.gq-resource-page .gq-search-clear:hover,
.gq-resource-page .gq-search-clear:focus,
.gq-resource-page .gq-search-clear:active {
  background: #eef1f4;
  color: var(--gq-navy);
}

.gq-resource-page .gq-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  max-height: min(420px, 60vh);
  overflow: auto;
  padding: 8px;
  background: #ffffff;
  color: var(--gq-search-text);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
}

.gq-resource-page .gq-search-results[hidden] {
  display: none;
}

.gq-resource-page .gq-search-results li {
  border-radius: 12px;
}

.gq-resource-page .gq-search-results li[aria-selected="true"],
.gq-resource-page .gq-search-results li:hover {
  background: #edf3f7;
}

.gq-resource-page .gq-search-results button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: var(--gq-search-text);
  text-align: left;
}

.gq-resource-page .gq-search-results b {
  display: block;
  font-weight: 600;
  line-height: 1.35;
}

.gq-resource-page .gq-search-results small {
  color: #576b76;
  font-size: 0.82rem;
}

.gq-resource-page .gq-search-results .gq-no-results {
  padding: 16px;
  color: #4a5a66;
}

.gq-resource-page .gq-search-results .gq-no-results a {
  color: var(--gq-navy);
  text-decoration: underline;
}

.gq-resource-page mark {
  background: rgba(239, 141, 100, 0.38);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------- "Try:" quick searches (inline row, wraps on small screens) ---------- */
.gq-resource-page .gq-quick-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  color: var(--gq-soft);
  font-size: 0.92rem;
}

.gq-resource-page .gq-quick-search-button {
  display: inline-block;
  margin: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--gq-text);
  font-size: 0.92rem;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-color: var(--gq-or);
  text-underline-offset: 4px;
}

.gq-resource-page .gq-quick-search-button:hover,
.gq-resource-page .gq-quick-search-button:focus,
.gq-resource-page .gq-quick-search-button:active {
  color: var(--gq-or);
  background: transparent;
}

/* ---------- Count / expand-all bar ---------- */
.gq-resource-page .gq-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  margin-top: clamp(28px, 5vw, 56px);
  padding: 16px 0;
  border-top: 1px solid var(--gq-rule);
  color: var(--gq-soft);
  font-size: 0.95rem;
}

.gq-resource-page .gq-count {
  color: var(--gq-soft);
  white-space: nowrap;
}

.gq-resource-page .gq-toggle-all {
  display: inline-block;
  white-space: nowrap;
  padding: 9px 18px;
  background: transparent;
  color: var(--gq-text);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.gq-resource-page .gq-toggle-all:hover,
.gq-resource-page .gq-toggle-all:focus,
.gq-resource-page .gq-toggle-all:active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gq-text);
}

/* ---------- Topics ---------- */
.gq-resource-page .gq-topics {
  margin: 0;
}

.gq-resource-page .gq-topic {
  margin: 0;
  border-bottom: 1px solid var(--gq-rule);
  background: transparent;
  color: var(--gq-text);
}

.gq-resource-page .gq-topic-toggle {
  display: flex;
  max-width: 100%;
  white-space: normal;
  align-items: center;
  gap: 8px 16px;
  width: 100%;
  padding: 22px 6px;
  background: transparent;
  color: var(--gq-text);
  text-align: left;
}

.gq-resource-page .gq-topic-toggle:hover,
.gq-resource-page .gq-topic-toggle:focus,
.gq-resource-page .gq-topic-toggle:active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gq-text);
}

.gq-resource-page .gq-topic-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--gq-serif);
  font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem);
  line-height: 1.2;
  font-weight: 400;
  color: var(--gq-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.gq-resource-page .gq-topic-count {
  flex: 0 0 auto;
  color: var(--gq-or);
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
}

.gq-resource-page .gq-topic-icon {
  position: relative;
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gq-or);
}

.gq-resource-page .gq-topic-icon::before,
.gq-resource-page .gq-topic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  margin: -1px 0 0 -7px;
  background: var(--gq-navy);
  transition: transform 0.2s ease;
}

.gq-resource-page .gq-topic-icon::after {
  transform: rotate(90deg);
}

.gq-resource-page .gq-topic.gq-is-open .gq-topic-name {
  color: var(--gq-or);
}

.gq-resource-page .gq-topic.gq-is-open .gq-topic-icon::after {
  transform: rotate(0deg);
}

/* ---------- Smooth accordion (topics + questions) ----------
   A closed panel is ALWAYS height:0 - that value is hard-wired here, so no
   theme rule, [hidden] quirk or inline style can make it leave a gap.
   The script opens a panel by setting the --gq-h custom property (a pixel
   value while animating, then "auto"), and CSS transitions the height. */
.gq-resource-page .gq-topic-panel,
.gq-resource-page .gq-topic-panel[hidden],
.gq-resource-page .gq-question-panel,
.gq-resource-page .gq-question-panel[hidden] {
  --gq-h: 0px; /* declared on every panel so it is never inherited from a parent panel */
  display: block !important;
  height: var(--gq-h) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  visibility: hidden;
  transition:
    height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    visibility 0s linear 0.42s;
}

.gq-resource-page .gq-topic.gq-is-open > .gq-topic-panel,
.gq-resource-page .gq-question-item.gq-is-open > .gq-question-panel {
  opacity: 1 !important;
  visibility: visible;
  transition:
    height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease 0.08s,
    visibility 0s linear 0s;
}

/* flow-root keeps the children's margins inside the panel, so the measured
   height is exact. */
.gq-resource-page .gq-topic-panel > *,
.gq-resource-page .gq-question-panel > * {
  display: flow-root;
}

/* ---------- Questions ---------- */
.gq-resource-page .gq-question-list {
  margin: 0;
  padding: 0;
}

.gq-resource-page .gq-question-list > li:last-child {
  margin-bottom: 18px;
}

.gq-resource-page .gq-question-item {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.gq-resource-page .gq-question-toggle {
  display: flex;
  max-width: 100%;
  white-space: normal;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px 8px;
  background: transparent;
  color: var(--gq-text);
  text-align: left;
}

.gq-resource-page .gq-question-toggle:hover,
.gq-resource-page .gq-question-toggle:focus,
.gq-resource-page .gq-question-toggle:active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gq-text);
}

.gq-resource-page .gq-question-icon {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  border: 2px solid var(--gq-or);
  border-radius: 50%;
}

.gq-resource-page .gq-question-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  border-left: 6px solid var(--gq-or);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.gq-resource-page .gq-question-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--gq-text);
  white-space: normal;
  overflow-wrap: anywhere;
}

.gq-resource-page .gq-question-item.gq-is-open .gq-question-text {
  color: var(--gq-or);
}

.gq-resource-page .gq-question-item.gq-is-open .gq-question-icon {
  background: var(--gq-or);
}

.gq-resource-page .gq-question-item.gq-is-open .gq-question-icon::after {
  border-left-color: var(--gq-navy);
}

.gq-resource-page .gq-question-inner {
  padding: 0 8px 0 42px;
}

/* ---------- Topic-level video (sits at the top of the topic panel) ---------- */
.gq-resource-page .gq-topic-video {
  margin: 2px 8px 22px;
}

.gq-resource-page .gq-topic-video .gq-question-actions {
  margin-bottom: 4px;
}

/* ---------- Video ---------- */
.gq-resource-page .gq-video-container {
  margin-top: 6px;
  width: 100%;
  max-width: 860px;
  border-radius: var(--gq-radius);
  overflow: hidden;
  background: #0c1530;
}

.gq-resource-page .gq-wistia-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.gq-resource-page .gq-wistia-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gq-resource-page .gq-video-placeholder {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 20px;
  text-align: center;
  color: var(--gq-text);
  background: linear-gradient(135deg, #12354d, #166785);
}

.gq-resource-page .gq-video-play-button {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border: 2px solid var(--gq-or);
  border-radius: 50%;
}

.gq-resource-page .gq-video-play-button::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 21px;
  border-left: 19px solid var(--gq-or);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.gq-resource-page .gq-video-placeholder small {
  display: block;
  color: var(--gq-soft);
}

/* ---------- Actions under a video ---------- */
.gq-resource-page .gq-question-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 18px;
  margin-bottom: 28px;
}

.gq-resource-page .gq-next-question,
.gq-resource-page .gq-question-actions a {
  display: inline-block;
  padding: 2px 0;
  background: transparent;
  color: var(--gq-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gq-or);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.gq-resource-page .gq-next-question:hover,
.gq-resource-page .gq-next-question:focus,
.gq-resource-page .gq-next-question:active,
.gq-resource-page .gq-question-actions a:hover {
  color: var(--gq-or);
  background: transparent;
}

.gq-resource-page .gq-action-help {
  color: var(--gq-soft);
  font-size: 0.92rem;
}

.gq-resource-page .gq-action-help a {
  color: var(--gq-soft);
  font-weight: 400;
  text-decoration-color: var(--gq-soft);
  text-decoration-thickness: 1px;
}

.gq-resource-page .gq-empty,
.gq-empty {
  padding: 32px 12px;
  color: var(--gq-text);
}

/* ---------- Tablet ---------- */
@media (max-width: 782px) {
  .gq-resource-page {
    font-size: 16px;
  }

  .gq-resource-page .gq-question-inner {
    padding-left: 34px;
  }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
  .gq-resource-page .gq-search-field {
    min-height: 56px;
    padding-left: 16px;
    gap: 8px;
  }

  .gq-resource-page .gq-search-field input {
    font-size: 16px; /* prevents iOS zoom-on-focus */
    height: 44px;
    line-height: 44px;
  }

  .gq-resource-page .gq-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .gq-resource-page .gq-toggle-all {
    width: 100%;
    padding: 12px 18px;
  }

  /* topic: title on the first row, count underneath, icon on the right */
  .gq-resource-page .gq-topic-toggle {
    flex-wrap: wrap;
    padding: 18px 2px;
    gap: 4px 12px;
  }

  .gq-resource-page .gq-topic-name {
    flex: 1 1 calc(100% - 52px);
  }

  .gq-resource-page .gq-topic-icon {
    order: 2;
    margin-left: auto;
  }

  .gq-resource-page .gq-topic-count {
    order: 3;
    flex: 1 1 100%;
    margin-top: -2px;
  }

  .gq-resource-page .gq-question-toggle {
    padding: 14px 2px;
    gap: 12px;
  }

  .gq-resource-page .gq-question-inner {
    padding: 0;
  }

  .gq-resource-page .gq-topic-video {
    margin: 0 0 18px;
  }

  .gq-resource-page .gq-question-actions {
    margin-bottom: 22px;
  }

  .gq-resource-page .gq-video-container {
    border-radius: 8px;
  }

  .gq-resource-page .gq-question-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gq-resource-page *,
  .gq-resource-page *::before,
  .gq-resource-page *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.gq-resource-page .gq-question-toggle:focus-visible,
.gq-resource-page .gq-next-question:focus-visible {
  outline-offset: -3px;
}
