/* ============================================================
   Coloring Forum v5 — SuperColoring layout
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

.sc-wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 14px 18px 56px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #222;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
.sc-bc {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    color: #aaa;
    margin-bottom: 18px;
}
.sc-bc a { color: #666; text-decoration: none; }
.sc-bc a:hover { color: #1a73e8; text-decoration: underline; }
.sc-bc span { color: #ccc; }

/* ── Layout: imagem esq + info dir ───────────────────────────── */
.sc-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: start;
    margin-bottom: 32px;
}
.sc-img-col { display: flex; align-items: flex-start; }
.sc-main-img {
    display: block;
    max-width: 520px;
    width: 100%;
    height: auto;
}
.sc-info-col { min-width: 0; }

/* ── H1 ─────────────────────────────────────────────────────── */
.sc-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px;
    line-height: 1.3;
}

/* ── Botões ─────────────────────────────────────────────────── */
.sc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 260px;
}
.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: filter .15s;
    width: 100%;
    line-height: 1;
}
.sc-btn:hover { filter: brightness(.9); }
.sc-btn-print { background: #1a73e8; color: #fff; }
.sc-btn-dl    { background: #34a853; color: #fff; }
.sc-btn-pdf   { background: #fbbc04; color: #222; }

/* ── Contador ───────────────────────────────────────────────── */
.sc-print-count { font-size: .78rem; color: #aaa; margin: 0 0 12px; }

/* ── Meta ───────────────────────────────────────────────────── */
.sc-meta {
    font-size: .84rem;
    color: #555;
    line-height: 1.65;
    margin-bottom: 14px;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}
.sc-meta p { margin: 0 0 3px; }
.sc-meta-k  { font-weight: 600; color: #333; margin-right: 4px; }
.sc-meta-v  { color: #1a73e8; text-decoration: none; }
.sc-meta-v:hover { text-decoration: underline; }
.sc-permission { font-size: .78rem; color: #999; margin-top: 7px !important; }

/* ── Tags ───────────────────────────────────────────────────── */
.sc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sc-tag {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    background: #f1f3f4;
    color: #444;
    font-size: .78rem;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: background .12s;
}
.sc-tag:hover { background: #e8eaed; }

/* ═══════════════════════════════════════════════════════════
   MORE LIKE THIS — full width, grid 6 col, sem títulos
   ═══════════════════════════════════════════════════════════ */
.sc-related { margin-top: 32px; }

.sc-related-heading {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #aaa;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.sc-rel-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

/* Card relacionado */
.sc-rel-card {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    border-radius: 4px;
    background: #f0f0f0;  /* placeholder cor enquanto carrega */
    /* Tamanho FIXO reservado — evita CLS */
    width: 100%;
    aspect-ratio: 1 / 1;
}
.sc-rel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.sc-rel-card:hover img { transform: scale(1.06); }
.sc-rel-hover {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 5px 7px 7px;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
    color: #fff;
    font-size: .7rem;
    line-height: 1.2;
    opacity: 0;
    transition: opacity .18s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-rel-card:hover .sc-rel-hover { opacity: 1; }

/* Skeleton — tamanho FIXO igual ao card (evita CLS) */
.sc-rel-skeleton {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sc-shimmer 1.4s infinite;
}
@keyframes sc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Categorias relacionadas ─────────────────────────────────── */
.sc-rel-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.sc-rel-cat-btn {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 6px;
    background: #f1f3f4;
    color: #333;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: background .12s, border-color .12s;
}
.sc-rel-cat-btn:hover { background: #e4e8f0; border-color: #c0c8d8; }

/* ═══════════════════════════════════════════════════════════
   GRID DE IMAGENS (categoria)
   ═══════════════════════════════════════════════════════════ */
.sc-img-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

/* Card de imagem — mesmo padrão do related */
.sc-img-card {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    border-radius: 4px;
    background: #f0f0f0;
    width: 100%;
    aspect-ratio: 1 / 1;  /* Reserva espaço fixo — sem CLS */
}
.sc-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}
.sc-img-card:hover img { transform: scale(1.06); }
.sc-img-hover {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 5px 7px 7px;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
    color: #fff;
    font-size: .7rem;
    line-height: 1.2;
    opacity: 0;
    transition: opacity .18s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-img-card:hover .sc-img-hover { opacity: 1; }

/* Skeleton de carregamento — mesmo tamanho fixo */
.sc-img-skeleton {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sc-shimmer 1.4s infinite;
}

/* ── H1 categoria ───────────────────────────────────────────── */
.sc-cat-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 18px;
}

/* Descrição SEO */
.sc-cat-desc {
    font-size: .87rem;
    line-height: 1.75;
    color: #666;
    max-width: 720px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}

/* ═══════════════════════════════════════════════════════════
   ARQUIVO GERAL
   ═══════════════════════════════════════════════════════════ */
.sc-archive-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px;
}
.sc-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}
.sc-cat-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: box-shadow .18s, transform .15s;
}
.sc-cat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); }
.sc-cat-thumb { aspect-ratio: 1/1; overflow: hidden; background: #f5f5f5; }
.sc-cat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.sc-cat-card:hover .sc-cat-thumb img { transform: scale(1.05); }
.sc-cat-no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.sc-cat-info { padding: 8px 10px 10px; }
.sc-cat-name  { display: block; font-size: .84rem; font-weight: 600; color: #111; line-height: 1.3; }
.sc-cat-count { display: block; font-size: .72rem; color: #aaa; margin-top: 2px; }
.sc-cat-empty { opacity: .5; }
.sc-no-results { color: #888; padding: 32px 0; text-align: center; }

/* ── Shortcode grid de categorias ───────────────────────────── */
.cfsf-card { border-radius: 6px; overflow: hidden; background: #fff; border: 1px solid #e8e8e8; transition: box-shadow .18s, transform .15s; }
.cfsf-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); }
.cfsf-card a { display: block; text-decoration: none; color: inherit; }
.cfsf-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.cfsf-no-img { aspect-ratio: 1/1; background: #f5f5f5; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.cfsf-info { padding: 8px 10px 10px; }
.cfsf-info h3 { margin: 0 0 2px; font-size: .84rem; font-weight: 600; color: #111; line-height: 1.3; }
.cfsf-info span { font-size: .72rem; color: #aaa; }
.cfsf-empty-admin { opacity: .5; }
.cfsf-spinner { display: none; padding: 9px 22px; background: #f0f0f0; border-radius: 20px; font-size: .84rem; color: #555; }
.cfsf-spinner.on { display: inline-block; }
.cfsf-loader { text-align: center; padding: 20px; }

/* ── Print modal ────────────────────────────────────────────── */
#sc-print-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.55);
    align-items: center;
    justify-content: center;
}
.sc-pm-inner {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    max-width: 680px;
    width: 92%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
}
.sc-pm-close {
    position: absolute;
    top: 10px; right: 14px;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: #aaa; line-height: 1;
}
.sc-pm-close:hover { color: #333; }
.sc-pm-img { max-width: 100%; max-height: 70vh; margin: 0 auto 16px; display: block; }
.sc-pm-actions { display: flex; justify-content: center; gap: 10px; }

/* Paginação */
.sc-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; margin: 24px 0; }
.sc-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 8px;
    border-radius: 5px; border: 1px solid #ddd; background: #fff;
    color: #333; text-decoration: none; font-size: .85rem; transition: background .12s;
}
.sc-pagination .page-numbers:hover { background: #f0f4ff; color: #1a73e8; }
.sc-pagination .page-numbers.current { background: #1a73e8; color: #fff; border-color: #1a73e8; font-weight: 700; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
    .sc-layout          { grid-template-columns: 1fr; gap: 18px; }
    .sc-main-img        { max-width: 100%; }
    .sc-actions         { max-width: 100%; flex-direction: row; flex-wrap: wrap; }
    .sc-btn             { width: auto; flex: 1; min-width: 90px; }
    .sc-rel-grid,
    .sc-img-grid        { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
    .sc-wrap            { padding: 10px 12px 40px; }
    .sc-title,
    .sc-cat-title,
    .sc-archive-title   { font-size: 1.05rem; }
    .sc-rel-grid,
    .sc-img-grid        { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .sc-categories-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .sc-actions         { flex-direction: column; }
    .sc-btn             { width: 100%; }
}
