/*
  Hanesol Blog Format CSS
  File: ./common/blog.css
  Purpose: 1記事1ページ型の読み物向けブログフォーマット
*/

:root {
  --bg: #f3f4f6;
  --paper: #ffffff;
  --text: #24313f;
  --muted: #667085;
  --line: #e6e9ee;
  --brand: #0f8f9f;
  --brand-dark: #08717f;
  --brand-soft: #e7f7f8;
  --accent: #f7b731;
  --cream: #fff8ea;
  --blue-soft: #eef7ff;
  --green-soft: #edf9f3;
  --red-soft: #fff1f1;
  --shadow: 0 10px 30px rgba(31, 41, 55, .08);
  --radius: 3px;
  --header-height: 68px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "M PLUS 1c", sans-serif;
  line-height: 1.9;
  letter-spacing: .02em;
  word-break: break-word;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

.site-logo img {
  width: auto;
  height: 30px;
  object-fit: contain;
}

.site-logo__text {
  font-size: 14px;
  color: var(--muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.header-nav a {
  color: var(--text);
}

.header-nav .header-nav__button {
  padding: 8px 14px;
  color: #fff;
  background: var(--brand);
  border-radius: 3px;
}

.header-nav .header-nav__button:hover {
  background: var(--brand-dark);
  text-decoration: none;
}

/* Layout */
.page-shell {
  max-width: 1120px;
  margin: 28px auto 0;
  padding: 0 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.article-card,
.sidebar-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.article-card {
  padding: 44px 52px 52px;
}

.article-meta {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.article-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 3px;
  font-weight: 700;
}

.article-card h1 {
  margin: 0 0 26px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.35;
  letter-spacing: .03em;
}

.main-visual {
  margin: 0 0 34px;
}

.main-visual img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.main-visual figcaption,
.article-image figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.article-card p {
  margin: 0 0 1.35em;
}

.article-card b,
.article-card strong {
  font-weight: 700;
  background: linear-gradient(transparent 62%, rgba(247, 183, 49, .35) 62%);
}

.article-card h2 {
  margin: 56px 0 22px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--line);
  position: relative;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.45;
}

.article-card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 72px;
  height: 2px;
  background: var(--brand);
}

.article-card h3 {
  margin: 34px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--brand);
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5;
}

.article-card h4 {
  margin: 28px 0 12px;
  font-size: 18px;
}

.article-image {
  margin: 32px 0;
}

.article-image img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* Lead and notes */
.lead {
  margin: 0 0 30px;
  padding: 15px 22px;
  background: var(--brand-soft);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  font-size: 17px;
}

.note-box,
.point-box,
.warning-box {
  margin: 28px 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.note-box {
  background: var(--cream);
}

.point-box {
  background: var(--green-soft);
}

.warning-box {
  background: var(--red-soft);
}

.note-box__title,
.point-box__title,
.warning-box__title {
  margin: 0 0 8px;
  font-weight: 700;
}

/* Lists */
ul,
ol {
  margin: 22px 0 30px;
  padding-left: 1.4em;
}

li { margin: .45em 0; }

.list-check,
.list-card,
ol.list-step,
ol.list-number {
  padding: 10px 40px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.list-check,
ol.list-step {
  background: var(--brand-soft);
}

.list-card,
ol.list-number {
  background: var(--cream);
}

.list-check {
  list-style: none;
  padding-left: 22px;
}

.list-check li {
  position: relative;
  padding-left: 1.6em;
}

.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

ol.list-step {
  list-style: none;
  counter-reset: step;
}

ol.list-step li {
  position: relative;
  padding-left: 2.4em;
}

ol.list-step li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: .15em;
  width: 1.7em;
  height: 1.7em;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.definition-list,
.link-list {
  margin: 24px 0 32px;
}

.definition-list div,
.link-list div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.definition-list div + div,
.link-list div + div {
  margin-top: 10px;
}

.definition-list dt {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--brand-dark);
}

.definition-list dd {
  margin: 0;
  color: var(--text);
}

.link-list dt {
  margin: 0 0 6px;
  font-weight: 700;
}

.link-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Tables */
.table-scroll {
  margin: 30px 0 36px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
  font-size: 15px;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

tr:last-child th,
tr:last-child td {
  border-bottom: none;
}

.table-basic th {
  background: #f7f8fa;
  font-weight: 700;
}

.table-blue th {
  color: #123b53;
  background: var(--blue-soft);
}

.table-green th {
  color: #174d36;
  background: var(--green-soft);
}

.table-accent th {
  color: #3f2b00;
  background: #fff3cd;
}

/* CTA */
.cta-box {
  margin: 48px 0 8px;
  padding: 28px;
  background: linear-gradient(180deg, #ffffff, var(--brand-soft));
  border: 1px solid #c9edf0;
  border-radius: var(--radius);
  text-align: center;
}

.cta-box h2 {
  margin-top: 0;
  border-bottom: none;
}

.cta-box h2::after { display: none; }

.cta-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 12px 18px;
  border-radius: 3px;
  font-weight: 700;
}

.button-primary {
  color: #fff;
  background: var(--brand);
}

.button-primary:hover {
  color: #fff;
  background: var(--brand-dark);
  text-decoration: none;
}

.button-secondary {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #b9e3e7;
}

.button-secondary:hover {
  background: var(--brand-soft);
  text-decoration: none;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
}

.sidebar-card {
  padding: 22px 20px;
}

.sidebar-card + .sidebar-card {
  margin-top: 18px;
}

.sidebar-title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 700;
}

.sidebar-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-list li {
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  line-height: 1.55;
  font-size: 14px;
}

.sidebar-list li:last-child { border-bottom: none; }

.sidebar-list span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

/* Footer */
.site-footer {
  padding: 30px 20px 34px;
  background: #26313a;
  color: #fff;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  margin-bottom: 12px;
}

.footer-links a {
  color: #fff;
}

.copyright {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--brand-dark);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

@media screen and (max-width: 960px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .sidebar-card {
    box-shadow: none;
  }
}

@media screen and (max-width: 767px) {
  :root {
    --header-height: 62px;
  }

  .site-header__inner {
    padding: 0 14px;
  }

  .site-logo img {
    height: 30px;
  }

  .site-logo__text {
    display: none;
  }

  .header-nav a:not(.header-nav__button) {
    display: none;
  }

  .header-nav .header-nav__button {
    padding: 7px 12px;
    font-size: 13px;
  }

  .page-shell {
    margin-top: 16px;
    padding: 0 12px 36px;
    gap: 18px;
  }

  .article-card {
    padding: 28px 20px 34px;
    border-radius: 6px;
  }

  .article-card h1 {
    margin-bottom: 20px;
  }

  .article-card h2 {
    margin-top: 44px;
  }

  .lead,
  .note-box,
  .point-box,
  .warning-box,
  .list-check,
  .list-card,
  ol.list-step,
  ol.list-number {
    padding: 15px;
  }

  .cta-box {
    padding: 22px 16px;
  }

  .button-primary,
  .button-secondary {
    width: 100%;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

/* =========================================================
   Responsive refinement for smartphone readability
   2026-05-30
   - 横スクロール防止
   - スマホ時の見出しサイズ調整
   - 固定ヘッダー内のロゴ・問い合わせボタン幅調整
   ========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.site-header,
.site-header__inner,
.page-shell,
.article-card,
.sidebar,
.sidebar-card {
  min-width: 0;
}

.article-card {
  overflow-wrap: anywhere;
}

.header-nav .header-nav__button {
  white-space: nowrap;
  flex-shrink: 0;
}

.site-logo {
  min-width: 0;
  overflow: hidden;
}

.site-logo img {
  max-width: 100%;
}

@media screen and (max-width: 767px) {
  body {
    font-size: 16px;
    line-height: 1.9;
    letter-spacing: .01em;
  }

  .site-header {
    overflow: hidden;
  }

  .site-header__inner {
    width: 100%;
    padding: 0 12px;
    gap: 8px;
  }

  .site-logo img {
    height: 28px;
    max-width: calc(100vw - 150px);
  }

  .header-nav {
    gap: 0;
    flex-shrink: 0;
  }

  .header-nav .header-nav__button {
    min-width: 106px;
    max-width: 116px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.3;
    text-align: center;
  }

  .page-shell {
    width: 100%;
    margin-top: 14px;
    padding: 0 10px 34px;
  }

  .article-card {
    width: 100%;
    padding: 24px 18px 34px;
    box-shadow: 0 6px 18px rgba(31, 41, 55, .06);
  }

  .article-meta {
    margin-bottom: 16px;
    gap: 7px;
    font-size: 12.5px;
    line-height: 1.6;
  }

  .article-category {
    padding: 4px 9px;
    font-size: 13px;
  }

  .article-card h1 {
    margin-bottom: 22px;
    font-size: clamp(24px, 7.1vw, 30px);
    line-height: 1.42;
    letter-spacing: .015em;
  }

  .main-visual {
    margin-bottom: 28px;
  }

  .lead {
    margin-bottom: 26px;
    padding: 16px 17px;
    font-size: 16px;
    line-height: 1.95;
  }

  .article-card p {
    margin-bottom: 1.25em;
    line-height: 1.95;
  }

  .article-card h2 {
    margin: 44px 0 18px;
    padding-bottom: 10px;
    font-size: clamp(21px, 6vw, 25px);
    line-height: 1.5;
    letter-spacing: .01em;
  }

  .article-card h3 {
    margin: 30px 0 14px;
    padding-left: 12px;
    font-size: clamp(18px, 5vw, 21px);
    line-height: 1.55;
    letter-spacing: .01em;
  }

  .article-card h4 {
    font-size: 17px;
    line-height: 1.55;
  }

  .article-image {
    margin: 28px 0;
  }

  ul,
  ol {
    margin: 20px 0 28px;
    padding-left: 1.25em;
  }

  li {
    margin: .5em 0;
    line-height: 1.8;
  }

  .list-check,
  .list-card,
  ol.list-step,
  ol.list-number,
  .note-box,
  .point-box,
  .warning-box {
    padding: 16px 17px;
  }

  .list-check {
    padding-left: 17px;
  }

  .definition-list div,
  .link-list div {
    padding: 15px 16px;
  }

  .table-scroll {
    margin: 26px -2px 32px;
  }

  table {
    min-width: 560px;
    font-size: 14px;
  }

  th,
  td {
    padding: 11px 12px;
  }

  .sidebar-card {
    padding: 20px 18px;
  }

  .sidebar-title {
    font-size: 15px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

@media screen and (max-width: 420px) {
  :root {
    --header-height: 58px;
  }

  .site-header__inner {
    padding: 0 10px;
  }

  .site-logo img {
    height: 25px;
    max-width: calc(100vw - 138px);
  }

  .header-nav .header-nav__button {
    min-width: 100px;
    max-width: 106px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .page-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  .article-card {
    padding: 22px 16px 32px;
  }

  .article-card h1 {
    font-size: clamp(23px, 7vw, 28px);
  }

  .article-card h2 {
    font-size: clamp(20px, 5.8vw, 24px);
  }

  .lead {
    padding: 15px 15px;
  }
}

@media screen and (max-width: 360px) {
  .site-logo img {
    max-width: calc(100vw - 128px);
  }

  .header-nav .header-nav__button {
    min-width: 92px;
    max-width: 98px;
    font-size: 12px;
  }

  .article-card {
    padding-right: 14px;
    padding-left: 14px;
  }
}
