/*
 * HT Access Integration 1.0.5: paywall card.
 * Every selector is scoped to the plugin's own .htpw wrapper (or, for the plain
 * fallback, .ht-paywall-prompt). Nothing here styles the theme, ads or homepage.
 * Fonts are the theme's own families with system fallbacks; no external assets.
 */

/* Fallback for the plain core box (only used if the card markup was not applied). */
.ht-paywall-prompt:not(.htpw) {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid #1f3a5f;
  background: #f4f7fb;
  color: #142033;
}
.ht-paywall-prompt:not(.htpw) p { margin: 0 0 0.75rem; }
.ht-paywall-prompt:not(.htpw) p:last-child { margin-bottom: 0; }
.ht-paywall-prompt:not(.htpw) a { color: #0b3a75; font-weight: 650; }

/* ---------- Card ---------- */
.htpw {
  --htpw-page: #ffffff;
  --htpw-ink: #121212;
  --htpw-muted: #5c5c5c;
  --htpw-accent: #b00020;
  --htpw-line: #e4dfd3;
  --htpw-card: #ffffff;
  --htpw-card-2: #faf8f3;
  --htpw-tile: #ffffff;
  --htpw-tile-line: #d9d3c4;
  --htpw-strong: #121212;
  --htpw-strong-ink: #ffffff;
  --htpw-focus: #b00020;
  position: relative;
  box-sizing: border-box;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--htpw-ink);
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  clear: both;
}
.htpw *, .htpw *::before, .htpw *::after { box-sizing: border-box; }

/* Soft fade over the last visible paragraph into the card. */
.htpw::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 150px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--htpw-page) 92%);
}

.htpw .htpw-card {
  position: relative;
  margin: 0 auto;
  max-width: none;
  padding: 36px 36px 26px;
  border: 1px solid var(--htpw-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--htpw-card) 0%, var(--htpw-card-2) 100%);
  box-shadow: 0 1px 2px rgba(18, 18, 18, 0.04), 0 18px 40px -18px rgba(18, 18, 18, 0.22);
  overflow: visible;
}

.htpw p { margin: 0; padding: 0; }

.htpw .htpw-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--htpw-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}
.htpw .htpw-rule {
  display: block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.htpw .htpw-headline {
  max-width: 30ch;
  margin: 0 auto 26px;
  color: var(--htpw-ink);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* ---------- Options ---------- */
.htpw .htpw-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
.htpw .htpw-option,
.htpw .htpw-option:link,
.htpw .htpw-option:visited {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 22px 18px 18px;
  border: 1px solid var(--htpw-tile-line);
  border-radius: 12px;
  background: var(--htpw-tile);
  color: var(--htpw-ink);
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.htpw .htpw-option:hover {
  border-color: var(--htpw-strong);
  box-shadow: 0 10px 24px -14px rgba(18, 18, 18, 0.35);
  transform: translateY(-2px);
  color: var(--htpw-ink);
  text-decoration: none;
}
.htpw .htpw-option:focus { outline: none; }
.htpw .htpw-option:focus-visible {
  outline: 3px solid var(--htpw-focus);
  outline-offset: 3px;
}
.htpw .htpw-option--monthly,
.htpw .htpw-option--monthly:link,
.htpw .htpw-option--monthly:visited {
  border: 2px solid var(--htpw-strong);
  padding: 21px 17px 17px;
}

.htpw .htpw-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--htpw-accent);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}
.htpw .htpw-name {
  display: block;
  color: var(--htpw-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}
.htpw .htpw-price {
  display: block;
  margin: 6px 0 2px;
  color: var(--htpw-ink);
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.htpw .htpw-per {
  margin-left: 2px;
  color: var(--htpw-muted);
  font-family: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}
.htpw .htpw-note {
  display: block;
  color: var(--htpw-muted);
  font-size: 13.5px;
  line-height: 1.4;
}
.htpw .htpw-go {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid var(--htpw-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--htpw-strong);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.htpw .htpw-option--monthly .htpw-go {
  background: var(--htpw-strong);
  color: var(--htpw-strong-ink);
}
.htpw .htpw-option--day:hover .htpw-go {
  background: var(--htpw-strong);
  color: var(--htpw-strong-ink);
}

/* ---------- Log in ---------- */
.htpw .htpw-login {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--htpw-line);
  color: var(--htpw-muted);
  font-size: 14px;
  line-height: 1.4;
}
.htpw .htpw-login a,
.htpw .htpw-login a:link,
.htpw .htpw-login a:visited {
  margin-left: 2px;
  color: var(--htpw-ink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.htpw .htpw-login a:hover { color: var(--htpw-accent); }
.htpw .htpw-login a:focus-visible {
  outline: 3px solid var(--htpw-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Small screens: stack the options ---------- */
@media (max-width: 560px) {
  .htpw::before { height: 110px; }
  .htpw .htpw-card { padding: 28px 18px 20px; border-radius: 12px; }
  .htpw .htpw-headline { font-size: 21px; margin-bottom: 24px; }
  .htpw .htpw-options { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .htpw .htpw-price { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .htpw .htpw-option, .htpw .htpw-go { transition: none; }
  .htpw .htpw-option:hover { transform: none; }
}

@media print {
  .htpw::before { display: none; }
  .htpw .htpw-card { box-shadow: none; }
}

/* Forced-colors (Windows high contrast): keep the tiles and links visible. */
@media (forced-colors: active) {
  .htpw .htpw-option, .htpw .htpw-go, .htpw .htpw-badge { border: 1px solid CanvasText; }
  .htpw::before { display: none; }
}

/*
 * Theme "late-night lobby" dark mode (html.ht-lobby). The theme's own lobby sheet styles
 * .ht-paywall-prompt with three :not(#htz) id hops and !important; four hops win here
 * while staying inside the plugin's .htpw wrapper.
 */
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw {
  --htpw-page: #122356;
  --htpw-ink: #f7f5ef;
  --htpw-muted: #c9c2b0;
  --htpw-accent: #d4a63a;
  --htpw-line: rgba(212, 166, 58, 0.35);
  --htpw-card: #1b2e66;
  --htpw-card-2: #172859;
  --htpw-tile: rgba(255, 255, 255, 0.04);
  --htpw-tile-line: rgba(212, 166, 58, 0.45);
  --htpw-strong: #d4a63a;
  --htpw-strong-ink: #122356;
  --htpw-focus: #f7f5ef;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--htpw-ink) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw::before {
  background: linear-gradient(180deg, rgba(18, 35, 86, 0) 0%, var(--htpw-page) 92%) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-card {
  background: linear-gradient(180deg, var(--htpw-card) 0%, var(--htpw-card-2) 100%) !important;
  border-color: var(--htpw-line) !important;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-eyebrow { color: var(--htpw-accent) !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-headline,
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-price { color: var(--htpw-ink) !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-name,
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-note,
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-per,
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-login { color: var(--htpw-muted) !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw a.htpw-option {
  background: var(--htpw-tile) !important;
  border-color: var(--htpw-tile-line) !important;
  color: var(--htpw-ink) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw a.htpw-option--monthly { border-color: var(--htpw-strong) !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw a.htpw-option:hover { border-color: var(--htpw-strong) !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw a.htpw-option:focus-visible { outline: 3px solid var(--htpw-focus) !important; outline-offset: 3px !important; }
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-go {
  background: transparent !important;
  border-color: var(--htpw-strong) !important;
  color: var(--htpw-strong) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-option--monthly .htpw-go,
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-option--day:hover .htpw-go {
  background: var(--htpw-strong) !important;
  color: var(--htpw-strong-ink) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-badge {
  background: var(--htpw-strong) !important;
  color: var(--htpw-strong-ink) !important;
}
html.ht-lobby body:not(#htz):not(#htz):not(#htz):not(#htz) .htpw .htpw-login a {
  color: var(--htpw-accent) !important;
}
