/*
Theme Name: Luma Editorial Blocks
Theme URI: https://example.com/luma-editorial-blocks
Author: OpenAI
Description: Universal How Does X Work editorial block theme for Explained How. Built for WordPress 7.1+ and PHP 8.1+ with Full Site Editing, broad knowledge navigation, mechanism-first content patterns, and Global Styles.
Version: 3.3.0
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: luma-editorial-blocks
Tags: block-patterns, block-styles, full-site-editing, editor-style, wide-blocks, blog, news, e-commerce
*/

/* Small layer of component CSS; global design tokens live in theme.json. */
:root {
  --luma-shadow: 0 12px 40px rgba(17,17,17,.08);
  --luma-shadow-soft: 0 8px 24px rgba(17,17,17,.06);
}

html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { text-underline-offset: .18em; }
.wp-site-blocks { overflow: clip; }

.luma-topbar { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.luma-masthead { border-bottom: 1px solid var(--wp--preset--color--line); }
.luma-card { height: 100%; }
.luma-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.luma-card--portrait img { aspect-ratio: 4/5; }
.luma-card--wide img { aspect-ratio: 16/9; }
.luma-card h3, .luma-card h2 { text-wrap: balance; }

.luma-kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.2;
  text-transform: uppercase;
}

.luma-section-title {
  border-top: 1px solid var(--wp--preset--color--contrast);
  padding-top: .75rem;
}

.luma-product-card {
  box-shadow: var(--luma-shadow-soft);
  border: 1px solid var(--wp--preset--color--line);
}
.luma-product-card .wp-block-image img { object-fit: contain; }
.luma-product-card .wp-block-button__link { width: 100%; text-align: center; }

.luma-pros { border-left: 4px solid var(--wp--preset--color--sage); }
.luma-cons { border-left: 4px solid var(--wp--preset--color--rose); }

.luma-disclosure {
  border-top: 1px solid var(--wp--preset--color--line);
  border-bottom: 1px solid var(--wp--preset--color--line);
}

.luma-sticky-cta {
  position: sticky;
  bottom: 1rem;
  z-index: 20;
  box-shadow: var(--luma-shadow);
}

.luma-author-box img { border-radius: 999px; }

.luma-toc a { text-decoration: none; }
.luma-toc a:hover { text-decoration: underline; }

.luma-mega-grid .wp-block-navigation__submenu-container {
  min-width: 18rem;
  padding: 1rem;
  box-shadow: var(--luma-shadow);
}

@media (max-width: 781px) {
  .luma-desktop-only { display: none !important; }
  .luma-product-card { padding: var(--wp--preset--spacing--40) !important; }
  .luma-sticky-cta { bottom: .5rem; }
}

@media (min-width: 782px) {
  .luma-mobile-only { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

.is-style-luma-card {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--line);
  padding: var(--wp--preset--spacing--40);
}
.is-style-luma-soft-panel {
  background: var(--wp--preset--color--sand);
  padding: var(--wp--preset--spacing--50);
}
.wp-block-image.is-style-luma-editorial img {
  box-shadow: var(--luma-shadow-soft);
}
.wp-block-quote.is-style-luma-pullquote {
  border: 0;
  padding: 0;
  font-family: var(--wp--preset--font-family--editorial-serif);
  font-size: var(--wp--preset--font-size--xl);
  line-height: 1.25;
}


/* Mechanism-first homepage */
.luma-eyebrow {
  margin: 0;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}
.luma-home-hero h1 { max-width: 10ch; text-wrap: balance; }
.luma-home-hero .wp-block-search__inside-wrapper {
  min-height: 58px;
  border: 1px solid var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--base);
}
.luma-home-hero .wp-block-search__input { font-size: 1rem; padding-left: 1rem; }
.luma-home-hero .wp-block-search__button { margin: 0; min-width: 118px; }
.luma-topic-chips p { margin: 0; }
.luma-topic-chips a {
  display: inline-block;
  padding: .38rem .7rem;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 999px;
  text-decoration: none;
  background: var(--wp--preset--color--base);
}
.luma-topic-chips a:hover { border-color: var(--wp--preset--color--contrast); }
.luma-mechanism-card { box-shadow: 18px 18px 0 var(--wp--preset--color--sand); }
.luma-mini-flow { margin-top: 1.5rem; }
.luma-mini-flow p {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  padding: .8rem 0;
  margin: 0;
  border-top: 1px solid rgba(255,255,255,.18);
}
.luma-mini-flow p:last-child { border-bottom: 1px solid rgba(255,255,255,.18); }
.luma-mini-flow strong { font-size: .72rem; letter-spacing: .1em; }
.luma-mini-flow span { color: var(--wp--preset--color--line); }
.luma-section-head { margin-bottom: var(--wp--preset--spacing--50); }
.luma-featured-story .wp-block-post-featured-image img { box-shadow: var(--luma-shadow-soft); }
.luma-featured-story .wp-block-post-title { text-wrap: balance; }
.luma-system-grid { align-items: stretch; }
.luma-system-grid > .wp-block-column { display: flex; }
.luma-system-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(1.4rem, 2.5vw, 2.2rem);
  border-top: 3px solid var(--wp--preset--color--contrast);
  border-bottom: 1px solid var(--wp--preset--color--line);
  background: var(--wp--preset--color--base);
}
.luma-system-number,
.luma-step-index {
  margin: 0 0 .8rem;
  font-family: var(--wp--preset--font-family--system-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  opacity: .65;
}
.luma-cluster-topics { margin-top: auto; padding-top: 1rem; }
.luma-mechanism-steps { gap: 1px; background: rgba(255,255,255,.18); }
.luma-mechanism-step {
  min-height: 170px;
  padding: 1.5rem;
  background: var(--wp--preset--color--contrast);
}
.luma-mechanism-step h3 { margin: .2rem 0 .45rem; }
.luma-explainer-card { padding-bottom: 1.2rem; border-bottom: 1px solid var(--wp--preset--color--line); }
.luma-explainer-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: .92rem; }
.luma-path-list { border-top: 1px solid rgba(22,22,22,.25); }
.luma-path-row {
  display: grid !important;
  grid-template-columns: 105px 1fr;
  gap: 1.2rem;
  width: 100%;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(22,22,22,.18);
}
.luma-path-row p { margin: 0; }
.luma-path-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.luma-path-row a { text-decoration-thickness: 1px; }
.luma-trust-item {
  height: 100%;
  padding: 1.2rem 0 1.5rem;
  border-top: 1px solid var(--wp--preset--color--contrast);
}
.luma-trust-item h3 { margin-bottom: .55rem; }
.luma-trust-item p:last-child { margin-bottom: 0; }
.luma-footer-links { list-style: none; padding-left: 0; }
.luma-footer-links li { margin-bottom: .55rem; }
.luma-footer a { color: inherit; }
.luma-topbar a { color: inherit; }
.luma-primary-nav { position: sticky; top: 0; z-index: 40; }

@media (max-width: 960px) {
  .luma-mechanism-card { box-shadow: 10px 10px 0 var(--wp--preset--color--sand); }
  .luma-header-search { display: none; }
}
@media (max-width: 781px) {
  .luma-home-hero { padding-top: 2.5rem !important; padding-bottom: 3.5rem !important; }
  .luma-home-hero h1 { max-width: none; }
  .luma-mechanism-card { margin-top: 1.2rem; box-shadow: 8px 8px 0 var(--wp--preset--color--sand); }
  .luma-system-grid > .wp-block-column { display: block; }
  .luma-path-row { grid-template-columns: 1fr; gap: .35rem; }
  .luma-section-head { align-items: flex-start !important; }
}

/* Explained How — universal X homepage, v3.1 */
.eh-masthead .wp-block-site-title { font-size: clamp(1.5rem, 2.8vw, 2.2rem); letter-spacing: -.045em; text-transform: none; line-height: 1; margin: 0; }
.eh-masthead .wp-block-site-title a { text-decoration: none; }
.eh-primary-nav .wp-block-navigation-item__content { text-transform: none; letter-spacing: .01em; font-weight: 650; }
.eh-home-hero { border-bottom: 1px solid var(--wp--preset--color--line); }
.eh-hero-title { max-width: 11ch; text-wrap: balance; }
.eh-hero-title em { color: #1768e5; font-style: normal; }
.eh-hero-deck { max-width: 48rem; }
.eh-universal-search .wp-block-search__inside-wrapper { min-height: 66px; padding: 0; border: 2px solid var(--wp--preset--color--contrast); background: var(--wp--preset--color--base); }
.eh-universal-search .wp-block-search__input { padding: 0 1.15rem; font-size: 1.02rem; }
.eh-universal-search .wp-block-search__button { margin: 0; min-width: 126px; min-height: 62px; }
.eh-question-chips p { margin: 0; }
.eh-question-chips a { display: inline-block; padding: .38rem .7rem; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; background: var(--wp--preset--color--base); text-decoration: none; }
.eh-question-chips a:hover { border-color: #1768e5; color: #1768e5; }
.eh-anything-panel { box-shadow: 18px 18px 0 #dbe8fb; }
.eh-domain-stream { margin-top: 1.2rem; }
.eh-section-intro { margin-bottom: 2.2rem; }
.eh-section-intro > * { max-width: 780px; }
.eh-world-grid { gap: 1px; background: var(--wp--preset--color--line); border: 1px solid var(--wp--preset--color--line); }
.eh-world-card { min-height: 245px; padding: 1.55rem; background: var(--wp--preset--color--base); transition: transform .18s ease, box-shadow .18s ease; }
.eh-world-card:hover { position: relative; z-index: 2; transform: translateY(-3px); box-shadow: var(--luma-shadow-soft); }
.eh-world-card h3 { margin: .65rem 0 .55rem; }
.eh-world-card h3 a { text-decoration: none; }
.eh-world-card h3 a:hover { color: #1768e5; }
.eh-world-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; margin: 0; border: 1px solid var(--wp--preset--color--contrast); border-radius: 50%; font: 800 .82rem/1 var(--wp--preset--font-family--system-sans); }
.eh-c3 .eh-world-icon, .eh-c5 .eh-world-icon, .eh-c8 .eh-world-icon { background:#eaf2ff; border-color:#a8c7f5; }
.eh-c1 .eh-world-icon, .eh-c4 .eh-world-icon { background:#eef5e8; border-color:#bdd2ad; }
.eh-c11 .eh-world-icon, .eh-c12 .eh-world-icon { background:#f4ebf2; border-color:#d3b7ce; }
.eh-feature-query .wp-block-post-template { align-items:start; }
.eh-feature-card { padding-bottom: 1.2rem; border-bottom: 1px solid var(--wp--preset--color--line); }
.eh-feature-card .wp-block-post-featured-image img { object-fit: cover; }
.eh-feature-card .wp-block-post-title { margin-top: .55rem; text-wrap: balance; }
.eh-feature-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); }
.eh-curiosity a { color: inherit; text-decoration-color: rgba(255,255,255,.35); }
.eh-curiosity a:hover { color: #72a8ff; }
.eh-trail-list { border-top: 1px solid rgba(255,255,255,.2); }
.eh-trail { display:grid; grid-template-columns: 105px 1fr; gap:1rem; padding:1.15rem 0; border-bottom:1px solid rgba(255,255,255,.16); }
.eh-trail .eh-trail-label { margin:0; color:#72a8ff; font-size:.7rem; letter-spacing:.12em; }
.eh-trail .eh-trail-links { margin:0; }
.eh-section-search { max-width: 360px; }
.eh-method-grid { gap: 1px; background: rgba(22,22,22,.18); }
.eh-method-card { min-height: 210px; padding: 1.45rem; background: var(--wp--preset--color--base); }
.eh-method-card .eh-method-index { display:block; margin:0 0 1rem; font:700 .7rem/1 var(--wp--preset--font-family--system-mono); color:#1768e5; }
.eh-method-card h3 { margin:0 0 .7rem; font-size:1.12rem; }
.eh-method-card p { margin:0; color:var(--wp--preset--color--muted); font-size:.92rem; }
@media (max-width: 960px) { .eh-anything-panel { box-shadow: 10px 10px 0 #dbe8fb; } }
@media (max-width: 781px) {
  .eh-home-hero { padding-top:2.8rem!important; }
  .eh-hero-title { max-width:none; }
  .eh-anything-panel { margin-top:1.4rem; box-shadow:8px 8px 0 #dbe8fb; }
  .eh-world-card { min-height:auto; }
  .eh-trail { grid-template-columns:1fr; gap:.4rem; }
  .eh-universal-search .wp-block-search__button { min-width:96px; padding-left:.75rem; padding-right:.75rem; }
}


/* 3.2.0: Gutenberg-safe domain panel rows. */
.eh-domain-stream .eh-domain-row {
  display: grid !important;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  padding: 1.1rem 0;
  border-top: 1px solid rgba(255,255,255,.18);
}
.eh-domain-stream .eh-domain-row:first-child { margin-top: .85rem; }
.eh-domain-index { margin: .15rem 0 0 !important; color: #6aa4ff; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.eh-domain-copy { margin: 0 !important; }
.eh-domain-name { margin: 0 !important; color: inherit; font-family: var(--wp--preset--font-family--sans, sans-serif); font-size: 1rem !important; line-height: 1.2; }
.eh-domain-desc { margin: .28rem 0 0 !important; color: var(--wp--preset--color--line); font-size: .82rem; line-height: 1.45; }


/* 3.3.0 — stable universal hero + Gutenberg sizing controls. */
.eh-home-hero .wp-block-columns {
  min-width: 0;
}
.eh-home-hero .wp-block-column {
  min-width: 0;
}
.eh-anything-panel {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.eh-domain-stream,
.eh-domain-stream .eh-domain-row,
.eh-domain-stream .eh-domain-copy {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.eh-domain-stream .eh-domain-row {
  grid-template-columns: 2rem minmax(0, 1fr) !important;
}
.eh-domain-stream .eh-domain-index,
.eh-domain-stream .eh-domain-name,
.eh-domain-stream .eh-domain-desc {
  display: block;
  min-width: 0;
  width: auto;
  padding: 0;
  border: 0;
}
.eh-domain-stream .eh-domain-index {
  white-space: nowrap;
}
.eh-domain-stream .eh-domain-name,
.eh-domain-stream .eh-domain-desc {
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none;
}
.eh-domain-stream .eh-domain-desc {
  max-width: none;
}

/* Make selected layout blocks easier to identify while editing only. */
.editor-styles-wrapper .wp-block-column,
.editor-styles-wrapper .wp-block-group,
.editor-styles-wrapper .wp-block-columns {
  box-sizing: border-box;
}

@media (max-width: 960px) {
  .eh-home-hero .wp-block-columns {
    flex-wrap: wrap !important;
  }
  .eh-home-hero .wp-block-column {
    flex-basis: 100% !important;
  }
  .eh-anything-panel {
    margin-top: 1.5rem;
  }
}
