/* Small Space Japan — main stylesheet
   1. Tokens (copied from small-space-japan-handoff/tokens/tokens.css; keep the two in step)
   2. Base: page, text, headings, links (step 1)
   Header/footer (step 2), components (step 3) and templates (step 4) are added below in order. */

/* ==========================================================================
   1. Tokens
   ========================================================================== */
/* Small Space Japan — design tokens v1 (2026-11-08)
   Source of truth: tokens.json. theme.json mirrors these names. */
:root {
  /* Color — surfaces */
  --ssj-kinari: #FBF8F3;      /* page background */
  --ssj-white: #FFFFFF;       /* cards, boxes, tables */
  --ssj-paper: #F4EFE7;       /* footer, disclosure, table head */
  --ssj-placeholder: #EFE9DF; /* empty image frame */
  --ssj-line: #E7E0D6;        /* 1px borders */
  --ssj-line-strong: #D8CFC2; /* card hover border */

  /* Color — text */
  --ssj-sumi: #2A2724;        /* headings */
  --ssj-sumi-soft: #3D3934;   /* body, 10.8:1 on kinari */
  --ssj-haizumi: #6F6860;     /* dates, captions, 5.2:1 on kinari */

  /* Color — brand */
  --ssj-ai: #33507A;          /* links, buttons, current nav */
  --ssj-ai-dark: #243B5C;     /* hover, small labels */
  --ssj-ai-soft: #E8EEF5;     /* Quick answer, label tint */
  --ssj-sakura: #E8B9BE;      /* decoration only, never text */
  --ssj-sakura-link: #D9969E; /* link underline on hover */
  --ssj-sakura-soft: #F8E9EA; /* hero panel, avatar */
  --ssj-matcha: #7C9473;      /* icons only */
  --ssj-kaki: #B5643C;        /* "unavailable" dot */
  --ssj-kaki-text: #8E4A2A;   /* "unavailable" text, AA */
  /* From design-system/project/tokens.json (not in tokens.css) */
  --ssj-disclosure-text: #4E4842; /* disclosure box text on paper, 7.9:1 */
  --ssj-ai-pressed: #1C2F4A;      /* button pressed */
  --ssj-sakura-marker: #C98F96;   /* list dots */
  --ssj-matcha-soft: #EAF0E6;     /* form "sent" ground */
  --ssj-matcha-text: #3B5237;     /* form "sent" text */

  /* Spacing presets that published posts reference in inline styles (figure margins, set by the
     block editor under Kadence). The theme's theme.json has its own scale, so define these two here
     with WordPress's default values, or the figures would lose their margins. */
  --wp--preset--spacing--50: clamp(30px, 5vw, 50px);
  --wp--preset--spacing--60: clamp(30px, 7vw, 70px);

  /* Category: image ground / label tint / label text */
  --ssj-cat-kitchen: #33507A;  --ssj-cat-kitchen-tint: #E8EEF5;  --ssj-cat-kitchen-text: #243B5C;
  --ssj-cat-bathroom: #3F6B66; --ssj-cat-bathroom-tint: #E3EFEC; --ssj-cat-bathroom-text: #2B4E4A;
  --ssj-cat-entryway: #6E5443; --ssj-cat-entryway-tint: #F2EAE3; --ssj-cat-entryway-text: #57402F;
  --ssj-cat-spare-1: #5F5A82;  --ssj-cat-spare-1-tint: #ECEAF4;  --ssj-cat-spare-1-text: #46416A;
  --ssj-cat-spare-2: #8A6236;  --ssj-cat-spare-2-tint: #F5EDE2;  --ssj-cat-spare-2-text: #6B4A27;
  /* Ground colours of today's titled featured images (fill around the legacy crop) */
  --ssj-legacy-kitchen: #2B4C7E; --ssj-legacy-bathroom: #2C6A66; --ssj-legacy-entryway: #5E4636;
  --ssj-cat-spare-3: #4F6B4A;  --ssj-cat-spare-3-tint: #EAF0E6;  --ssj-cat-spare-3-text: #3B5237;

  /* Type */
  --ssj-font-serif: "Fraunces", Georgia, serif;          /* font-variation-settings: "SOFT" 100, "WONK" 0 */
  --ssj-font-sans: "Instrument Sans", system-ui, sans-serif;
  --ssj-weight-heading: 450;
  --ssj-text-xs: 14px;   /* dates, captions — never below 13px */
  --ssj-text-sm: 15px;   /* disclosure, nav */
  --ssj-text-base: 18px; /* body (mobile 17px) */
  --ssj-text-lg: 21px;   /* H3 (mobile 19px) */
  --ssj-text-xl: 28px;   /* H2 (mobile 24px) */
  --ssj-text-2xl: 42px;  /* article H1 (mobile 30px) */
  --ssj-text-3xl: 46px;  /* home / category H1 (mobile 30px) */
  --ssj-leading-body: 1.8;
  --ssj-leading-heading: 1.2;
  --ssj-leading-small: 1.6;
  --ssj-tracking-heading: -0.01em;

  /* Space (8px scale with 4/12) */
  --ssj-space-1: 4px;  --ssj-space-2: 8px;  --ssj-space-3: 12px; --ssj-space-4: 16px;
  --ssj-space-5: 24px; --ssj-space-6: 32px; --ssj-space-7: 48px; --ssj-space-8: 64px; --ssj-space-9: 96px;

  /* Layout */
  --ssj-wide: 1200px;    /* page max width */
  --ssj-content: 700px;  /* article text column */
  --ssj-featured: 960px; /* article featured image */
  --ssj-gutter: 40px;    /* mobile 20px */
  --ssj-header-h: 68px;  /* mobile 60px */

  /* Shape */
  --ssj-radius-sm: 8px;    /* buttons, inputs */
  --ssj-radius-md: 12px;   /* cards, figures, tables, disclosure */
  --ssj-radius-lg: 20px;   /* Quick answer, hero, author box, featured image */
  --ssj-radius-pill: 999px;
  --ssj-border: 1px solid var(--ssj-line);
  /* No shadows. */

  /* Motion */
  --ssj-duration: 200ms;
  --ssj-ease: ease;
}
@media (max-width: 720px) {
  :root {
    --ssj-text-base: 17px; --ssj-text-lg: 19px; --ssj-text-xl: 24px;
    --ssj-text-2xl: 30px; --ssj-text-3xl: 30px;
    --ssj-gutter: 20px; --ssj-header-h: 60px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root { --ssj-duration: 0ms; }
}

/* ==========================================================================
   2. Base: page, text, headings, links
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--ssj-header-h) + 20px); /* jump links land below the sticky header */
}

body {
  margin: 0;
  background: var(--ssj-kinari);
  color: var(--ssj-sumi-soft);
  font-family: var(--ssj-font-sans);
  font-size: var(--ssj-text-base);
  line-height: var(--ssj-leading-body);
  font-kerning: normal;
  overflow-wrap: break-word;
}

::selection { background: var(--ssj-sakura-soft); color: var(--ssj-sumi); }

/* Page width */
.ssj-container {
  width: 100%;
  max-width: calc(var(--ssj-wide) + 2 * var(--ssj-gutter));
  margin-inline: auto;
  padding-inline: var(--ssj-gutter);
}
.ssj-article,
.entry-content { max-width: var(--ssj-content); margin-inline: auto; }

/* Headings: Fraunces (SOFT 100 and WONK 0 are fixed inside the font file) */
h1, h2, h3, h4, h5, h6 {
  color: var(--ssj-sumi);
  font-family: var(--ssj-font-serif);
  font-weight: var(--ssj-weight-heading);
  font-optical-sizing: auto;
  letter-spacing: var(--ssj-tracking-heading);
  line-height: var(--ssj-leading-heading);
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--ssj-text-2xl); line-height: 1.2; }
h2 { font-size: var(--ssj-text-xl); line-height: 1.3; }
h3 {
  font-family: var(--ssj-font-sans);
  font-size: var(--ssj-text-lg);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
}
h4 { font-family: var(--ssj-font-sans); font-size: var(--ssj-text-base); font-weight: 600; letter-spacing: 0; }

/* Body text rhythm inside an article or page */
.entry-content > * { margin-block: 0; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content > h2 { margin-top: 64px; margin-bottom: 16px; }
.entry-content > h3 { margin-top: 40px; margin-bottom: 10px; }
.entry-content > h2 + *,
.entry-content > h3 + * { margin-top: 0; }
@media (max-width: 720px) {
  .entry-content > h2 { margin-top: 48px; }
}

p { margin: 0; }
strong, b { font-weight: 600; }
em, i { font-style: italic; }
small { font-size: var(--ssj-text-xs); }

ul, ol { padding-left: 1.4em; margin: 0; }
li + li { margin-top: 0.35em; }
li::marker { color: #C98F96; } /* sakura, darker for the dot only (design-spec §8) */
ol > li::marker { color: var(--ssj-haizumi); font-variant-numeric: tabular-nums; }

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

hr { border: 0; border-top: var(--ssj-border); margin: 48px 0; }

/* Links: underline stays in body text (a rule carried over from the current site) */
a {
  color: var(--ssj-ai);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(51, 80, 122, .4);
  transition: color var(--ssj-duration) var(--ssj-ease), text-decoration-color var(--ssj-duration) var(--ssj-ease);
}
a:hover { color: var(--ssj-ai-dark); text-decoration-color: var(--ssj-sakura-link); }
a:visited { color: var(--ssj-ai); }
a:visited:hover { color: var(--ssj-ai-dark); }

/* Keyboard focus: always visible */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ssj-ai);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Screen-reader-only text and the skip link */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 0;
  top: 8px; left: 8px; z-index: 1000;
  padding: 10px 16px;
  background: var(--ssj-white);
  color: var(--ssj-ai);
  border-radius: var(--ssj-radius-sm);
}

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

/* ==========================================================================
   3. Layout shell: header, search bar, mobile menu, footer (step 2)
   ========================================================================== */
[hidden] { display: none !important; }
html.ssj-menu-open { overflow: hidden; }
.ssj-page-pad { padding-top: 40px; padding-bottom: var(--ssj-space-9); }
.ssj-main:focus { outline: none; }

/* Small shared pieces used by the shell (the full button set comes with the components) */
.ssj-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 44px; height: 44px; padding: 0;
  border: var(--ssj-border); border-radius: var(--ssj-radius-pill);
  background: var(--ssj-white); color: var(--ssj-sumi);
  cursor: pointer;
  transition: border-color var(--ssj-duration) var(--ssj-ease), background-color var(--ssj-duration) var(--ssj-ease);
}
.ssj-icon-btn:hover { border-color: var(--ssj-line-strong); background: var(--ssj-ai-soft); }
.ssj-icon-btn[aria-expanded="true"] { border-color: var(--ssj-ai); background: var(--ssj-ai-soft); }
.ssj-icon-btn:focus-visible { border-radius: var(--ssj-radius-pill); }
.ssj-icon { display: block; flex: none; }

/* .ssj-btn (the search button and other theme buttons) is defined with the Amazon button in section 4a. */

.ssj-input {
  width: 100%; height: 48px;
  padding: 0 14px;
  border: 1px solid var(--ssj-line-strong); border-radius: var(--ssj-radius-sm);
  background: var(--ssj-white); color: var(--ssj-sumi);
  font: 400 16px/1.4 var(--ssj-font-sans); /* 16px keeps iOS from zooming in */
  transition: border-color var(--ssj-duration) var(--ssj-ease), box-shadow var(--ssj-duration) var(--ssj-ease);
}
.ssj-input::placeholder { color: var(--ssj-haizumi); opacity: 1; }
.ssj-input:focus { outline: none; border-color: var(--ssj-ai); box-shadow: 0 0 0 3px var(--ssj-ai-soft); }

/* ---- Header ---- */
.ssj-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 50;
  background: var(--ssj-kinari);
  border-bottom: var(--ssj-border);
}
html { scroll-padding-top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--ssj-header-h) + 20px); }
.ssj-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: var(--ssj-header-h);
}

.ssj-logo {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  color: var(--ssj-sumi);
  text-decoration: none;
}
.ssj-logo:hover, .ssj-logo:visited { color: var(--ssj-sumi); }
.ssj-logo-mark { flex: none; }
.ssj-logo-name {
  font-family: var(--ssj-font-serif);
  font-size: 21px; font-weight: 500;
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.2;
  white-space: nowrap;
}

.ssj-nav { display: flex; align-items: center; gap: 22px; }
.ssj-nav-links { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.ssj-nav-links li { margin: 0; }
.ssj-nav-links a {
  display: block;
  padding: 10px 4px;
  color: var(--ssj-sumi);
  font-size: var(--ssj-text-sm);
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
}
.ssj-nav-links a:hover { color: var(--ssj-ai); }
.ssj-nav-links a[aria-current="page"],
.ssj-nav-links a.is-section {
  color: var(--ssj-ai);
  box-shadow: inset 0 -2px 0 var(--ssj-sakura);
}
.ssj-menu-toggle { display: none; }

/* ---- Search bar under the header (desktop) ---- */
.ssj-search-bar { padding: 12px 0 16px; }
.ssj-search-box {
  max-width: var(--ssj-content);
  margin-left: auto;
  padding: 12px;
  background: var(--ssj-kinari);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
}
.ssj-search-form { display: flex; align-items: center; gap: 10px; }
.ssj-search-field { position: relative; flex: 1; min-width: 0; }
.ssj-search-field .ssj-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--ssj-haizumi);
  pointer-events: none;
}
.ssj-search-field .ssj-input { padding-left: 40px; }
/* Hide the browser's own clear button so the field looks the same everywhere */
.ssj-input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---- Mobile menu (full screen) ---- */
.ssj-menu {
  position: fixed;
  inset: var(--wp-admin--admin-bar--height, 0px) 0 0 0;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--ssj-kinari);
}
.ssj-menu-top {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--ssj-header-h);
  padding: 0 12px 0 20px;
  border-bottom: var(--ssj-border);
}
.ssj-menu-body { padding: 16px 20px 40px; }
.ssj-menu .ssj-search-form .ssj-btn { display: none; } /* Enter submits; the field alone matches the design */
.ssj-menu-label {
  margin: 20px 0 4px;
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs);
  line-height: 1.5;
}
.ssj-menu-rooms, .ssj-menu-pages { list-style: none; margin: 0; padding: 0; }
.ssj-menu-rooms li, .ssj-menu-pages li { margin: 0; }
.ssj-menu-rooms a {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px;
  border-bottom: var(--ssj-border);
  color: var(--ssj-sumi);
  text-decoration: none;
}
.ssj-menu-rooms a::before {
  content: "";
  flex: none;
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--ssj-room, var(--ssj-ai));
}
.ssj-menu-rooms a[aria-current="page"], .ssj-menu-rooms a.is-section { color: var(--ssj-ai); font-weight: 600; }
.ssj-menu-pages { display: flex; gap: 20px; padding-top: 12px; }
.ssj-menu-pages a { display: inline-flex; align-items: center; min-height: 44px; }

/* Room colours (design-spec §1). Used by the menu squares now, by labels and room cards later. */
.ssj-room-kitchen  { --ssj-room: var(--ssj-cat-kitchen);  --ssj-room-tint: var(--ssj-cat-kitchen-tint);  --ssj-room-text: var(--ssj-cat-kitchen-text); }
.ssj-room-bathroom { --ssj-room: var(--ssj-cat-bathroom); --ssj-room-tint: var(--ssj-cat-bathroom-tint); --ssj-room-text: var(--ssj-cat-bathroom-text); }
.ssj-room-entryway { --ssj-room: var(--ssj-cat-entryway); --ssj-room-tint: var(--ssj-cat-entryway-tint); --ssj-room-text: var(--ssj-cat-entryway-text); }
.ssj-room-spare-1  { --ssj-room: var(--ssj-cat-spare-1);  --ssj-room-tint: var(--ssj-cat-spare-1-tint);  --ssj-room-text: var(--ssj-cat-spare-1-text); }
.ssj-room-spare-2  { --ssj-room: var(--ssj-cat-spare-2);  --ssj-room-tint: var(--ssj-cat-spare-2-tint);  --ssj-room-text: var(--ssj-cat-spare-2-text); }
.ssj-room-spare-3  { --ssj-room: var(--ssj-cat-spare-3);  --ssj-room-tint: var(--ssj-cat-spare-3-tint);  --ssj-room-text: var(--ssj-cat-spare-3-text); }

/* ---- Footer ---- */
.ssj-footer {
  background: var(--ssj-paper);
  border-top: var(--ssj-border);
  color: var(--ssj-sumi-soft);
}
.ssj-footer-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px;
  padding-top: 56px; padding-bottom: 40px;
}
.ssj-footer-about { max-width: 360px; }
.ssj-footer-about p { font-size: var(--ssj-text-sm); line-height: 1.7; margin: 0; }
.ssj-footer-about .ssj-footer-name {
  margin: 0 0 8px;
  color: var(--ssj-sumi);
  font-family: var(--ssj-font-serif);
  font-size: 21px; font-weight: 500;
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.3;
}
.ssj-footer-nav { font-size: var(--ssj-text-sm); }
.ssj-footer-label {
  margin: 0 0 2px;
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs);
  line-height: 1.6;
}
.ssj-footer-nav ul { list-style: none; margin: 0; padding: 0; }
.ssj-footer-nav li { margin: 0; }
.ssj-footer-nav li + li { margin-top: 0; }
.ssj-footer-nav a { display: inline-flex; align-items: center; min-height: 44px; line-height: 1.4; }
.ssj-footer-legal {
  margin: 0;
  padding: 20px 0 40px;
  border-top: var(--ssj-border);
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs);
  line-height: 1.6;
}

/* ---- Mobile (720px and below) ---- */
@media (max-width: 720px) {
  .ssj-header-inner { padding-left: 20px; padding-right: 12px; }
  .ssj-logo { gap: 8px; }
  .ssj-logo-mark { width: 20px; height: 20px; }
  .ssj-logo-name { font-size: 19px; }
  .ssj-nav-links, .ssj-search-toggle, .ssj-search-bar { display: none !important; }
  .ssj-menu-toggle { display: inline-flex; }
  .ssj-footer-top { flex-direction: column; gap: 24px; padding-top: 40px; padding-bottom: 24px; }
}
@media (max-width: 360px) {
  .ssj-logo-name { font-size: 17px; }
}

/* ==========================================================================
   4. Components (step 3) — design-spec §4 and §8
   4a. Inside posts: these style the HTML that published posts already have.
   ========================================================================== */

/* Disclosure: the first blockquote of every post (never moved, never below 15px) */
.entry-content > .wp-block-quote:first-of-type,
.entry-content > blockquote:first-child {
  margin-left: 0; margin-right: 0;
  padding: 16px 20px;
  border: 0; border-radius: var(--ssj-radius-md);
  background: var(--ssj-paper);
  color: var(--ssj-disclosure-text);
  font-size: var(--ssj-text-sm);
  line-height: 1.65;
}
.entry-content > .wp-block-quote:first-of-type > *,
.entry-content > blockquote:first-child > * { margin: 0; }
.entry-content > .wp-block-quote:first-of-type > * + *,
.entry-content > blockquote:first-child > * + * { margin-top: 0.6em; }
.entry-content > .wp-block-quote:first-of-type strong,
.entry-content > blockquote:first-child strong { color: var(--ssj-sumi); }

/* Any later blockquote: "What buyers say" style (white box, serif). None in published posts yet. */
.entry-content > .wp-block-quote:not(:first-of-type) {
  margin-left: 0; margin-right: 0;
  padding: 18px 22px;
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
  background: var(--ssj-white);
  color: var(--ssj-sumi);
  font-family: var(--ssj-font-serif);
  font-size: 19px; line-height: 1.5;
}
.entry-content > .wp-block-quote:not(:first-of-type) > * { margin: 0; }
.entry-content > .wp-block-quote:not(:first-of-type) > * + * { margin-top: 0.5em; }
.entry-content > .wp-block-quote:not(:first-of-type) cite {
  display: block; margin-top: 8px;
  color: var(--ssj-haizumi);
  font: 400 var(--ssj-text-xs)/1.6 var(--ssj-font-sans);
}

/* Quick answer: .ssj-quick (a group block; its inner container is added by WordPress) */
.ssj-quick {
  padding: 28px 32px;
  border-radius: var(--ssj-radius-lg);
  background: var(--ssj-ai-soft);
}
.ssj-quick > .wp-block-group__inner-container > * { margin: 0; }
.ssj-quick > .wp-block-group__inner-container > * + * { margin-top: 0.8em; }
.entry-content .ssj-quick-title,
.ssj-quick-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  color: var(--ssj-ai-dark);
  font-size: var(--ssj-text-xs);
  font-weight: 600;
  line-height: 1.4;
}
.ssj-quick-title::before { /* small sakura circle with a check */
  content: "";
  flex: none;
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23E8B9BE'/%3E%3Cpath d='M4.6 8.3l2.2 2.2 4.6-4.8' fill='none' stroke='%23243B5C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ssj-quick ul, .ssj-quick ol { padding-left: 1.1em; font-size: 17px; line-height: 1.65; }
.ssj-quick li + li { margin-top: 8px; }
.ssj-quick strong { color: var(--ssj-sumi); }

/* Lists in posts */
.entry-content li::marker { color: var(--ssj-sakura-marker); }
.entry-content ol > li::marker { color: var(--ssj-haizumi); }
.entry-content li > ul, .entry-content li > ol { margin-top: 0.35em; }
.entry-content strong { color: var(--ssj-sumi); }

/* Comparison table: the figure is the white scroll box, the table keeps a 560px minimum width */
.entry-content .wp-block-table {
  margin-left: 0; margin-right: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
}
.entry-content .wp-block-table table {
  width: 100%; min-width: 560px;
  margin: 0;
  border-collapse: collapse;
  font-size: 16px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.entry-content .wp-block-table thead { border: 0; } /* core adds a 3px line under the head */
.entry-content .wp-block-table th,
.entry-content .wp-block-table td {
  padding: 14px 16px;
  border: 0;
  text-align: left;
  vertical-align: top;
}
.entry-content .wp-block-table th {
  padding-top: 12px; padding-bottom: 12px;
  background: var(--ssj-paper);
  color: var(--ssj-sumi);
  font-size: var(--ssj-text-xs);
  font-weight: 600;
}
.entry-content .wp-block-table tbody tr + tr td,
.entry-content .wp-block-table thead + tbody tr:first-child td { border-top: var(--ssj-border); }
.entry-content .wp-block-table figcaption {
  margin: 0; padding: 10px 16px;
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs); line-height: 1.6;
}

/* Figures (the site's own line drawings) */
.entry-content .wp-block-image { margin-left: 0; margin-right: 0; }
.entry-content .wp-block-image img {
  width: 100%; height: auto;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
}
.entry-content figcaption,
.entry-content .wp-element-caption {
  margin-top: 10px;
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs); line-height: 1.6;
}

/* Separator */
.entry-content hr,
.entry-content .wp-block-separator {
  margin: 48px 0;
  border: 0; border-top: var(--ssj-border);
  opacity: 1;
  background: none;
}

/* Amazon button: .wp-block-button__link (option A: indigo fill, white text, small chevron) */
.entry-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.entry-content .wp-block-button { margin: 0; max-width: 100%; }
.entry-content .wp-block-button__link,
.ssj-btn {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px;
  max-width: 100%;
  padding: 13px 22px;
  border: 0; border-radius: var(--ssj-radius-sm);
  background: var(--ssj-ai); color: #fff;
  font: 500 16px/1.3 var(--ssj-font-sans);
  text-align: left;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  cursor: pointer;
  transition: background-color var(--ssj-duration) var(--ssj-ease);
}
.entry-content .wp-block-button__link::after,
.ssj-btn--chevron::after {
  content: "\203A"; /* › */
  flex: none;
  font-size: 1.25em; line-height: 1;
  transform: translateY(-1px);
  transition: transform var(--ssj-duration) var(--ssj-ease);
}
.entry-content .wp-block-button__link:visited,
.entry-content .wp-block-button__link:hover,
.ssj-btn:hover { color: #fff; }
.entry-content .wp-block-button__link:hover,
.ssj-btn:hover { background: var(--ssj-ai-dark); }
.entry-content .wp-block-button__link:hover::after,
.ssj-btn--chevron:hover::after { transform: translate(2px, -1px); }
.entry-content .wp-block-button__link:active,
.ssj-btn:active { background: var(--ssj-ai-pressed); transform: translateY(1px); }
.entry-content .wp-block-button__link:focus-visible,
.ssj-btn:focus-visible { outline: 2px solid var(--ssj-ai); outline-offset: 3px; border-radius: var(--ssj-radius-sm); }

/* Secondary and text-only buttons (theme templates, not posts) */
.ssj-btn--secondary { background: var(--ssj-white); color: var(--ssj-ai); box-shadow: inset 0 0 0 1.5px var(--ssj-ai); }
.ssj-btn--secondary:hover { background: var(--ssj-ai-soft); color: var(--ssj-ai-dark); }
.ssj-btn--secondary:active { background: var(--ssj-ai-soft); }
.ssj-btn--text {
  padding: 10px 0;
  background: none; color: var(--ssj-ai);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(51, 80, 122, .4);
}
.ssj-btn--text:hover, .ssj-btn--text:active { background: none; color: var(--ssj-ai-dark); text-decoration-color: var(--ssj-sakura-link); }

/* Out-of-stock note: the theme adds .ssj-unavailable to <p><em>Out of stock on Amazon.com on …</em></p>
   when it renders a post (inc/content-filters.php). The wording is never changed. */
.entry-content .ssj-unavailable,
.ssj-unavailable {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--ssj-kaki-text);
  font-size: var(--ssj-text-sm); line-height: 1.6;
}
.ssj-unavailable::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: var(--ssj-radius-pill);
  background: var(--ssj-kaki);
  transform: translateY(-1px);
}
.ssj-unavailable em { font-style: normal; font-weight: 500; }
.entry-content > .wp-block-buttons + .ssj-unavailable { margin-top: 10px; }
.entry-content > .ssj-unavailable + .wp-block-buttons { margin-top: 8px; }

/* Note box and "good point" marker: patterns for new posts (design-spec §9) */
.ssj-note {
  display: flex; gap: 12px;
  padding: 16px 20px;
  border-radius: var(--ssj-radius-md);
  background: var(--ssj-paper);
  font-size: 16px; line-height: 1.7;
}
.ssj-note::before {
  content: "";
  flex: none;
  width: 18px; height: 18px; margin-top: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Ccircle cx='9' cy='9' r='7.5' fill='none' stroke='%2333507A' stroke-width='1.4'/%3E%3Cline x1='9' y1='8' x2='9' y2='13' stroke='%2333507A' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='5.4' r='1' fill='%2333507A'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ssj-note > .wp-block-group__inner-container > * { margin: 0; }
.ssj-good { display: flex; align-items: baseline; gap: 8px; }
.ssj-good::before {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  transform: translateY(2px);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.2l2.6 2.6L11 4.4' fill='none' stroke='%237C9473' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 720px) {
  .ssj-quick { padding: 22px 20px; }
  .entry-content .wp-block-button { width: 100%; }
  .entry-content .wp-block-button__link { display: flex; width: 100%; justify-content: space-between; }
}

/* ==========================================================================
   4b. Theme components (templates in step 4 use these)
   ========================================================================== */

.ssj-small { color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }

/* Room label: pill in the room's tint. Add .ssj-room-{key} to set the colours. */
.ssj-label {
  display: inline-flex; align-items: center;
  padding: 7px 12px;
  border-radius: var(--ssj-radius-pill);
  background: var(--ssj-room-tint, var(--ssj-ai-soft));
  color: var(--ssj-room-text, var(--ssj-ai-dark));
  font: 400 var(--ssj-text-xs)/1 var(--ssj-font-sans);
  text-decoration: none;
  white-space: nowrap;
}
a.ssj-label:hover, a.ssj-label:visited { color: var(--ssj-room-text, var(--ssj-ai-dark)); text-decoration: underline; text-decoration-color: currentColor; }

/* Image frame for cards: fixed ratio, so old drawings, new illustrations and photos sit side by side.
   .is-legacy: today's featured images (title on the left, drawing on the right) show only the drawing:
   a 480:630 right-hand crop, centred, on the image's own ground colour. */
.ssj-frame {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ssj-placeholder);
}
.ssj-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ssj-frame.is-legacy { background: var(--ssj-room-legacy, var(--ssj-legacy-kitchen)); }
.ssj-frame.is-legacy img {
  width: auto; height: 100%;
  aspect-ratio: 480 / 630;
  margin-inline: auto;
  object-fit: cover; object-position: right center;
}
.ssj-room-kitchen  { --ssj-room-legacy: var(--ssj-legacy-kitchen); }
.ssj-room-bathroom { --ssj-room-legacy: var(--ssj-legacy-bathroom); }
.ssj-room-entryway { --ssj-room-legacy: var(--ssj-legacy-entryway); }

/* Article card (large): image on top, label, serif title, one-line summary, date */
.ssj-card {
  position: relative;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
  transition: border-color var(--ssj-duration) var(--ssj-ease), transform var(--ssj-duration) var(--ssj-ease);
}
.ssj-card:hover { border-color: var(--ssj-line-strong); transform: translateY(-2px); }
.ssj-card .ssj-frame { border-bottom: var(--ssj-border); }
.ssj-card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px 22px; }
.ssj-card__title { /* h2/h3 in templates: serif here, not the sans used for h3 in post text */
  margin: 0;
  font-family: var(--ssj-font-serif);
  font-size: 20px; font-weight: var(--ssj-weight-heading);
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.35;
}
.ssj-card__title a { color: var(--ssj-sumi); text-decoration: none; }
.ssj-card__title a::after { content: ""; position: absolute; inset: 0; } /* the whole card is clickable */
.ssj-card__title a:hover { color: var(--ssj-ai-dark); }
.ssj-card__summary { margin: 0; font-size: var(--ssj-text-sm); line-height: 1.6; }
.ssj-card__date { margin: 0; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-card .ssj-label { position: relative; z-index: 1; } /* the label stays its own link above the card link */
.ssj-card:focus-within { outline: 2px solid var(--ssj-ai); outline-offset: 3px; }
.ssj-card__title a:focus-visible { outline: none; }

/* Article card (row): category lists. Image 240px on the left. */
.ssj-card--row { flex-direction: row; align-items: center; gap: 28px; padding: 16px; }
.ssj-card--row:hover { transform: none; }
.ssj-card--row .ssj-frame { flex: none; width: 240px; border: 0; border-radius: var(--ssj-radius-sm); }
.ssj-card--row .ssj-card__body { justify-content: center; gap: 6px; padding: 0 12px 0 0; }
.ssj-card--row .ssj-card__title { font-size: 22px; }
.ssj-card--row .ssj-card__summary { font-size: 16px; line-height: 1.65; }

/* Article card (mini): similar guides on phones. 88px square image. */
.ssj-card--mini { flex-direction: row; align-items: center; gap: 14px; padding: 10px; }
.ssj-card--mini .ssj-frame { flex: none; width: 88px; aspect-ratio: 1; border: 0; border-radius: var(--ssj-radius-sm); }
.ssj-card--mini .ssj-card__body { padding: 0; gap: 4px; }
.ssj-card--mini .ssj-card__title { font-family: var(--ssj-font-sans); font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: 0; }

.ssj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

/* Room entry (home page): white card, 48px square in the room colour, serif name, one line */
.ssj-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ssj-room-card {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
  transition: border-color var(--ssj-duration) var(--ssj-ease), transform var(--ssj-duration) var(--ssj-ease);
}
.ssj-room-card:hover { border-color: var(--ssj-line-strong); transform: translateY(-2px); }
.ssj-room-card::before { content: ""; flex: none; width: 48px; height: 48px; border-radius: 10px; background: var(--ssj-room, var(--ssj-ai)); }
.ssj-room-card__name {
  margin: 0;
  font-family: var(--ssj-font-serif);
  font-size: 20px; font-weight: var(--ssj-weight-heading);
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.3;
}
.ssj-room-card__name a { color: var(--ssj-sumi); text-decoration: none; }
.ssj-room-card__name a::after { content: ""; position: absolute; inset: 0; }
.ssj-room-card__desc { margin: 2px 0 0; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.5; }
.ssj-room-card:focus-within { outline: 2px solid var(--ssj-ai); outline-offset: 3px; }
.ssj-room-card a:focus-visible { outline: none; }

/* Author box: initial in a sakura-soft circle (no photo, no Gravatar) */
.ssj-author {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 28px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-lg);
}
.ssj-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 56px; height: 56px;
  border-radius: var(--ssj-radius-pill);
  background: var(--ssj-sakura-soft);
  color: var(--ssj-ai-dark);
  font: 450 24px/1 var(--ssj-font-serif);
}
.ssj-avatar--sm { width: 36px; height: 36px; font-size: 16px; }
.ssj-author p { margin: 0; font-size: 16px; line-height: 1.7; }
.ssj-author p + p { margin-top: 10px; }
.ssj-author .ssj-author__name {
  margin: 0 0 6px;
  color: var(--ssj-sumi);
  font-family: var(--ssj-font-serif);
  font-size: 21px; font-weight: 500;
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.3;
}
.ssj-author .ssj-author__name + p { margin-top: 0; }
.ssj-author p:last-child { font-size: var(--ssj-text-sm); }

/* Breadcrumb (Yoast's output, wrapped by the theme) */
.ssj-breadcrumb { margin: 0 0 24px; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-breadcrumb a { color: var(--ssj-haizumi); text-decoration-color: rgba(111, 104, 96, .45); }
.ssj-breadcrumb a:hover { color: var(--ssj-ai-dark); }
.ssj-breadcrumb .breadcrumb_last { color: var(--ssj-sumi-soft); }

/* Pagination: the_posts_pagination() / paginate_links() output */
/* (.ssj-pagenums / .ssj-pagenum are for hand-made number lists; .ssj-page is the fixed page template) */
.pagination .nav-links,
.ssj-pagenums { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers,
.ssj-pagenum {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px;
  padding: 0 14px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-sm);
  color: var(--ssj-sumi);
  font-size: var(--ssj-text-sm);
  text-decoration: none;
  transition: background-color var(--ssj-duration) var(--ssj-ease);
}
.pagination a.page-numbers:hover, .ssj-pagenum:hover { background: var(--ssj-ai-soft); color: var(--ssj-sumi); }
.pagination .page-numbers.current,
.ssj-pagenum[aria-current="page"] { background: var(--ssj-ai); border-color: var(--ssj-ai); color: #fff; }
.pagination .page-numbers.dots { background: none; border: 0; min-width: 24px; padding: 0; }

/* Previous / next post */
.ssj-postnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ssj-postnav a { display: block; padding: 8px 0; text-decoration: none; }
.ssj-postnav__dir { display: block; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.5; }
.ssj-postnav__title { display: block; color: var(--ssj-ai); font-size: 16px; line-height: 1.5; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(51, 80, 122, .4); }
.ssj-postnav a:hover .ssj-postnav__title { color: var(--ssj-ai-dark); text-decoration-color: var(--ssj-sakura-link); }
.ssj-postnav__next { text-align: right; grid-column: 2; }

/* Form (Contact): Kadence Blocks advanced form, matched to the design */
.kb-advanced-form .kb-adv-form-label,
.ssj-field label { display: block; margin-bottom: 6px; color: var(--ssj-sumi); font: 600 var(--ssj-text-sm)/1.4 var(--ssj-font-sans); }
.kb-adv-form-required { color: var(--ssj-kaki-text); margin-left: 2px; }
.kb-advanced-form .kb-field,
.ssj-field .ssj-input,
.ssj-field textarea {
  width: 100%; min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--ssj-line-strong) !important; border-radius: var(--ssj-radius-sm) !important;
  background: var(--ssj-white) !important; color: var(--ssj-sumi) !important;
  font: 400 16px/1.5 var(--ssj-font-sans) !important;
  box-shadow: none;
  transition: border-color var(--ssj-duration) var(--ssj-ease), box-shadow var(--ssj-duration) var(--ssj-ease);
}
.kb-advanced-form textarea.kb-field, .ssj-field textarea { min-height: 160px; resize: vertical; }
.kb-advanced-form .kb-field:focus,
.ssj-field .ssj-input:focus,
.ssj-field textarea:focus { outline: none; border-color: var(--ssj-ai) !important; box-shadow: 0 0 0 3px var(--ssj-ai-soft); }
.kb-advanced-form .kb-field[aria-invalid="true"],
.kb-advanced-form .kb-field.has-error,
.ssj-field [aria-invalid="true"] { border-color: var(--ssj-kaki-text) !important; }
.kb-advanced-form .kb-adv-form-error,
.kb-advanced-form .kb-form-error-msg,
.ssj-error { margin: 6px 0 0; color: var(--ssj-kaki-text); font-size: var(--ssj-text-xs); line-height: 1.5; }
.kb-advanced-form .kb-adv-form-field { margin-bottom: 18px; }
.kb-advanced-form .kb-adv-form-submit-button,
.kb-advanced-form button[type="submit"] {
  padding: 13px 26px !important;
  border: 0 !important; border-radius: var(--ssj-radius-sm) !important;
  background: var(--ssj-ai) !important; color: #fff !important;
  font: 500 16px/1.3 var(--ssj-font-sans) !important;
  cursor: pointer;
  transition: background-color var(--ssj-duration) var(--ssj-ease);
}
.kb-advanced-form .kb-adv-form-submit-button:hover { background: var(--ssj-ai-dark) !important; }
.kb-advanced-form .kb-adv-form-submit-button:focus-visible { outline: 2px solid var(--ssj-ai) !important; outline-offset: 3px; }
.kb-adv-form-message.kb-adv-form-success,
.kb-adv-form-success,
.ssj-sent {
  margin: 12px 0 0; padding: 10px 14px;
  border: 0; border-radius: var(--ssj-radius-sm);
  background: var(--ssj-matcha-soft); color: var(--ssj-matcha-text);
  font-size: var(--ssj-text-sm);
}
.kb-adv-form-message.kb-adv-form-warning {
  margin: 12px 0 0; padding: 10px 14px;
  border: 0; border-radius: var(--ssj-radius-sm);
  background: #F7ECE6; color: var(--ssj-kaki-text);
  font-size: var(--ssj-text-sm);
}
.kb-adv-form-warning h2.kb-adv-form-error-title { margin: 0 0 4px; color: inherit; font: 600 var(--ssj-text-sm)/1.4 var(--ssj-font-sans); letter-spacing: 0; }

@media (min-width: 721px) and (max-width: 1024px) {
  .ssj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ssj-grid--similar > :nth-child(3) { display: none; }
}
@media (max-width: 720px) {
  .ssj-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ssj-card--row { flex-direction: column; align-items: stretch; gap: 14px; }
  .ssj-card--row .ssj-frame { width: auto; }
  .ssj-card--row .ssj-card__body { padding: 0 4px 6px; }
  .ssj-card--row .ssj-card__title { font-size: 20px; }
  .ssj-author { flex-direction: column; gap: 14px; padding: 22px 20px; }
  .ssj-postnav { grid-template-columns: minmax(0, 1fr); }
  .ssj-postnav__next { grid-column: auto; }
  .kb-advanced-form .kt-row-column-wrap { display: block !important; }
}
@media (prefers-reduced-motion: reduce) {
  .ssj-card:hover, .ssj-room-card:hover { transform: none; }
}

/* ==========================================================================
   5. Templates (step 4)
   5-1. Article page (single.php) — pages.md §1, ArticleTop board
   ========================================================================== */
.ssj-col { max-width: var(--ssj-content); margin-inline: auto; }
.ssj-single { padding-top: 40px; padding-bottom: var(--ssj-space-9); }

.ssj-entry-header .ssj-breadcrumb { margin-bottom: 24px; }
.ssj-entry-title { margin: 18px 0 20px; font-size: var(--ssj-text-2xl); line-height: 1.2; }
.ssj-byline {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  color: var(--ssj-sumi-soft);
  font-size: var(--ssj-text-xs); line-height: 1.6;
}
.ssj-byline a { color: var(--ssj-ai); }
.ssj-dot { margin: 0 6px; color: #C9C0B4; }
.ssj-byline__date { color: var(--ssj-haizumi); }
/* Posts without a new illustration: a thin rule under the byline, then the disclosure */
.ssj-entry-header.has-rule { padding-bottom: 28px; margin-bottom: 28px; border-bottom: var(--ssj-border); }

.ssj-featured { max-width: var(--ssj-featured); margin: 40px auto; }
.ssj-featured img {
  width: 100%; height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--ssj-radius-lg);
  background: var(--ssj-placeholder);
}

.entry-content > .wp-block-quote:first-of-type + * { margin-top: 28px; }

/* Breadcrumb on a post: show "Home › Room", hide the post title (Yoast's last crumb) and the sign before it */
.single .ssj-breadcrumb .breadcrumb_last,
.single .ssj-breadcrumb .ssj-sep:has(+ .breadcrumb_last) { display: none; }
.ssj-sep { margin: 0 4px; }

.ssj-single .ssj-author { margin-top: 64px; }
.ssj-single .ssj-postnav { margin-top: 32px; }
.ssj-single .ssj-postnav a { padding: 16px 4px; }
.ssj-similar { margin-top: 80px; }
.ssj-similar > h2 { margin: 0 0 24px; }

@media (max-width: 720px) {
  .ssj-entry-title { font-size: var(--ssj-text-2xl); }
  .ssj-entry-header.has-rule { padding-bottom: 20px; margin-bottom: 20px; }
  .ssj-featured { margin: 28px auto; }
  .ssj-featured img { border-radius: var(--ssj-radius-md); }
  .ssj-similar { margin-top: 56px; }
  /* Similar guides on phones: small cards (88px image, title, date) */
  .ssj-grid--similar { gap: 12px; }
  .ssj-grid--similar .ssj-card { flex-direction: row; align-items: center; gap: 14px; padding: 10px; }
  .ssj-grid--similar .ssj-frame { flex: none; width: 88px; aspect-ratio: 1; border: 0; border-radius: var(--ssj-radius-sm); }
  .ssj-grid--similar .ssj-card__body { padding: 0; gap: 4px; }
  .ssj-grid--similar .ssj-label { display: none; }
  .ssj-grid--similar .ssj-card__title { font-family: var(--ssj-font-sans); font-size: 17px; font-weight: 500; line-height: 1.4; letter-spacing: 0; }
}

/* ==========================================================================
   5-2. Home page (front-page.php) — pages.md §2, Home / HomeMobile / HomeTablet boards
   ========================================================================== */
.ssj-home { padding-top: 40px; padding-bottom: var(--ssj-space-9); }
.ssj-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center;
  padding: 56px;
  border-radius: var(--ssj-radius-lg);
  background: var(--ssj-sakura-soft);
}
.ssj-hero.has-image { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.ssj-hero:not(.has-image) .ssj-hero__text { max-width: 760px; }
.ssj-hero__kicker { margin: 0 0 16px; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-hero h1 { margin: 0 0 20px; font-size: var(--ssj-text-3xl); line-height: 1.15; }
.ssj-hero__lead { margin: 0 0 12px; }
.ssj-hero__note { margin: 0 0 28px; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-hero__image { display: block; }
.ssj-hero__image img {
  width: 100%; height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--ssj-radius-md);
  background: var(--ssj-kinari);
}

.ssj-home__section { padding-top: 72px; }
.ssj-home__section > h2 { margin: 0 0 20px; }
.ssj-home .pagination { margin-top: 40px; }
.ssj-home__paged-title { margin: 8px 0 0; font-size: var(--ssj-text-2xl); }
.ssj-home__paged-title span { color: var(--ssj-haizumi); font-family: var(--ssj-font-sans); font-size: 0.5em; letter-spacing: 0; }
.ssj-home__paged-title + .ssj-home__section { padding-top: 32px; }

/* Short note on the author at the bottom */
.ssj-home__author { padding-top: 80px; }
.ssj-intro {
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px;
  padding: 32px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-lg);
}
.ssj-intro > div { flex: 1 1 400px; }
.ssj-intro p { margin: 0; }
.ssj-intro p + p { margin-top: 10px; }
.ssj-intro .ssj-intro__title {
  margin: 0 0 8px;
  color: var(--ssj-sumi);
  font-family: var(--ssj-font-serif);
  font-size: 24px; font-weight: var(--ssj-weight-heading);
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.3;
}
.ssj-intro__title + p { margin-top: 0; }
.ssj-intro p:last-child { font-size: 16px; }
.ssj-avatar--lg { width: 120px; height: 120px; font-size: 48px; }

@media (min-width: 721px) and (max-width: 1024px) {
  .ssj-hero, .ssj-hero.has-image { grid-template-columns: minmax(0, 1fr); padding: 40px; }
  .ssj-rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ssj-home { padding-top: 16px; }
  .ssj-home.ssj-container { padding-inline: 16px; }
  .ssj-home__section, .ssj-home__author { padding-inline: 4px; }
  .ssj-hero, .ssj-hero.has-image { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 24px 20px; }
  .ssj-hero.has-image { padding-top: 16px; }
  .ssj-hero__image { order: -1; } /* image first on phones */
  .ssj-hero__image img { aspect-ratio: 9 / 8; }
  .ssj-hero__kicker { margin-bottom: 10px; }
  .ssj-hero h1 { margin-bottom: 12px; }
  .ssj-hero__lead { font-size: 16px; line-height: 1.7; }
  .ssj-hero__note { margin-bottom: 20px; }
  .ssj-hero .ssj-btn { display: flex; width: 100%; justify-content: space-between; padding-inline: 18px; }
  .ssj-home__section { padding-top: 40px; }
  .ssj-home__section > h2 { margin-bottom: 14px; }
  .ssj-rooms { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ssj-room-card::before { width: 40px; height: 40px; border-radius: var(--ssj-radius-sm); }
  .ssj-room-card__name { font-size: 18px; }
  .ssj-home .pagination { margin-top: 28px; }
  .ssj-home__author { padding-top: 48px; }
  .ssj-intro { padding: 24px 20px; gap: 16px; }
  .ssj-avatar--lg { width: 80px; height: 80px; font-size: 34px; }
}

/* ==========================================================================
   5-3. Room (category) page (category.php) — pages.md §3, Category / CategoryHeader boards
   ========================================================================== */
.ssj-archive { padding-top: 32px; padding-bottom: var(--ssj-space-9); }
.ssj-archive > .ssj-breadcrumb { margin-bottom: 20px; }
.ssj-cathead {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center;
  margin-bottom: 56px;
}
.ssj-cathead h1 { margin: 0 0 16px; font-size: var(--ssj-text-3xl); line-height: 1.15; }
.ssj-cathead__page { color: var(--ssj-haizumi); font-family: var(--ssj-font-sans); font-size: 0.5em; letter-spacing: 0; }
.ssj-cathead__desc { margin: 0 0 12px; max-width: 460px; }
.ssj-cathead__count { margin: 0; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-cathead__image {
  aspect-ratio: 16 / 6;
  overflow: hidden;
  border: var(--ssj-border); border-radius: var(--ssj-radius-lg);
  background: var(--ssj-room-tint, var(--ssj-ai-soft));
}
.ssj-cathead__image img { width: 100%; height: 100%; object-fit: cover; }
.ssj-rowlist { display: flex; flex-direction: column; gap: 16px; max-width: 960px; }
.ssj-archive .pagination { max-width: 960px; margin-top: 40px; }

@media (max-width: 720px) {
  .ssj-archive { padding-top: 24px; }
  .ssj-cathead { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 32px; }
  .ssj-cathead h1 { font-size: var(--ssj-text-3xl); margin-bottom: 10px; }
  .ssj-cathead__image { aspect-ratio: 16 / 7; border-radius: var(--ssj-radius-md); }
  .ssj-cathead__image.is-empty { display: none; } /* an empty tint panel only takes room on a phone */
  .ssj-rowlist { gap: 12px; }
  .ssj-archive .pagination { margin-top: 28px; }
}

/* ==========================================================================
   5-4. Fixed pages: generic (page.php), About, Contact, legal — pages.md §4–6
   ========================================================================== */
.ssj-page { padding-top: 56px; padding-bottom: var(--ssj-space-9); }
.ssj-page__header { margin-bottom: 28px; }
.ssj-page__header h1 { margin: 0; font-size: var(--ssj-text-2xl); line-height: 1.2; }
.ssj-page__label { margin: 0 0 10px; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-page .entry-content > p:empty { display: none; } /* empty paragraphs left in the pages by the editor */

/* About: square image (or initial) next to the label, title and the page's own introduction */
.ssj-page--about { padding-top: 48px; }
.ssj-about-head {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: center;
  max-width: 960px;
  margin: 0 auto 24px;
}
.ssj-about-head__image {
  aspect-ratio: 1;
  overflow: hidden;
  border: var(--ssj-border); border-radius: var(--ssj-radius-lg);
  background: var(--ssj-sakura-soft);
}
.ssj-about-head__image img { width: 100%; height: 100%; object-fit: cover; }
.ssj-about-head__image.is-empty { display: flex; align-items: center; justify-content: center; }
.ssj-avatar--xl { width: 120px; height: 120px; font-size: 52px; background: var(--ssj-white); }
.ssj-about-head h1 { margin: 0 0 16px; font-size: var(--ssj-text-2xl); line-height: 1.2; }
.ssj-about-head__intro > * { margin: 0; }
.ssj-about-head__intro > * + * { margin-top: 0.8em; }
.ssj-page--about .entry-content { max-width: var(--ssj-content); }
.ssj-page--about .entry-content > h2:first-child { margin-top: 40px; }

/* Contact: 640px column; the form in a white box */
.ssj-page--contact article { max-width: 640px; margin-inline: auto; }
.ssj-page--contact .ssj-page__header { margin-bottom: 14px; }
.ssj-page--contact .entry-content { max-width: none; }
.ssj-page--contact .wp-block-kadence-advanced-form {
  margin-top: 32px; margin-bottom: 32px;
  padding: 32px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-lg);
}
.ssj-page--contact .kb-advanced-form .kb-adv-form-field:last-of-type { margin-bottom: 0; }
.ssj-page--contact .kt-row-column-wrap { gap: 16px !important; padding: 0 !important; }

/* Legal pages: 680px column, 17px text with slightly tighter lines for long reading */
.ssj-page--legal article { max-width: 680px; margin-inline: auto; }
.ssj-page--legal .ssj-page__header { margin-bottom: 10px; }
.ssj-page--legal .ssj-page__header h1 { font-size: 40px; }
.ssj-page--legal .entry-content { max-width: none; font-size: 17px; line-height: 1.75; }
.ssj-page--legal .entry-content > h2 { margin-top: 48px; margin-bottom: 12px; font-size: 24px; }
.ssj-page--legal .entry-content > h3 { margin-top: 28px; font-size: 18px; }
/* The page's first line, "Last updated: …" in italics, shown as a quiet date line */
.ssj-page--legal .entry-content > p:first-child:has(> em:only-child) {
  margin-bottom: 32px;
  color: var(--ssj-haizumi);
  font-size: var(--ssj-text-xs); line-height: 1.6;
}
.ssj-page--legal .entry-content > p:first-child > em:only-child { font-style: normal; }

@media (max-width: 720px) {
  .ssj-page { padding-top: 32px; }
  .ssj-about-head { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ssj-about-head__image { width: 160px; }
  .ssj-avatar--xl { width: 80px; height: 80px; font-size: 34px; }
  .ssj-page--contact .wp-block-kadence-advanced-form { padding: 22px 18px; }
  .kb-advanced-form .kt-row-column-wrap > .wp-block-kadence-column ~ .wp-block-kadence-column { margin-top: 18px; } /* Name and Email stack on phones */
  .ssj-page--legal .ssj-page__header h1 { font-size: var(--ssj-text-2xl); }
  .ssj-page--legal .entry-content > h2 { margin-top: 40px; font-size: 22px; }
}

/* ==========================================================================
   5-5. Search results (search.php) and 404 (404.php) — pages.md §7, Search404 boards
   ========================================================================== */
.ssj-search, .ssj-404 { padding-top: 48px; padding-bottom: 80px; }
.ssj-search__col, .ssj-404__col { max-width: 760px; margin-inline: auto; }
.ssj-search h1 { margin: 0 0 20px; font-size: 36px; line-height: 1.2; overflow-wrap: anywhere; }
.ssj-search__count { margin-left: 6px; color: var(--ssj-haizumi); font-family: var(--ssj-font-sans); font-size: 16px; letter-spacing: 0; white-space: nowrap; }
.ssj-search__form { margin-bottom: 16px; }
.ssj-search__form .ssj-input, .ssj-404__search .ssj-input { height: 50px; }

.ssj-results { list-style: none; margin: 0; padding: 0; }
.ssj-results li { margin: 0; }
.ssj-result {
  display: block;
  padding: 18px 0;
  border-bottom: var(--ssj-border);
  color: var(--ssj-sumi-soft);
  text-decoration: none;
}
.ssj-result__meta { display: block; color: var(--ssj-haizumi); font-size: var(--ssj-text-xs); line-height: 1.6; }
.ssj-result__title {
  display: block;
  margin: 2px 0 4px;
  color: var(--ssj-ai);
  font-family: var(--ssj-font-serif);
  font-size: 21px; font-weight: var(--ssj-weight-heading);
  letter-spacing: var(--ssj-tracking-heading);
  line-height: 1.35;
}
.ssj-result:hover .ssj-result__title { color: var(--ssj-ai-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--ssj-sakura-link); }
.ssj-result__text { display: block; font-size: 16px; line-height: 1.65; }
.ssj-result mark, .ssj-results mark { padding: 0 2px; border-radius: 3px; background: var(--ssj-sakura-soft); color: inherit; }
.ssj-search .pagination { margin-top: 32px; }
.ssj-search__none { margin: 24px 0 16px; }

/* Room links: small white tiles with the room's colour square */
.ssj-roomlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.ssj-roomlinks li { margin: 0; }
.ssj-roomlinks a {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--ssj-white);
  border: var(--ssj-border); border-radius: var(--ssj-radius-md);
  color: var(--ssj-sumi);
  text-decoration: none;
  transition: border-color var(--ssj-duration) var(--ssj-ease);
}
.ssj-roomlinks a::before { content: ""; flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--ssj-room, var(--ssj-ai)); }
.ssj-roomlinks a:hover { border-color: var(--ssj-line-strong); color: var(--ssj-ai-dark); }

.ssj-404__col { text-align: center; }
.ssj-404 h1 { margin: 0 0 12px; font-size: 40px; line-height: 1.2; }
.ssj-404__line { max-width: 520px; margin: 0 auto 28px; }
.ssj-404 .ssj-roomlinks { text-align: left; }
.ssj-404__search { max-width: 520px; margin: 28px auto 0; text-align: left; }
.ssj-404__home { margin: 24px 0 0; }

@media (max-width: 720px) {
  .ssj-search, .ssj-404 { padding-top: 32px; padding-bottom: 56px; }
  .ssj-search h1, .ssj-404 h1 { font-size: 30px; }
  .ssj-roomlinks { grid-template-columns: minmax(0, 1fr); }
}
