/* ===== CSS Reset & Variables ===== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=Noto+Sans+JP:wght@300;400;500&family=JetBrains+Mono:wght@300;400;500&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #FFFFFF;
    --bg-light: #f8f9fa;
    --border-color: #eee;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    --font-sans-cjk: 'Inter', 'Pretendard', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-main: var(--font-serif);
}

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

html {
    scroll-behavior: smooth;
}

html.snap-scroll {
    scroll-snap-type: y mandatory;
    scroll-padding-top: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
}

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

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Transparent Navbar for Hero */
.navbar--transparent {
    background: transparent;
    box-shadow: none;
}

.navbar--transparent .nav-brand a,
.navbar--transparent .nav-menu a {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar--transparent .nav-menu a::after {
    background: white;
}

.navbar--transparent .lang-btn {
    color: white;
}

.navbar--transparent .nav-toggle span {
    background: white;
}

/* When mobile menu is active, override transparent styles */
@media (max-width: 768px) {
    .navbar--transparent .nav-toggle.active span {
        background: var(--primary-color);
    }

    .navbar--transparent .nav-menu.active {
        background: white;
    }

    .navbar--transparent .nav-menu.active a {
        color: var(--text-color);
        text-shadow: none;
    }

    .navbar--transparent .nav-menu.active a:hover,
    .navbar--transparent .nav-menu.active a.active {
        color: var(--secondary-color);
    }

    .navbar--transparent .nav-menu.active .lang-btn {
        color: var(--text-color);
    }

    .navbar--transparent .nav-menu.active .lang-switcher {
        display: flex;
    }

    .navbar--transparent .nav-menu.active .lang-option {
        color: var(--text-color);
    }
}

/* Solid state after scrolling */
.navbar--solid {
    background: white;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.navbar--solid .nav-brand a,
.navbar--solid .nav-menu a {
    color: var(--text-color);
    text-shadow: none;
}

.navbar--solid .lang-btn {
    color: var(--text-color);
}

.navbar--solid .nav-toggle span {
    background: var(--primary-color);
}

.nav-brand a {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-menu a {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-color);
    position: relative;
    padding: 5px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* ===== Language Switcher ===== */
.lang-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--secondary-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 120px;
    background: white;
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
}

.lang-option:hover,
.lang-option.active {
    background: var(--bg-light);
    color: var(--secondary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
    font-family: var(--font-serif);
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== Hero Section - Immersive Full Screen ===== */
.hero-immersive {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    scroll-snap-align: start;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

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

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 40%,
        rgba(0, 0, 0, 0.4) 100%
    );
    z-index: 2;
}

.hero-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 3;
}

.hero-brand {
    font-family: var(--font-serif);
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 30px;
    white-space: nowrap;
}

.btn-hero {
    font-family: var(--font-serif);
    display: inline-block;
    padding: 14px 40px;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-hero:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-2px);
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.hero-scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    position: relative;
}

.hero-scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

@keyframes scrollIndicator {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(12px);
    }
}

/* Legacy hero styles (kept for backward compatibility) */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 60px 60px;
    gap: 60px;
    scroll-snap-align: start;
}

.hero-content {
    flex: 1;
    max-width: 550px;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.hero-content .highlight {
    color: var(--secondary-color);
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-image {
    flex: 1;
    max-width: 600px;
}

.hero-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

/* ===== Section Styles ===== */
section {
    padding: 80px 0;
    /* min-height moved to scoped block below */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

html.snap-scroll section {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

/* Footer doesn't need full height */
html.snap-scroll .footer {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    scroll-snap-align: start;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
}

/* ===== About Section ===== */
.about {
    background: var(--bg-light);
}

.about-content {
    display: flex;
    gap: 60px;
    align-items: center;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.about-text {
    flex: 1;
}

.about-text h3 {
    font-family: var(--font-serif);
    font-size: 1.7rem;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-text p {
    font-family: var(--font-sans-cjk);
    color: var(--text-light);
    margin-bottom: 15px;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}

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

/* ===== Featured Section ===== */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.featured-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.featured-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
}

.featured-item:hover img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.featured-item:hover .featured-overlay {
    transform: translateY(0);
}

.featured-overlay h4 {
    font-size: 1.2rem;
}

/* ===== Page Header ===== */
.page-header {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 140px 20px 60px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-header p {
    opacity: 0.8;
}

/* ===== Gallery Section ===== */
.gallery-section {
    padding: 100px 0 60px;
    background-color: #FFFFFF;
}

/* Filter Tabs */
/* Filter Container */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 0;
}

.filter-tab {
    padding: 14px 35px;
    border: none;
    background: var(--bg-light);
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
    border-bottom: 3px solid transparent;
}

.filter-tab:first-child {
    border-radius: 10px 0 0 0;
}

.filter-tab:last-child {
    border-radius: 0 10px 0 0;
}

.filter-tab:hover {
    color: var(--primary-color);
    background: var(--bg-light);
}

.filter-tab.active {
    background: white;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.filter-tab.active::after {
    display: none;
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    padding: 25px 20px;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-top: 1px solid var(--border-color);
}

.filter-btn {
    padding: 10px 22px;
    border: none;
    background: var(--bg-light);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mosaic Grid Layout - Improved Masonry */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 8px;
    gap: 12px;
    padding: 0 15px 15px;
    grid-auto-flow: dense;
}

@media (max-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    margin: 0;
    opacity: 0;
    grid-column: span 1;
    align-self: start;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Wide images span 2 columns */
.gallery-item.wide {
    grid-column: span 2;
}

/* Fade-in Animation for Gallery Items */
.gallery-item.loaded {
    animation: galleryFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes galleryFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    60% {
        opacity: 0.8;
        transform: translateY(5px) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Image behavior for grid */
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

/* Hover Effect - Zoom */
.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay h4 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.gallery-overlay p {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Reduce gallery section padding on mobile */
    .gallery-section {
        padding: 70px 0 40px;
    }

    /* Hide overlay on mobile - info available in modal */
    .gallery-overlay {
        display: none;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
        padding: 0 8px 16px;
    }

    .gallery-item {
        grid-row-end: auto !important;
    }

    .gallery-item.wide {
        grid-column: span 1;
    }
}

/* ===== Image Modal ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 5px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary-color);
}

.modal-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* ===== Blog Section ===== */
.blog-section {
    padding: 100px 0 120px;
    font-family: var(--font-sans-cjk);
    min-height: auto;
}

.blog-section .container {
    padding: 0 20px;
    max-width: 1200px;
    width: 100%;
}

.blog-section * {
    font-family: inherit;
}

.blog-section h1,
.blog-section h2,
.blog-section h3,
.blog-section h4 {
    font-family: var(--font-sans-cjk);
    font-weight: 600;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.blog-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.blog-card * {
    min-width: 0;
    max-width: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-image {
    position: relative;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: var(--transition);
}

.blog-card:hover .blog-image img {
    transform: scale(1.05);
}

.blog-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.blog-content {
    padding: 16px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.blog-meta {
    margin-bottom: 10px;
}

.blog-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.blog-content h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.blog-content h3 a {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blog-content h3 a:hover {
    color: var(--secondary-color);
}

.blog-content p {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 10px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.read-more {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.read-more:hover {
    color: var(--primary-color);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover,
.page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ===== Blog Post ===== */
.post-header {
    background: var(--primary-color);
    color: white;
    padding: 140px 20px 60px;
    font-family: var(--font-sans-cjk);
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-family: var(--font-sans-cjk);
    opacity: 0.8;
}

.back-link:hover {
    opacity: 1;
}

.post-category {
    display: inline-block;
    background: var(--secondary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font-sans-cjk);
    margin-bottom: 15px;
}

.post-header h1 {
    font-family: var(--font-sans-cjk);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    max-width: 800px;
}

.post-meta {
    display: flex;
    gap: 20px;
    opacity: 0.8;
    font-family: var(--font-sans-cjk);
}

.post-featured-image {
    margin-top: -40px;
    padding: 0 20px;
}

.post-featured-image img {
    width: 100%;
    max-width: 1000px;
    height: 500px;
    object-fit: cover;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.post-content {
    padding: 60px 20px;
    font-family: var(--font-sans-cjk);
}

.post-content * {
    font-family: inherit;
}

.post-content .lead {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: var(--primary-color);
}

.post-content p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.post-content ol,
.post-content ul {
    margin: 20px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 15px;
    line-height: 1.7;
    list-style: decimal;
}

.post-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--bg-light);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-light);
}

.post-image {
    margin: 40px 0;
}

.post-image img {
    width: 100%;
    border-radius: 8px;
}

.post-image figcaption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 40px 0;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.tag {
    background: var(--bg-light);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-share {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    color: var(--text-color);
}

.share-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== Related Posts ===== */
.related-posts {
    background: var(--bg-light);
    padding: 60px 0;
}

.related-posts h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: left;
}

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

.related-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.related-card:hover {
    transform: translateY(-5px);
}

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

.related-card h4 {
    padding: 15px;
    font-size: 1rem;
    line-height: 1.4;
}

/* ===== Footer ===== */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.footer-brand p {
    opacity: 0.7;
}

.footer h4 {
    margin-bottom: 15px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

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

.footer-contact p {
    opacity: 0.7;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    /* Immersive Hero Responsive */
    .hero-brand {
        font-size: 4rem;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 120px 30px 60px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-image {
        max-width: 100%;
    }

    .about-content {
        flex-direction: column;
    }

    .about-image {
        max-width: 100%;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    /* Immersive Hero Mobile */
    .hero-brand {
        font-size: 2rem;
        letter-spacing: 0.01em;
        white-space: normal;
        padding: 0 20px;
    }

    .btn-hero {
        padding: 12px 30px;
        font-size: 0.9rem;
    }

    .hero-scroll-indicator {
        bottom: 30px;
    }

    /* Compact Section Padding */
    .hero {
        padding: 80px 20px 40px;
        min-height: 100vh;
        /* Keep 100vh for snap */
        justify-content: center;
        /* Center content vertically */
        gap: 30px;
    }

    section {
        padding: 40px 0;
        /* Reduced from 80px */
    }

    .page-header {
        padding: 100px 20px 40px;
    }

    /* Navbar Compact */
    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 10px 20px;
        transform: none !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 80vh;
        /* Allow seeing content below */
        background: white;
        flex-direction: column;
        padding: 80px 20px 30px;
        /* Top padding for close button/brand area */
        gap: 0;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateY(0);
    }

    .nav-menu li {
        width: 100%;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for menu items */
    .nav-menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu a {
        display: block;
        padding: 20px 10px;
        font-size: 1.2rem;
        font-weight: 600;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        color: var(--secondary-color);
        background: var(--bg-light);
        border-bottom-color: var(--secondary-color);
    }

    .nav-menu a::after {
        display: none;
        /* Remove the underline effect on mobile */
    }

    /* Mobile Language Switcher */
    /* Mobile Language Switcher */
    .nav-menu li:last-child {
        margin-top: 0;
        border-bottom: 1px solid #f0f0f0;
        /* Reset any potential overrides */
        transform: none;
        opacity: 0;
        /* Will be handled by staggered animation */
        width: 100%;
        height: auto;
        position: relative;
    }

    /* Add staggered animation for the 4th item (Guestbook) */
    .nav-menu.active li:nth-child(4) {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.25s;
    }

    /* Add staggered animation for the 5th item (Language) */
    .nav-menu.active li:nth-child(5) {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.3s;
    }

    .lang-switcher {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        z-index: auto;
    }

    .lang-btn {
        width: 100%;
        padding: 20px;
        background: transparent;
        border-radius: 0;
        justify-content: center;
        color: var(--text-color);
    }

    .lang-btn:hover {
        background: var(--bg-light);
        color: var(--secondary-color);
    }

    .lang-btn svg {
        width: 24px;
        height: 24px;
    }

    .lang-dropdown {
        position: static;
        /* Flow in the list */
        width: 100%;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
        /* Inner shadow for depth */
        background: #fafafa;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border-radius: 0;
        transform: none;
        transition: all 0.3s ease;
    }

    .lang-dropdown.active {
        opacity: 1;
        visibility: visible;
        max-height: 200px;
        padding: 10px 0;
        transform: none;
    }

    .lang-option {
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid #eee;
    }

    .lang-option:last-child {
        border-bottom: none;
    }

    /* Ensure language switcher is visible in mobile menu */
    .nav-menu.active li:last-child {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-toggle {
        display: flex;
        z-index: 1100;
        /* Ensure above menu */
        position: relative;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Typography Compact */
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    /* Hero Image */
    .hero-image img {
        height: 250px;
        /* Reduced height */
    }

    /* About Section */
    .about-content {
        gap: 30px;
    }

    .about-image img {
        height: 250px;
    }

    .about-text h3 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .about-stats {
        justify-content: center;
        gap: 20px;
        margin-top: 20px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    /* Featured Grid */
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .featured-item img {
        height: 200px;
        /* Smaller featured images */
    }

    /* Filter Tabs */
    .filter-tabs {
        gap: 0;
    }

    .filter-tab {
        padding: 10px 20px;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
    }

    .gallery-filter {
        padding: 15px 10px;
        gap: 6px;
        border-radius: 0 0 8px 8px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
        padding: 0 8px 16px;
    }

    .gallery-item {
        grid-row-end: auto !important;
    }

    .gallery-item.wide {
        grid-column: span 1;
    }

    .gallery-item img {
        height: auto;
    }

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

    .post-header h1 {
        font-size: 1.8rem;
    }

    .post-featured-image img {
        height: 300px;
    }

    .post-content .lead {
        font-size: 1.1rem;
    }

    /* Optimized Mobile Blog Content Width */
    .post-content {
        padding: 30px 0;
    }

    .post-content .container {
        padding: 0 15px;
    }

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

    .modal-nav {
        padding: 10px 15px;
        font-size: 18px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 20px 40px;
    }

    .hero-content h1 {
        font-size: 1.7rem;
    }

    .hero-image img {
        height: 280px;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .about-stats {
        gap: 25px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 16px;
        padding: 0 8px 16px;
    }

    .gallery-item {
        grid-row-end: auto !important;
    }

    .gallery-item.wide {
        grid-column: span 1;
    }

    .gallery-item img {
        height: auto;
    }

    .filter-btn {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    .page-header {
        padding: 120px 15px 40px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 5px;
    }

    /* Snap scroll adjustments for mobile - allow overflow scroll */
    html.snap-scroll section {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow: visible;
        padding: 80px 0 60px;
    }

    html.snap-scroll .about-content {
        flex-direction: column;
        gap: 20px;
    }

    html.snap-scroll .about-image {
        max-width: 180px;
    }

    html.snap-scroll .about-image img {
        height: 180px;
    }

    html.snap-scroll .about-text p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    html.snap-scroll .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    html.snap-scroll .featured-item img {
        height: 120px;
    }

}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Hide items initially for filter animation */
.gallery-item.hide {
    display: none;
}

/* ===== Floating Filter Menu (Glassmorphism) ===== */
.floating-filter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.floating-filter.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.filter-glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hide mobile scroll-to-top on desktop */
.scroll-to-top-mobile {
    display: none;
}

.filter-tabs-floating {
    display: flex;
    gap: 2px;
}

.filter-tab-float {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-light);
}

.filter-tab-float:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.filter-tab-float.active {
    background: rgba(0, 0, 0, 0.08);
    color: var(--primary-color);
}

.filter-tab-float svg {
    width: 18px;
    height: 18px;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
}

/* Filter options wrapper with scroll indicator */
.filter-options-wrapper {
    position: relative;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
}

/* Scroll arrow buttons */
.filter-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.filter-scroll-arrow:hover {
    background: rgba(255, 255, 255, 1);
}

.filter-scroll-arrow svg {
    color: rgba(0, 0, 0, 0.6);
}

.filter-scroll-left {
    left: 0;
}

.filter-scroll-right {
    right: 0;
}

/* Show arrows based on scroll state */
.filter-options-wrapper.can-scroll-left .filter-scroll-left {
    opacity: 1;
    pointer-events: auto;
}

.filter-options-wrapper.can-scroll-right .filter-scroll-right {
    opacity: 1;
    pointer-events: auto;
}

.filter-options {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
    scroll-behavior: smooth;
}

/* Fade mask for overflow indication */
.filter-options-wrapper.can-scroll-right .filter-options {
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.filter-options-wrapper.can-scroll-left .filter-options {
    -webkit-mask-image: linear-gradient(to left, black 85%, transparent 100%);
    mask-image: linear-gradient(to left, black 85%, transparent 100%);
}

.filter-options-wrapper.can-scroll-left.can-scroll-right .filter-options {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.filter-options::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    font-family: var(--font-sans);
    padding: 7px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-light);
}

.filter-pill:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.filter-pill.active {
    background: var(--primary-color);
    color: white;
}

/* Gallery Loading & Sentinel */
.gallery-sentinel {
    height: 1px;
    width: 100%;
}

.gallery-loading {
    display: none;
    justify-content: center;
    padding: 40px 0;
}

.gallery-loading.visible {
    display: flex;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Floating Filter - Safari-style bottom bar */
@media (max-width: 768px) {
    /* Container: filter bar (left ~80%) + scroll-to-top button (right) */
    .floating-filter {
        bottom: 20px;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(20px);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .floating-filter.visible {
        transform: translateX(0) translateY(0);
    }

    /* Filter glass bar takes most of the width */
    .filter-glass {
        flex: 1;
        padding: 10px 12px;
        gap: 8px;
        border-radius: 18px;
        overflow: hidden;
        flex-wrap: nowrap;
    }

    .filter-tabs-floating {
        flex-shrink: 0;
    }

    .filter-tab-float {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .filter-tab-float svg {
        width: 18px;
        height: 18px;
    }

    .filter-divider {
        height: 28px;
        flex-shrink: 0;
    }

    /* Filter options wrapper for mobile */
    .filter-options-wrapper {
        flex: 1;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .filter-options-wrapper::after {
        right: 4px;
        font-size: 18px;
    }

    /* Horizontal scrollable filter options */
    .filter-options {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 2px 28px 2px 0;
        -webkit-mask-image: linear-gradient(to right, black 70%, transparent 100%);
        mask-image: linear-gradient(to right, black 70%, transparent 100%);
    }

    .filter-options::-webkit-scrollbar {
        display: none;
    }

    .filter-pill {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 0.8rem;
        border-radius: 10px;
        white-space: nowrap;
    }

    /* Round scroll-to-top button on the right */
    .scroll-to-top-mobile {
        display: flex;
        width: 52px;
        height: 52px;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        transition: var(--transition);
    }

    .scroll-to-top-mobile:active {
        background: var(--secondary-color);
        transform: scale(0.95);
    }

    .scroll-to-top-mobile svg {
        width: 22px;
        height: 22px;
    }

    /* Hide desktop scroll-to-top on mobile */
    .scroll-to-top {
        display: none !important;
    }
}

/* ===== Load More Button (Legacy - Hidden) ===== */
.load-more-container {
    display: none;
    justify-content: center;
    margin: 50px 0;
}

.load-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.load-more-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* ===== Scroll to Top Button ===== */
.scroll-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* ===== Loading & Error States ===== */
.loading-state,
.empty-state,
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-state p,
.empty-state p,
.error-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* ===== Markdown Body Styles ===== */
.markdown-body {
    font-family: var(--font-sans-cjk);
    line-height: 1.8;
}

.markdown-body * {
    font-family: inherit;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 20px;
}

.markdown-body h1 {
    font-size: 2rem;
}

.markdown-body h2 {
    font-size: 1.6rem;
}

.markdown-body h3 {
    font-size: 1.3rem;
}

.markdown-body h4 {
    font-size: 1.1rem;
}

.markdown-body p {
    margin-bottom: 20px;
    line-height: 1.8;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

/* Figure with caption styles */
.markdown-body figure {
    margin: 30px 0;
    text-align: center;
}

.markdown-body figure img {
    margin: 0 auto;
    display: block;
}

.markdown-body figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    font-style: normal;
}

/* Alternative caption style (for text after images) */
.markdown-body p em {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--text-light);
    margin-top: -20px;
    margin-bottom: 20px;
}

.markdown-body ul,
.markdown-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.markdown-body ul li {
    list-style: disc;
    margin-bottom: 10px;
}

.markdown-body ol li {
    list-style: decimal;
    margin-bottom: 10px;
}

.markdown-body blockquote {
    border-left: 4px solid var(--secondary-color);
    padding: 20px 30px;
    margin: 30px 0;
    background: var(--bg-light);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-light);
    border-radius: 0 8px 8px 0;
}

.markdown-body blockquote p {
    margin-bottom: 0;
}

.markdown-body code {
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.markdown-body a {
    color: var(--accent-color);
    text-decoration: underline;
}

.markdown-body a:hover {
    color: var(--secondary-color);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
}

.markdown-body strong {
    font-weight: 600;
    color: var(--text-color);
}

/* ===== Comments Section ===== */
.comments-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.comments-section h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
    background: white;
    transition: var(--transition);
    box-sizing: border-box;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-form .honeypot {
    position: absolute;
    left: -9999px;
}

.comment-form .btn {
    align-self: flex-start;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-message {
    line-height: 1.7;
    color: var(--text-color);
    white-space: pre-wrap;
    word-break: break-word;
}

.no-comments,
.loading-comments {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
    background: white;
    border-radius: 8px;
}

.comment-message-success {
    color: #27ae60;
    padding: 15px;
    background: #e8f8e8;
    border-radius: 8px;
    margin-bottom: 20px;
}

.comment-message-error {
    color: #e74c3c;
    padding: 15px;
    background: #fde8e8;
    border-radius: 8px;
    margin-bottom: 20px;
}

#comment-message {
    display: none;
}

/* Guestbook specific styles */
.guestbook-section {
    display: block;
    padding-top: 120px;
    padding-bottom: 80px;
}

.guestbook-section .container {
    max-width: 550px;
    margin: 0 auto;
}

.guestbook-form {
    width: 100%;
}

/* Post comments specific styles */
.post-comments {
    display: block;
}

.post-comments h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.comment-form-title {
    font-size: 1.2rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .comments-section {
        padding: 40px 0;
    }

    .comment-form .btn {
        align-self: stretch;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .guestbook-section {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .guestbook-section .container {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* ===== Mobile Blog Content Adjustment ===== */
@media (max-width: 768px) {

    /* Remove default container padding in blog post content to allow full-width images */
    .post-content .container {
        padding-left: 0;
        padding-right: 0;
    }

    /* Add padding back to all direct children of markdown-body EXCEPT images and figures */
    .markdown-body>*:not(img):not(figure):not(div.post-image) {
        padding-left: 25px;
        padding-right: 25px;
    }

    /* Handling for lists to keep bullets aligned nicely */
    .markdown-body ul,
    .markdown-body ol {
        margin-left: 25px;
        padding-right: 25px;
        /* "padding-left" is already set in base styles, but we need to ensure container edge spacing */
    }

    /* Images with minimal margins for maximum visibility */
    .markdown-body img {
        border-radius: 8px;
        /* Restore rounded corners */
        width: calc(100% - 16px);
        /* 8px margin on each side - minimal spacing */
        max-width: 100%;
        margin: 30px 8px;
        /* 30px top/bottom, 8px left/right for minimal side spacing */
        box-shadow: var(--shadow);
        /* Restore shadow */
        display: block;
    }

    /* Image captions with same padding as text */
    .markdown-body p em,
    .markdown-body figcaption {
        padding-left: 25px;
        padding-right: 25px;
    }

    /* Also handle the featured image at the top */
    .post-featured-image {
        padding: 0;
        margin-top: 0;
    }

    .post-featured-image img {
        border-radius: 0;
    }
}