/* ==========================================================================
   CORE WORDPRESS BLOCKS
   ==========================================================================

   This file was missing from v1.0.0 and that was the bug.

   The prototype pages used this theme's own component classes, so nothing
   here was needed. Real page content — including everything migrated from the
   old site — is made of CORE Gutenberg blocks: columns, media-text, images,
   groups, lists, tables, buttons. Those were previously styled by the old
   theme's stylesheet. When the theme changed, that styling went with it, and
   the content collapsed together with no spacing.

   Everything below is themed (light and dark) and uses the same tokens as the
   rest of the system.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VERTICAL RHYTHM
   The single most important rule here. Without it, every block sits flush
   against the next one — which is exactly the "all squashed together" symptom.
   -------------------------------------------------------------------------- */
.entry-content > * + *,
.wp-block-group > * + *,
.wp-block-column > * + *{
  margin-block-start:var(--s-5);
}

.entry-content > .wp-block-heading,
.wp-block-column > .wp-block-heading{
  margin-block-start:var(--s-8);
}
.entry-content > .wp-block-heading:first-child{margin-block-start:0}
.entry-content > h3.wp-block-heading,
.entry-content > h4.wp-block-heading{margin-block-start:var(--s-6)}

.entry-content p:last-child{margin-bottom:0}
/* Imported pages are dense. Give the copy more room to breathe. */
.entry-content{line-height:1.7}
.entry-content p{margin-bottom:var(--s-4)}

/* --------------------------------------------------------------------------
   2. COLUMNS
   -------------------------------------------------------------------------- */
/* Columns are the single biggest cause of cramped-looking imported pages.
   As flexbox, three columns inside an 800px area give ~250px each, which is
   about 28 characters a line — text set that narrow reads as squashed no
   matter what the type is doing.

   Grid with auto-fit and a minimum width fixes it structurally: columns keep
   a sane measure and simply wrap to fewer per row when there is not enough
   space, instead of shrinking indefinitely. A three-column row becomes two,
   then one, without anyone editing the page. */
.wp-block-columns{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(340px,100%),1fr));
  gap:var(--s-7);
  margin-block:var(--s-7);
  align-items:start;
}
.wp-block-columns.are-vertically-aligned-center{align-items:center}
.wp-block-columns.are-vertically-aligned-bottom{align-items:end}
.wp-block-column{min-width:0}
.wp-block-column > *:first-child{margin-block-start:0}

/* Two-column rows get a more generous minimum — a half-width column should
   never drop below a comfortable reading measure. */
.wp-block-columns:has(> .wp-block-column:nth-child(2):last-child){
  grid-template-columns:repeat(auto-fit,minmax(min(420px,100%),1fr));
}

/* An explicit width set in the editor is respected, but never below the
   point where the text becomes unreadable. */
.wp-block-column[style*="flex-basis"]{flex-basis:auto!important;min-width:min(340px,100%)}

@media(max-width:781px){
  .wp-block-columns{grid-template-columns:1fr;gap:var(--s-6)}
}

/* --------------------------------------------------------------------------
   3. MEDIA & TEXT
   -------------------------------------------------------------------------- */
.wp-block-media-text{
  display:grid;grid-template-columns:50% 1fr;align-items:center;
  gap:var(--s-7);margin-block:var(--s-7);
}
.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}
.wp-block-media-text .wp-block-media-text__media{grid-column:1;margin:0}
.wp-block-media-text .wp-block-media-text__content{grid-column:2;padding:0}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media{grid-column:2}
.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{grid-column:1}
.wp-block-media-text img{width:100%;height:auto;border-radius:var(--r-md)}
@media(max-width:781px){
  .wp-block-media-text,
  .wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr;gap:var(--s-5)}
  .wp-block-media-text .wp-block-media-text__media,
  .wp-block-media-text .wp-block-media-text__content,
  .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media,
  .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{grid-column:1}
}

/* --------------------------------------------------------------------------
   4. IMAGES & GALLERIES
   -------------------------------------------------------------------------- */
.wp-block-image{margin-block:var(--s-6)}
.wp-block-image img{height:auto;border-radius:var(--r-md)}
.wp-block-image.is-style-rounded img{border-radius:50%}
.wp-block-image figcaption,
.wp-block-embed figcaption,
.wp-block-gallery figcaption{
  font-size:var(--t-small);color:var(--text-mute);
  margin-top:var(--s-3);text-align:center;
}
.wp-block-image.alignleft{float:left;margin:0 var(--s-6) var(--s-5) 0;max-width:min(50%,420px)}
.wp-block-image.alignright{float:right;margin:0 0 var(--s-5) var(--s-6);max-width:min(50%,420px)}
.wp-block-image.aligncenter{margin-inline:auto;text-align:center}
.wp-block-gallery{margin-block:var(--s-6)}
.wp-block-gallery.has-nested-images figure.wp-block-image img{border-radius:var(--r-sm)}

/* --------------------------------------------------------------------------
   5. GROUPS, COVERS, ALIGNMENT
   -------------------------------------------------------------------------- */
.wp-block-group.has-background{
  padding:var(--s-7);border-radius:var(--r-lg);
}
.wp-block-column.has-background{padding:var(--s-6);border-radius:var(--r-lg)}
.wp-block-cover{
  margin-block:var(--s-7);border-radius:var(--r-lg);overflow:hidden;
  padding:var(--s-9) var(--s-7);
}
.wp-block-cover .wp-block-cover__inner-container > *{color:#fff}

/* alignwide / alignfull inside a constrained container */
.entry-content > .alignwide{
  max-width:var(--page);
  margin-inline:auto;
  width:auto;
}
.entry-content > .alignfull{
  max-width:none;
  width:auto;
  margin-inline:calc(50% - 50vw);
  padding-inline:var(--gutter);
}

/* --------------------------------------------------------------------------
   6. LISTS, QUOTES, TABLES
   -------------------------------------------------------------------------- */
.entry-content ul,
.entry-content ol{margin-block:var(--s-4);padding-inline-start:24px}
.entry-content li{margin-block:6px}
.entry-content li > ul,
.entry-content li > ol{margin-block:6px}

.wp-block-quote,
.entry-content blockquote{
  margin-block:var(--s-6);padding:var(--s-5) var(--s-6);
  background:var(--shell);border-left:3px solid var(--brand-red);
  border-radius:0 var(--r-md) var(--r-md) 0;
  font-size:17px;color:var(--text);
}
.wp-block-quote cite{
  display:block;margin-top:var(--s-3);font-size:var(--t-small);
  font-style:normal;color:var(--text-mute);
}
.wp-block-pullquote{
  margin-block:var(--s-8);padding:var(--s-7) 0;text-align:center;
  border-block:2px solid var(--line);
}

.wp-block-table{margin-block:var(--s-6);overflow-x:auto}
.wp-block-table table{width:100%;border-collapse:collapse}
.wp-block-table th,
.wp-block-table td{
  padding:var(--s-4) var(--s-3);text-align:left;
  border-bottom:1px solid var(--line-soft);font-size:14.5px;vertical-align:top;
}
.wp-block-table th{
  font-family:var(--font-head);font-size:11.5px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text-mute);font-weight:700;
}
.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background:var(--shell-3)}

.wp-block-separator{
  border:0;border-top:1px solid var(--line);
  margin-block:var(--s-8);opacity:1;
}
.wp-block-separator.is-style-wide{max-width:none}

/* --------------------------------------------------------------------------
   7. BUTTONS
   Core button blocks inherit the pill treatment from the rest of the system.
   -------------------------------------------------------------------------- */
.wp-block-buttons{
  display:flex;flex-wrap:wrap;gap:12px;margin-block:var(--s-6);
}
.wp-block-button__link{
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--btn-bg);color:var(--btn-fg);
  border-radius:var(--r-pill);padding:14px 26px;
  font-family:var(--font-body);font-size:13.5px;font-weight:700;
  text-decoration:none;box-shadow:var(--e-1);
  transition:transform var(--dur) var(--ease),box-shadow var(--dur) var(--ease);
}
.wp-block-button__link:hover{transform:translateY(-2px);box-shadow:var(--e-2);color:var(--btn-fg)}
.wp-block-button.is-style-outline .wp-block-button__link{
  background:transparent;color:var(--text);border:1.5px solid var(--text);box-shadow:none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover{background:var(--text);color:var(--paper)}

/* --------------------------------------------------------------------------
   8. EMBEDS
   -------------------------------------------------------------------------- */
.wp-block-embed{margin-block:var(--s-6)}
.wp-block-embed__wrapper{position:relative}
.wp-block-embed.wp-embed-aspect-16-9 .wp-block-embed__wrapper::before{
  content:"";display:block;padding-top:56.25%;
}
.wp-block-embed.wp-embed-aspect-16-9 iframe{
  position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:var(--r-md);
}

/* --------------------------------------------------------------------------
   9. DETAILS / ACCORDIONS
   Old FAQ sections often use the core Details block.
   -------------------------------------------------------------------------- */
.wp-block-details{
  border-bottom:1px solid var(--line-soft);padding-block:var(--s-4);
}
.wp-block-details summary{
  cursor:pointer;font-family:var(--font-head);font-size:15px;font-weight:700;
  text-transform:uppercase;letter-spacing:.03em;color:var(--text);
}
.wp-block-details[open] summary{margin-bottom:var(--s-3)}

/* --------------------------------------------------------------------------
   10. IMPORTED CONTENT SAFETY NET
   Migrated pages were authored against a different theme. These rules stop
   the most common leftovers from breaking the layout.
   -------------------------------------------------------------------------- */
.entry-content img{max-width:100%;height:auto}
.entry-content iframe{max-width:100%}
.entry-content table{max-width:100%}
/* Old inline widths that assumed a wider canvas. */
.entry-content [style*="width:"]{max-width:100%}

/* Sentence-case rescue for headings typed in lower case. Composed pages put
   the heading in .band-head rather than inside the content wrapper, so that
   has to be covered too — otherwise "our mission" stays lower case on exactly
   the pages this was written for. */
.entry-content :is(h1,h2,h3,h4):not(.keep-original)::first-letter,
.prose-col :is(h1,h2,h3,h4):not(.keep-original)::first-letter,
.band-head :is(h1,h2,h3):not(.keep-original)::first-letter,
.feat :is(h3,h4)::first-letter,
.qa .acc-head .label::first-letter{
  text-transform:uppercase;
}

/* Social links pasted into a values or team card by the old theme. They point
   at the site's own accounts from inside a card about "Accessibility", which
   reads as a mistake because it is one. */
.feat .wp-block-social-links,
.feat-body .wp-block-social-links,
.prose-col .wp-block-column .wp-block-social-links{display:none}

/* --------------------------------------------------------------------------
   11. EDITOR NOTES
   Kept as a safety net: if anyone ever pastes an unfinished note into a page,
   it renders loudly in amber rather than blending into the copy. The theme
   itself ships no placeholder text.
   -------------------------------------------------------------------------- */
.lkta-editor-note{
  background:var(--amber-wash);
  border-left:3px solid var(--brand-amber);
  padding:var(--s-4) var(--s-5);
  border-radius:0 var(--r-sm) var(--r-sm) 0;
  font-size:14.5px;
  color:var(--text);
}
.lkta-editor-note strong{
  font-family:var(--font-head);font-size:11px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--amber-ink);display:block;margin-bottom:4px;
}

/* ==========================================================================
   12. IMPORTED CONTENT NORMALISER
   ==========================================================================

   Pages migrated from the old site carry that theme's presentational baggage:
   inline font-family and font-size declarations, hard-coded hex colours, and
   preset classes whose values no longer exist. The result is pages that keep
   the old look while the homepage uses the new one — which is exactly the
   inconsistency reported.

   This section brings imported content back onto the design system. It uses
   !important deliberately: inline styles cannot be beaten any other way, and
   the alternative is editing fifteen pages by hand.

   ESCAPE HATCH: add the class `keep-original` to any block whose original
   styling you want to preserve, and none of this applies to it.
   ========================================================================== */

/* --- typeface: everything comes back to the two brand fonts --- */
.entry-content :not(.keep-original) :is(h1,h2,h3,h4,h5,h6),
.entry-content > :is(h1,h2,h3,h4,h5,h6):not(.keep-original){
  font-family:var(--font-head)!important;
  text-transform:none!important;
  /* Headings on the old site were typed in lower case and made to look like
     titles by the previous theme's text-transform:uppercase. Turning that off
     — which we must, because ALL-CAPS was the reported problem — leaves
     "our mission" and "our core values" reading as though someone forgot the
     shift key. Capitalising the first letter puts them back into sentence
     case without shouting, and does nothing to a heading that was already
     capitalised. */
  letter-spacing:-.015em!important;
  color:var(--text)!important;
}
.entry-content :not(.keep-original) :is(p,li,td,th,span,div),
.entry-content > :is(p,li,div):not(.keep-original){
  font-family:var(--font-body)!important;
}

/* --- size: legacy inline sizes and dead presets snap back to the scale ---
   Body-copy elements only. Headings are handled separately below, because an
   attribute selector outranks an element one and would otherwise flatten
   every heading to body size. */
.entry-content :is(p,span,li,td,th,div)[style*="font-size"]:not(.keep-original):not([class*="has-"]){
  font-size:inherit!important;
}
.entry-content :is(h1,h2,h3,h4,h5,h6)[style*="font-size"]:not(.keep-original),
.entry-content :is(h1,h2,h3,h4,h5,h6):not(.keep-original){
  font-size:revert-layer;
}
.entry-content h1:not(.keep-original),
.entry-content h1[style*="font-size"]:not(.keep-original){font-size:var(--t-h1)!important}
.entry-content h2:not(.keep-original),
.entry-content h2[style*="font-size"]:not(.keep-original){font-size:var(--t-h2)!important}
.entry-content h3:not(.keep-original),
.entry-content h3[style*="font-size"]:not(.keep-original){font-size:var(--t-h3)!important}
.entry-content h4:not(.keep-original),
.entry-content h4[style*="font-size"]:not(.keep-original){font-size:var(--t-h4)!important}
.entry-content p:not(.keep-original):not([class*="has-"]){font-size:var(--t-body)!important}

/* Old themes often set line-height inline at values tuned to a different
   typeface. Heebo needs more room than most. */
.entry-content [style*="line-height"]:not(.keep-original){line-height:inherit!important}

/* --- colour: hard-coded hex text colours become theme colours ---
   Without this, imported pages break in dark mode: black text on a dark
   background. Explicit palette classes are respected; raw inline hex is not. */
.entry-content [style*="color:"]:not(.keep-original):not([class*="has-"]):not(.wp-block-button__link){
  color:inherit!important;
}
.entry-content [style*="background-color:#fff"]:not(.keep-original),
.entry-content [style*="background-color:#ffffff"]:not(.keep-original),
.entry-content [style*="background:#fff"]:not(.keep-original){
  background-color:var(--card-bg)!important;
}

/* --- shape: old sharp-cornered boxes pick up the system radius --- */
.entry-content .wp-block-group.has-background:not(.keep-original),
.entry-content .wp-block-column.has-background:not(.keep-original){
  border-radius:var(--r-lg);
  padding:var(--s-7);
}

/* --- legacy preset classes from the previous theme ---
   These map onto the current scale so old content sizes sensibly rather than
   silently falling back to body size. */
.entry-content .has-small-font-size{font-size:var(--t-small)!important}
.entry-content .has-medium-font-size{font-size:var(--t-body)!important}
.entry-content .has-large-font-size{font-size:var(--t-h3)!important}
.entry-content .has-x-large-font-size{font-size:var(--t-h2)!important}
.entry-content .has-huge-font-size{font-size:var(--t-h1)!important}

/* --- buttons authored in the old theme --- */
.entry-content .wp-block-button__link:not(.keep-original){
  background:var(--action)!important;color:var(--action-fg)!important;
  border-radius:var(--r-pill)!important;font-family:var(--font-body)!important;
}
.entry-content .wp-block-button.is-style-outline .wp-block-button__link:not(.keep-original){
  background:transparent!important;color:var(--text)!important;border:1.5px solid var(--text)!important;
}

/* --- images: old fixed widths and square corners --- */
.entry-content img:not(.keep-original){border-radius:var(--r-md)}
.entry-content figure:not(.keep-original){margin-inline:0}
