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

:root {
    --bg: #faf9f6;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-sub: #6b6b6b;
    --accent: #e8590c;
    --accent-light: #fff4e6;
    --border: #e9e5e0;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --font: 'Pretendard Variable', -apple-system, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.9);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
}

.header-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* ── Main ────────────────────────────────────────────────── */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
    width: 100%;
    flex: 1;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 40px 0 32px;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero-desc {
    color: var(--text-sub);
    font-size: 1.05rem;
}

/* ── Recipe Grid ─────────────────────────────────────────── */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.recipe-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.recipe-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-emoji {
    font-size: 2.4rem;
    flex-shrink: 0;
}

.card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-sub {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag {
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.source {
    font-size: 0.75rem;
    color: var(--text-sub);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 0;
}

.empty-emoji {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--text-sub);
    font-size: 1.1rem;
}

.empty-hint {
    margin-top: 8px;
    font-size: 0.9rem !important;
}

/* ── Detail Page ─────────────────────────────────────────── */
.recipe-detail {
    max-width: 700px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent);
}

.detail-header {
    margin-bottom: 32px;
}

.detail-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.detail-sub {
    color: var(--text-sub);
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.servings {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.source-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* ── Recipe Section ──────────────────────────────────────── */
.recipe-section {
    margin-bottom: 36px;
}

.recipe-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

.ingredients-box, .steps-box, .notes-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.ingredients-box h3, .steps-box h3, .notes-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.ingredients-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.ingredients-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.95rem;
}

.ingredients-list li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    margin-right: 8px;
}

.steps-list {
    padding-left: 24px;
}

.steps-list li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    padding-left: 8px;
}

.steps-list li::marker {
    color: var(--accent);
    font-weight: 700;
}

.notes-box p {
    color: var(--text-sub);
    font-size: 0.95rem;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-sub);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .hero h1 { font-size: 1.5rem; }
    .recipe-grid { grid-template-columns: 1fr; }
    .detail-header h1 { font-size: 1.4rem; }
    .ingredients-list { grid-template-columns: 1fr; }
    main { padding: 20px 16px; }
}
