/**
 * Base Styles - The NatureCredits Theme
 * Professional News Site Design (Bloomberg/Reuters Style)
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --font-primary: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', 'Noto Sans JP', sans-serif;
    --color-black: #1a1a1a;
    --color-gray-900: #2d2d2d;
    --color-gray-700: #4a4a4a;
    --color-gray-500: #6b6b6b;
    --color-gray-400: #999999;
    --color-gray-300: #cccccc;
    --color-gray-200: #e5e5e5;
    --color-gray-100: #f5f5f5;
    --color-white: #ffffff;
    --color-accent: #0d7377;
    --color-accent-light: #14919b;
    --header-height: 56px;
    --content-width: 1200px;
    --article-width: 680px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-black);
    background-color: var(--color-white);
    min-height: 100vh;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-black);
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

p {
    margin-bottom: 1.5em;
}

a {
    color: var(--color-black);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

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

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

.container--narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    padding-top: var(--header-height);
    min-height: calc(100vh - 200px);
}

.article-content {
    max-width: var(--article-width);
    margin: 0 auto;
}

/* ==========================================================================
   Article Content Typography
   ========================================================================== */
/* 記事本文内の見出し - 章の区切りに十分な余白を確保 */
#article-content h2,
.wp-block-post-content h2 {
    margin-top: 56px;
    margin-bottom: 20px;
    padding-top: 24px;
    border-top: 1px solid var(--color-gray-200);
}

#article-content h2:first-child,
.wp-block-post-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

#article-content h3,
.wp-block-post-content h3 {
    margin-top: 40px;
    margin-bottom: 16px;
}

#article-content h4,
.wp-block-post-content h4 {
    margin-top: 32px;
    margin-bottom: 12px;
}

/* 段落 - 適度な間隔を維持 */
#article-content p,
.wp-block-post-content p {
    margin-bottom: 1.75em;
    line-height: 1.9;
}

/* リスト */
#article-content ul,
#article-content ol,
.wp-block-post-content ul,
.wp-block-post-content ol {
    margin-bottom: 1.75em;
    padding-left: 1.5em;
}

#article-content li,
.wp-block-post-content li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}

/* 引用 */
#article-content blockquote,
.wp-block-post-content blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    background-color: var(--color-gray-100);
    border-left: 4px solid var(--color-gray-300);
    font-style: normal;
}

#article-content blockquote p:last-child,
.wp-block-post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Post Grid
   ========================================================================== */
.post-grid {
    display: grid;
    gap: 32px;
}

.post-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

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

.post-grid .post-card {
    height: 100%;
}

/* ==========================================================================
   Category Sections
   ========================================================================== */
.category-section {
    margin-bottom: 64px;
}

.category-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-black);
}

.category-section__title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-section__link {
    font-size: 13px;
    color: var(--color-gray-500);
    font-weight: 500;
}

.category-section__link:hover {
    color: var(--color-accent);
}

/* ==========================================================================
   404 Error Page
   ========================================================================== */
.error-404__content {
    text-align: center;
    margin-bottom: 48px;
}

.error-404__code {
    display: block;
    font-family: var(--font-heading);
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-gray-200);
    margin-bottom: 16px;
}

.error-404__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 12px;
}

.error-404__text {
    font-size: 15px;
    color: var(--color-gray-500);
    margin-bottom: 32px;
}

.error-404__button {
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-white);
    background-color: var(--color-black);
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.error-404__button:hover {
    background-color: var(--color-gray-700);
    color: var(--color-white);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1023px) {
    .post-grid--3col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 56px;
    }

    body {
        font-size: 15px;
        padding-bottom: 72px;
    }

    h1 { font-size: 26px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }

    .container {
        padding: 0 16px;
    }

    .post-grid--3col,
    .post-grid--2col {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .category-section {
        margin-bottom: 48px;
    }

    .error-404__code {
        font-size: 80px;
    }
}
