/* ============================================
   Elevate Free Content Site - Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --bg-primary: #fafaf9;
    --bg-secondary: #f5f5f4;
    --bg-card: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --accent-light: rgba(14, 165, 233, 0.08);
    --accent-border: rgba(14, 165, 233, 0.2);
    --purple: #6366f1;
    --purple-light: rgba(99, 102, 241, 0.08);
    --purple-border: rgba(99, 102, 241, 0.2);
    --green: #10b981;
    --green-light: rgba(16, 185, 129, 0.08);
    --green-border: rgba(16, 185, 129, 0.2);
    --amber: #f59e0b;
    --amber-light: rgba(245, 158, 11, 0.08);
    --amber-border: rgba(245, 158, 11, 0.2);
    --red: #ef4444;
    --red-light: rgba(239, 68, 68, 0.06);
    --red-border: rgba(239, 68, 68, 0.2);
    --pink: #ec4899;
    --border: #e7e5e4;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1120px;
    --article-width: 780px;
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

/* ---------- Layout ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.article-container {
    max-width: var(--article-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 249, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.site-logo .logo-accent {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-logo .logo-sub {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-left: 0.3rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 0.25rem 0;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
    border-radius: 1px;
}

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

.header-nav a:hover::after {
    width: 100%;
}

/* ---------- Hero (Top Page) ---------- */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -60%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.06), transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    line-height: 1.8;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hero-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.hero-search .search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ---------- Category Section ---------- */
.section {
    padding: 3rem 0;
}

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

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.02em;
}

.section-title .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.section-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- Category Cards (Top Page) ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-border);
    color: inherit;
}

.category-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.category-card .card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.category-card .card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.category-card .card-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- Article List Cards ---------- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.article-card .card-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}

.article-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.article-card .card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---------- Article Page ---------- */
.article-header {
    padding: 3rem 0 2rem;
}

.article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.article-breadcrumb a {
    color: var(--text-secondary);
}

.article-breadcrumb .sep {
    color: var(--text-muted);
}

.article-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---------- Article Content ---------- */
.article-content {
    padding-bottom: 3rem;
}

.article-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
    letter-spacing: -0.02em;
}

.article-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1.25rem;
    line-height: 2;
}

/* Callout / Important Box */
.callout {
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    line-height: 1.8;
}

.callout.info {
    background: var(--accent-light);
    border-left: 4px solid var(--accent);
}

.callout.warning {
    background: var(--amber-light);
    border-left: 4px solid var(--amber);
}

.callout.success {
    background: var(--green-light);
    border-left: 4px solid var(--green);
}

.callout.danger {
    background: var(--red-light);
    border-left: 4px solid var(--red);
}

.callout-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Example Sentence Box */
.example-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1.25rem 0;
}

.example-box .english {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.example-box .english .highlight {
    color: var(--accent);
    font-weight: 700;
}

.example-box .english .highlight-b {
    color: var(--purple);
    font-weight: 700;
}

.example-box .japanese {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Comparison Table */
.compare-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.compare-table tr:last-child td {
    border-bottom: none;
}

.compare-table .correct {
    color: var(--green);
    font-weight: 600;
}

.compare-table .incorrect {
    color: var(--red);
    font-weight: 600;
}

/* ---------- AdSense Placeholder ---------- */
.ad-slot {
    display: none;
    /* AdSense設定時にこの行を削除して、下のコメントアウトを解除 */
    /* display: flex; */
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 2rem 0;
    min-height: 100px;
    align-items: center;
    justify-content: center;
}

/* ---------- CTA Banner ---------- */
.cta-banner {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    color: white;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.cta-banner h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
}

.cta-banner p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
    position: relative;
}

.cta-banner .cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.cta-banner .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    color: var(--accent);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand .logo {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.footer-col a {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 2rem auto 0;
    padding: 1.5rem 1.5rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .article-title {
        font-size: 1.5rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .header-nav {
        display: none;
    }

    .article-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ---------- Utility ---------- */
.flex {
    display: flex;
}

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

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.text-sm {
    font-size: 0.85rem;
}

.text-muted {
    color: var(--text-secondary);
}

.font-bold {
    font-weight: 700;
}

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

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

.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}