/* =============================================
   CRE-BOOK Blog Grid Page — Child Theme Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Azeret+Mono:wght@400;500;600;700&display=swap');

.crebook-blog-page {
    --cb-primary:       #5485D6;
    --cb-text:          #000000;
    --cb-text-muted:    #54595F;
    --cb-text-light:    #7A7A7A;
    --cb-border:        rgba(0, 0, 0, .12);
    --cb-bg:            rgba(0, 0, 0, .03);
    --cb-surface:       #ffffff;
    --cb-radius:        4px;
    --cb-radius-sm:     3px;
    --cb-shadow:        0 1px 3px rgba(0,0,0,.07), 0 4px 18px rgba(0,0,0,.06);
    --cb-shadow-hover:  0 6px 28px rgba(0,0,0,.14);
    --cb-ease:          .22s cubic-bezier(.4,0,.2,1);
    --cb-font-sans:     Helvetica, Arial, sans-serif;
    --cb-font-mono:     'Azeret Mono', 'SFMono-Regular', Consolas, monospace;
    font-family: var(--cb-font-sans);
    background: var(--cb-bg);
    padding-bottom: 72px;
}
.crebook-blog-page .page-title h1 {
    font-family: var(--cb-font-sans);
}

/* ---- Section header ---- */
.crebook-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.crebook-section-header h2 {
    font-family: var(--cb-font-sans);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--cb-text);
    margin: 0;
}
.crebook-results-count {
    font-family: var(--cb-font-mono);
    font-size: .8125rem;
    color: var(--cb-text-muted);
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    padding: 3px 10px;
    border-radius: var(--cb-radius-sm);
}

/* ===== HERO ===== */
.crebook-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
    background: var(--cb-surface);
    border-radius: var(--cb-radius);
    overflow: hidden;
    box-shadow: var(--cb-shadow);
    margin-bottom: 48px;
    text-decoration: none;
}
@media (max-width: 767px) {
    .crebook-hero { grid-template-columns: 1fr; }
}

.crebook-hero__media {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    background: var(--cb-text);
}
.crebook-hero__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform var(--cb-ease);
}
.crebook-hero:hover .crebook-hero__img {
    transform: scale(1.04);
}
.crebook-hero__no-media {
    width: 100%;
    height: 100%;
    background: var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-text-light);
}
.crebook-hero__no-media svg { width: 56px; height: 56px; opacity: .35; }

/* Category badge on hero image — keeps color (important label) */
.crebook-hero__cat-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    background: var(--cb-primary);
    color: var(--cb-surface);
    font-family: var(--cb-font-mono);
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: var(--cb-radius-sm);
    text-decoration: none;
}
.crebook-hero__cat-badge:hover { color: var(--cb-surface); opacity: .88; }

.crebook-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 48px;
}
@media (max-width: 991px) {
    .crebook-hero__content { padding: 28px 32px; }
}
@media (max-width: 767px) {
    .crebook-hero__content { padding: 28px 24px 32px; }
}

/* Eyebrow label — keeps color (accent/identity element) */
.crebook-hero__eyebrow {
    font-family: var(--cb-font-mono);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cb-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crebook-hero__eyebrow::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    background: var(--cb-primary);
    border-radius: 0;
}
.crebook-hero__title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cb-text);
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.crebook-hero__title a {
    font-family: var(--cb-font-sans);
    color: inherit;
    text-decoration: none;
    transition: color var(--cb-ease);
}
.crebook-hero__title a:hover { color: var(--cb-primary); }
.crebook-hero__excerpt {
    font-size: .9375rem;
    line-height: 1.65;
    color: var(--cb-text-muted);
    margin: 0 0 22px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 991px) {
    .crebook-hero__title { font-size: 1.4rem; }
}

.crebook-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 26px;
}
.crebook-hero__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--cb-text);
}
.crebook-hero__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--cb-border);
    flex-shrink: 0;
}
.crebook-hero__date-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--cb-font-mono);
    font-size: .8125rem;
    color: var(--cb-text-muted);
}
.crebook-hero__date-item svg { flex-shrink: 0; }

/* CTA button — keeps color (primary action) */
.crebook-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--cb-primary);
    color: var(--cb-surface);
    font-size: .875rem;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: var(--cb-radius-sm);
    text-decoration: none;
    width: fit-content;
    transition: background var(--cb-ease), transform var(--cb-ease), gap var(--cb-ease);
}
.crebook-hero__cta:hover {
    background: var(--cb-text);
    color: var(--cb-surface);
    transform: translateY(-1px);
    gap: 11px;
    text-decoration: none;
}

/* ===== FILTER BAR ===== */
.crebook-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}
.crebook-filter-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.crebook-filter-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

/* Filter pills — inactive: monochrome; active: keeps color */
.crebook-filter-cats .crebook-filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--cb-radius-sm);
    font-family: var(--cb-font-mono);
    font-size: .8rem;
    font-weight: 500;
    color: var(--cb-text-muted);
    background: var(--cb-surface);
    border: 1.5px solid var(--cb-border);
    text-decoration: none;
    transition: border-color var(--cb-ease), color var(--cb-ease), background var(--cb-ease);
    white-space: nowrap;
    line-height: 1;
}
.crebook-filter-pill:hover {
    border-color: var(--cb-text-light);
    color: var(--cb-text);
    text-decoration: none;
}
.crebook-filter-pill.is-active {
    background: var(--cb-primary);
    border-color: var(--cb-primary);
    color: var(--cb-surface);
}
.crebook-filter-pill.is-active:hover { color: var(--cb-surface); }
.crebook-filter-pill__count {
    font-weight: 400;
    font-size: .7em;
    opacity: .65;
    margin-left: 4px;
}

.crebook-filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.crebook-search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.crebook-search-box input[type="text"] {
    height: 40px;
    padding: 0 38px 0 14px;
    border: 1.5px solid var(--cb-border);
    border-radius: var(--cb-radius-sm);
    font-family: var(--cb-font-mono);
    font-size: .875rem;
    color: var(--cb-text);
    background: var(--cb-surface);
    width: 210px;
    outline: none;
    transition: border-color var(--cb-ease);
}
.crebook-search-box input[type="text"]:focus { border-color: var(--cb-primary); }
.crebook-search-box input[type="text"]::placeholder { color: var(--cb-text-light); }
.crebook-search-box button {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cb-text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color var(--cb-ease);
}
.crebook-search-box button:hover { color: var(--cb-primary); }

.crebook-sort-select {
    height: 40px;
    padding: 0 32px 0 12px;
    border: 1.5px solid var(--cb-border);
    border-radius: var(--cb-radius-sm);
    font-family: var(--cb-font-mono);
    font-size: .875rem;
    color: var(--cb-text);
    background: var(--cb-surface);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%237a7a7a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
    transition: border-color var(--cb-ease);
}
.crebook-sort-select:focus { border-color: var(--cb-primary); }

@media (max-width: 600px) {
    .crebook-filter-bar__row { flex-direction: column; align-items: flex-start; }
    .crebook-filter-controls { width: 100%; }
    .crebook-search-box { flex: 1; }
    .crebook-search-box input[type="text"] { width: 100%; }
}

.crebook-active-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--cb-font-mono);
    font-size: .8125rem;
    color: var(--cb-text-muted);
    flex-wrap: wrap;
}
.crebook-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: var(--cb-radius-sm);
    background: var(--cb-border);
    color: var(--cb-text-muted);
    text-decoration: none;
    font-family: var(--cb-font-mono);
    font-weight: 500;
    font-size: .78rem;
    transition: background var(--cb-ease), color var(--cb-ease);
}
.crebook-clear-btn:hover { background: var(--cb-text); color: var(--cb-surface); text-decoration: none; }

/* ===== BLOG CARD ===== */
.crebook-blog-card {
    background: var(--cb-surface);
    border-radius: var(--cb-radius);
    overflow: hidden;
    box-shadow: var(--cb-shadow);
    transition: box-shadow var(--cb-ease), transform var(--cb-ease);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.crebook-blog-card:hover {
    box-shadow: var(--cb-shadow-hover);
    transform: translateY(-3px);
}

.crebook-blog-card__thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}
.crebook-blog-card__thumb-link {
    display: block;
    width: 100%;
    height: 100%;
}
.crebook-blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform var(--cb-ease);
}
.crebook-blog-card:hover .crebook-blog-card__img { transform: scale(1.02); }

.crebook-blog-card__no-img {
    width: 100%;
    height: 100%;
    background: var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-text-light);
}
.crebook-blog-card__no-img svg { width: 36px; height: 36px; opacity: .4; }

/* Category badge — keeps color (taxonomy label) */
.crebook-blog-card__cat {
    position: absolute;
    top: 11px;
    left: 11px;
    z-index: 2;
    background: var(--cb-primary);
    color: var(--cb-surface);
    font-family: var(--cb-font-mono);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: var(--cb-radius-sm);
    text-decoration: none;
    line-height: 1.4;
    transition: opacity var(--cb-ease);
}
.crebook-blog-card__cat:hover { color: var(--cb-surface); opacity: .85; }

.crebook-blog-card__body {
    padding: 20px 22px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.crebook-blog-card__meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--cb-font-mono);
    font-size: .73rem;
    color: var(--cb-text-light);
    margin-bottom: 9px;
}
.crebook-blog-card__meta-sep { color: var(--cb-border); }

.crebook-blog-card__title {
    font-size: .9875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--cb-text);
    margin: 0 0 9px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.crebook-blog-card__title a {
    font-family: var(--cb-font-sans);
    color: inherit;
    text-decoration: none;
    transition: color var(--cb-ease);
}
.crebook-blog-card__title a:hover { color: var(--cb-primary); }

.crebook-blog-card__excerpt {
    font-size: .85rem;
    line-height: 1.65;
    color: var(--cb-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.crebook-blog-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px 16px;
    border-top: 1px solid var(--cb-border);
    gap: 10px;
    margin-top: auto;
}
.crebook-blog-card__author {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.crebook-blog-card__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--cb-border);
}
.crebook-blog-card__author-name {
    font-size: .78rem;
    font-weight: 500;
    color: var(--cb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Read more link — keeps color (action element) */
.crebook-blog-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--cb-font-mono);
    font-size: .78rem;
    font-weight: 600;
    color: var(--cb-primary);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: gap var(--cb-ease), color var(--cb-ease);
}
.crebook-blog-card__read-more:hover {
    gap: 7px;
    color: var(--cb-text);
    text-decoration: none;
}

/* ===== NO RESULTS ===== */
.crebook-no-results {
    text-align: center;
    padding: 72px 24px;
    background: var(--cb-surface);
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
}
.crebook-no-results__icon {
    width: 52px;
    height: 52px;
    color: var(--cb-text-light);
    margin: 0 auto 16px;
    display: block;
}
.crebook-no-results h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cb-text);
    margin: 0 0 8px;
}
.crebook-no-results p {
    font-size: .9rem;
    color: var(--cb-text-muted);
    margin: 0 0 20px;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}
.crebook-no-results__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--cb-primary);
    text-decoration: none;
}
.crebook-no-results__back:hover { color: var(--cb-text); text-decoration: underline; }

/* ===== PAGINATION SPACING ===== */
.crebook-blog-page .houzez-pagination,
.crebook-blog-page .pagination-wrap {
    margin-top: 40px;
}
