/* ============================================================
   Membership Gate — Gate B (single answer) + Archive A (taxonomy)
   Namespaced btmg- to avoid collisions with theme styles.
   Design tokens match the live brain-trainer.com theme.
   ============================================================ */

:root {
  --btmg-blue:        #2e6da4;
  --btmg-blue-press:  #245a8a;
  --btmg-blue-link:   #2166a8;
  --btmg-blue-tint:   #e8f0f7;
  --btmg-gold:        #bd9a3c;
  --btmg-gold-hover:  #a9862f;
  --btmg-gold-tint:   #f4ecd5;
  --btmg-gold-ink:    #8a6d1f;
  --btmg-surface:     #ffffff;
  --btmg-surface-2:   #f6f4ef;
  --btmg-ink:         #2b2a28;
  --btmg-ink-soft:    #54514c;
  --btmg-ink-faint:   #8a857d;
  --btmg-line:        #ddd9d0;
  --btmg-line-soft:   #e9e6df;
  --btmg-content-bg:  #ececea;
  --btmg-radius:      10px;
  --btmg-radius-sm:   7px;
  --btmg-shadow-card: 0 1px 2px rgba(40,35,25,.05), 0 10px 30px -14px rgba(40,35,25,.22);
  --btmg-shadow-soft: 0 1px 2px rgba(40,35,25,.05), 0 3px 10px -5px rgba(40,35,25,.12);
  --btmg-slab:        "Roboto Slab", Georgia, "Times New Roman", serif;
  --btmg-ui:          "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ---- Teaser fade ---- */
.btmg-teaser {
  position: relative;
}
.btmg-teaser-fade {
  max-height: 160px;
  overflow: hidden;
}
.btmg-teaser-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 110px;
  background: linear-gradient(to bottom, rgba(236,236,234,0), var(--btmg-content-bg) 92%);
  pointer-events: none;
}
.btmg-prose p {
  font-size: 17px;
  line-height: 1.75;
  color: #4a4843;
  margin: 0 0 18px;
}

/* ---- Shared atoms ---- */
.btmg-lockbadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--btmg-gold-tint);
  color: var(--btmg-gold-ink);
  border: 1px solid rgba(189,154,60,.3);
  flex-shrink: 0;
}
.btmg-lockbadge svg {
  width: 21px;
  height: 21px;
}

.btmg-memberline {
  font-size: 14.5px;
  color: var(--btmg-ink-soft);
}
.btmg-memberline a {
  color: var(--btmg-blue-link);
  font-weight: 700;
  text-decoration: none;
}
.btmg-memberline a:hover {
  text-decoration: underline;
}

.btmg-poptag {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--btmg-gold);
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---- Buttons ---- */
.btmg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--btmg-ui);
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  border: none;
  border-radius: var(--btmg-radius-sm);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .04s;
  padding: 13px 22px;
}
.btmg-btn:active {
  transform: translateY(0.5px);
}
.btmg-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btmg-btn-sm {
  padding: 10px 16px;
  font-size: 14px;
}
.btmg-btn-block {
  width: 100%;
}
.btmg-btn-primary {
  background: var(--btmg-blue);
  color: #fff;
  box-shadow: var(--btmg-shadow-soft);
}
.btmg-btn-primary:hover {
  background: var(--btmg-blue-press);
  color: #fff;
}
.btmg-btn-gold {
  background: var(--btmg-gold);
  color: #fff;
  box-shadow: var(--btmg-shadow-soft);
}
.btmg-btn-gold:hover {
  background: var(--btmg-gold-hover);
  color: #fff;
}
.btmg-btn-ghost {
  background: var(--btmg-surface);
  color: var(--btmg-ink);
  box-shadow: inset 0 0 0 1px var(--btmg-line);
}
.btmg-btn-ghost:hover {
  box-shadow: inset 0 0 0 1px var(--btmg-ink-faint);
  color: var(--btmg-ink);
}
.btmg-btn-trial {
  background: var(--btmg-gold-tint);
  color: var(--btmg-gold-ink);
  box-shadow: inset 0 0 0 1.5px rgba(189,154,60,.5);
  font-size: 15px;
}
.btmg-btn-trial:hover {
  background: #ecdcb0;
  box-shadow: inset 0 0 0 1.5px rgba(189,154,60,.75);
  color: var(--btmg-gold-ink);
}

/* ================================================================
   GATE B — Split value + plan cards (single answer posts)
   ================================================================ */
.btmg-gateB {
  position: relative;
  margin-top: -22px;
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  background: var(--btmg-surface);
  border: 1px solid var(--btmg-line);
  border-radius: var(--btmg-radius);
  box-shadow: var(--btmg-shadow-card);
  overflow: hidden;
  font-family: var(--btmg-ui);
}

/* Left panel */
.btmg-left {
  padding: 30px;
  display: flex;
  flex-direction: column;
}
.btmg-head {
  font-family: var(--btmg-slab);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.16;
  color: #232220;
  margin: 14px 0 9px;
}
.btmg-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--btmg-ink-soft);
  margin: 0 0 18px;
}
.btmg-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btmg-perks li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--btmg-ink);
  align-items: flex-start;
}
.btmg-ck {
  color: var(--btmg-blue);
  flex-shrink: 0;
  margin-top: 1px;
  width: 18px;
  height: 18px;
}
.btmg-memberbox {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--btmg-line-soft);
}

/* ---- Video thumbnail + modal ---- */
.btmg-video-thumb {
  position: relative;
  display: block;
  width: 100%;
  margin: 4px 0 18px;
  padding: 0;
  border: none;
  border-radius: var(--btmg-radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--btmg-ink);
  aspect-ratio: 16 / 9;
}
.btmg-video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .92;
  transition: opacity .15s, transform .2s;
}
.btmg-video-thumb:hover img {
  opacity: 1;
  transform: scale(1.02);
}
.btmg-video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--btmg-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.btmg-video-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.btmg-video-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btmg-video-modal[hidden] {
  display: none;
}
.btmg-video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,15,.82);
}
.btmg-video-modal-box {
  position: relative;
  width: min(900px, 92vw);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--btmg-radius);
  overflow: hidden;
  box-shadow: var(--btmg-shadow-card);
}
.btmg-video-modal-frame {
  width: 100%;
  height: 100%;
}
.btmg-video-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.btmg-video-modal-close {
  position: absolute;
  top: -38px;
  right: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: var(--btmg-ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* ---- Trial divider ---- */
.btmg-trial-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--btmg-ink-faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 2px 0;
}
.btmg-trial-divider::before,
.btmg-trial-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--btmg-line-soft);
}

/* ---- Free trial inline form ---- */
.btmg-trial-slot {
  display: flex;
  flex-direction: column;
}
.btmg-trial-form[hidden] {
  display: none;
}
.btmg-trial-form {
  margin-top: 4px;
}
.btmg-trial-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--btmg-ink-soft);
  margin-bottom: 6px;
}
.btmg-trial-row {
  display: flex;
  gap: 8px;
}
.btmg-trial-email {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--btmg-ui);
  font-size: 14px;
  padding: 11px 12px;
  border-radius: var(--btmg-radius-sm);
  border: 1px solid var(--btmg-line);
  background: var(--btmg-surface);
  color: var(--btmg-ink);
}
.btmg-trial-email:focus {
  outline: 2px solid var(--btmg-blue);
  outline-offset: 1px;
}
.btmg-trial-msg {
  margin: 8px 0 0;
  font-size: 13px;
  min-height: 1em;
}
.btmg-trial-msg[data-state="error"] {
  color: #a4313b;
}
.btmg-trial-msg[data-state="success"] {
  color: #1c7c4d;
}

/* Right panel */
.btmg-right {
  padding: 24px;
  background: var(--btmg-surface-2);
  border-left: 1px solid var(--btmg-line-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.btmg-pcard {
  background: var(--btmg-surface);
  border: 1px solid var(--btmg-line);
  border-radius: var(--btmg-radius-sm);
  padding: 17px 19px;
}
.btmg-pcard-pop {
  border-color: rgba(189,154,60,.55);
  box-shadow: 0 0 0 3px var(--btmg-gold-tint);
}
.btmg-r1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
}
.btmg-nm {
  font-size: 14px;
  font-weight: 800;
  color: var(--btmg-ink);
}
.btmg-pr {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 4px 0 13px;
}
.btmg-amt {
  font-family: var(--btmg-slab);
  font-size: 27px;
  font-weight: 700;
  color: var(--btmg-ink);
}
.btmg-per {
  font-size: 13px;
  font-weight: 600;
  color: var(--btmg-ink-faint);
}

/* ================================================================
   ARCHIVE A — top banner (taxonomy / archive pages)
   ================================================================ */
.btmg-arc-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--btmg-surface);
  border: 1px solid var(--btmg-line);
  border-top: 3px solid var(--btmg-gold);
  border-radius: var(--btmg-radius);
  box-shadow: var(--btmg-shadow-soft);
  padding: 20px 24px;
  margin-bottom: 26px;
  font-family: var(--btmg-ui);
}
.btmg-arc-txt {
  flex: 1 1 auto;
}
.btmg-arc-txt h3 {
  font-family: var(--btmg-slab);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #232220;
  margin: 0 0 5px;
}
.btmg-arc-txt h3 em {
  font-style: normal;
}
.btmg-arc-txt p {
  font-size: 14px;
  color: var(--btmg-ink-soft);
  line-height: 1.5;
  margin: 0;
}
.btmg-bannerlinks {
  font-size: 13.5px;
  color: var(--btmg-ink-soft);
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btmg-bannerlinks a {
  color: var(--btmg-blue-link);
  font-weight: 700;
  text-decoration: none;
}
.btmg-bannerlinks a:hover {
  text-decoration: underline;
}
.btmg-bannerlinks span {
  color: var(--btmg-ink-faint);
}
.btmg-arc-act {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* ================================================================
   Responsive — collapse to single column below 640px
   ================================================================ */
@media (max-width: 640px) {
  .btmg-gateB {
    grid-template-columns: 1fr;
  }
  .btmg-right {
    border-left: none;
    border-top: 1px solid var(--btmg-line-soft);
  }
  .btmg-arc-banner {
    flex-wrap: wrap;
  }
  .btmg-arc-act {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ================================================================
   Trial expired dialog
   ================================================================ */
.btmg-trial-expired-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--btmg-ui);
}
.btmg-trial-expired-modal[hidden] {
  display: none;
}
.btmg-trial-expired-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,15,.72);
}
.btmg-trial-expired-box {
  position: relative;
  width: min(440px, 92vw);
  background: var(--btmg-surface);
  border-radius: var(--btmg-radius);
  box-shadow: var(--btmg-shadow-card);
  padding: 30px;
  text-align: center;
}
.btmg-trial-expired-box h3 {
  font-family: var(--btmg-slab);
  font-size: 21px;
  font-weight: 700;
  color: #232220;
  margin: 14px 0 9px;
}
.btmg-trial-expired-box p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--btmg-ink-soft);
  margin: 0 0 20px;
}
.btmg-trial-expired-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btmg-trial-expired-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--btmg-surface-2);
  color: var(--btmg-ink-faint);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

/* ================================================================
   Active trial banner
   ================================================================ */
.btmg-trial-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--btmg-ink);
  color: #fff;
  font-family: var(--btmg-ui);
  font-size: 14px;
  box-shadow: 0 -2px 12px rgba(0,0,0,.18);
}
.btmg-trial-banner strong {
  color: var(--btmg-gold);
}
.btmg-trial-banner-acts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 540px) {
  .btmg-trial-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
