:root {
    --bs-body-bg: #f0f2f5;
    /* 明るいグレー/白 */
    --bs-body-color: #222222;
    --accent-color: #E43F3B;
    --accent-hover: #c03531;
    --card-bg: rgba(255, 255, 255, 0.6);
    --sidebar-bg: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #222222;
}

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

a:hover {
    color: var(--accent-color);
}

/* --- Utility Classes --- */
.text-accent {
    color: var(--accent-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.btn-accent {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    color: #fff;
}

.btn-outline-accent {
    background-color: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
}

.btn-outline-accent:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* --- Sidebar Styling --- */
.sidebar {
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.4);
    min-height: 100vh;
    padding: 2rem;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

/* Flex column layout for PC default */
.sidebar-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.blog-title {
    font-size: 1.8rem;
    margin-bottom: 0;
    letter-spacing: -0.05rem;
}

.blog-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 2rem;
}

.nav-link {
    color: #555;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active {
    font-weight: bold;
    padding-left: 10px;
    border-left: 3px solid var(--accent-color);
}

.profile-section img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.social-links a {
    font-size: 1.2rem;
    margin-right: 1rem;
    color: #666;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* --- Main Content Styling --- */
.main-content {
    padding: 3rem 4rem;
}

.article-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* .article-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
} */

.article-meta {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.8rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-meta i {
    color: var(--accent-color);
    margin-right: 5px;
}

.article-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-title a {
    color: #222;
}

.article-title a:hover {
    color: var(--accent-color);
}

.article-summary {
    color: #333;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tag-badge {
    background-color: rgba(0, 0, 0, 0.05);
    color: #555;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 5px;
    transition: all 0.2s;
}

.tag-badge:hover {
    background-color: var(--accent-color);
    color: #fff;
}

/* --- Pagination --- */
.pagination .page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: #333;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    border-color: var(--border-color);
    color: var(--accent-color);
}

.pagination .active>.page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* --- Mobile Toggler Style --- */
.sidebar-toggler {
    border: 1px solid var(--border-color);
    color: #333;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background: transparent;
}

.sidebar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(228, 63, 59, 0.25);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991.98px) {
    .sidebar {
        min-height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding: 1rem 1.5rem;
        display: block;
        /* Reset flex */
    }

    .blog-subtitle {
        margin-bottom: 0;
        /* スマホではサブタイトル下の余白を詰める */
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .sidebar-collapse-content {
        margin-top: 1.5rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .sidebar-content-wrapper {
        height: auto;
        display: block;
    }
}

/* --- Article Grid Layout --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.article-grid .article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.article-grid .article-summary {
    flex-grow: 1;
}

/* Responsive Grid Adjustments */
@media (max-width: 1199.98px) {

    /* Medium screens: 2 columns */
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {

    /* Mobile screens: 1 column */
    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* Clickable Card Pattern */
.article-title a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Ensure tags are clickable on top of the card link */
.tags {
    position: relative;
    z-index: 2;
}

/* --- Article Detail Page --- */
.article-detail {
    background-color: transparent;
    padding: 0;
    margin-bottom: 2rem;
    border: none;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* 記事詳細の中身に余白を持たせる */
.article-detail .article-content,
.article-detail .article-title,
.article-detail .article-meta {
    /* 必要に応じてパディング調整 */
}

.article-content {
    color: #111;
    line-height: 1.8;
}

/* Go Back Top Button */
.go-back-top {
    border-color: #ccc;
    color: #666;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.go-back-top:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* =========================================
   About Page Specific Styles
   ========================================= */

.about-header {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.about-header h1 {
    font-size: 2.5rem;
    margin: 0;
    position: relative;
}

/* タイトルの下のアクセントライン */
.about-header h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    margin-top: 10px;
    border-radius: 2px;
}

/* プロフィールカード */
.profile-hero {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    display: flex;
    gap: 3rem;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.profile-avatar-lg {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.profile-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-role {
    font-family: 'Roboto Mono', monospace;
    color: var(--accent-color);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: block;
}

.profile-bio {
    color: #333;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

/* スキルバッジ */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-badge {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-badge i {
    color: var(--accent-color);
}

.skill-badge:hover {
    border-color: var(--accent-color);
    background-color: #fff;
    transform: translateY(-2px);
}

/* サブセクション */
.about-section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.about-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.content-block {
    line-height: 1.8;

    .skill-tags {
        justify-content: center;
    }

    .about-header h1 {
        font-size: 2rem;
    }
}

/* --- Index Page Redesign --- */
.index-content {
    max-width: 1200px;
    /* Increased width for 3 columns */
    margin: 0 auto;
}

.index-article-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.index-article-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.index-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.index-article-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.index-article-meta {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.index-article-meta i {
    color: var(--accent-color);
}

.index-article-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.index-article-title a {
    color: #222;
    text-decoration: none;
    /* Remove underline animation for card title as the whole card is interactive */
    background: none;
}

.index-article-title a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.index-article-summary {
    color: #333;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Pushes footer to bottom */
}

.tags {
    position: relative;
    z-index: 2;
    /* Ensure clickable over card link */
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    background-color: rgba(0, 0, 0, 0.05);
    color: #555;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tag-badge:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* Responsive Grid Adjustments */
@media (max-width: 991.98px) {

    /* Tablet/Small Desktop: 2 columns */
    .index-article-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {

    /* Mobile: 1 column */
    .index-article-list {
        grid-template-columns: 1fr;
    }

    .index-article-title {
        font-size: 1.3rem;
    }
}