/* =========================
   CSS Variables
========================= */
:root {
    /* base colors */
    --bg: #ffffff;
    --text: #222;
    --link: #0066cc;

    /* borders */
    --border: #eee;

    /* blockquote */
    --quote-bg: #fafafa;
    --quote-text: #555;
    --quote-border: #ddd;

    /* code */
    --code-bg: #f4f4f4;
    --pre-bg: #f6f6f6;
    --code-text: inherit;
}

/* Dark mode */
/*
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121212;
        --text: #e6e6e6;
        --link: #6ea8ff;

        --border: #333;

        --quote-bg: #1e1e1e;
        --quote-text: #ccc;
        --quote-border: #444;

        --code-bg: #1f1f1f;
        --pre-bg: #1b1b1b;
        --code-text: #eaeaea;
    }
}
*/

/* =========================
   Base
========================= */
img {
    max-width: 100%;
    height: auto;
}

html {
    font-size: 17px;
}

body {
    margin: 0;
    padding: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Hiragino Sans",
        "Hiragino Kaku Gothic ProN",
        "Noto Sans JP",
        "Yu Gothic",
        Meiryo,
        sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 2.1;
}

/* =========================
   Layout
========================= */
.article {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 20px 0px;
}

/* =========================
   Headings
========================= */
.article h1 {
    font-size: 1.9rem;
    font-weight: 700;
    margin: 2.8em 0 1.2em;
    line-height: 1.4;
}

.article h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 3em 0 1.2em;
}

.article h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2.4em 0 1em;
}

/* =========================
   Text
========================= */
.article p {
    margin: 1.6em 0;
}

.article strong {
    font-weight: 700;
}

.article em {
    font-style: italic;
}

/* =========================
   Links
========================= */
.article a {
    color: var(--link);
    text-decoration: none;
}

.article a:hover {
    text-decoration: underline;
}

/* =========================
   Lists
========================= */
.article ul,
.article ol {
    margin: 1.6em 0 1.6em 1.5em;
    padding: 0;
}

.article li {
    margin: 0.6em 0;
}

/* =========================
   Blockquote
========================= */
.article blockquote {
    margin: 2em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--quote-border);
    color: var(--quote-text);
    background: var(--quote-bg);
}

/* =========================
   Code
========================= */
.article code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.article pre {
    margin: 2em 0;
    padding: 1.2em 1.4em;
    background: var(--pre-bg);
    overflow-x: auto;
    border-radius: 6px;
}

.article pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
}

/* =========================
   Images
========================= */
.article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2.4em auto;
    border-radius: 6px;
}

/* =========================
   Horizontal Rule
========================= */
.article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3em 0;
}

/* =========================
   Responsive
========================= */
@media (max-width:600px) {
    .article {
        padding: 32px 16px 64px;
    }

    .article h1 {
        font-size: 1.6rem;
    }

    .article h2 {
        font-size: 1.3rem;
    }
}

/* =========================
   Table (NOTE-like)
========================= */

.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.2em 0;
    font-size: 0.95em;
}

/* 外枠はつけない（NOTEっぽさ） */
.article table {
    border: none;
}

/* セル */
.article th,
.article td {
    padding: 0.7em 0.6em;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

/* ヘッダーだけ少しだけ強調 */
.article th {
    font-weight: 600;
}

/* 最終行は線なし（NOTE寄せ） */
.article tr:last-child td {
    border-bottom: none;
}

/* 行ホバー（ほぼ見えない程度） */
.article tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

/* ダークモード微調整 */
@media (prefers-color-scheme: dark) {
    .article tr:hover td {
        background: rgba(255, 255, 255, 0.03);
    }
}

/* =========================
   Article date
========================= */
.article-date {
    display: block;
    font-size: 0.85em;
    color: var(--quote-text);
    margin: -0.4em 0 2em;
    letter-spacing: 0.02em;
}

.article-date:empty {
    display: none;
}

/* =========================
   Header title link
========================= */
.article h1 a,
h2 a {
    color: inherit;
    text-decoration: none;
}

.article h1 a:hover,
h2 a:hover {
    text-decoration: none;
    opacity: 0.7;
}

/* =========================
   In-content OG Card
========================= */
.article .og-card {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 1.8em 0;
    background: var(--bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s;
}

.article .og-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.article .og-card-link {
    display: flex;
    width: 100%;
    text-decoration: none;
    color: inherit;
    gap: 0;
}

.article .og-card-img {
    display: block;
    width: 140px;
    height: calc(140px / 1.91);
    object-fit: cover;
    flex: 0 0 auto;
}

.article .og-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3em;
    padding: 0.75em 1em;
    min-width: 0;
}

.article .og-card-title {
    font-size: 0.95em;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article .og-card-desc {
    font-size: 0.82em;
    line-height: 1.5;
    color: var(--quote-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .article .og-card-link {
        flex-direction: column;
    }

    .article .og-card-img {
        width: 100%;
        height: auto;
        aspect-ratio: 1.91 / 1;
    }
}

/* =========================
   Footer
========================= */
.site-footer {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 20px 3rem;
    text-align: center;
    font-size: 0.82em;
    color: var(--quote-text);
}

.site-footer a {
    color: var(--quote-text);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-nav {
    text-align: left;
}

.footer-credit {
    text-align: center;
}

.footer-sep {
    margin: 0 0.5em;
    opacity: 0.4;
}