:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;

    --accent: #2f6d57;
    --accent2: #2b5d9a;

    --radius-card: 16px;
    --radius-inner: 14px;
}

/* =========================
   Base
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI",
        "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* =========================
   Header
========================= */
.site-header {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    font-weight: 900;
    font-size: 16px;
    letter-spacing: .02em;
}

.nav-desktop {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-desktop a {
    font-size: 14px;
    font-weight: 700;
}

.btn {
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
}

/* =========================
   Hamburger / Mobile menu
========================= */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #111827;
    margin: 4px auto;
}

.mobile-menu {
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-weight: 700;
}

.mobile-menu hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 10px 0;
}

/* =========================
   Hero
========================= */
.hero {
    background: linear-gradient(180deg,
            rgba(43, 93, 154, 0.18),
            rgba(47, 109, 87, 0.12));
    border-bottom: 1px solid var(--line);
}

.hero-inner {
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    margin: 0;
    font-size: 72px;
    font-weight: 900;
    letter-spacing: .08em;
}

.hero-sub {
    margin-top: 18px;
    font-size: 22px;
    font-weight: 800;
}

/* =========================
   Layout
========================= */
.layout {
    display: flex;
    gap: 40px;
    padding: 40px 0;
}

.main {
    flex: 1;
}

.sidebar {
    width: 300px;
}

/* =========================
   Index cards
========================= */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding-left: 12px;
    padding-right: 12px;
}

.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 26px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .04);
    transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .06);
}

/* 右下リンク三角 */
.card::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 22px 22px;
    border-color: transparent transparent #d1d5db transparent;
    transition: .2s ease;
}

.card:hover::after {
    border-color: transparent transparent var(--accent2) transparent;
    transform: translate(2px, 2px);
}

.card-link {
    display: flex;
    align-items: center;
    gap: 28px;
}

/* =========================
   Thumbnail
========================= */
.thumb {
    width: 300px;
    height: 180px;
    border-radius: var(--radius-inner);
    background: linear-gradient(135deg,
            rgba(47, 109, 87, .25),
            rgba(43, 93, 154, .25));
    flex-shrink: 0;
}

/* no photo */
.thumb.no-photo {
    background:
        repeating-linear-gradient(135deg,
            rgba(255, 255, 255, .35),
            rgba(255, 255, 255, .35) 10px,
            rgba(0, 0, 0, .02) 10px,
            rgba(0, 0, 0, .02) 20px),
        linear-gradient(135deg,
            rgba(47, 109, 87, .10),
            rgba(43, 93, 154, .12));
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumb.no-photo::after {
    content: "NO PHOTO";
    font-size: 12px;
    letter-spacing: .18em;
    color: rgba(31, 41, 55, .45);
    font-weight: 700;
}

/* =========================
   Card text
========================= */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-body time {
    font-size: 13px;
    color: var(--muted);
}

.card-body h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 700;
}

/* =========================
   Topics footer (index)
========================= */
.topics-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
    padding: 22px 12px 0;
    border-top: 1px solid var(--line);
}

.topics-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: var(--accent2);
    padding: 10px 12px;
    border-radius: 999px;
}

.topics-more::after {
    content: "";
    border-style: solid;
    border-width: 6px 0 6px 8px;
    border-color: transparent transparent transparent var(--accent2);
}

.topics-more:hover {
    background: rgba(43, 93, 154, .08);
    transform: translateX(2px);
}

/* =========================
   Detail page
========================= */
.detail-wrap {
    padding: 40px 12px 60px;
}

.topic-article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 28px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .04);
}

.topic-title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 900;
}

.topic-date {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 18px;
}

.topic-content {
    font-size: 15px;
    line-height: 1.9;
}

.topic-content p {
    margin: 0 0 14px;
}

.topic-figure {
    margin: 18px 0 0;
}

.topic-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-inner);
}

.topic-back {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

/* =========================
   Sidebar
========================= */
.sidebox {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 18px;
    margin-bottom: 18px;
}

.sidebox h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    font-size: 15px;
    font-weight: 900;
    border-bottom: 1px solid var(--line);
}

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

.archive-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.archive-list li:last-child {
    border-bottom: 0;
}

.archive-list a {
    font-weight: 900;
}

.archive-list span {
    font-size: 12px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =========================
   Footer
========================= */
.site-footer {
    margin-top: 60px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.site-footer .container {
    padding-left: 24px;
    padding-right: 24px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 0;
}

.footer-brand {
    font-weight: 900;
    margin-bottom: 6px;
}

.footer-address {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.footer-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-nav a {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
}

.copyright {
    border-top: 1px solid var(--line);
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* =========================
   Responsive
========================= */
@media (max-width:860px) {
    .nav-desktop {
        display: none;
    }

    .hamburger {
        display: inline-block;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: auto;
    }
}

@media (max-width:600px) {
    .hero-inner {
        padding: 56px 0;
    }

    .hero-title {
        font-size: 44px;
    }

    .hero-sub {
        font-size: 18px;
    }

    .card-grid {
        padding-left: 8px;
        padding-right: 8px;
    }

    .detail-wrap {
        padding-left: 8px;
        padding-right: 8px;
    }

    .card,
    .topic-article {
        box-shadow: 0 6px 16px rgba(0, 0, 0, .04);
        padding: 18px;
    }

    .card-link {
        gap: 16px;
        align-items: flex-start;
    }

    .thumb {
        width: 160px;
        height: 100px;
    }

    .card-body h3 {
        font-size: 16px;
    }

    .site-footer .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* =========================
   Article content (from contents/*.html)
========================= */
.topic-content h1 {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 900;
}

.topic-content .article-date {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--muted);
}

.topic-content h2 {
    margin: 28px 0 10px;
    font-size: 18px;
    font-weight: 900;
}

.topic-content ul {
    margin: 0 0 16px 1.2em;
    padding: 0;
}

.topic-content li {
    margin: 0 0 6px;
    line-height: 1.7;
}

/* =========================
   Article images (contents html)
========================= */
.topic-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 16px auto;
    border-radius: 12px;
}

.topic-content figure {
    margin: 20px 0;
    text-align: center;
}

.topic-content figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

/* =========================
   Prevent overflow for article images
========================= */

/* 親要素がはみ出さないように */
.topic-article,
.topic-content {
    max-width: 100%;
    overflow: hidden;
}

/* 画像そのもの */
.topic-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    box-sizing: border-box;
    margin: 16px auto;
    border-radius: 12px;
}

/* figure で囲んだ場合も安全に */
.topic-content figure {
    max-width: 100%;
    margin: 20px 0;
}

/* 横並びなどで div を使った場合の保険 */
.topic-content>* {
    max-width: 100%;
}

/* =========================
   Mobile: sidebar margin align with cards
========================= */
@media (max-width: 768px) {

    /* sidebar 全体をカードと同じ余白に */
    .sidebar {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* 各ボックス（アーカイブ／お問い合わせ） */
    .sidebox {
        margin-left: 0;
        margin-right: 0;
    }

}

/* =========================
   Mobile: sidebar aligns with card-grid edges
========================= */
@media (max-width: 600px) {

    /* card-grid は container(16px) + card-grid(8px) = 24px */
    /* sidebar も同じ 24px に合わせる（= sidebar に 8px足す） */
    .sidebar {
        padding-left: 8px;
        padding-right: 8px;
        box-sizing: border-box;
    }

    /* sidebox は card-grid と同じ基準で並ぶように */
    .sidebar .sidebox {
        margin: 0 0 16px;
        padding: 18px;
        width: 100%;
        box-sizing: border-box;
    }

    /* お問い合わせ下の余白が気になる場合の締め */
    .sidebar .sidebox:last-child {
        margin-bottom: 0;
    }
}
