/* =========================================================
   ACHADOS PRINCIPAIS — CSS v2.0
========================================================= */

:root {
    --ach-accent:        #6d5c6d;
    --ach-accent-hover:  #5c4d5c;
    --ach-accent-light:  #f0eaf0;
    --ach-tab-active:    #6d5c6d;
    --ach-bg:            #ffffff;
    --ach-surface:       #f8f6f4;
    --ach-text:          #111111;
    --ach-muted:         #aaaaaa;
    --ach-border:        #e8e8e8;
    --ach-radius:        12px;
    --ach-btn-radius:    22px;
    --ach-font-display:  'Lora', Georgia, serif;
    --ach-font-body:     -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ach-shadow:        0 2px 16px rgba(0,0,0,0.07);
    --ach-max-width:     560px;
}

/* ── Reset base ── */
.achados-wrap *,
.achados-wrap *::before,
.achados-wrap *::after {
    box-sizing: border-box;
}

/* ── Wrapper principal ── */
.achados-wrap {
    background: var(--ach-bg);
    width: 100%;
    max-width: var(--ach-max-width);
    margin: 0 auto;
    position: relative;
    font-family: var(--ach-font-body);
    color: var(--ach-text);
    overflow: hidden;
}

/* ── Cabeçalho ── */
.achados-header {
    padding: 1.1rem 1rem 0.8rem;
    border-bottom: 0.5px solid var(--ach-border);
    background: var(--ach-bg);
    position: sticky;
    top: 0;
    z-index: 20;
}

.achados-title {
    font-family: var(--ach-font-display) !important;
    font-size: clamp(19px, 5vw, 23px) !important;
    font-weight: 600 !important;
    color: var(--ach-text) !important;
    text-align: center;
    margin: 0 0 0.7rem !important;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-transform: none !important;
}

.achados-search-bar {
    display: flex;
    align-items: center;
    background: var(--ach-surface);
    border-radius: 22px;
    padding: 6px 13px;
    gap: 7px;
    border: 0.5px solid var(--ach-border);
    transition: border-color 0.15s;
}

.achados-search-bar:focus-within {
    border-color: var(--ach-accent);
}

.achados-search-bar .ti {
    color: var(--ach-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.achados-search-bar input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 11.5px;
    color: var(--ach-text);
    width: 100%;
    font-family: var(--ach-font-display);
    line-height: 1.4;
    box-shadow: none !important;
    padding: 0 !important;
}

.achados-search-bar input::placeholder { color: var(--ach-muted); }

/* ── Abas de categoria ── */
.achados-tab-bar {
    display: flex;
    border-bottom: 0.5px solid var(--ach-border);
    padding: 0 14px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--ach-bg);
    -webkit-overflow-scrolling: touch;
}

.achados-tab-bar::-webkit-scrollbar { display: none; }

.achados-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    color: var(--ach-muted);
    padding: 9px 10px;
    cursor: pointer;
    font-family: var(--ach-font-body);
    transition: color 0.15s;
    white-space: nowrap;
    text-transform: lowercase;
    line-height: 1;
    border-radius: 0;
    box-shadow: none;
}

.achados-tab:hover { color: var(--ach-accent); }

.achados-tab.active {
    color: var(--ach-tab-active);
    border-bottom-color: var(--ach-tab-active);
    font-weight: 600;
}

/* ── Grid de cards ── */
.achados-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px 10px 20px;
}

/* ── Card ── */
.achados-card {
    background: var(--ach-bg);
    border-radius: var(--ach-radius);
    border: 0.5px solid var(--ach-border);
    overflow: hidden;
    transition: box-shadow 0.18s, transform 0.18s;
}

.achados-card:hover {
    box-shadow: var(--ach-shadow);
    transform: translateY(-1px);
}

.achados-card-img {
    aspect-ratio: 3 / 4;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #f0ede8;
}

.achados-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.achados-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achados-card-placeholder .ti {
    font-size: clamp(28px, 8vw, 44px);
    color: #c4a882;
}

.achados-pin-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    font-size: 10px;
    color: #666;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}

.achados-card-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.achados-card-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--ach-text);
    margin: 0 0 7px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(12px * 1.4 * 2);
    flex-shrink: 0;
}

.achados-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: none;
    border-radius: var(--ach-btn-radius);
    padding: 7px 12px;
    font-size: 11.5px;
    cursor: pointer;
    font-family: var(--ach-font-body);
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1.2;
    margin-top: auto;
}

.achados-btn:hover { opacity: 0.85; text-decoration: none; }

.achados-btn-single {
    background: #f2f0ee;
    color: #555;
}

.achados-btn-multi {
    background: var(--ach-accent);
    color: #fff !important;
}

.achados-count {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 10.5px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* ── Sem resultados ── */
.achados-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ach-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.achados-no-results .ti { font-size: 32px; }

/* ════════════════════════════════════════════
   PAINEL INTERNO DO POST
════════════════════════════════════════════ */
.achados-post-panel {
    position: absolute;
    inset: 0;
    background: var(--ach-bg);
    z-index: 30;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: achadosSlideIn 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes achadosSlideIn {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.achados-post-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.achados-post-topbar {
    padding: 12px 14px 10px;
    border-bottom: 0.5px solid var(--ach-border);
    position: sticky;
    top: 0;
    background: var(--ach-bg);
    z-index: 5;
}

.achados-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ach-accent);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--ach-font-body);
    padding: 0;
    text-decoration: none;
}

.achados-back-btn:hover { color: var(--ach-accent-hover); }

.achados-post-body {
    padding: 1rem 1rem 3rem;
    flex: 1;
}

.achados-post-cover {
    width: 100%;
    border-radius: var(--ach-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f5f2ee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achados-post-cover img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    background: #f5f2ee;
}

.achados-post-cover .ti {
    font-size: 60px;
    color: #c4a882;
    padding: 2rem;
}

.achados-post-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ach-text);
    margin: 0 0 0.5rem;
    line-height: 1.35;
    font-family: var(--ach-font-display);
}

.achados-clicks-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--ach-surface);
    border: 0.5px solid var(--ach-border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    color: #888;
    margin-bottom: 1.1rem;
}

.achados-clicks-badge .ti { font-size: 12px; color: #b0956e; }

.achados-links-label {
    font-size: 10px;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    margin-top: 2px;
}

.achados-link-btn {
    display: flex;
    width: 100%;
    background: var(--ach-accent);
    color: #fff !important;
    border: none;
    border-radius: var(--ach-btn-radius);
    padding: 13px 18px;
    font-size: 14px;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    text-decoration: none !important;
    font-family: var(--ach-font-body);
    transition: background 0.15s, transform 0.12s;
    line-height: 1.3;
    gap: 10px;
}

.achados-link-btn:hover {
    background: var(--ach-accent-hover);
    transform: translateY(-1px);
    text-decoration: none !important;
    color: #fff !important;
}

.achados-link-btn .ti {
    font-size: 16px;
    opacity: 0.75;
    flex-shrink: 0;
}

.achados-clique-btn {
    display: flex;
    width: 100%;
    background: var(--ach-accent);
    color: #fff !important;
    border: none;
    border-radius: var(--ach-btn-radius);
    padding: 15px 18px;
    font-size: 15px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none !important;
    font-family: var(--ach-font-body);
    margin-top: 6px;
    transition: background 0.15s, transform 0.12s;
    font-weight: 500;
}

.achados-clique-btn:hover {
    background: var(--ach-accent-hover);
    transform: translateY(-1px);
    color: #fff !important;
}

/* ════════════════════════════════════════════
   RESPONSIVO
════════════════════════════════════════════ */

@media (max-width: 380px) {
    .achados-header     { padding: 0.55rem 6px 0.5rem; }
    .achados-tab-bar    { padding: 0 6px; gap: 0; }
    .achados-grid       { gap: 6px; padding: 6px 5px 14px; }
    .achados-card-body  { padding: 5px 6px 7px; }
    .achados-card-title { font-size: 11px; }
    .achados-btn        { font-size: 10.5px; padding: 6px 8px; }
}

@media (max-width: 768px) {
    .wp-block-post-content:has(.achados-wrap),
    .entry-content:has(.achados-wrap) {
        padding-inline: 0 !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .achados-wrap {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        margin-left: 0;
        margin-right: 0;
    }

    .achados-header {
        padding-top: 0.4rem;
        padding-bottom: 0.5rem;
        padding-left: 10px;
        padding-right: 10px;
    }

    .achados-title {
        margin-top: 0 !important;
        margin-bottom: 0.45rem !important;
    }

    .achados-tab-bar { padding: 0 10px; gap: 0; }

    .achados-post-panel {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        border-radius: 0;
    }

    .achados-post-body   { padding: 1rem 18px 2.5rem; }
    .achados-post-topbar { padding: 10px 18px 8px; }
}

@media (min-width: 601px) and (max-width: 1023px) {
    .achados-post-panel {
        position: absolute;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .achados-wrap {
        max-width: 860px;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
        border-radius: 16px;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }

    .achados-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        padding: 16px 16px 28px;
    }

    .achados-post-panel { position: absolute; }

    .achados-post-body {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
        padding: 1.25rem 1.5rem 3rem;
    }

    .achados-post-cover img {
        max-height: 420px;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .achados-post-cover { justify-content: center; }
}

@media (min-width: 1280px) {
    .achados-wrap {
        max-width: 1100px;
        box-shadow: 0 0 56px rgba(0, 0, 0, 0.09);
        border-radius: 18px;
        margin-top: 2.5rem;
        margin-bottom: 2.5rem;
    }

    .achados-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 18px 18px 32px;
    }

    .achados-header { padding: 1.5rem 1.5rem 1rem; }
    .achados-tab-bar { padding: 0 1.5rem; }
    .achados-post-panel { position: absolute; }

    .achados-post-body {
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
        padding: 1.5rem 2rem 4rem;
    }

    .achados-post-cover { justify-content: center; }

    .achados-post-cover img {
        max-height: 480px;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .achados-link-btn   { font-size: 14.5px; padding: 14px 20px; }
    .achados-clique-btn { font-size: 15.5px; padding: 16px 20px; }

    .achados-post-panel { border-radius: 0 0 18px 18px; }
}