/* =========================================
   Calm Knowledge Blog Theme (FS-like)
   - readable, low-fatigue, repeat-visit design
   ========================================= */

/* 1) Design Tokens */
:root {
    /* Neutrals (paper-like) */
    --bg: #fbfaf6;
    --surface: #ffffff;
    --surface-2: #f4f2ea;

    --text: #1e1f1c;
    --muted: #5a5f57;
    --muted-2: #7a8077;

    --border: #e7e1d3;

    /* Accent (low saturation) */
    --accent: #2f5f55; /* deep desaturated green */
    --accent-2: #3a7267; /* hover */
    --link: var(--accent);
    --link-hover: var(--accent-2);

    /* Typography */
    --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
        'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
    --font-serif: ui-serif, 'Iowan Old Style', 'Palatino',
        'Hiragino Mincho ProN', 'Noto Serif JP', 'Yu Mincho', serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        'Liberation Mono', monospace;

    --maxw: 980px;
    --contentw: 760px;

    /* Spacing / radius / shadow */
    --r: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);

    /* Rhythm */
    --lh: 1.85;
}

/* 2) Base */
* {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: var(--lh);
}

html,
body {
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}
a {
    color: var(--link);
    text-decoration: none;
}
a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}
code,
pre {
    font-family: var(--font-mono);
}

.container {
    width: min(var(--maxw), calc(100% - 32px));
    margin: 0 auto;
}

.content {
    width: min(var(--contentw), 100%);
    margin: 0 auto;
}

.hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}

/* 3) Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 95;
    background: rgba(251, 250, 246, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
}

.brand {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.brand a {
    color: var(--text);
    text-decoration: none;
}
.brand__title {
    font-family: var(--font-serif);
    font-weight: 700;
    letter-spacing: 0.2px;
    font-size: 18px;
}
.brand__tagline {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.nav {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav a {
    color: var(--muted);
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 10px;
}
.nav a:hover {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}

/* 4) Layout */
.page {
    padding: 30px 0 70px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* 5) Hero */
.hero {
    padding: 22px 0 12px;
}
.hero__kicker {
    color: var(--muted-2);
    font-size: 13px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(26px, 3.3vw, 42px);
    line-height: 1.25;
    margin: 10px 0 6px;
}
.hero__lead {
    color: var(--muted);
    font-size: 16px;
    max-width: 68ch;
}

/* 6) Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 18px;
}

.card--plain {
    background: transparent;
    border: 1px solid var(--border);
    box-shadow: none;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 18px;
    margin: 0 0 10px;
}

.meta {
    font-size: 12px;
    color: var(--muted-2);
}

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

.article-item {
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.article-item:first-child {
    border-top: 0;
    padding-top: 0;
}
.article-item__title {
    font-size: 16px;
    margin: 2px 0 6px;
    line-height: 1.4;
}
.article-item__excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.badge {
    font-size: 12px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
}

/* 7) Sidebar */
.sidebar .card {
    margin-bottom: 16px;
}

.search {
    display: flex;
    gap: 8px;
}
.search input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    font-size: 14px;
}
.search button {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}
.search button:hover {
    background: #efece1;
}

.kv-links a {
    display: block;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
}
.kv-links a:first-child {
    border-top: 0;
}
.kv-links a:hover {
    color: var(--text);
    text-decoration: none;
}

/* 8) Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    background: var(--surface-2);
    text-decoration: none;
}
.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
}

/* 9) Article page */
.breadcrumb {
    font-size: 12px;
    color: var(--muted-2);
    margin-bottom: 12px;
}

.article {
    padding: 26px;
}
.article h1 {
    font-family: var(--font-serif);
    line-height: 1.25;
    margin: 6px 0 10px;
    font-size: clamp(24px, 2.5vw, 36px);
}
.article h2,
.article h3 {
    font-family: var(--font-serif);
    line-height: 1.35;
}
.article h2 {
    margin-top: 26px;
    font-size: 20px;
}
.article h3 {
    margin-top: 18px;
    font-size: 17px;
}
.article p {
    margin: 12px 0;
}
.article ul {
    margin: 10px 0 12px 1.2em;
}
.article pre {
    overflow: auto;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #0f1412;
    color: #e7f0ea;
}
.article code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1px 6px;
}
.article pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

/* ToC */
.toc {
    border-left: 3px solid var(--border);
    padding-left: 14px;
}
.toc a {
    color: var(--muted);
}
.toc a:hover {
    color: var(--text);
    text-decoration: none;
}

/* 10) Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
    color: var(--muted);
    font-size: 13px;
}
.footer-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.footer-links a {
    color: var(--muted);
}
.footer-links a:hover {
    color: var(--text);
    text-decoration: none;
}

/* =========================================
   Add-ons: Portfolio + About + Contact
   (append to the end of style.css)
   ========================================= */

/* Portfolio grid */
.portfolio-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.chip:hover {
    background: var(--surface-2);
    color: var(--text);
    text-decoration: none;
}
.chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 860px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.case-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 16px;
    display: grid;
    gap: 10px;
}

.case-card__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.case-card__title {
    font-size: 16px;
    margin: 0;
    line-height: 1.45;
}
.case-card__title a {
    color: var(--text);
    text-decoration: none;
}
.case-card__title a:hover {
    text-decoration: underline;
}

.case-card__desc {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.case-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 12px;
}

.case-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 560px) {
    .case-stats {
        grid-template-columns: 1fr;
    }
}

.stat {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
}

.stat__k {
    font-size: 12px;
    color: var(--muted-2);
}
.stat__v {
    font-size: 14px;
    color: var(--text);
    margin-top: 2px;
}

.case-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 2px;
}

.note {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
    color: var(--muted);
    font-size: 14px;
}

/* About page */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
}

@media (max-width: 980px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 560px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

.kpi {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface);
}

.kpi .meta {
    margin-top: 4px;
}

/* Contact form */
.form {
    display: grid;
    gap: 12px;
}

.form-row {
    display: grid;
    gap: 6px;
}

.label {
    font-size: 13px;
    color: var(--muted);
}

.req {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 2px 8px;
    vertical-align: middle;
}

.input,
.textarea,
.select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
    font-size: 14px;
    color: var(--text);
}

.textarea {
    min-height: 160px;
    resize: vertical;
}

.help {
    font-size: 12px;
    color: var(--muted-2);
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
}

.privacy {
    font-size: 12px;
    color: var(--muted-2);
}

.alert {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r);
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
}

/* =========================
   Header: hamburger + drawer
========================= */

/* ボタン（デスクトップでは非表示） */
.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: transparent;
    position: relative;
    cursor: pointer;
}

/* ハンバーガーの3本線 */
.nav-toggle__lines,
.nav-toggle__lines::before,
.nav-toggle__lines::after {
    content: '';
    display: block;
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
    transform: translateX(-50%);
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__lines {
    top: 50%;
    transform: translate(-50%, -50%);
}
.nav-toggle__lines::before {
    top: calc(50% - 6px);
}
.nav-toggle__lines::after {
    top: calc(50% + 6px);
}

/* メニュー開いたとき：×に変形 */
.site-header.is-nav-open .nav-toggle__lines {
    opacity: 0;
}
.site-header.is-nav-open .nav-toggle__lines::before {
    top: 50%;
    transform: translateX(-50%) rotate(45deg);
}
.site-header.is-nav-open .nav-toggle__lines::after {
    top: 50%;
    transform: translateX(-50%) rotate(-45deg);
}

/* オーバーレイ（デフォルトは非表示） */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 90;
}

.site-header .nav {
    z-index: 100;
}

/* ========== モバイル（ここが本体） ========== */
@media (max-width: 960px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* navをドロワー化 */
    .site-header .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: min(84vw, 360px);
        height: 100vh;
        padding: 76px 18px 18px;
        background: var(--bg, #fff);
        border-left: 1px solid var(--border);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
        z-index: 100;

        display: flex;
        flex-direction: column;
        gap: 10px;

        transform: translateX(100%);
        transition: transform 0.22s ease;
    }

    /* navが開く */
    .site-header.is-nav-open .nav {
        transform: translateX(0);
    }

    /* overlayが出る */
    body.is-nav-open .nav-overlay {
        display: block;
    }

    /* ドロワー内リンクを押しやすく */
    .site-header .nav a {
        display: block;
        padding: 12px 10px;
        border-radius: 12px;
    }

    /* ヘッダー内の並び調整（brand 左 / toggle 右） */
    .header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
}

/* スクロールロック（メニュー開いている間） */
body.is-nav-open {
    overflow: hidden;
}

/* =========================
     Footer: responsive
  ========================= */

/* もし footer-grid を使っている場合のレスポンシブ */
.footer-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.2fr 1fr 1fr;
}

@media (max-width: 960px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.post-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
}
@media (max-width: 960px){
  .post-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .post-grid{ grid-template-columns:1fr; }
}

.post-card{ border-radius:16px; overflow:hidden; background:#fff; }
.post-card__link{ display:block; color:inherit; text-decoration:none; }
.post-card__thumb img{ width:100%; height:180px; object-fit:cover; display:block; }
.post-card__thumb--placeholder{ height:180px; background:rgba(0,0,0,.06); }
.post-card__body{ padding:14px 14px 16px; }
.post-card__meta{ display:flex; gap:10px; align-items:center; font-size:12px; opacity:.8; }
.post-card__title{ margin:8px 0 8px; font-size:16px; line-height:1.4; }
.post-card__excerpt{ margin:0; font-size:13px; line-height:1.7; opacity:.9; }

.sidebar ul,
.widget-area ul,
.site-sidebar ul {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.sidebar li,
.widget-area li,
.site-sidebar li {
  list-style: none;
}

.sidebar li::marker,
.widget-area li::marker,
.site-sidebar li::marker {
  content: "";
}

