/* ═══════════════════════════════════════════════════════════
   Icookada — Recipe Archive Page
   Tokens from tokens.css — do not redeclare palette here.
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.ica-archive-page {
    font-family: var(--ica-font);
    background: var(--ica-bg);
    color: var(--ica-text);
    min-height: 100vh;
}

/* ── HERO ─────────────────────────────────────────────────── */
.arc-hero {
    background: var(--ica-forest);
    color: #fff;
    padding: 3rem 1.5rem 2.5rem;
}
.arc-hero__inner { max-width: 1240px; margin: 0 auto; }
.arc-hero__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -.03em;
    margin-bottom: .4rem;
}
.arc-hero__sub { color: rgba(255,255,255,.65); font-size: 1.05rem; }

/* ── FILTERS ──────────────────────────────────────────────── */
.arc-filters {
    background: var(--ica-surface);
    border-bottom: 1px solid var(--ica-border);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 60px;
    z-index: 90;
}
.arc-filters__inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
}
.arc-search-wrap {
    position: relative;
    flex: 1 1 200px;
    min-width: 160px;
}
.arc-search-icon {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--ica-muted);
    pointer-events: none;
}
.arc-search {
    width: 100%;
    padding: .55rem .75rem .55rem 2.2rem;
    border: 1px solid var(--ica-border);
    border-radius: 100px;
    background: #fff;
    font-family: var(--ica-font);
    font-size: .875rem;
    color: var(--ica-text);
    outline: none;
    transition: border-color .15s;
}
.arc-search:focus { border-color: var(--ica-forest); }
.arc-select {
    padding: .55rem 2rem .55rem .9rem;
    border: 1px solid var(--ica-border);
    border-radius: 100px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a6e5c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right .75rem center;
    appearance: none;
    font-family: var(--ica-font);
    font-size: .875rem;
    color: var(--ica-text);
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
}
.arc-select:focus { border-color: var(--ica-forest); }

/* ── MAIN / GRID ──────────────────────────────────────────── */
.arc-main { padding: 2rem 1.5rem 4rem; }
.arc-container { max-width: 1240px; margin: 0 auto; }
.arc-count {
    font-size: .85rem;
    color: var(--ica-muted);
    margin-bottom: 1.25rem;
}

.arc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

/* ── RECIPE CARD ──────────────────────────────────────────── */
.arc-card {
    background: #fff;
    border: 1px solid var(--ica-border);
    border-radius: var(--ica-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.arc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.09);
}
.arc-card__thumb-wrap {
    position: relative;
}
.arc-card__thumb {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--ica-surface);
    display: block;
}
.arc-card__thumb-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--ica-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}
.arc-origin {
    position: absolute;
    top: .5rem;
    left: .5rem;
    padding: .2rem .55rem;
    border-radius: 100px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    line-height: 1;
}
.arc-origin--icookada {
    background: var(--ica-forest);
    color: #fff;
}
.arc-origin--community {
    background: var(--ica-claret);
    color: #fff;
}
.arc-card__body {
    padding: .9rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.arc-card__title {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.35;
    color: var(--ica-text);
}
.arc-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .2rem;
}
.arc-tag {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--ica-surface);
    color: var(--ica-muted);
    text-transform: capitalize;
}
.arc-tag--cuisine { background: #e8f0eb; color: #1d5c35; }
.arc-tag--meal    { background: #f0e8ec; color: var(--ica-claret); }
.arc-tag--diff    { background: #fdf3eb; color: #8a4a1b; }

/* ── STATES ───────────────────────────────────────────────── */
.arc-loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}
.arc-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--ica-border);
    border-top-color: var(--ica-forest);
    border-radius: 50%;
    animation: arc-spin .7s linear infinite;
}
@keyframes arc-spin { to { transform: rotate(360deg); } }

.arc-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--ica-muted);
    font-size: 1rem;
}
.arc-empty[hidden] { display: none; }

.arc-more-wrap {
    text-align: center;
    margin-top: 2.5rem;
}
.arc-more-wrap[hidden] { display: none; }
.arc-load-more {
    padding: .75rem 2rem;
    background: var(--ica-forest);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-family: var(--ica-font);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
}
.arc-load-more:hover { opacity: .85; }
.arc-load-more:disabled { opacity: .5; cursor: not-allowed; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 640px) {
    .arc-filters__inner { flex-direction: column; align-items: stretch; }
    .arc-search-wrap { flex: 1 1 100%; }
    .arc-select { width: 100%; }
    .arc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
}
