/* FAQs — Biver Royalty Homes */
*,
*::before,
*::after { box-sizing: border-box; }

body.page-faqs {
  margin: 0;
  font-family: var(--ff-body);
  color: var(--dark-jungle-green);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(212, 175, 55, 0.08), transparent 55%),
    linear-gradient(180deg, #faf7f1 0%, #ffffff 42%, #f7f2e9 100%);
  overflow-x: clip;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* Hero — one composition, brand first, full-bleed */
.faqs-hero {
  position: relative;
  min-height: min(72vh, 620px);
  display: flex;
  align-items: flex-end;
  padding: clamp(120px, 18vh, 160px) 0 clamp(48px, 8vh, 72px);
  overflow: hidden;
  color: #f7f0e4;
}
.faqs-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(26, 12, 2, 0.55) 0%, rgba(55, 24, 1, 0.88) 48%, rgba(15, 7, 2, 0.95) 100%),
    url('../images/biver-logo.png') center 35% / min(70vw, 640px) no-repeat,
    linear-gradient(125deg, #2a1505 0%, #371801 55%, #1a0c02 100%);
  background-blend-mode: normal, soft-light, normal;
  transform: scale(1.04);
  animation: faqsHeroDrift 18s ease-in-out infinite alternate;
}
.faqs-hero-glow {
  position: absolute;
  inset: auto -10% -30% 35%;
  height: 70%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, transparent 65%);
  pointer-events: none;
  animation: faqsGlow 8s ease-in-out infinite alternate;
}
.faqs-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.faqs-brand {
  font-family: var(--ff-display);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  color: #fff;
}
.faqs-brand::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  margin: 14px auto 0;
  background: var(--gold-gradient);
}
.faqs-hero h1 {
  font-family: var(--ff-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 18px 0 14px;
  color: #fffdf8;
}
.faqs-hero h1 em {
  font-style: italic;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.faqs-hero-lead {
  margin: 0 auto 28px;
  max-width: 42ch;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.7;
  color: rgba(255, 247, 232, 0.72);
  font-weight: 300;
}

.faqs-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(255, 253, 247, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.faqs-search:focus-within {
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}
.faqs-search > ion-icon {
  margin-left: 18px;
  font-size: 1.2rem;
  color: var(--gold);
  flex-shrink: 0;
}
.faqs-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  padding: 16px 12px;
  outline: none;
}
.faqs-search input::placeholder { color: rgba(255, 247, 232, 0.45); }
.faqs-search-clear {
  margin-right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 232, 0.8);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.faqs-search-clear:hover { background: rgba(212, 175, 55, 0.2); color: var(--gold-light); }

/* Body */
.faqs-body {
  padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 64px);
}

.faqs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.faqs-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.faqs-cat {
  border: 1px solid rgba(55, 24, 1, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--prussian-blue);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}
.faqs-cat span {
  font-size: 0.72rem;
  color: var(--cadet);
  background: rgba(55, 24, 1, 0.06);
  padding: 2px 7px;
  border-radius: 999px;
}
.faqs-cat:hover {
  border-color: rgba(212, 175, 55, 0.55);
  transform: translateY(-1px);
}
.faqs-cat.is-active {
  background: var(--prussian-blue);
  border-color: var(--prussian-blue);
  color: #fff;
}
.faqs-cat.is-active span {
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-light);
}
.faqs-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cadet);
  letter-spacing: 0.02em;
}

/* Accordion */
.faqs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-item {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(55, 24, 1, 0.08);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(55, 24, 1, 0.04);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.faq-item:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 16px 40px rgba(55, 24, 1, 0.08);
}
.faq-item.is-open {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 18px 44px rgba(55, 24, 1, 0.1);
}
.faq-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.faq-cat-pill {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: rgba(212, 175, 55, 0.12);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.faq-question-text {
  font-family: var(--ff-display);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--prussian-blue);
}
.faq-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(55, 24, 1, 0.05);
  color: var(--prussian-blue);
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s, transform 0.35s;
}
.faq-icon ion-icon { font-size: 1.15rem; }
.faq-icon .icon-minus { display: none; }
.faq-item.is-open .faq-icon {
  background: var(--gold-gradient);
  color: var(--prussian-blue);
  transform: rotate(180deg);
}
.faq-item.is-open .faq-icon .icon-plus { display: none; }
.faq-item.is-open .faq-icon .icon-minus { display: block; }

.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-answer {
  padding: 0 20px 22px;
  margin-left: 0;
  font-size: 0.98rem;
  line-height: 1.8;
  color: #5a5246;
  border-top: 1px solid rgba(55, 24, 1, 0.06);
  padding-top: 16px;
}
@media (min-width: 720px) {
  .faq-answer { padding-left: calc(20px + 7.5rem); }
}

.faqs-no-match,
.faqs-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--cadet);
}
.faqs-no-match ion-icon,
.faqs-empty ion-icon {
  font-size: 2.4rem;
  color: var(--gold-dark);
  margin-bottom: 12px;
}
.faqs-empty h2 {
  font-family: var(--ff-display);
  font-size: 2rem;
  color: var(--prussian-blue);
  margin: 0 0 10px;
}
.faqs-empty p,
.faqs-no-match p {
  max-width: 40ch;
  margin: 0 auto 22px;
  line-height: 1.7;
}

/* CTA */
.faqs-cta {
  position: relative;
  padding: clamp(56px, 9vw, 96px) 0;
  background:
    linear-gradient(135deg, #2a1505 0%, #371801 50%, #1c0d03 100%);
  color: #f7f0e4;
  overflow: hidden;
}
.faqs-cta::before {
  content: '';
  position: absolute;
  inset: -20% 40% auto -10%;
  height: 80%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%);
  pointer-events: none;
}
.faqs-cta-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}
.faqs-cta-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 12px;
}
.faqs-cta h2 {
  font-family: var(--ff-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 600;
  margin: 0 0 12px;
  color: #fff;
}
.faqs-cta p {
  margin: 0 auto 28px;
  line-height: 1.75;
  color: rgba(255, 247, 232, 0.7);
  max-width: 42ch;
}
.faqs-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.faqs-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--gold-gradient);
  color: var(--prussian-blue);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: transform 0.25s, box-shadow 0.25s;
}
.faqs-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.35);
}
.faqs-cta-btn--ghost {
  background: transparent;
  color: #f7f0e4;
  border: 1px solid rgba(212, 175, 55, 0.45);
}
.faqs-cta-btn--ghost:hover {
  border-color: var(--gold-light);
  box-shadow: none;
  background: rgba(212, 175, 55, 0.08);
}

/* Motion */
.reveal-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-up.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.faq-item.reveal-up { transition-delay: calc(var(--i, 0) * 0.05s); }

@keyframes faqsHeroDrift {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.06) translateY(-1.5%); }
}
@keyframes faqsGlow {
  from { opacity: 0.7; transform: translateX(0); }
  to { opacity: 1; transform: translateX(-6%); }
}

@media (max-width: 640px) {
  .faq-trigger {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "pill icon"
      "q icon";
    gap: 8px 12px;
    padding: 16px;
  }
  .faq-cat-pill { grid-area: pill; justify-self: start; }
  .faq-question-text { grid-area: q; }
  .faq-icon { grid-area: icon; align-self: center; }
  .faq-answer { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .faqs-hero-bg,
  .faqs-hero-glow { animation: none; }
  .reveal-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
