/* pages.css — Page-Specific Styles
 * Stiluri valabile doar în contextul unui singur tip de pagină.
 * Nu conțin componente reutilizabile — acelea merg în components.css.
 */

/* ── Home ───────────────────────────────────────────────────────── */
.hero {
    padding: var(--space-8) 0 var(--space-7);
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-7);
}

.hero__pretitle {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    color: var(--brand);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-3);
}

.hero__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    max-width: 640px;
    margin-inline: auto;
}

.hero__desc {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    max-width: 520px;
    margin-inline: auto;
    margin-bottom: var(--space-6);
}

.hero__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* Search bar (home + search page) */
.search-bar {
    display: flex;
    gap: 0;
    max-width: 560px;
    margin: 0 auto var(--space-7);
}

.search-bar__input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-base);
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    min-height: 48px;
    outline: none;
    transition: border-color var(--duration-fast);
}
.search-bar__input:focus { border-color: var(--brand); }

.search-bar__btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    min-height: 48px;
    padding: 0 var(--space-5);
    flex-shrink: 0;
}

/* Category grid (home) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-7);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: box-shadow var(--duration-fast), transform var(--duration-fast);
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}

.category-card__icon   { font-size: 2rem; }
.category-card__name   { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); }
.category-card__count  { font-family: var(--font-family-ui); font-size: var(--font-size-xs); color: var(--text-muted); }

/* ── Recipe List ────────────────────────────────────────────────── */
.list-filters {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.list-filters__group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 140px;
}

.list-filters__label {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-4);
}

.recipe-card { display: flex; flex-direction: column; }
.recipe-card .card__body { flex: 1; }

.recipe-card__owner {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-3);
}

/* ── Recipe Detail ──────────────────────────────────────────────── */
.recipe-detail {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-6);
    align-items: start;
}

.recipe-detail__main {}
.recipe-detail__aside {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-4));
}

.recipe-hero-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    background: var(--surface-2);
}

.recipe-hero-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--border-strong);
    margin-bottom: var(--space-5);
}

.recipe-meta-bar {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    flex-wrap: wrap;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: var(--space-4) 0 var(--space-5);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.recipe-meta-bar__item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.recipe-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.recipe-instructions {
    font-size: var(--font-size-base);
    line-height: var(--line-height-loose);
    color: var(--text-primary);
}

.recipe-instructions ol {
    list-style: decimal;
    padding-left: var(--space-5);
}

.recipe-instructions ol li {
    margin-bottom: var(--space-3);
}

/* Ingredients list */
.ingredient-list { list-style: none; }

.ingredient-list__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    align-items: baseline;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
}

.ingredient-list__item:last-child { border-bottom: none; }

.ingredient-list__qty {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    white-space: nowrap;
    font-family: var(--font-family-mono);
    min-width: 80px;
}

.ingredient-list__name { color: var(--text-primary); }

.ingredient-list__note {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-style: italic;
}

/* Ingredient group header */
.ingredient-group-header {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-3) 0 var(--space-1);
    margin-top: var(--space-2);
}

/* Calculator widget */
.calculator-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.calculator-widget__title {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-3);
    color: var(--text-secondary);
}

.servings-control {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.servings-input {
    width: 72px;
    text-align: center;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
}

/* ── Recipe Form ────────────────────────────────────────────────── */
.recipe-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-6);
    align-items: start;
}

.ingredient-row {
    display: grid;
    grid-template-columns: 2fr 80px 120px 1.5fr auto;
    gap: var(--space-2);
    align-items: end;
    margin-bottom: var(--space-2);
}

.ingredient-row--header {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

.ingredient-add-btn {
    margin-top: var(--space-2);
}

/* ── Auth Pages ─────────────────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-6);
    box-shadow: var(--shadow-md);
}

.auth-card__logo {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
}

.auth-card__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: var(--space-1);
}

.auth-card__subtitle {
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-card__footer {
    text-align: center;
    margin-top: var(--space-5);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.auth-card__footer a {
    color: var(--brand);
    font-weight: var(--font-weight-medium);
}

/* ── Dashboard ──────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* ── Profile ────────────────────────────────────────────────────── */
.profile-header {
    display: flex;
    gap: var(--space-5);
    align-items: flex-start;
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.profile-header__info { flex: 1; min-width: 200px; }
.profile-header__name { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); margin-bottom: var(--space-1); }
.profile-header__username { font-family: var(--font-family-ui); font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: var(--space-3); }
.profile-header__bio { font-family: var(--font-family-ui); font-size: var(--font-size-sm); color: var(--text-secondary); margin-bottom: var(--space-4); }

.profile-stats {
    display: flex;
    gap: var(--space-5);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.profile-stats__item strong {
    display: block;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .recipe-detail { grid-template-columns: 1fr; }
    .recipe-detail__aside { position: static; }
    .recipe-form-layout   { grid-template-columns: 1fr; }
    .stats-row            { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .ingredient-row       { grid-template-columns: 1fr 1fr; }
    .ingredient-row > *:nth-child(n+3) { display: none; }
}

@media (max-width: 480px) {
    .auth-card            { padding: var(--space-5); }
    .list-filters         { flex-direction: column; }
    .stats-row            { grid-template-columns: 1fr 1fr; }
    .recipe-actions       { flex-direction: column; }
    .hero__actions        { flex-direction: column; align-items: center; }
}
