@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
    --bg: #f5f3ef;
    --bg-sub: #ece8e1;
    --bg-card: #ffffff;
    --bg-code: #eae6df;
    --text: #1d1b18;
    --text-sub: #70685e;
    --text-muted: #a09890;
    --accent: #9a7357;
    --accent-hover: #7d5c44;
    --accent-bg: #f0e8df;
    --accent-border: #e0d4c6;
    --border: #e8e4dd;
    --border-strong: #d8d2c8;
    --thumb-bg: #ece8e1;
    --thumb-icon: #c8bfb4;
    --aff-bg: #faf8f5;
    --aff-border: #e8e2d8;
    --aff-btn-bg: #9a7357;
    --aff-btn-text: #fff;
    --header-border: #e8e4dd;
    --nav-text: #a09890;
    --shadow: rgba(30, 25, 18, 0.06);
}

[data-theme="dark"] {
    --bg: #12100d;
    --bg-sub: #1c1915;
    --bg-card: #1a1714;
    --bg-code: #1e1a16;
    --text: #ddd8d0;
    --text-sub: #8a8278;
    --text-muted: #5a544c;
    --accent: #c99b7a;
    --accent-hover: #ddb08e;
    --accent-bg: #1e1a15;
    --accent-border: #302820;
    --border: #221f1a;
    --border-strong: #302c24;
    --thumb-bg: #1c1915;
    --thumb-icon: #2e2a24;
    --aff-bg: #181510;
    --aff-border: #2a2520;
    --aff-btn-bg: #c99b7a;
    --aff-btn-text: #12100d;
    --header-border: #221f1a;
    --nav-text: #6a6258;
    --shadow: rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.9;
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

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

/* ── Header ── */
.site-header {
    border-bottom: 1px solid var(--header-border);
    padding: 24px 0;
}

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

.site-logo {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--text);
    text-decoration: none;
}

.site-tagline {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a {
    font-size: 13px;
    color: var(--nav-text);
    text-decoration: none;
    transition: color 0.2s;
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--accent); }

.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; font-size: 24px; }

/* ── Theme toggle ── */
.theme-toggle {
    position: relative;
    width: 56px;
    height: 28px;
    background: var(--border-strong);
    border-radius: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s;
}
.theme-toggle:hover {
    border-color: var(--accent);
}
.theme-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: var(--bg-card);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    z-index: 1;
}
[data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(28px);
}
.theme-toggle__icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    line-height: 1;
    transition: opacity 0.3s;
    pointer-events: none;
}
.theme-toggle__icon--sun {
    left: 7px;
    opacity: 1;
}
.theme-toggle__icon--moon {
    right: 6px;
    opacity: 0.35;
}
[data-theme="dark"] .theme-toggle__icon--sun { opacity: 0.35; }
[data-theme="dark"] .theme-toggle__icon--moon { opacity: 1; }

/* ── Main ── */
.site-main {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* ── Article card list ── */
.article-list { display: grid; gap: 32px; }

.article-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--shadow);
}

.article-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--thumb-bg);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}
.article-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-theme="dark"] .article-card__thumb img {
    filter: brightness(0.88) contrast(1.05);
}

.article-card__meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent-border);
}

.article-card__date {
    font-size: 12px;
    color: var(--text-muted);
}

.article-card__title {
    font-size: 18px;
    font-weight: 500;
    margin-top: 8px;
    line-height: 1.6;
    color: var(--text);
}

.article-card__excerpt {
    font-size: 14px;
    color: var(--text-sub);
    margin-top: 6px;
    line-height: 1.7;
}

/* ── Article detail ── */
.article-header { margin-bottom: 32px; }

.article-header__meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.article-header__title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text);
}

.article-eyecatch {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--thumb-bg);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 16px var(--shadow);
}
.article-eyecatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body img {
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}

[data-theme="dark"] .article-eyecatch img,
[data-theme="dark"] .article-body img {
    filter: brightness(0.88) contrast(1.05);
}

.article-body {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}
.article-body p { margin-bottom: 1.6em; }
.article-body h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 2.4em 0 1em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.article-body h3 {
    font-size: 17px;
    font-weight: 500;
    margin: 2em 0 0.8em;
    color: var(--text);
}
.article-body ul, .article-body ol {
    margin: 0 0 1.6em 1.4em;
}
.article-body li { margin-bottom: 0.4em; }
.article-body strong { font-weight: 500; }
.article-body code {
    font-size: 14px;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ── Breadcrumb ── */
.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ── Affiliate card (OGP style) ── */
.affiliate-card {
    margin-top: 40px;
}
.affiliate-card__link {
    display: flex;
    background: var(--aff-bg);
    border: 1px solid var(--aff-border);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.affiliate-card__link:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 12px var(--shadow);
}
.affiliate-card__thumb {
    flex: 0 0 180px;
    background: var(--thumb-bg);
}
.affiliate-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.affiliate-card__body {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}
.affiliate-card__title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
}
.affiliate-card__desc {
    font-size: 12px;
    color: var(--text-sub);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.affiliate-card__site {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.affiliate-card__favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

/* ── Category page ── */
.page-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 32px;
    color: var(--text);
}

/* ── About ── */
.about-content { max-width: 600px; }
.about-content p { margin-bottom: 1.4em; color: var(--text-sub); }

/* ── PR badge ── */
.badge--pr {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--accent);
    color: var(--bg);
    letter-spacing: 0.06em;
}

/* ── Affiliate disclosure ── */
.affiliate-disclosure {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Disclosure page ── */
.disclosure-content { max-width: 640px; }
.disclosure-content h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 2em 0 0.8em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}
.disclosure-content p {
    margin-bottom: 1.2em;
    color: var(--text-sub);
    font-size: 15px;
    line-height: 1.8;
}
.disclosure-content ul {
    margin: 0 0 1.2em 1.4em;
    color: var(--text-sub);
    font-size: 15px;
}
.disclosure-content li { margin-bottom: 0.4em; }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}
.site-footer a {
    color: var(--text-muted);
}
.site-footer a:hover {
    color: var(--accent);
}
.site-footer p + p {
    margin-top: 6px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .site-header__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
    .site-nav { display: none; gap: 16px; }
    .site-nav.is-open { display: flex; }
    .nav-toggle { display: block; position: absolute; right: 20px; top: 24px; }
    .site-header { position: relative; }
    .article-header__title { font-size: 20px; }
    .article-card__title { font-size: 16px; }
    .affiliate-card__link { flex-direction: column; }
    .affiliate-card__thumb { flex: none; height: 160px; }
}
