:root {
    --primary-color: #2cb696;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #fff;
    --border-color: #e5e5e5;
    --sidebar-width: 280px;
    --header-height: 60px;
    --container-max-width: 1080px;
    --gap: 32px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Font Awesome icon spacing */
.fa-solid { margin-right: 0.3em; }

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

.header-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-logo img {
    height: 32px;
    width: auto;
}

.header-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.header-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.nav-btn {
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: bold;
}

.btn-signup {
    background-color: var(--primary-color);
    color: #fff !important;
}

.btn-login {
    border: 1px solid var(--border-color);
}

/* ハンバーガーメニューボタン */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
}

/* モバイルバックドロップ */
.mobile-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* モバイルメニュー */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 200;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.mobile-menu-content {
    padding: 24px;
}

.mobile-profile {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.mobile-profile-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.mobile-profile-bio {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.mobile-profile-follow {
    display: inline-block;
    padding: 8px 20px;
    background: #000;
    color: #fff !important;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav a {
    display: block;
    padding: 16px 0;
    font-size: 1rem;
    color: var(--text-color);
}

/* Layout */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 32px 16px;
}

.main-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 32px);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.profile-name a {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
}

.profile-bio {
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.profile-features {
    list-style: none;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.profile-message {
    font-weight: bold;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.profile-stats {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
}

.sidebar-actions {
    margin-bottom: 32px;
}

.btn-follow-x {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    background: #000;
    color: #fff !important;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
}

.btn-follow-x:hover {
    background: #333;
    opacity: 1;
}

.sidebar-nav ul {
    list-style: none;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.sidebar-nav li {
    margin-bottom: 12px;
}

.sidebar-nav a {
    color: var(--text-light);
    font-size: 0.9rem;
}

.sidebar-footer {
    margin-top: 32px;
    font-size: 0.8rem;
    color: #999;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    min-width: 0;
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article Grid (Home) */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    opacity: 1;
}

.grid-card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.grid-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-card-body {
    padding: 16px;
}

.grid-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 12px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.grid-card-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.grid-card-date {
    margin-left: auto;
}

/* Article List (Card) */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.article-card {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 32px;
    align-items: start;
}

.article-card:last-child {
    border-bottom: none;
}

.article-content {
    flex: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.article-author-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.article-title {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 8px;
}

.article-snippet {
    font-size: 0.95rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.article-footer {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: #999;
}

.article-thumbnail {
    width: 160px;
    height: 110px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Single Article */
.single-article {
    max-width: 720px;
    margin: 0 auto 0 0;
}

.article-header {
    margin-bottom: 32px;
}

.article-hero {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 24px;
}

.article-hero img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.article-title-large {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 16px;
    line-height: 1.4;
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--text-color);
}

.article-body h2 {
    font-size: 1.6rem;
    margin: 48px 0 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 32px 0 16px;
}

.article-body p {
    margin-bottom: 24px;
}

.article-body ol {
    margin: 2em 0;
    padding-left: 1.5em;
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: 4px;
}

.article-tags {
    margin-top: 48px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tag {
    background: #f4f4f4;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Share Buttons */
.share-buttons {
    margin-top: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
}

.share-x {
    background: #000;
    color: #fff !important;
}

.share-hatena {
    background: #00A4DE;
    color: #fff !important;
}

.share-btn:hover {
    opacity: 0.8;
}

/* Author Box */
.author-box {
    margin-top: 32px;
    padding: 24px;
    background: #f8f8f8;
    border-radius: 12px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.author-box-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
}

.author-box-info {
    flex: 1;
}

.author-box-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.author-box-bio {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
}

.author-box-follow {
    display: inline-block;
    padding: 8px 16px;
    background: #000;
    color: #fff !important;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.author-box-follow:hover {
    background: #333;
    opacity: 1;
}

/* Reel View (Mobile 4-koma) - TikTok風 */
.reel-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    background: #111;
}

.reel-item {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-shrink: 0;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
}

.reel-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 100px - env(safe-area-inset-bottom, 0px));
}

.reel-image-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.reel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
}

.reel-zoom-hint {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reel-info {
    padding: 10px 14px;
    background: linear-gradient(to bottom, #1a1a1a, #222);
    flex-shrink: 0;
}

.reel-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.reel-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.reel-link-btn,
.reel-home-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.reel-link-btn {
    background: var(--primary-color);
    color: #fff !important;
}

.reel-home-btn {
    background: #444;
    color: #fff !important;
}

.reel-link-btn:hover,
.reel-home-btn:hover {
    opacity: 0.85;
}

/* 広告スペース（レガシー） */
.reel-ad-space {
    margin-top: 12px;
    background: #222;
    border-radius: 12px;
    padding: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.ad-label {
    display: inline-block;
    background: #444;
    color: #999;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ad-placeholder {
    color: #666;
    font-size: 0.85rem;
    padding: 30px 0;
    border: 1px dashed #444;
    border-radius: 8px;
}

/* リール固定バナー広告 */
.reel-sticky-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(17, 17, 17, 0.95);
    padding: 4px 8px;
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    text-align: center;
}

.reel-sticky-ad .ad-unit {
    margin: 0 auto;
    max-width: 400px;
}

.reel-sticky-ad .ad-unit-label {
    background: #333;
    color: #888;
    font-size: 0.6rem;
    padding: 1px 6px;
}

.reel-sticky-ad .ad-placeholder-box {
    background: #222;
    border-color: #444;
    color: #666;
    padding: 8px;
    font-size: 0.75rem;
    min-height: auto;
}

/* モバイル: リールビューではサイドバーとヘッダーを隠す */
@media (max-width: 768px) {
    body:has(.reel-container) .sidebar,
    body:has(.reel-container) .site-header,
    body:has(.reel-container) .site-footer,
    body:has(.reel-container) .hamburger-btn,
    body:has(.reel-container) .mobile-menu {
        display: none;
    }

    body:has(.reel-container) .main-layout {
        padding: 0;
        gap: 0;
    }

    body:has(.reel-container) .main-content {
        width: 100%;
        max-width: 100%;
    }
}

/* PC: リールのマガジン風グリッド */
@media (min-width: 769px) {
    .reel-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding: 24px;
        max-width: 100%;
        height: auto;
        overflow-y: auto;
        scroll-snap-type: none;
        background: #f5f5f5;
    }
    .reel-item {
        min-height: auto;
        height: auto;
        scroll-snap-align: unset;
        padding: 0;
    }
    .reel-card {
        height: 100%;
        max-height: none;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        background: #fff;
        display: flex;
        flex-direction: column;
    }
    .reel-image-wrap {
        flex: 0 0 auto;
        overflow: visible;
    }
    .reel-image {
        width: 100%;
        max-height: none;
        height: auto;
        object-fit: contain;
    }
    .reel-zoom-hint {
        display: none;
    }
    .reel-info {
        background: #fff;
        padding: 12px 16px;
    }
    .reel-title { color: var(--text-color); }
    .reel-link-btn { background: var(--primary-color); }
    .reel-home-btn { background: #666; }
    .reel-sticky-ad { display: none; }
    .reel-link-btn .fa-solid,
    .reel-home-btn .fa-solid { margin-right: 0; }
}

/* 大画面: 2列のまま（カード幅を広げすぎない） */
@media (min-width: 1200px) {
    .reel-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Site Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 48px;
    padding: 48px 0 24px;
    background: #fafafa;
}

.footer-inner {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 16px;
}

.footer-columns {
    display: flex;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-col {
    flex: 1;
}

.footer-col-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-col a:hover {
    color: var(--primary-color);
    opacity: 1;
}

.copyright {
    font-size: 0.85rem;
    color: #999;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }

    /* モバイルではサイドバーを非表示 */
    .sidebar {
        display: none;
    }

    /* ハンバーガーメニューを表示 */
    .hamburger-btn {
        display: flex;
    }

    /* PC用ナビを非表示 */
    .header-nav {
        display: none;
    }

    .article-card {
        flex-direction: column-reverse;
    }
    
    .article-thumbnail {
        width: 100%;
        height: 200px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .hero-banner {
        height: 180px;
    }

    .article-title-large {
        font-size: 1.5rem;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* パンくずリスト */
.breadcrumb {
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin: 0 8px;
    color: #999;
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb li:last-child {
    color: var(--text-light);
}

/* 関連記事 */
.related-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: bold;
}

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

.related-card {
    display: block;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    opacity: 1;
}

.related-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.related-card-title {
    display: block;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-color);
}

/* 追加シェアボタン */
.share-fb {
    background: #1877F2;
    color: #fff !important;
}

.share-line {
    background: #00B900;
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: bold;
}

/* 記事下CTA */
.article-cta {
    margin-top: 32px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f5f2, #f0f8ff);
    border-radius: 12px;
    text-align: center;
}

.article-cta p {
    margin: 8px 0;
    font-size: 0.95rem;
}

.article-cta a {
    color: var(--primary-color);
    font-weight: bold;
}

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

    .share-buttons {
        flex-wrap: wrap;
    }

    .footer-columns {
        flex-direction: column;
        gap: 24px;
    }
}

/* サイドバーフッターナビ */
.sidebar-nav-footer {
    margin-top: 16px;
    border-top: none;
    padding-top: 0;
}

.sidebar-nav-footer ul {
    border-top: none;
    padding-top: 0;
}

.sidebar-nav-footer a {
    font-size: 0.85rem;
    color: #999;
}

/* モバイルナビフッター */
.mobile-nav-footer {
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.mobile-nav-footer a {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e5e5e5;
}
.pagination-link {
    padding: 8px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
}

/* Header Logo Text */
.header-logo-text {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--text-color);
}

/* Ad Units */
.ad-unit {
    margin: 24px 0;
    text-align: center;
}

.ad-unit-label {
    display: inline-block;
    font-size: 0.7rem;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.ad-placeholder-box {
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px 20px;
    color: #999;
    font-size: 0.85rem;
    background: #fafafa;
}

.ad-unit-sidebar {
    margin-top: 32px;
}

.ad-unit-infeed {
    grid-column: 1 / -1;
}

/* インフィード広告 PC/モバイル出し分け */
.ad-infeed-mobile {
    display: none;
}

@media (max-width: 768px) {
    .ad-infeed-desktop {
        display: none;
    }
    .ad-infeed-mobile {
        display: block;
    }
}

/* リール用広告の改善 */
/* reel-ad-unit (inline, レガシー) */
.reel-ad-unit {
    display: none;
}

/* テーブル横スクロール対応 */
.article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* 記事本文リンクの色・下線を明示化 */
.article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    opacity: 0.7;
}

/* タッチターゲットサイズ拡大 */
@media (max-width: 768px) {
    .header-nav a,
    .mobile-nav a,
    .sidebar-nav a,
    .pagination-link,
    .share-btn,
    .article-tag,
    .breadcrumb a {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
    }

    .share-btn {
        width: 48px;
        height: 48px;
    }

    .pagination-link {
        padding: 12px 20px;
    }

    .article-tag {
        padding: 10px 16px;
    }

    .hamburger-btn {
        width: 48px;
        height: 48px;
        justify-content: center;
        padding: 14px 10px;
    }
}

/* 記事一覧のインラインタグ */
.article-tag-inline {
    font-size: 0.8rem;
    color: var(--primary-color);
    background: #f0f9f6;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 90;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #249e82;
}

/* ライトボックス（画像拡大表示） */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
}

.lightbox-close:hover {
    opacity: 0.7;
}

/* 404 Not Found Page */
.not-found {
    text-align: center;
    padding: 60px 20px 40px;
}

.not-found h1 {
    font-size: 5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 0 16px;
    line-height: 1;
}

.not-found p {
    color: var(--text-light);
    margin: 8px 0;
}

.not-found-btn {
    display: inline-block;
    margin-top: 24px;
    padding: 12px 32px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.2s;
}

.not-found-btn:hover {
    background: #249e82;
    opacity: 1;
}

.not-found-heading {
    font-size: 1.3rem;
    margin: 32px 0 20px;
    font-weight: bold;
}
