/**
 * Base Styles - NatureCredit Theme
 * 直接値を使用してCSS変数未定義によるスタイル崩壊を防止
 */

/* ==========================================================================
   CSS Variables (参照用、フォールバックとして定義)
   ========================================================================== */
:root {
    --nc-font-primary: 'Noto Sans JP', 'Inter', sans-serif;
    --nc-font-heading: 'Inter', 'Noto Sans JP', sans-serif;
    --nc-color-brand: #0D7377;
    --nc-color-brand-light: #14919B;
    --nc-color-brand-accent: #4FD1C5;
    --nc-color-body: #F2F4F4;
    --nc-color-card: #FFFFFF;
    --nc-color-text: #111111;
    --nc-color-text-muted: #666666;
    --nc-color-border: #E5E5E5;
    --nc-header-height: 64px;
    --nc-content-width: 1200px;
    --nc-article-width: 720px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #111111;
    background-color: #FFFFFF;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    color: #111111;
}

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

p {
    margin-bottom: 1em;
}

a {
    color: #0D7377;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #14919B;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding-top: 64px; /* ヘッダー高さ */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ==========================================================================
   Utilities
   ========================================================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

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

/* グリッド内のアイテム高さを揃える */
.post-grid .post-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-grid .post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-grid .post-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Category Section
   ========================================================================== */
.category-section {
    margin-bottom: 48px;
}

.category-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0D7377;
}

.category-section__title {
    font-size: 20px;
    font-weight: 700;
    color: #111111;
}

.category-section__link {
    font-size: 14px;
    color: #0D7377;
    font-weight: 600;
}

.category-section__link:hover {
    color: #14919B;
}

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

.error-404__code {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    color: #E5E5E5;
    margin-bottom: 16px;
}

.error-404__title {
    font-size: 28px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 12px;
}

.error-404__text {
    font-size: 16px;
    color: #666666;
    margin-bottom: 32px;
}

.error-404__button {
    display: inline-block;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    background-color: #0D7377;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.error-404__button:hover {
    background-color: #14919B;
}

.error-404__search {
    max-width: 400px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .error-404__code {
        font-size: 80px;
    }

    .error-404__title {
        font-size: 22px;
    }
}

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

@media (max-width: 767px) {
    html {
        font-size: 15px;
    }

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

    .container {
        padding: 0 16px;
    }

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

    .site-main {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 20px));
    }
}
