/**
 * Booklex — global design layer (loaded on every page, before responsive.css).
 * Modern polish on top of block templates: ambient background, glass header,
 * buttons, eyebrow pills, cards, article typography.
 */

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  background-color: var(--wp--preset--color--bg, #11100f);
  background-image:
    radial-gradient(1100px 560px at 82% -8%, rgba(212, 96, 60, 0.14), transparent 62%),
    radial-gradient(900px 520px at -12% 22%, rgba(242, 166, 90, 0.07), transparent 58%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(212, 96, 60, 0.55);
  color: #fff7f2;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.wp-element-button:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-2, #f2a65a);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ */
/* Sticky glass header                                                 */
/* ------------------------------------------------------------------ */

header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 90;
}

header .booklex-site-header {
  /* full-bleed background behind body gutters */
  margin-left: calc(-1 * var(--booklex-gutter, 1.125rem));
  margin-right: calc(-1 * var(--booklex-gutter-right, 1.125rem));
  padding-left: var(--booklex-gutter, 1.125rem);
  padding-right: var(--booklex-gutter-right, 1.125rem);
  background: rgba(17, 16, 15, 0.94);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  header .booklex-site-header {
    background: rgba(17, 16, 15, 0.72);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    backdrop-filter: blur(16px) saturate(1.4);
  }
}

.booklex-logo {
  display: block;
  width: 26px;
  height: auto;
}

.wp-block-site-title a {
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.18s ease;
}

.wp-block-site-title a:hover {
  color: var(--wp--preset--color--accent-2, #f2a65a);
}

.booklex-catalog-nav__link {
  padding: 0.35rem 0.2rem;
  transition: color 0.18s ease;
}

.booklex-catalog-nav__link:hover {
  color: var(--wp--preset--color--accent-2, #f2a65a);
  opacity: 1;
}

/* Language switcher as a small pill */
.booklex-language-switcher__summary {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.booklex-language-switcher__summary:hover,
.booklex-language-switcher[open] .booklex-language-switcher__summary {
  border-color: rgba(212, 96, 60, 0.55);
  background: rgba(212, 96, 60, 0.1);
}

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */

.wp-element-button,
.wp-block-button__link {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    filter 0.18s ease;
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: linear-gradient(135deg, #e2724a 0%, #c9532f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 10px 28px rgba(212, 96, 60, 0.32);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 14px 34px rgba(212, 96, 60, 0.42);
}

.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1px solid rgba(255, 247, 242, 0.28);
  color: var(--wp--preset--color--text, #fff7f2);
  background: rgba(255, 255, 255, 0.03);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 96, 60, 0.65);
  background: rgba(212, 96, 60, 0.12);
}

.booklex-appstore-badge a {
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.booklex-appstore-badge a:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

/* ------------------------------------------------------------------ */
/* Eyebrow pills (section labels)                                      */
/* ------------------------------------------------------------------ */

.booklex-eyebrow p {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.34rem 0.9rem;
  border: 1px solid rgba(212, 96, 60, 0.38);
  border-radius: 999px;
  background: rgba(212, 96, 60, 0.12) !important;
  color: var(--wp--preset--color--accent-2, #f2a65a) !important;
  font-weight: 700;
  font-size: 0.76rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.booklex-eyebrow p::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--wp--preset--color--accent, #d4603c);
  box-shadow: 0 0 10px rgba(212, 96, 60, 0.9);
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */

.booklex-hero h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.6vw, 3.4rem);
  line-height: 1.06;
  background: linear-gradient(135deg, #fff7f2 48%, #f2a65a 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff7f2; /* fallback when clip:text unsupported */
}

.booklex-hero p.has-lg-font-size {
  max-width: 36em;
}

/* Feature chips */
.booklex-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045) !important;
  color: var(--wp--preset--color--text, #fff7f2);
}

.booklex-chip::before {
  content: "✓";
  font-weight: 800;
  font-size: 0.8em;
  color: var(--wp--preset--color--accent-2, #f2a65a);
}

/* Stats card glow */
.booklex-hero .wp-block-column:last-child > .wp-block-group.has-background {
  box-shadow:
    0 24px 80px rgba(212, 96, 60, 0.16),
    0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ------------------------------------------------------------------ */
/* "How it works" step badges                                          */
/* ------------------------------------------------------------------ */

.booklex-section-flow .wp-block-column > p.has-accent-color {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(212, 96, 60, 0.4);
  border-radius: 13px;
  background: rgba(212, 96, 60, 0.12);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ */
/* Feature cards                                                       */
/* ------------------------------------------------------------------ */

.wp-block-column:has(> .booklex-card) {
  display: flex;
}

.booklex-card {
  flex: 1;
  background: linear-gradient(170deg, #201c19 0%, #171412 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.booklex-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 96, 60, 0.42);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

/* ------------------------------------------------------------------ */
/* "Everything included" panel + checklist                             */
/* ------------------------------------------------------------------ */

.booklex-panel {
  background: linear-gradient(170deg, #201c19 0%, #171412 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.35);
}

/* let the checklist columns use the full panel width (constrained layout
   would otherwise cap them at content-size and center them) */
.booklex-panel > .wp-block-columns {
  max-width: none;
}

.booklex-checklist p {
  position: relative;
  margin: 0;
  padding-left: 2.2rem;
  color: var(--wp--preset--color--muted, #c7b2a8);
  line-height: 1.55;
}

.booklex-checklist p + p {
  margin-top: 1rem;
}

.booklex-checklist p strong {
  color: var(--wp--preset--color--text, #fff7f2);
  font-weight: 600;
}

.booklex-checklist p::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 96, 60, 0.4);
  background: rgba(212, 96, 60, 0.14);
  color: var(--wp--preset--color--accent-2, #f2a65a);
  font-size: 0.72rem;
  font-weight: 800;
}

/* comfortable gap between the two stacked checklist columns on mobile */
@media (max-width: 781px) {
  .booklex-panel > .wp-block-columns {
    row-gap: 1.4rem;
  }
}

/* ------------------------------------------------------------------ */
/* Bottom CTA band                                                     */
/* ------------------------------------------------------------------ */

.booklex-section-cta > .wp-block-group.has-background {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 30px 90px rgba(212, 96, 60, 0.16);
}

/* ------------------------------------------------------------------ */
/* Pagination                                                          */
/* ------------------------------------------------------------------ */

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--wp--preset--color--muted, #c7b2a8);
  text-decoration: none;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.wp-block-query-pagination a:hover {
  border-color: rgba(212, 96, 60, 0.55);
  background: rgba(212, 96, 60, 0.1);
  color: var(--wp--preset--color--text, #fff7f2);
}

.wp-block-query-pagination .page-numbers.current {
  border-color: rgba(212, 96, 60, 0.65);
  background: rgba(212, 96, 60, 0.16);
  color: var(--wp--preset--color--text, #fff7f2);
}

/* ------------------------------------------------------------------ */
/* Article (single post) typography                                    */
/* ------------------------------------------------------------------ */

.wp-block-post-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.wp-block-post-content > * + * {
  margin-top: 1.1em;
}

.wp-block-post-content h2,
.wp-block-post-content h3 {
  margin-top: 1.9em;
  margin-bottom: 0.6em;
}

.wp-block-post-content img {
  border-radius: 16px;
}

.wp-block-post-content blockquote {
  margin: 1.4em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--wp--preset--color--accent, #d4603c);
  color: var(--wp--preset--color--muted, #c7b2a8);
  font-style: italic;
}

.wp-block-post-content a {
  text-decoration-color: rgba(212, 96, 60, 0.5);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.wp-block-post-content a:hover {
  color: var(--wp--preset--color--accent-2, #f2a65a);
}

.wp-block-post-content li + li {
  margin-top: 0.4em;
}

.wp-block-post-content code {
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.92em;
}

/* Prev / next links on single posts */
.wp-block-post-navigation-link a {
  color: var(--wp--preset--color--muted, #c7b2a8);
  text-decoration: none;
  transition: color 0.15s ease;
}

.wp-block-post-navigation-link a:hover {
  color: var(--wp--preset--color--accent-2, #f2a65a);
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */

footer .booklex-site-footer .wp-block-navigation a {
  color: var(--wp--preset--color--muted, #c7b2a8);
  text-decoration: none;
  transition: color 0.15s ease;
}

footer .booklex-site-footer .wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent-2, #f2a65a);
}
