/* ═══════════════════════════════════════════════════════════════
   community_recipe.css
   Styles for the community recipe detail page:
   - Page layout
   - Community Recipe badge
   - Author attribution
   - Delete button
   - Elevation step tracker (dots, lines, animation)
   - Tier tabs and tier content panels
   - Processing / failed state messages
   - Responsive adjustments
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page Layout ──────────────────────────────────────────────── */

.community-recipe {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-8) var(--container-padding);
}

.community-recipe__header {
    margin-bottom: var(--space-6);
}

.community-recipe__title {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--text-color);
    margin: var(--space-3) 0 var(--space-4);
}

/* ─── Community Recipe Badge ───────────────────────────────────── */

.community-recipe__badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-lighter);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.community-recipe__provenance-note {
    max-width: 62ch;
    margin: 1rem auto 0;
    padding: .85rem 1rem;
    border: 1px solid color-mix(in srgb, var(--accent-color) 48%, var(--border-color));
    border-radius: .75rem;
    background: color-mix(in srgb, var(--accent-color) 8%, var(--surface-elevated));
    color: var(--text-secondary);
    font-size: .84rem;
    line-height: 1.55;
    text-align: left;
}

/* ─── Author Attribution ───────────────────────────────────────── */

.community-recipe__author {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.community-recipe__author-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: var(--text-color);
}

.community-recipe__author-link:hover .community-recipe__author-name {
    color: var(--accent-color);
}

.community-recipe__author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.community-recipe__author-name {
    font-weight: 500;
    font-size: var(--text-base);
    transition: color var(--transition-speed);
}

.community-recipe__date {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* ─── Delete Button ────────────────────────────────────────────── */

.community-recipe__delete {
    background: none;
    border: none;
    color: #dc2626;
    font-size: var(--text-sm);
    cursor: pointer;
    padding: var(--space-1) 0;
    text-decoration: none;
    transition: text-decoration var(--transition-speed);
}

.community-recipe__delete:hover {
    text-decoration: underline;
}

.community-recipe__delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Recipe Image ─────────────────────────────────────────────── */

.community-recipe__image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: var(--space-6);
}

/* ─── Recipe Meta Pills ────────────────────────────────────────── */

.community-recipe__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.community-recipe__meta-pill {
    display: inline-block;
    padding: 4px 12px;
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    border-radius: 16px;
    font-size: var(--text-sm);
    font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════
   ELEVATION STEP TRACKER
   ═══════════════════════════════════════════════════════════════ */

.elevation-tracker {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: var(--space-6) 0;
}

.elevation-tracker__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.elevation-tracker__dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.elevation-tracker__dot--complete {
    background: #16a34a;
    border-color: #16a34a;
}

.elevation-tracker__dot--complete::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    position: absolute;
    top: 5px;
}

.elevation-tracker__dot--active {
    border-color: var(--accent-color);
    animation: elevation-pulse 2s infinite;
}

.elevation-tracker__line {
    height: 2px;
    width: 60px;
    background: var(--border-color);
    transition: background 0.3s ease;
}

.elevation-tracker__line--complete {
    background: #16a34a;
}

.elevation-tracker__label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
}

@keyframes elevation-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(196, 93, 62, 0.4); }
    50%      { box-shadow: 0 0 0 8px rgba(196, 93, 62, 0); }
}

/* ─── Processing / Failed State Messages ───────────────────────── */

.elevation-processing {
    text-align: center;
    padding: var(--space-4);
    background: var(--accent-lighter);
    border-radius: 8px;
    margin-bottom: var(--space-6);
    color: var(--accent-color);
    font-size: var(--text-base);
}

.elevation-failed {
    text-align: center;
    padding: var(--space-4);
    background: #fef2f2;
    border-radius: 8px;
    margin-bottom: var(--space-6);
    color: #dc2626;
    font-size: var(--text-base);
}

.elevation-failed__max {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: var(--space-2);
}

.elevation-retry-btn {
    display: inline-block;
    margin-top: var(--space-3);
    padding: 8px 20px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: background var(--transition-speed);
}

.elevation-retry-btn:hover {
    background: #b91c1c;
}

.elevation-retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════
   TIER TABS
   ═══════════════════════════════════════════════════════════════ */

.tier-tabs {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
    margin-bottom: var(--space-6);
}

.tier-tab {
    padding: 12px 24px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-speed), border-color var(--transition-speed);
}

.tier-tab:hover {
    color: var(--accent-color);
}

.tier-tab--active {
    border-bottom-color: var(--accent-color);
    color: var(--accent-color);
}

/* ═══════════════════════════════════════════════════════════════
   TIER CONTENT PANELS
   ═══════════════════════════════════════════════════════════════ */

.tier-content {
    margin-bottom: var(--space-8);
}

.tier-panel {
    display: none;
}

.tier-panel--active {
    display: block;
}

.tier-panel__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--space-3);
}

.tier-panel__description {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    margin-bottom: var(--space-6);
}

.tier-panel__ingredients {
    list-style: disc;
    padding-left: var(--space-6);
    margin-bottom: var(--space-6);
}

.tier-panel__ingredients li {
    padding: var(--space-1) 0;
    color: var(--text-color);
    line-height: var(--leading-normal);
}

.tier-panel__instructions {
    padding-left: var(--space-6);
    margin-bottom: var(--space-6);
}

.tier-panel__instructions li {
    padding: var(--space-2) 0;
    color: var(--text-color);
    line-height: var(--leading-normal);
}

.tier-panel__instructions li::marker {
    font-weight: 600;
    color: var(--accent-color);
}

.tier-panel__list {
    list-style: disc;
    padding-left: var(--space-6);
    margin-bottom: var(--space-6);
}

.tier-panel__list li {
    padding: var(--space-1) 0;
    color: var(--text-color);
    line-height: var(--leading-normal);
}

.tier-panel h3,
.tier-panel h4 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-3);
    color: var(--text-color);
}

.tier-panel h4 {
    font-size: var(--text-lg);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE (< 600px)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .community-recipe {
        padding: var(--space-4) var(--space-4);
    }

    .community-recipe__title {
        font-size: var(--text-2xl);
    }

    .community-recipe__image {
        border-radius: 8px;
        max-height: 300px;
    }

    /* Smaller tracker on mobile */
    .elevation-tracker__dot {
        width: 20px;
        height: 20px;
    }

    .elevation-tracker__dot--complete::after {
        width: 6px;
        height: 4px;
        top: 4px;
    }

    .elevation-tracker__line {
        width: 36px;
    }

    .elevation-tracker__label {
        font-size: var(--text-xs);
    }

    /* Tighter tier tabs */
    .tier-tab {
        padding: 10px 14px;
        font-size: var(--text-sm);
    }
}
