/* ══════════════════════════════════════════════════════════════════════════
   AMAZING — MÓDULOS NATIVOS
   1. Barra de progresso de leitura
   2. Botões de compartilhamento
   3. Posts relacionados
   4. Aviso de cookies (LGPD)
   5. Seletor de cores do tema
══════════════════════════════════════════════════════════════════════════ */

/* ── 1. PROGRESSO DE LEITURA ─────────────────────────────────────────────── */

.amazing-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--flame, #e05a2b);
    z-index: 9999;
    transition: width .1s linear;
    pointer-events: none;
}

.admin-bar .amazing-progress { top: 32px; }

@media (max-width: 782px) {
    .admin-bar .amazing-progress { top: 46px; }
}

/* ── 2. COMPARTILHAMENTO ─────────────────────────────────────────────────── */

.amazing-share {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: #f8f8f6;
    border-radius: 12px;
    border: 1px solid #eee;
}

.amazing-share__label {
    font-size: .72rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .07em;
    display: block;
    margin-bottom: .75rem;
}

.amazing-share__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
}

.amazing-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .42rem .95rem;
    border-radius: 24px;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
    color: #fff;
    font-family: inherit;
    line-height: 1.5;
}

.amazing-share__btn:hover { opacity: .86; transform: translateY(-1px); }

.amazing-share__btn--whatsapp,
.amazing-share__btn--facebook,
.amazing-share__btn--twitter,
.amazing-share__btn--telegram,
.amazing-share__btn--copy      { background: #1a1a1a; }

.amazing-share__btn:hover { background: var(--flame, #e05a2b) !important; opacity: 1; transform: translateY(-1px); }

.amazing-share__copy-done { display: none; }
.amazing-share__btn--copy.copied .amazing-share__copy-label { display: none; }
.amazing-share__btn--copy.copied .amazing-share__copy-done  { display: block; }
.amazing-share__btn--copy.copied { background: #333 !important; }

.amazing-share__views {
    font-size: .74rem;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .amazing-share__btn span { display: none; }
    .amazing-share__btn { padding: .5rem .65rem; border-radius: 50%; }
}

/* ── 3. POSTS RELACIONADOS ───────────────────────────────────────────────── */

.amazing-related {
    margin: 2.5rem 0 1.5rem;
    padding-top: 1.5rem;
    border-top: 3px solid var(--flame, #e05a2b);
}

.amazing-related__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 1.1rem;
}

.amazing-related__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 600px) {
    .amazing-related__grid { grid-template-columns: repeat(4, 1fr); }
}

.amazing-related__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease;
}

.amazing-related__card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    transform: translateY(-3px);
}

.amazing-related__thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eee;
}

.amazing-related__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.amazing-related__card:hover .amazing-related__thumb img { transform: scale(1.06); }

.amazing-related__no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
}

.amazing-related__body {
    padding: .7rem .75rem .75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amazing-related__cat {
    font-size: .63rem;
    font-weight: 700;
    color: var(--flame, #e05a2b);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.amazing-related__post-title {
    font-size: .82rem;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.amazing-related__date {
    font-size: .67rem;
    color: #aaa;
    margin-top: auto;
    padding-top: 4px;
}

/* Dark mode */
.dark-mode .amazing-related__card { background: #1e1e1e; border-color: #333; }
.dark-mode .amazing-related__post-title { color: #e8e8e8; }
.dark-mode .amazing-share { background: #1e1e1e; border-color: #333; }
.dark-mode .amazing-related__title { color: #e8e8e8; }

/* ── 4. LGPD / COOKIE CONSENT ────────────────────────────────────────────── */

.amazing-lgpd {
    display: none; /* js mostra */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    color: #ddd;
    padding: 1rem 1.5rem;
    z-index: 9998;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 24px rgba(0,0,0,.35);
    transition: transform .35s ease, opacity .35s ease;
}

.amazing-lgpd.is-hiding {
    transform: translateY(100%);
    opacity: 0;
}

.amazing-lgpd__text {
    flex: 1;
    font-size: .82rem;
    line-height: 1.55;
    margin: 0;
    min-width: 0;
}

.amazing-lgpd__policy {
    color: var(--flame, #e05a2b);
    text-decoration: underline;
}

.amazing-lgpd__policy:hover { opacity: .8; }

.amazing-lgpd__actions {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.amazing-lgpd__accept {
    background: var(--flame, #e05a2b);
    color: #fff;
    border: none;
    padding: .5rem 1.35rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}

.amazing-lgpd__accept:hover { opacity: .85; }

.amazing-lgpd__reject {
    background: transparent;
    color: #888;
    border: 1px solid #444;
    padding: .5rem 1rem;
    border-radius: 6px;
    font-size: .82rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}

.amazing-lgpd__reject:hover { opacity: .7; }

@media (max-width: 500px) {
    .amazing-lgpd { flex-direction: column; align-items: flex-start; }
}

/* ── 5. SELETOR DE CORES DO TEMA ─────────────────────────────────────────── */

.amazing-color-switcher {
    position: fixed;
    bottom: 80px;
    right: 18px;
    z-index: 9990;
}

.amazing-color-switcher__toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--flame, #e05a2b);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0,0,0,.28);
    transition: transform .2s ease, box-shadow .2s ease;
}

.amazing-color-switcher__toggle:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 24px rgba(0,0,0,.32);
}

.amazing-color-switcher__panel {
    position: absolute;
    bottom: 54px;
    right: 0;
    background: #fff;
    border-radius: 16px;
    padding: 1rem 1.1rem 1.1rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    width: 222px;
    border: 1px solid rgba(0,0,0,.06);
}

.amazing-color-switcher__panel[hidden] { display: none; }

.amazing-color-switcher__panel-label {
    font-size: .68rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 .7rem;
    display: block;
}

.amazing-color-switcher__swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.amazing-color-switcher__swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    outline: none;
    transition: transform .18s ease, border-color .18s ease;
    position: relative;
}

.amazing-color-switcher__swatch:hover { transform: scale(1.18); }

.amazing-color-switcher__swatch.is-active {
    border-color: #111;
    transform: scale(1.12);
}

.amazing-color-switcher__swatch.is-active::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid #fff;
}

.amazing-color-switcher__notice {
    font-size: .62rem;
    color: #bbb;
    text-align: center;
    margin: .65rem 0 0;
    line-height: 1.4;
}

/* Dark mode adjustments */
.dark-mode .amazing-color-switcher__panel {
    background: #222;
    border-color: #333;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

.dark-mode .amazing-color-switcher__panel-label { color: #666; }
.dark-mode .amazing-color-switcher__swatch.is-active { border-color: #fff; }
.dark-mode .amazing-color-switcher__notice { color: #555; }

/* ── 6b. BOTÃO WHATSAPP FLUTUANTE ────────────────────────────────────────── */

.amazing-whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9989;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 18px rgba(37,211,102,.45);
    transition: transform .22s ease, box-shadow .22s ease;
    text-decoration: none;
}

.amazing-whatsapp-float:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 28px rgba(37,211,102,.55);
}

/* Desloca para cima quando o cookie banner estiver visível */
.amazing-lgpd ~ .amazing-whatsapp-float,
body:has(.amazing-lgpd:not(.is-hiding)) .amazing-whatsapp-float {
    bottom: 100px;
}

@media (max-width: 768px) {
    .amazing-whatsapp-float { bottom: 72px; right: 16px; width: 50px; height: 50px; }
}

/* ── MOBILE STICKY AD ────────────────────────────────────────────────────── */

.amazing-ad-mobile-sticky {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9985;
    text-align: center;
    background: #fff;
    padding: 4px 0 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,.12);
}

@media (min-width: 481px) {
    .amazing-ad-mobile-sticky { display: none; }
}

.dark-mode .amazing-ad-mobile-sticky { background: #111; }
