/**
 * 百人一首.jp MVP
 * ネオ和風デザイン
 *
 * カラーパレット:
 * - ベース: #FDFCF0（鳥の子色）
 * - メイン: #2B4C7E（紺藍）
 * - 学習アクセント: #B03A2E（茜色）
 * - 超現代語訳アクセント: #FF007A（ネオンピンク）
 *
 * フォント:
 * - 和歌・大見出し: Shippori Mincho
 * - 解説・本文: Noto Sans JP
 * - 超現代語訳: Zen Maru Gothic
 */

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

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 1.8;
    color: #333;
    background-color: #FDFCF0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #2B4C7E;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #B03A2E;
}

ul {
    list-style: none;
}

/* ============================
   Layout
   ============================ */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.site-main {
    flex: 1;
    padding: 2rem 0;
}

/* ============================
   Header
   ============================ */
.site-header {
    background: #2B4C7E;
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    color: #fff;
    display: flex;
    flex-direction: column;
}

.site-logo:hover {
    color: #fff;
    opacity: 0.9;
}

.logo-main {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.logo-sub {
    font-size: 0.7rem;
    opacity: 0.8;
}

.site-nav {
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    color: #fff;
    font-size: 0.9rem;
}

.site-nav a:hover {
    color: #FDFCF0;
}

/* ============================
   Footer
   ============================ */
.site-footer {
    background: #2B4C7E;
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
}

.copyright {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.coming-soon {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background: #B03A2E;
    color: #fff;
}

.btn-primary:hover {
    background: #8a2d24;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: #2B4C7E;
    border: 1px solid #2B4C7E;
}

.btn-secondary:hover {
    background: #2B4C7E;
    color: #fff;
}

.btn-filter {
    background: #2B4C7E;
    color: #fff;
}

.btn-filter:hover {
    background: #1e3a5f;
    color: #fff;
}

.btn-reset {
    background: transparent;
    color: #666;
    padding: 0.75rem 1rem;
}

.btn-reset:hover {
    color: #B03A2E;
}

/* ============================
   Hero Section (Home)
   ============================ */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.hero-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #2B4C7E;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.hero-description {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ============================
   Section Titles
   ============================ */
.section-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.3rem;
    color: #2B4C7E;
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 3rem;
    height: 2px;
    background: #B03A2E;
    margin: 0.5rem auto 0;
}

.page-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    color: #2B4C7E;
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================
   Poem Card
   ============================ */
.poem-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poem-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.poem-card--featured {
    border-left: 4px solid #B03A2E;
}

.poem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.poem-number {
    font-family: 'Shippori Mincho', serif;
    font-size: 0.9rem;
    color: #B03A2E;
    font-weight: 600;
}

.poem-poet {
    font-size: 0.85rem;
    color: #666;
}

.poem-kimariji {
    font-size: 0.8rem;
    color: #2B4C7E;
    background: rgba(43, 76, 126, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.poem-body {
    margin-bottom: 1rem;
}

.poem-kami,
.poem-shimo {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

.poem-kami-short {
    font-family: 'Shippori Mincho', serif;
    font-size: 0.95rem;
    color: #333;
    margin: 0.5rem 0;
}

.poem-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #B03A2E;
}

.poem-link:hover {
    text-decoration: underline;
}

/* ============================
   Modern Slang (超現代語訳)
   ============================ */
.modern-slang {
    background: linear-gradient(135deg, #FF007A 0%, #ff4da6 100%);
    color: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
    position: relative;
}

.modern-slang-label {
    display: inline-block;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.modern-slang-text {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
}

/* ============================
   Filter Section (List)
   ============================ */
.filter-section {
    margin-bottom: 2rem;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.filter-select {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #2B4C7E;
}

/* ============================
   Poem Grid (List)
   ============================ */
.result-count {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.no-result {
    text-align: center;
    color: #666;
    padding: 2rem;
}

.poem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.poem-item {
    display: contents;
}

/* ============================
   Poem Detail Page
   ============================ */
.poem-detail {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.poem-detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.poem-number-large {
    display: block;
    font-family: 'Shippori Mincho', serif;
    font-size: 1rem;
    color: #B03A2E;
    margin-bottom: 0.5rem;
}

.poem-poet-name {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    color: #2B4C7E;
    font-weight: 600;
}

.poem-body-full {
    text-align: center;
    padding: 1.5rem 0;
    margin-bottom: 1.5rem;
}

.poem-kami-full,
.poem-shimo-full {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.4rem;
    color: #333;
    line-height: 1.8;
}

.modern-slang-section {
    margin: 2rem 0;
}

.poem-meaning-section,
.poem-kimariji-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f9f9f7;
    border-radius: 8px;
}

.section-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.poem-meaning {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.poem-kimariji-display {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.3rem;
    color: #2B4C7E;
    font-weight: 600;
}

/* ============================
   Poem Navigation
   ============================ */
.poem-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    gap: 0.5rem;
}

.poem-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.poem-nav-prev,
.poem-nav-next {
    background: #f5f5f3;
    min-width: 80px;
}

.poem-nav-prev:hover,
.poem-nav-next:hover {
    background: #eee;
}

.poem-nav-list {
    background: #2B4C7E;
    color: #fff;
}

.poem-nav-list:hover {
    background: #1e3a5f;
    color: #fff;
}

.poem-nav-disabled {
    visibility: hidden;
    min-width: 80px;
}

.nav-arrow {
    font-size: 1.2rem;
    color: #2B4C7E;
}

.nav-text {
    font-size: 0.75rem;
    color: #666;
}

.nav-number {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
}

/* ============================
   Error Page
   ============================ */
.error-page {
    text-align: center;
    padding: 3rem 1rem;
}

.error-code {
    font-family: 'Shippori Mincho', serif;
    font-size: 5rem;
    color: #B03A2E;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
}

.error-description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 600px) {
    html {
        font-size: 15px;
    }

    .site-header .container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .poem-detail {
        padding: 1.5rem 1rem;
    }

    .poem-kami-full,
    .poem-shimo-full {
        font-size: 1.2rem;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

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

    .poem-nav {
        flex-wrap: wrap;
    }

    .poem-nav-prev,
    .poem-nav-next {
        order: 2;
        flex: 1;
    }

    .poem-nav-list {
        order: 1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}
