/*
 * HANABAKO article presentation — 2026-10-26
 * Load after the existing Arkhe styles, in the parent WordPress only.
 * The parent-only plugin supplies .hb-site-design; the independent /bukka/
 * installation does not load this stylesheet or receive that body class.
 *
 * This layer changes presentation only. Article HTML, media, captions,
 * affiliate markup, product-card controls and table structure stay intact.
 * Keep the existing Additional CSS for table scrolling before this layer.
 */

body.hb-site-design.single-post {
  --hb-article-green: #547c5f;
  --hb-article-ink: #293f32;
  --hb-article-muted: #5c685f;
  --hb-article-paper: #fbfaf6;
  --hb-article-line: #dbe2d7;
  --ark-color--main: var(--hb-article-green);
  --ark-color--text: var(--hb-article-ink);
  --ark-color--link: var(--hb-article-green);
  --ark-color--bg: var(--hb-article-paper);
  --ark-color--gray: #eef2e9;
  --ark-color--border: var(--hb-article-line);
  --ark-color--border--table: var(--hb-article-line);
  --ark-width--article: 820px;
  color: var(--hb-article-ink);
  background-color: var(--hb-article-paper);
}

/* Respect Arkhe's existing sidebar/no-sidebar layout and its mobile gutters. */
body.hb-site-design.single-post .l-main.l-article,
body.hb-site-design.single-post .p-entry {
  min-width: 0;
}

body.hb-site-design.single-post .l-content__body {
  margin-top: clamp(28px, 4vw, 52px);
  margin-bottom: clamp(40px, 5vw, 72px);
}

body.hb-site-design.single-post .p-entry__head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hb-article-line);
}

body.hb-site-design.single-post .p-entry__head .c-pageTitle__main {
  padding: 0;
  border: 0;
  color: var(--hb-article-ink);
  background: transparent;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: clamp(27px, 2.7vw, 36px);
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: .035em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

body.hb-site-design.single-post .p-entry__head .c-postMetas {
  color: var(--hb-article-muted);
  line-height: 1.7;
}

body.hb-site-design.single-post .p-entry__thumb {
  margin-top: 28px;
}

/* Keep the whole featured image visible, including tall illustrations. */
body.hb-site-design.single-post .p-entry__thumb__img {
  height: auto;
  max-height: 600px;
  object-fit: contain;
  background-color: var(--hb-article-paper);
}

body.hb-site-design.single-post .c-postContent.p-entry__content {
  margin-top: 32px;
  margin-bottom: 56px;
  color: var(--hb-article-ink);
  line-height: 1.95;
  letter-spacing: .025em;
}

/* Only ordinary top-level headings: nested boxes, FAQ and product widgets
 * retain their own markup, color and heading geometry. */
body.hb-site-design.single-post .c-postContent.p-entry__content > h2 {
  margin-top: 3.25rem;
  margin-bottom: 1.1rem;
  padding: 0 0 13px;
  border: 0;
  border-bottom: 1px solid var(--hb-article-line);
  color: var(--hb-article-ink);
  background: transparent;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 600;
  line-height: 1.65;
  box-shadow: none;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > h3 {
  margin-top: 2.4rem;
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
  color: var(--hb-article-ink);
  background: transparent;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: clamp(19px, 1.7vw, 22px);
  font-weight: 600;
  line-height: 1.7;
  box-shadow: none;
}

/* Restrict reading rhythm to direct article blocks. Do not cascade margins
 * into the inline-styled approved icon boxes or the Rinker product cards. */
body.hb-site-design.single-post .c-postContent.p-entry__content > :is(p, ul, ol) {
  margin-top: 1.45em;
  margin-bottom: 0;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > :is(ul, ol) {
  padding-inline-start: 1.5em;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > :is(ul, ol) > li + li {
  margin-top: .45em;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > :is(h2, h3) + :is(p, ul, ol, figure) {
  margin-top: 1.1rem;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > figure.wp-block-image {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > figure.wp-block-image img {
  max-width: 100%;
  height: auto;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > figure.wp-block-image > figcaption,
body.hb-site-design.single-post .c-postContent.p-entry__content > figure.wp-block-table > figcaption {
  margin-top: 10px;
  color: var(--hb-article-muted);
  font-size: .8125rem;
  line-height: 1.8;
}

/* Existing comparison tables already have horizontal-scroll wrappers and
 * their own min-widths. Preserve display:table, cell widths and focusability.
 * Do not add overflow:hidden to the article or force images inside tables. */
body.hb-site-design.single-post .c-postContent.p-entry__content > :is(figure.wp-block-table, figure.wp-block-flexible-table-block-table, div[role="region"]):has(> table) {
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
}

/* Keep internal text links legible without recoloring affiliate buttons. */
body.hb-site-design.single-post .c-postContent.p-entry__content :is(th, td) {
  word-break: normal;
  overflow-wrap: break-word;
}

body.hb-site-design.single-post .c-postContent.p-entry__content > p > a:not([class]):is([href^="https://hana-bako.com/"], [href^="/"], [href^="#"]) {
  color: var(--hb-article-green);
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-thickness: .06em;
}

@media (max-width: 600px) {
  body.hb-site-design.single-post .p-entry__head {
    padding-bottom: 20px;
  }

  body.hb-site-design.single-post .p-entry__head .c-pageTitle__main {
    font-size: clamp(25px, 6.8vw, 29px);
    line-height: 1.7;
    letter-spacing: .02em;
  }

  body.hb-site-design.single-post .p-entry__thumb {
    margin-top: 24px;
  }

  body.hb-site-design.single-post .c-postContent.p-entry__content {
    margin-top: 28px;
    margin-bottom: 42px;
    line-height: 1.95;
  }

  body.hb-site-design.single-post .c-postContent.p-entry__content > h2 {
    margin-top: 2.75rem;
    font-size: 22px;
    padding-bottom: 12px;
  }

  body.hb-site-design.single-post .c-postContent.p-entry__content > h3 {
    margin-top: 2.1rem;
    font-size: 20px;
  }
}
