﻿/* ============================================================
   Category Index — BookStore Editorial Style
   File: Content/css/category-index.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,800;1,600&family=DM+Sans:wght@300;400;500&display=swap');

/* ── ROOT TOKENS ── */
:root {
    --ink: #1a1410;
    --cream: #faf7f2;
    --sand: #f0ead8;
    --amber: #c8862a;
    --amber-lt: #e9a94a;
    --muted: #7a6e62;
    --white: #ffffff;
    --card-r: 20px;
    --ease: cubic-bezier(.25,.8,.25,1);
}

/* ── RESET FOR PAGE ── */
.ci-page {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

/* ── HERO ── */
.ci-hero {
    position: relative;
    background: var(--ink);
    overflow: hidden;
    padding: 90px 0 80px;
}

.ci-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Decorative grid lines */
.ci-hero__lines {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(200,134,42,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(200,134,42,.08) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Gold circle accent */
.ci-hero__bg::after {
    content: '';
    position: absolute;
    right: -120px;
    top: -120px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,134,42,.18) 0%, transparent 70%);
}

.ci-hero__content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.ci-hero__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 20px;
    padding: 6px 14px;
    border: 1px solid rgba(200,134,42,.35);
    border-radius: 40px;
}

.ci-hero__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--white);
    margin: 0 0 20px;
}

    .ci-hero__title em {
        font-style: italic;
        color: var(--amber-lt);
    }

.ci-hero__sub {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255,255,255,.6);
    line-height: 1.7;
    margin: 0 0 36px;
    max-width: 460px;
}

.ci-hero__stat {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ci-hero__num {
    font-family: 'Playfair Display', serif;
    font-size: 52px;
    font-weight: 800;
    color: var(--amber);
    line-height: 1;
}

.ci-hero__unit {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ── GRID SECTION ── */
.ci-grid-section {
    padding: 70px 0 90px;
}

/* ── CARD GRID ── */
.ci-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1100px) {
    .ci-grid {
        grid-template-columns: repeat(3,1fr);
    }
}

@media (max-width: 768px) {
    .ci-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 480px) {
    .ci-grid {
        grid-template-columns: 1fr;
    }
}

/* ── CARD ── */
.ci-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--card-r);
    border: 1.5px solid #e8e0d0;
    padding: 28px 24px 22px;
    text-decoration: none;
    color: var(--ink);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
    animation: fadeUp .5s var(--ease) both;
    animation-delay: var(--delay, 0s);
    position: relative;
    overflow: hidden;
}

    .ci-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--amber), var(--amber-lt));
        opacity: 0;
        transition: opacity .3s;
    }

    .ci-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 50px rgba(26,20,16,.12);
        border-color: var(--amber);
        text-decoration: none;
        color: var(--ink);
    }

        .ci-card:hover::before {
            opacity: 1;
        }

/* Icon */
.ci-card__icon-wrap {
    width: 56px;
    height: 56px;
    background: var(--sand);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: background .3s;
}

.ci-card:hover .ci-card__icon-wrap {
    background: #fdecc8;
}

.ci-card__icon {
    font-size: 26px;
    line-height: 1;
}

/* Body */
.ci-card__body {
    flex: 1;
}

.ci-card__name {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.3;
}

.ci-card__desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.ci-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0e8d8;
}

.ci-card__count {
    font-size: 12px;
    font-weight: 500;
    color: var(--amber);
    letter-spacing: .5px;
    background: #fff8ec;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #fdecc8;
}

.ci-card__arrow {
    font-size: 18px;
    color: var(--muted);
    transition: transform .3s, color .3s;
}

.ci-card:hover .ci-card__arrow {
    transform: translateX(5px);
    color: var(--amber);
}

/* ── EMPTY STATE ── */
.ci-empty {
    text-align: center;
    padding: 80px 20px;
}

.ci-empty__icon {
    font-size: 60px;
    display: block;
    margin-bottom: 16px;
}

.ci-empty p {
    font-size: 16px;
    color: var(--muted);
}

/* ── ANIMATION ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
