/* Builds on the tokens and components in /css/myprojects.styles.css */

[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

kbd {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.hero.compact { padding: 32px 0 26px; }
.hero.compact h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.hero.compact .lead { margin-bottom: 0; }

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.search {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
}
.search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15);
}
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex-shrink: 0; }
.search input {
    flex: 1;
    min-width: 0;
    padding: 13px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }

button.btn { font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; background: transparent; }
button.btn.ghost { border: 1px solid var(--border); }
.btn.on { border-color: var(--accent); background: rgba(124, 92, 255, 0.14); }

.chip span {
    margin-left: 4px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.count { color: var(--muted); font-size: 0.88rem; margin: 18px 0 14px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    overflow: hidden;
    transition: transform .25s ease, border-color .25s, box-shadow .25s;
    animation: rise .45s ease both;
}
.recipe-card:hover,
.recipe-card:focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--from) 60%, transparent);
    box-shadow: 0 20px 44px -24px var(--from);
    outline: none;
}

.recipe-art {
    display: grid;
    place-items: center;
    height: 132px;
    font-size: 4.2rem;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 55%),
        linear-gradient(135deg, var(--from), var(--to));
    transition: font-size .25s ease;
}
.recipe-card:hover .recipe-art { font-size: 4.8rem; }

.recipe-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px 20px;
    flex: 1;
}
.recipe-category {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.recipe-body strong { font-size: 1.2rem; letter-spacing: -0.01em; }
.recipe-body em { font-style: normal; color: var(--accent); font-size: 0.9rem; font-weight: 500; }
.recipe-desc { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.recipe-meta { margin-top: auto; padding-top: 12px; font-size: 0.8rem; color: var(--muted); }

.load-warnings {
    margin-top: 28px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid rgba(234, 179, 8, 0.5);
    background: rgba(234, 179, 8, 0.08);
    font-size: 0.9rem;
}
.load-warnings ul { margin: 8px 0 0; padding-left: 18px; font-family: "JetBrains Mono", monospace; font-size: 0.8rem; }

#detail-view { padding-top: 16px; animation: rise .35s ease both; }

.back {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
}
.back:hover { color: var(--text); }

.detail-head {
    display: flex;
    gap: 28px;
    align-items: center;
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--from) 16%, transparent), color-mix(in srgb, var(--to) 10%, transparent)),
        var(--surface);
}
.detail-art {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 130px;
    height: 130px;
    border-radius: 32px;
    font-size: 4.4rem;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.35), transparent 55%),
        linear-gradient(135deg, var(--from), var(--to));
    box-shadow: 0 20px 40px -20px var(--from);
}
.detail-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; line-height: 1.1; }
.detail-head .eyebrow { margin-bottom: 6px; }
.alt-name { margin: 4px 0 0; color: var(--accent); font-weight: 600; font-size: 1.05rem; }
.detail-head .lead { margin: 10px 0 0; font-size: 1rem; }
.detail-head .tags { margin: 14px 0 0; }

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.detail-body {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) 3fr;
    gap: 20px;
    align-items: start;
}

.panel {
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}
.ingredients { position: sticky; top: 16px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.panel h2 { margin: 0; font-size: 1.15rem; }
.panel h3 {
    margin: 18px 0 6px;
    font-size: 0.78rem;
    font-family: "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-2);
}
.progress { font-family: "JetBrains Mono", monospace; font-size: 0.78rem; color: var(--muted); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.checklist label:hover { background: rgba(124, 92, 255, 0.07); }
.checklist input {
    appearance: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    border-radius: 6px;
    border: 2px solid var(--border);
    background: var(--bg);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.checklist input::after { content: "✓"; color: #fff; font-size: 0.75rem; font-weight: 800; opacity: 0; }
.checklist input:checked { background: var(--live); border-color: var(--live); }
.checklist input:checked::after { opacity: 1; }
.checklist input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    transition: border-color .2s, opacity .2s, background .2s;
}
.steps li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.steps li.current {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, var(--bg));
    box-shadow: 0 12px 30px -22px var(--accent);
}
.steps li.done { opacity: 0.55; }
.steps li.done p { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.step-num {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.steps li.done .step-num { background: var(--live); font-size: 0; }
.steps li.done .step-num::after { content: "✓"; font-size: 1rem; }
.steps strong { display: block; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.65; }
.steps li.current p { color: var(--text); }

.tips {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px dashed rgba(234, 179, 8, 0.6);
    background: rgba(234, 179, 8, 0.07);
}
.tips ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 28px;
}
.pager a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    transition: border-color .2s;
}
.pager a:last-child { text-align: right; }
.pager a:hover { border-color: var(--accent); }
.pager span { font-size: 0.8rem; color: var(--muted); }

.site-footer code { font-family: "JetBrains Mono", monospace; font-size: 0.85em; }

@media (max-width: 820px) {
    .detail-body { grid-template-columns: 1fr; }
    .ingredients { position: static; }
}

@media (max-width: 560px) {
    .detail-head { flex-direction: column; align-items: flex-start; gap: 18px; padding: 22px; }
    .detail-art { width: 96px; height: 96px; font-size: 3.2rem; border-radius: 24px; }
    .search kbd { display: none; }
    .pager { grid-template-columns: 1fr; }
    .pager a:last-child { text-align: left; }
}

@media print {
    .bg-glow, .site-header, .site-footer, .back, .detail-actions, .pager { display: none !important; }
    body { background: #fff; color: #000; }
    .panel, .detail-head, .steps li { border-color: #ccc; background: #fff; box-shadow: none; }
    .detail-body { grid-template-columns: 1fr 1.5fr; }
    .ingredients { position: static; }
    .steps li { break-inside: avoid; opacity: 1 !important; }
    .steps p, .checklist span { color: #000 !important; text-decoration: none !important; }
}
