/* ── Cookbook: save button + evolution chip ──────────────────────────── */

html.legendary .lrd-cookbook-save-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: transparent;
    border: 1px solid var(--terracotta-500, #C45D3E);
    border-radius: 2rem;
    color: var(--terracotta-500, #C45D3E);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--motion-fast) ease,
                background var(--motion-fast) ease,
                color var(--motion-fast) ease;
}

html.legendary .lrd-cookbook-save-btn:hover {
    background: rgba(196, 93, 62, 0.10);
    border-color: var(--terracotta-600, #A9492E);
    color: var(--terracotta-700, #8C3A24);
}

html.legendary .lrd-cookbook-save-btn--saved {
    background: var(--terracotta-500, #C45D3E);
    border-color: var(--terracotta-500, #C45D3E);
    color: #fff;
}

html.legendary .lrd-cookbook-save-btn--saved:hover {
    background: var(--terracotta-600, #A9492E);
    border-color: var(--terracotta-600, #A9492E);
    color: #fff;
}

html.legendary .lrd-cookbook-save-btn__icon {
    font-size: 0.95em;
    line-height: 1;
}

html.legendary .lrd-cookbook-save-btn[disabled] {
    opacity: 0.6;
    cursor: progress;
}

/* Evolution chip — same skeleton as the scaffold chip but with a green
   sprout accent to signal this is "your copy" and organic. */

html.legendary .lrd-cookbook-chip {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    margin-bottom: var(--space-3);
}

html.legendary .lrd-cookbook-chip__toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: rgba(120, 135, 88, 0.20);
    border: 1px solid rgba(156, 174, 100, 0.55);
    border-radius: 2rem;
    color: var(--clay-100);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

html.legendary .lrd-cookbook-chip__toggle:hover {
    background: rgba(120, 135, 88, 0.32);
    border-color: rgba(180, 198, 118, 0.80);
}

html.legendary .lrd-cookbook-chip__toggle[aria-expanded="true"] .lrd-cookbook-chip__caret {
    transform: rotate(90deg);
}

html.legendary .lrd-cookbook-chip__icon {
    font-size: 0.95em;
    line-height: 1;
}

html.legendary .lrd-cookbook-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    background: #6f8355;
    border-radius: 1rem;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

html.legendary .lrd-cookbook-chip__meta {
    color: var(--clay-300);
    font-weight: 500;
}

html.legendary .lrd-cookbook-chip__caret {
    font-size: 1rem;
    line-height: 1;
    transition: transform var(--motion-fast) ease;
}

html.legendary .lrd-cookbook-chip__panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    min-width: min(320px, calc(100vw - 2rem));
    max-width: 420px;
    background: var(--clay-900);
    border: 1px solid var(--clay-700);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4);
    z-index: 10;
}

html.legendary .lrd-cookbook-chip__panel[hidden] {
    display: none;
}

html.legendary .lrd-cookbook-chip__intro {
    font-size: var(--text-sm);
    color: var(--clay-300);
    margin: 0 0 var(--space-3);
    line-height: 1.5;
}

html.legendary .lrd-cookbook-chip__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

html.legendary .lrd-cookbook-chip__item {
    padding: var(--space-2) var(--space-3);
    background: var(--clay-800);
    border-left: 2px solid #6f8355;
    border-radius: var(--radius-md);
}

html.legendary .lrd-cookbook-chip__item--reverted {
    opacity: 0.55;
    border-left-color: var(--clay-600);
}

html.legendary .lrd-cookbook-chip__item-head {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    align-items: baseline;
}

html.legendary .lrd-cookbook-chip__item-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--clay-100);
}

html.legendary .lrd-cookbook-chip__item-date {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--clay-400);
}

html.legendary .lrd-cookbook-chip__item-why {
    font-size: var(--text-xs);
    color: var(--clay-300);
    margin: var(--space-1) 0 0;
    line-height: 1.5;
}

html.legendary .lrd-cookbook-chip__revert {
    margin-top: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: transparent;
    border: 1px solid var(--clay-600);
    border-radius: var(--radius-sm);
    color: var(--clay-300);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: border-color var(--motion-fast) ease, color var(--motion-fast) ease;
}

html.legendary .lrd-cookbook-chip__revert:hover {
    border-color: var(--terracotta-400);
    color: var(--terracotta-300);
}

html.legendary .lrd-cookbook-chip__reverted-pill {
    display: inline-block;
    margin-top: var(--space-2);
    padding: 2px var(--space-2);
    background: var(--clay-700);
    border-radius: var(--radius-sm);
    color: var(--clay-400);
    font-size: var(--text-xs);
    font-style: italic;
}

html.legendary .lrd-cookbook-chip__link {
    display: block;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--clay-700);
    font-size: var(--text-xs);
    color: var(--clay-400);
    text-decoration: none;
}

html.legendary .lrd-cookbook-chip__link:hover {
    color: var(--clay-200);
}

/* Cookbook landing page */

html.legendary .cookbook-page {
    background: #0E0D0B;
    min-height: 100vh;
    color: var(--clay-100);
}

html.legendary .cookbook-hero {
    padding: var(--space-10) var(--space-5) var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

html.legendary .cookbook-hero__eyebrow {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--terracotta-400);
    margin-bottom: var(--space-3);
}

html.legendary .cookbook-hero__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.05;
    color: var(--clay-50);
    margin: 0 0 var(--space-3);
}

html.legendary .cookbook-hero__lede {
    font-size: var(--text-lg);
    color: var(--clay-300);
    line-height: 1.55;
    max-width: 640px;
    margin: 0 auto;
}

html.legendary .cookbook-hero__stats {
    display: inline-flex;
    gap: var(--space-6);
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-5);
    background: var(--clay-900);
    border: 1px solid var(--clay-800);
    border-radius: var(--radius-lg);
}

html.legendary .cookbook-hero__stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--clay-50);
}

html.legendary .cookbook-hero__stat span {
    font-size: var(--text-xs);
    color: var(--clay-400);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

html.legendary .cookbook-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-5) var(--space-10);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-5);
}

html.legendary .cookbook-card {
    background: var(--clay-900);
    border: 1px solid var(--clay-800);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
    text-decoration: none;
    color: inherit;
}

html.legendary .cookbook-card:hover {
    border-color: var(--terracotta-400);
    transform: translateY(-2px);
}

html.legendary .cookbook-card__media {
    aspect-ratio: 4 / 3;
    background: var(--clay-800);
    position: relative;
    overflow: hidden;
}

html.legendary .cookbook-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html.legendary .cookbook-card__evo-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 2px var(--space-2);
    background: rgba(111, 131, 85, 0.90);
    color: #fff;
    border-radius: 1rem;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

html.legendary .cookbook-card__body {
    padding: var(--space-3) var(--space-4) var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

html.legendary .cookbook-card__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--clay-50);
    margin: 0;
    line-height: 1.25;
}

html.legendary .cookbook-card__meta {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--clay-400);
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

html.legendary .cookbook-card__meta span {
    white-space: nowrap;
}

html.legendary .cookbook-empty {
    max-width: 640px;
    margin: var(--space-8) auto;
    padding: var(--space-10) var(--space-5);
    text-align: center;
    border: 1px dashed var(--clay-700);
    border-radius: var(--radius-lg);
    color: var(--clay-300);
}

html.legendary .cookbook-empty h2 {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    color: var(--clay-100);
    margin: 0 0 var(--space-2);
}

html.legendary .cookbook-empty a {
    display: inline-block;
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-5);
    background: var(--terracotta-500);
    border-radius: 2rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: var(--text-sm);
}

html.legendary .cookbook-empty a:hover {
    background: var(--terracotta-400);
}

@media (max-width: 640px) {
    html.legendary .lrd-cookbook-chip__panel {
        min-width: 260px;
        max-width: calc(100vw - 2rem);
    }
    html.legendary .cookbook-hero__stats {
        flex-direction: column;
        gap: var(--space-2);
    }
    html.legendary .cookbook-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
}
