/* =====================================================================
   BAS — Common styles (shared across all pages)
   Theme: bas (WordPress child theme of Blocksy)
   ---------------------------------------------------------------
   Naming:  prefix `bas-` + BEM, namespaced per page section
   Colors:  controlled by --theme-palette-color-* (Blocksy palette)
   Fonts:   --bas-font-display (Barlow Condensed), --bas-font-body (Sora)
   ---------------------------------------------------------------
   Cache busting: automatic via filemtime() in functions.php.
   ===================================================================== */

/* -------- Defensive a-tag reset for our scope --------
   Blocksy/WordPress apply global a:hover styles (color shifts, underline)
   that can break our custom button/link designs. This forces every link
   inside our markup to start clean. Per-component styles below restore
   the intended visual treatment with hardened specificity. */
a[class^="bas-"],
a[class*=" bas-"] {
  text-decoration: none;
  color: inherit;
}
a[class^="bas-"]:hover,
a[class*=" bas-"]:hover,
a[class^="bas-"]:focus,
a[class*=" bas-"]:focus,
a[class^="bas-"]:focus-visible,
a[class*=" bas-"]:focus-visible {
  text-decoration: none;
}

/* -------- Box model reset for our scope only -------- */
[class*="bas-"], [class*="bas-"] *,
[class*="bas-"] *::before, [class*="bas-"] *::after { box-sizing: border-box; }

/* -------- Design tokens -------- */
:where([class*="bas-"]) {
  /* core palette */
  --bas-black:        #111111;
  --bas-dark:         #23262D;
  --bas-white:        #FFFFFF;
  --bas-gray-bg:      #F5F5F5;
  --bas-gray-light:   #E5E5E5;
  --bas-gray-text:    #6B6B6B;     /* WCAG AA on white & on #F5F5F5 */
  --bas-gray-meta:    #8A8A8A;     /* WCAG AA on white */
  --bas-gray-border:  #E5E5E5;
  --bas-accent:       #E60023;     /* used sparingly for diagram accents */

  /* typography */
  --bas-font-display: 'Barlow Condensed', system-ui, sans-serif;
  --bas-font-body:    'Sora', system-ui, sans-serif;

  /* layout */
  --bas-container:    1280px;
  --bas-radius-pill:  40px;
  --bas-radius-sm:    4px;
  --bas-radius-md:    8px;

  /* spacing rhythm */
  --bas-space-xs:     8px;
  --bas-space-sm:     16px;
  --bas-space-md:     24px;
  --bas-space-lg:     48px;
  --bas-space-xl:     80px;
  --bas-space-2xl:    120px;
}

/* -------- Body wrapper -------- */
.bas-home {
  background: var(--bas-white);
  color: var(--bas-black);
  font-family: var(--bas-font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
:where([class*="bas-"]) img { display: block; max-width: 100%; }
:where([class*="bas-"]) a { text-decoration: none; color: inherit; }
:where([class*="bas-"]) button { font-family: var(--bas-font-body); cursor: pointer; }

/* hide section labels per request — sec-label will not be displayed anywhere */
.bas-section-tag { display: none !important; }

/* -------- Shared headings -------- */
.bas-section-h2 {
  font-family: var(--bas-font-display);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--bas-black);
  margin: 0 0 28px;
}

/* -------- Container -------- */
.bas-container {
  width: 100%;
  max-width: var(--bas-container);
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 768px) {
  .bas-container { padding: 0 20px; }
}

/* =====================================================================
   PILL BUTTONS — shared
   Hardened against Blocksy / WordPress global a:hover overrides:
   - Use a.bas-pill-* selectors so anchor-tag class wins specificity
   - Force text-decoration:none (Blocksy adds underline on a:hover)
   - Hover state inverts colors explicitly (don't rely on inheritance)
===================================================================== */

/* Solid WHITE pill — black text on white bg → on hover inverts to black/white */
.bas-pill-white,
a.bas-pill-white {
  display: inline-block;
  background: var(--bas-white);
  color: var(--bas-black);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 28px;
  border-radius: var(--bas-radius-pill);
  border: 1px solid var(--bas-white);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-white:hover,
.bas-pill-white:focus-visible,
a.bas-pill-white:hover,
a.bas-pill-white:focus-visible {
  background: var(--bas-black);
  color: var(--bas-white);
  border-color: var(--bas-black);
  text-decoration: none !important;
}

/* OUTLINE pill — used on DARK bg (hero, cta). Translucent white outline */
.bas-pill-outline,
a.bas-pill-outline {
  display: inline-block;
  background: rgba(255,255,255,0.10);
  color: var(--bas-white);
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 28px;
  border-radius: var(--bas-radius-pill);
  text-decoration: none !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-outline:hover,
.bas-pill-outline:focus-visible,
a.bas-pill-outline:hover,
a.bas-pill-outline:focus-visible {
  background: var(--bas-white);
  color: var(--bas-black);
  border-color: var(--bas-white);
  text-decoration: none !important;
}

/* OUTLINE pill — used on LIGHT (white/gray) bg → dark border + dark text */
.bas-pill-outline-onlight,
a.bas-pill-outline-onlight {
  display: inline-block;
  background: transparent;
  color: var(--bas-black);
  border: 1px solid var(--bas-black);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 28px;
  border-radius: var(--bas-radius-pill);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease;
}
.bas-pill-outline-onlight:hover,
.bas-pill-outline-onlight:focus-visible,
a.bas-pill-outline-onlight:hover,
a.bas-pill-outline-onlight:focus-visible {
  background: var(--bas-black);
  color: var(--bas-white);
  text-decoration: none !important;
}

/* Solid DARK pill — black bg + white text → on hover inverts to white/black */
.bas-pill-dark,
a.bas-pill-dark {
  display: inline-block;
  background: var(--bas-black);
  color: var(--bas-white);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 14px 30px;
  border-radius: var(--bas-radius-pill);
  border: 1px solid var(--bas-black);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-dark:hover,
.bas-pill-dark:focus-visible,
a.bas-pill-dark:hover,
a.bas-pill-dark:focus-visible {
  background: var(--bas-white);
  color: var(--bas-black);
  border-color: var(--bas-black);
  text-decoration: none !important;
}

/* Small dark pill — used in header nav */
.bas-pill-dark-sm,
a.bas-pill-dark-sm {
  display: inline-block;
  background: var(--bas-black);
  color: var(--bas-white);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--bas-radius-pill);
  border: 1px solid var(--bas-black);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-dark-sm:hover,
.bas-pill-dark-sm:focus-visible,
a.bas-pill-dark-sm:hover,
a.bas-pill-dark-sm:focus-visible {
  background: var(--bas-white);
  color: var(--bas-black);
  border-color: var(--bas-black);
  text-decoration: none !important;
}

/* Solid WHITE pill on DARK bg (alias for some sections) */
.bas-pill-white-dark,
a.bas-pill-white-dark {
  display: inline-block;
  background: var(--bas-white);
  color: var(--bas-black);
  font-size: 14px;
  font-weight: 600;
  padding: 14px 30px;
  border-radius: var(--bas-radius-pill);
  border: 1px solid var(--bas-white);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-white-dark:hover,
.bas-pill-white-dark:focus-visible,
a.bas-pill-white-dark:hover,
a.bas-pill-white-dark:focus-visible {
  background: transparent;
  color: var(--bas-white);
  border-color: var(--bas-white);
  text-decoration: none !important;
}

/* OUTLINE pill — DARK variant (white border on dark bg, e.g. pricing tier inside dark card) */
.bas-pill-outline-dark,
a.bas-pill-outline-dark {
  display: inline-block;
  background: transparent;
  color: var(--bas-white);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 28px;
  border-radius: var(--bas-radius-pill);
  border: 1px solid rgba(255,255,255,0.5);
  text-decoration: none !important;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bas-pill-outline-dark:hover,
.bas-pill-outline-dark:focus-visible,
a.bas-pill-outline-dark:hover,
a.bas-pill-outline-dark:focus-visible {
  background: var(--bas-white);
  color: var(--bas-black);
  border-color: var(--bas-white);
  text-decoration: none !important;
}

.bas-btn-dark-pill {
  display: inline-block;
  background: var(--bas-black);
  color: var(--bas-white);
  font-size: 14px;
  font-weight: 600;
  padding: 15px 40px;
  border-radius: var(--bas-radius-pill);
  transition: background 0.15s;
}
.bas-btn-dark-pill:hover { background: #333; }

/* =====================================================================
   FAQ accordion — shared between home & size guide
===================================================================== */
.bas-faq-list {
  border-top: 1px solid var(--bas-gray-border);
}
.bas-faq-item {
  border-bottom: 1px solid var(--bas-gray-border);
}
.bas-faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: var(--bas-font-body);
}
.bas-faq-q {
  font-size: 16px;
  font-weight: 600;
  color: var(--bas-black);
  line-height: 1.4;
}
.bas-faq-toggle {
  position: relative;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.bas-faq-toggle::before,
.bas-faq-toggle::after {
  content: '';
  position: absolute;
  background: var(--bas-black);
  transition: transform 0.2s ease;
}
.bas-faq-toggle::before {
  top: 8px; left: 0;
  width: 18px; height: 2px;
}
.bas-faq-toggle::after {
  top: 0; left: 8px;
  width: 2px; height: 18px;
}
.bas-faq-item.open .bas-faq-toggle::after { transform: scaleY(0); }
.bas-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 4px;
  color: var(--bas-gray-text);
  font-size: 15px;
  line-height: 1.7;
}
.bas-faq-a p { margin: 0 0 12px; }
.bas-faq-a p:last-child { margin-bottom: 0; }
.bas-faq-a ul { margin: 0 0 12px; padding-left: 22px; }
.bas-faq-a ul li { margin-bottom: 4px; }
.bas-faq-item.open .bas-faq-a {
  max-height: 600px;
  padding: 0 4px 22px;
}
.bas-faq-btn:hover .bas-faq-q { color: var(--bas-black); }


/* =====================================================================
   DEMO-only chrome (上线时不会被 enqueue)
===================================================================== */
.demo-bar {
  position: sticky; top: 0; z-index: 1000;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  font-size: 12px;
  font-family: var(--bas-font-body);
  border-bottom: 1px solid #2a2a2a;
}
.demo-bar-tag {
  background: #e60023;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 11px;
}
.demo-bar-title {
  font-weight: 600;
  margin-right: auto;
  color: rgba(255,255,255,0.85);
}
.demo-bar-links { display: flex; gap: 4px; }
.demo-bar-link {
  color: rgba(255,255,255,0.55);
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.demo-bar-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.demo-bar-link.active { color: #fff; background: rgba(255,255,255,0.12); }

.bas-demo-header {
  position: sticky; top: 32px; z-index: 100;
  background: var(--bas-white);
  border-bottom: 1px solid var(--bas-gray-border);
}
.bas-demo-header-inner {
  max-width: var(--bas-container);
  margin: 0 auto;
  padding: 16px 48px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.bas-demo-logo {
  font-family: var(--bas-font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--bas-black);
}
.bas-demo-nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.bas-demo-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--bas-black);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.bas-demo-nav a:hover { border-bottom-color: var(--bas-black); }

@media (max-width: 900px) {
  .bas-demo-nav { display: none; }
  .bas-demo-header-inner { padding: 14px 20px; gap: 16px; }
}

.bas-demo-footer {
  background: #0c0c0c;
  color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
  margin-top: 80px;
  font-size: 14px;
}
.bas-demo-footer .bas-container {
  padding: 0 48px;
}
.bas-demo-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
.bas-demo-footer h4 {
  font-family: var(--bas-font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  margin: 0 0 16px;
}
.bas-demo-footer a {
  display: block;
  color: rgba(255,255,255,0.6);
  padding: 4px 0;
  font-size: 14px;
  transition: color 0.15s;
}
.bas-demo-footer a:hover { color: #fff; }
.bas-demo-logo-light { color: #fff; margin-bottom: 8px; }
.bas-demo-footer-tag { color: rgba(255,255,255,0.5); margin: 0; line-height: 1.6; }
.bas-demo-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
@media (max-width: 768px) {
  .bas-demo-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .bas-demo-footer-bottom { flex-direction: column; gap: 8px; }
  .bas-demo-footer .bas-container { padding: 0 20px; }
}

/* =====================================================================
   FOCUS RING (a11y baseline)
===================================================================== */
:where([class*="bas-"]) :focus-visible {
  outline: 2px solid var(--bas-black);
  outline-offset: 3px;
  border-radius: 2px;
}
.bas-hero :focus-visible,
.bas-cta :focus-visible {
  outline-color: var(--bas-white);
}
