/* =========================================
   Fabulia View – Stylesheet
   DOW MEDIA Consulting – fabulia-view.css
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@700;800;900&family=Nunito+Sans:wght@400;600&display=swap');

/* ---- Root & Reset ---- */
.fabulia-view-wrap {
    --fv-radius-btn: 18px;
    --fv-radius-card: 14px;
    --fv-shadow: 0 4px 18px rgba(0,0,0,.13);
    --fv-shadow-hover: 0 8px 32px rgba(0,0,0,.22);
    --fv-font-title: 'Nunito', sans-serif;
    --fv-font-body: 'Nunito Sans', sans-serif;
    --fv-gap: 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--fv-font-body);
}

.fabulia-view-wrap *,
.fabulia-view-wrap *::before,
.fabulia-view-wrap *::after {
    box-sizing: border-box;
}

/* ---- Section ---- */
.fabulia-section {
    width: 100%;
    margin-bottom: 48px;
    padding: 0;
}

/* ---- Buttons shared ---- */
.fabulia-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    font-family: var(--fv-font-title);
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0,0,0,.25);
    border-radius: var(--fv-radius-btn);
    box-shadow: var(--fv-shadow);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    line-height: 1.2;
}

.fabulia-btn:hover,
.fabulia-btn:focus {
    transform: translateY(-3px) scale(1.04);
    box-shadow: var(--fv-shadow-hover);
    filter: brightness(1.08);
    outline: none;
}

.fabulia-btn:active {
    transform: translateY(0) scale(.98);
}

.fabulia-btn-count {
    background: rgba(255,255,255,.3);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .78em;
    font-weight: 900;
    white-space: nowrap;
    letter-spacing: .02em;
}

/* ---- Parent button ---- */
.fabulia-parent-btn-wrap {
    margin-bottom: 14px;
}

.fabulia-parent-btn {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    padding: 13px 28px;
    border-radius: 22px;
    letter-spacing: .01em;
    box-shadow: 0 6px 22px rgba(0,0,0,.18);
    position: relative;
    overflow: hidden;
}

.fabulia-parent-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
    pointer-events: none;
}

/* ---- Child buttons ---- */
.fabulia-children-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fv-gap);
    margin-bottom: 22px;
}

.fabulia-child-btn {
    font-size: clamp(.78rem, 1.6vw, .98rem);
    padding: 8px 18px;
    border-radius: var(--fv-radius-btn);
}

/* ---- Mosaic grid ---- */
.fabulia-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: var(--fv-gap);
    width: 100%;
}

/* ---- Card ---- */
.fabulia-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: var(--fv-radius-card);
    box-shadow: var(--fv-shadow);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.fabulia-card:hover {
    transform: translateY(-5px) scale(1.025);
    box-shadow: var(--fv-shadow-hover);
}

/* Image wrapper – aspect ratio 2:3 (book cover portrait) */
.fabulia-card-img-wrap {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.fabulia-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform .35s ease;
}

.fabulia-card:hover .fabulia-card-img-wrap img {
    transform: scale(1.07);
}

/* Card title */
.fabulia-card-title {
    padding: 8px 10px;
    font-family: var(--fv-font-title);
    font-weight: 700;
    font-size: clamp(.7rem, 1.2vw, .85rem);
    line-height: 1.35;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ---- Ripple effect ---- */
.fv-ripple {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    transform: scale(0);
    animation: fv-ripple-anim .65s linear;
    pointer-events: none;
    margin-left: -3px;
    margin-top: -3px;
}

@keyframes fv-ripple-anim {
    to { transform: scale(60); opacity: 0; }
}

/* ---- Utilities ---- */
.fabulia-empty,
.fabulia-no-posts {
    color: #999;
    font-style: italic;
    font-size: .9rem;
    padding: 12px 0;
}

/* ---- Buton "Vezi toate" ---- */
.fabulia-vezi-toate-wrap {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.fabulia-vezi-toate {
    font-size: clamp(.85rem, 1.8vw, 1rem);
    padding: 11px 26px;
    border-radius: var(--fv-radius-btn);
    gap: 10px;
}

.fabulia-btn-arrow {
    font-size: 1.2em;
    transition: transform .2s ease;
}

.fabulia-vezi-toate:hover .fabulia-btn-arrow {
    transform: translateX(5px);
}

/* ---- [fabulia_category_view] nav ---- */
.fabulia-category-view-wrap {
    padding: 0;
}

.fabulia-cat-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fv-gap);
    margin-bottom: 24px;
    align-items: center;
}

.fabulia-nav-all {
    font-size: clamp(.85rem, 1.8vw, 1rem);
    padding: 10px 22px;
}

/* Buton activ – chenar alb intern */
.fabulia-btn-active {
    box-shadow: 0 0 0 3px #fff, 0 4px 18px rgba(0,0,0,.18) !important;
    filter: brightness(1.06);
}

/* Titlu categorie activă */
.fabulia-cat-title {
    font-family: var(--fv-font-title);
    font-weight: 900;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #222;
    margin: 0 0 20px 0;
    padding-left: 14px;
    line-height: 1.2;
}

/* ---- Paginare ---- */
.fabulia-pagination {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.fabulia-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    font-family: var(--fv-font-title);
    font-weight: 700;
    font-size: .9rem;
    transition: background .18s, color .18s, transform .18s;
}

.fabulia-pagination .page-numbers:hover {
    background: #222;
    color: #fff;
    transform: translateY(-2px);
}

.fabulia-pagination .page-numbers.current {
    background: #222;
    color: #fff;
}

.fabulia-pagination .page-numbers.dots {
    background: transparent;
    pointer-events: none;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

/* Tablet: >=600px */
@media (min-width: 600px) {
    .fabulia-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Desktop: >=1024px */
@media (min-width: 1024px) {
    .fabulia-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    .fabulia-section {
        margin-bottom: 64px;
    }
}

/* Large desktop */
@media (min-width: 1440px) {
    .fabulia-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

/* Phone: <480px */
@media (max-width: 479px) {
    .fabulia-mosaic {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
    .fabulia-parent-btn {
        width: 100%;
        justify-content: space-between;
    }
    .fabulia-card-title {
        font-size: .72rem;
        padding: 6px 8px;
    }
}
