/*
Theme Name: 50代からの暮らしとお金の案内所
Author: 前田しんご
Description: 暮らしとお金の情報を読みやすく届けます。
Version: 1.8.0
Requires at least: 6.6
Tested up to: 7.0.2
Requires PHP: 7.4
Text Domain: kurashi-kakunin
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --kk-ink: #172033;
  --kk-muted: #4b5563;
  --kk-paper: #ffffff;
  --kk-soft: #f3f6f8;
  --kk-border: #c7d0d9;
  --kk-primary: #064f78;
  --kk-primary-dark: #063852;
  --kk-accent: #f2b705;
  --kk-ok: #146c43;
  --kk-alert: #9b2c2c;
  --kk-focus: #ffbf47;
  --kk-width: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  margin: 0;
  color: var(--kk-ink);
  background: var(--kk-paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: clamp(1.25rem, 1.15rem + .35vw, 1.375rem);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
a { color: #005a87; text-decoration-thickness: .12em; text-underline-offset: .16em; }
a:hover { color: #003c5b; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 4px solid var(--kk-focus);
  outline-offset: 3px;
}
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
button, .button, input[type="submit"], input[type="search"] { min-height: 48px; }
small { font-size: 1rem; }
h1, h2, h3 { line-height: 1.35; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 1.65rem + 1.5vw, 3.25rem); }
h2 { font-size: clamp(1.625rem, 1.45rem + .8vw, 2.25rem); margin-top: 2em; }
h3 { font-size: clamp(1.375rem, 1.25rem + .5vw, 1.75rem); }
p, ul, ol { margin-block: 0 1.2em; }
li + li { margin-top: .45em; }
.screen-reader-text { position: absolute; 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 { position: fixed; z-index: 100000; top: 8px; left: 8px; width: auto; height: auto; padding: 12px 16px; clip: auto; background: #fff; color: #000; }
.skip-link { font-weight: 700; }

.site-header { border-bottom: 1px solid var(--kk-border); background: #fff; }
.site-header__inner, .site-footer__inner, .site-main, .breadcrumbs { width: min(calc(100% - 32px), var(--kk-width)); margin-inline: auto; }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; min-height: 78px; padding-block: 10px; }
.header-promise { min-width: 0; max-width: 35em; color: var(--kk-ink); font-size: clamp(1rem, .9rem + .35vw, 1.2rem); font-weight: 900; line-height: 1.45; text-decoration: none; }
.header-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 12px; }
.header-social { display: flex; align-items: center; gap: 8px; }
.social-icon { display: inline-flex; width: 42px; aspect-ratio: 1; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-size: 1.25rem; font-weight: 900; line-height: 1; text-decoration: none; }
.social-icon--tiktok { background: #111; }
.social-icon--facebook { background: #1769aa; font-family: Arial, sans-serif; }
.primary-navigation { display: block; width: auto; padding: 0; }
.primary-navigation ul { display: flex; list-style: none; align-items: center; gap: 4px; margin: 0; padding: 0; }
.primary-navigation a { display: block; min-height: 48px; padding: 9px 10px; border-radius: 7px; color: var(--kk-ink); font-size: 1rem; font-weight: 800; text-decoration: none; }
.primary-navigation a:hover { background: var(--kk-soft); }
.header-search { margin-left: auto; }
.search-form { display: flex; gap: 8px; }
.search-field { min-width: 0; width: 100%; border: 2px solid #687484; border-radius: 6px; padding: 10px 12px; }
.search-submit, .button { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; border: 2px solid var(--kk-primary-dark); border-radius: 7px; padding: 10px 18px; background: var(--kk-primary); color: #fff; font-weight: 800; line-height: 1.45; text-align: center; text-decoration: none; white-space: normal; cursor: pointer; }
.search-submit:hover, .button:hover { background: var(--kk-primary-dark); color: #fff; }

.breadcrumbs { padding-block: 14px; font-size: 1rem; }
.site-main { padding-block: 28px 64px; }
.hero { margin-inline: 0; padding: clamp(22px, 4vw, 44px); overflow: hidden; border-radius: 14px; background: linear-gradient(135deg, #eef7f1 0%, #fffdf5 55%, #edf4f8 100%); }
.hero__content { min-width: 0; text-align: center; }
.hero__content h1 { margin: 0 0 clamp(20px, 4vw, 38px); font-size: clamp(1.8rem, 1.45rem + 1.5vw, 3.2rem); }
.hero__content h1 span, .hero__content h1 strong { display: block; }
.hero__content h1 strong { color: var(--kk-primary-dark); font-size: 1.15em; }
.hero__people { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: clamp(18px, 5vw, 64px); width: min(100%, 860px); margin-inline: auto; }
.hero__character, .hero__person { min-width: 0; text-align: center; }
.hero__character-image { display: block; width: min(100%, 260px); max-height: 280px; margin-inline: auto; object-fit: contain; }
.hero__character-empty { display: grid; width: min(100%, 260px); aspect-ratio: 1; place-items: center; margin-inline: auto; border: 3px dashed #84919d; border-radius: 50%; background: rgba(255,255,255,.72); color: var(--kk-muted); font-size: 1rem; font-weight: 800; }
.hero__tiktok { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 6px; color: var(--kk-ink); font-size: 1rem; font-weight: 900; text-decoration: none; }
.hero__tiktok .social-icon { width: 38px; }
.hero__name { margin: 0; color: var(--kk-primary-dark); font-size: clamp(1.35rem, 1.15rem + .65vw, 1.85rem); font-weight: 900; }
.hero__person-image, .hero__person-empty { display: block; width: min(100%, 360px); aspect-ratio: 4 / 5; margin-inline: auto; border-radius: 18px 18px 0 0; }
.hero__person-image { object-fit: cover; object-position: center top; box-shadow: 0 10px 28px rgba(23,32,51,.16); }
.hero__person-empty { display: grid; place-items: center; border: 3px dashed #84919d; background: rgba(255,255,255,.72); color: var(--kk-muted); font-size: 1rem; font-weight: 800; }
.author-card-compact { margin-top: 16px; text-align: left; }
.author-card-compact--text-only { padding: 0; border: 0; background: transparent; }
.author-card-compact__name { margin: 0; color: var(--kk-primary-dark); font-size: 1.05rem; font-weight: 900; }
.author-card-compact__role { margin: 2px 0 0; color: var(--kk-muted); font-size: 1rem; font-weight: 800; }
.author-card-compact .author-photo { float: left; width: 64px; aspect-ratio: 1; margin: 0 12px 4px 0; border-radius: 50%; }
.author-photo { width: min(100%, 320px); aspect-ratio: 4 / 5; margin-inline: auto; border: 4px solid #fff; border-radius: 16px; object-fit: cover; box-shadow: 0 4px 18px rgba(0,0,0,.14); }

.topic-section, .latest-section { margin-top: 48px; }
.decision-card { margin-block: 28px 36px; padding: clamp(18px, 4vw, 28px); border: 4px solid var(--kk-primary); border-radius: 14px; background: #eef6fa; }
.decision-card h2 { margin-top: 0; }
.decision-card__grid { display: grid; gap: 14px; margin: 0; }
.decision-card__item { padding: 17px; border: 2px solid var(--kk-border); border-radius: 10px; background: #fff; }
.decision-card__item dt { color: var(--kk-primary-dark); font-weight: 900; }
.decision-card__item dd { margin: 6px 0 0; }
.decision-card__item--action { border-color: var(--kk-ok); background: #f0f9f4; }
.card-grid { display: grid; gap: 18px; }
.article-list { grid-template-columns: minmax(0, 1fr); }
.article-list__item > .post-card { height: 100%; }
.article-list__more { margin: 28px 0 0; text-align: center; }
[hidden] { display: none !important; }
.entrance-card, .topic-card, .post-card { display: block; border: 2px solid var(--kk-border); border-radius: 12px; padding: 22px; background: #fff; color: var(--kk-ink); text-decoration: none; box-shadow: 0 2px 0 rgba(0,0,0,.05); }
.entrance-card:hover, .topic-card:hover, .post-card:hover { border-color: var(--kk-primary); background: #f5fbfe; color: var(--kk-ink); }
.entrance-card strong, .topic-card strong { display: block; font-size: 1.12em; }
.entrance-card span, .topic-card span { display: block; margin-top: 6px; color: var(--kk-muted); font-size: 1rem; }
.post-card__link { display: block; color: inherit; text-decoration: none; }
.post-card__link:focus-visible { outline: 3px solid var(--kk-primary); outline-offset: 4px; }
.post-card__title { display: block; margin: 10px 0; color: var(--kk-ink); font-size: 1.12em; font-weight: 900; line-height: 1.45; }
.post-card__meta, .entry-meta { color: var(--kk-muted); font-size: 1rem; }
.post-card__meta { display: block; }
.post-card__status, .status-badge { display: inline-block; padding: 5px 12px; border: 2px solid currentColor; border-radius: 999px; font-size: 1rem; font-weight: 900; }
.post-card__thumbnail { position: relative; display: block; margin: -22px -22px 18px; overflow: hidden; aspect-ratio: 16 / 9; border-radius: 10px 10px 0 0; background: #173247; color: #fff; }
.post-card__thumbnail-image, .post-card__thumbnail-fallback { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card__thumbnail-fallback, .article-thumbnail__fallback { --visual-a: #173247; --visual-b: #4e6e76; --visual-accent: #f4d06f; background: linear-gradient(135deg, var(--visual-a), var(--visual-b)); }
.topic-visual--yokoze-chichibu { --visual-a: #234f33; --visual-b: #6e8c47; --visual-accent: #f4e2a3; }
.topic-visual--money-support { --visual-a: #174c37; --visual-b: #25845f; --visual-accent: #ffe08a; }
.topic-visual--pension-work { --visual-a: #173f6b; --visual-b: #3d74a6; --visual-accent: #d9ecff; }
.topic-visual--health-medical { --visual-a: #7b2831; --visual-b: #bb5a64; --visual-accent: #fff0f1; }
.topic-visual--care-end-of-life { --visual-a: #5a3c75; --visual-b: #8c6aaa; --visual-accent: #f2e8ff; }
.topic-visual--inheritance-home { --visual-a: #6b4529; --visual-b: #a87750; --visual-accent: #fff0d6; }
.topic-visual--disaster-weather { --visual-a: #6b3b12; --visual-b: #b16f24; --visual-accent: #fff1c7; }
.topic-visual--saving-smartphone { --visual-a: #075665; --visual-b: #23869a; --visual-accent: #d9f7ff; }
.topic-visual--food-living { --visual-a: #5c4b1b; --visual-b: #a78b3c; --visual-accent: #fff4bd; }
.topic-visual--politics { --visual-a: #3e4551; --visual-b: #697485; --visual-accent: #eef3f8; }
.post-card__topic-label, .article-thumbnail__topic-label { position: absolute; top: 14px; left: 14px; z-index: 1; padding: 5px 10px; border: 2px solid rgba(255,255,255,.78); border-radius: 999px; background: rgba(0,0,0,.26); color: #fff; font-size: 1rem; font-weight: 900; }
.post-card__topic-mark, .article-thumbnail__topic-mark { position: absolute; right: 7%; top: 50%; display: grid; place-items: center; width: 27%; aspect-ratio: 1; transform: translateY(-50%); border: 4px solid rgba(255,255,255,.82); border-radius: 50%; background: rgba(0,0,0,.16); color: var(--visual-accent); font-size: clamp(2.2rem, 7vw, 5.5rem); font-weight: 900; line-height: 1; }

.article-header { width: 100%; min-width: 0; max-width: 900px; margin-inline: auto; }
.article-thumbnail { margin: 0 0 clamp(24px, 4vw, 40px); }
.article-thumbnail__image, .article-thumbnail__fallback { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; object-fit: cover; }
.article-thumbnail__fallback { position: relative; }
.article-header__content { width: 100%; min-width: 0; max-width: 780px; margin-inline: auto; }
.article-header__content h1 { max-width: 100%; margin: 0 0 12px; overflow-wrap: anywhere; word-break: break-word; }
.article-categories { margin-bottom: 12px; font-weight: 800; }
.article-summary { font-size: 1.08em; font-weight: 650; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.alert-box, .freeze-box { border: 4px solid var(--kk-alert); border-radius: 10px; padding: 18px; background: #fff3f3; color: #4b1111; font-weight: 750; }
.freeze-box { margin-block: 24px; }
.article-verification { margin-top: 48px; padding-top: 24px; border-top: 3px solid var(--kk-border); }
.article-verification h2 { margin-top: 0; }
.fact-list { margin: 0 0 22px; }
.fact-list > div { padding: 12px 0; border-bottom: 1px solid var(--kk-border); }
.fact-list dt { font-weight: 900; }
.fact-list dd { margin: 4px 0 0; }
.article-body { width: 100%; min-width: 0; max-width: 780px; margin-inline: auto; line-height: 1.9; line-break: strict; }
.article-body > * { min-width: 0; max-width: 100%; }
.entry-content, .article-sources, .comments-area { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.article-body a { font-weight: 650; }
.entry-content p, .entry-content li { max-inline-size: 36em; }
.entry-content h2, .entry-content h3, .article-body > section > h2, .article-body > section > h3 { max-inline-size: 24em; scroll-margin-top: 20px; }
.entry-content h2, .article-body > section > h2 { margin-block: 1.8em .7em; }
.entry-content h3, .article-body > section > h3 { margin-block: 1.5em .6em; }
.article-body > .decision-card > h2 { margin-top: 0; }
.article-body table { width: 100%; max-width: 100%; border-collapse: collapse; table-layout: fixed; }
.article-body th, .article-body td { border: 1px solid #798592; padding: 12px; text-align: left; vertical-align: top; }
.separation-panel { margin-block: 26px; padding: 20px; border-left: 8px solid var(--kk-primary); background: #f2f7fa; }
.separation-panel--uncertain { border-left-color: #a15c00; background: #fff6e7; }
.separation-panel--opinion { border-left-color: #70429a; background: #f7f1fb; }
.correction-history { margin-top: 42px; padding-top: 24px; border-top: 3px solid var(--kk-border); }
.article-sources { margin-top: 42px; padding-top: 24px; border-top: 3px solid var(--kk-border); }
.article-sources h2 { margin-top: 0; }
.article-sources h3 { margin: 1.4em 0 .35em; }
.article-sources p:last-child { margin-bottom: 0; }
.article-sources__warning { padding: 16px; border-left: 6px solid var(--kk-alert); background: #fff5f5; font-weight: 800; }
.author-box { display: grid; gap: 18px; margin-top: 44px; padding: 22px; border: 2px solid var(--kk-border); border-radius: 12px; background: var(--kk-soft); }
.author-box .author-photo { width: 160px; }
.author-box--text-only { grid-template-columns: 1fr; }
.action-panel { margin-top: 48px; padding: clamp(22px, 4vw, 34px); border: 3px solid var(--kk-primary); border-radius: 14px; background: #eef6fa; }
.action-panel h2 { margin-top: 0; }
.action-panel__links { display: grid; gap: 14px; }
.action-link { display: block; min-height: 72px; padding: 16px 18px; border: 2px solid var(--kk-primary); border-radius: 9px; background: #fff; color: var(--kk-ink); text-decoration: none; }
.action-link:hover { background: #f8fcfe; color: var(--kk-ink); }
.action-link strong { display: block; color: var(--kk-primary-dark); font-size: 1.05em; text-decoration: underline; text-underline-offset: .16em; }
.pagination, .post-navigation { margin-top: 36px; font-weight: 800; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.nav-links a { display: inline-flex; min-height: 44px; align-items: center; padding-block: 6px; }

.comments-area { max-width: 780px; margin: 54px auto 0; }
.comment-list { padding-left: 1.2em; }
.comment-body { margin-block: 18px; padding: 18px; border: 1px solid var(--kk-border); border-radius: 8px; }
.comment-form label { display: block; font-weight: 800; }
.comment-form input:not([type="checkbox"]), .comment-form textarea { width: 100%; border: 2px solid #687484; border-radius: 6px; padding: 10px; }
.required-field-message { display: block; }
.site-footer { border-top: 5px solid var(--kk-primary); background: #14293a; color: #fff; }
.site-footer__inner { padding-block: 32px; }
.site-footer a { color: #fff; }
.site-footer small { color: #d7e0e6; }
.empty-state { padding: 30px; border: 2px dashed var(--kk-border); background: var(--kk-soft); text-align: center; }

@media (min-width: 640px) {
  .card-grid--three, .card-grid--topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .author-box { grid-template-columns: 180px 1fr; align-items: center; }
  .author-box.author-box--text-only { grid-template-columns: 1fr; }
  .action-panel__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-card__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .decision-card__item--wide, .decision-card__item--action { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .site-header__inner { min-height: 82px; }
  .card-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid--three.article-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid--topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-panel__links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .site-header__inner { align-items: flex-start; }
  .header-promise, .header-actions { width: 100%; }
  .header-actions { flex-wrap: wrap; justify-content: space-between; }
  .primary-navigation { flex: 1 1 100%; }
  .primary-navigation ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .primary-navigation a { padding-inline: 5px; text-align: center; }
  .hero__people { grid-template-columns: 1fr; }
  .hero__character-image { max-height: 220px; }
  .hero__character-empty { width: min(100%, 220px); }
  .hero__person-image, .hero__person-empty { width: min(100%, 300px); }
  .article-body .wp-block-table { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .article-body table { display: block; overflow-x: auto; table-layout: auto; -webkit-overflow-scrolling: touch; }
  .article-body th, .article-body td { min-width: 9rem; }
  .comment-list, .comment-list .children { padding-left: 0; list-style-position: inside; }
}

@media (max-width: 430px) {
  .site-header__inner, .site-footer__inner, .site-main, .breadcrumbs { width: min(calc(100% - 24px), var(--kk-width)); }
  .site-header__inner { gap: 12px; padding-block: 10px; }
  .header-promise { font-size: 1rem; }
  .social-icon { width: 40px; }
  .primary-navigation ul { gap: 4px; }
  .primary-navigation a { min-height: 44px; padding: 8px 4px; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.25; text-align: center; }
  .hero, .action-panel, .decision-card { padding: 16px; }
  .search-form { flex-wrap: wrap; }
  .search-submit { width: 100%; }
  .decision-card__item, .fact-list > div { padding: 14px; }
}

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

@media print {
  .site-header, .site-footer, .comments-area, .post-navigation, .search-form { display: none !important; }
  body { color: #000; background: #fff; font-size: 12pt; }
  .site-main, .article-body { width: 100%; max-width: none; }
  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
