/* =========================================
   PostsLinks — Estilo Público
   ========================================= */

:root {
    --accent:      #c4522a;
    --accent-dark: #a8431f;
    --bg:          #f5f0eb;
    --card-bg:     #ffffff;
    --text:        #1a1a2e;
    --text-muted:  #777;
    --border:      #e5ddd5;
    --radius:      12px;
    --shadow:      0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---- Header ---- */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { flex-shrink: 0; }
.brand-logo.small svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1rem; font-weight: 700; color: #3d3d3d; line-height: 1.2; }
.brand-name.small { font-size: 0.9rem; }
.brand-name span { color: var(--accent); }
.brand-handle { font-size: 0.75rem; color: var(--text-muted); }
.back-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text);
    flex-shrink: 0;
    transition: background 0.15s;
}
.back-btn:hover { background: var(--bg); }
.site-header.compact .header-inner { gap: 10px; }

/* ---- Container ---- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ---- Grid de posts ---- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s, box-shadow 0.18s;
    display: flex;
    flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }

.card-img-wrap { aspect-ratio: 1 / 1; overflow: hidden; background: #e8e0d8; }
.card-img-wrap img { transition: transform 0.3s; }
.post-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-img-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, #e8e0d8, #d5cbc0); }

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-titulo { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.card-btn {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: auto;
    transition: background 0.15s;
}
.post-card:hover .card-btn { background: var(--accent-dark); }
.badge {
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* ---- Página de post ---- */
.post-page { background: var(--bg); }

.post-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    padding-top: 30px;
    padding-bottom: 50px;
}
@media (max-width: 700px) {
    .post-layout { grid-template-columns: 1fr; gap: 24px; }
}

/* ---- Carrossel ---- */
.carousel-wrap { position: relative; }
.carousel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #e8e0d8;
    aspect-ratio: 1 / 1;
}
.carousel-slide { display: none; width: 100%; height: 100%; }
.carousel-slide.active { display: block; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }

.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.85);
    border: none; border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: background 0.15s;
    color: #333;
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }

.carousel-dots {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none; cursor: pointer; padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.dot.active { background: #fff; transform: scale(1.3); }

.carousel-placeholder {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    background: #e8e0d8;
    display: flex; align-items: center; justify-content: center;
}

/* ---- Info do post ---- */
.post-info { display: flex; flex-direction: column; gap: 16px; }
.post-titulo { font-size: 1.35rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.post-descricao { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }
.links-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.links-list { display: flex; flex-direction: column; gap: 10px; }

.link-btn {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--accent);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    gap: 10px;
    transition: background 0.15s, transform 0.1s;
}
.link-btn:hover { background: var(--accent-dark); transform: translateX(2px); }
.link-btn svg { flex-shrink: 0; opacity: 0.8; }

.empty-links { font-size: 0.88rem; color: var(--text-muted); }
.empty-msg { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 1rem; }

/* ---- Logo circular ---- */
.logo-circle {
    width: 42px; height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    display: block;
}
.logo-circle.small { width: 28px; height: 28px; }

/* ---- Share button ---- */
.share-btn {
    display: flex; align-items: center; gap: 7px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    margin-left: auto;
}
.share-btn:hover { background: var(--bg); }
.share-btn-sm {
    padding: 7px; border-radius: 50%;
    width: 34px; height: 34px;
    justify-content: center;
}

/* ---- Toast ---- */
.toast-copiar {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1a1a2e; color: #fff;
    padding: 10px 22px; border-radius: 24px;
    font-size: 0.88rem; font-weight: 600;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 999;
}
.toast-copiar.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Barra de busca + filtro ---- */
.search-bar-wrap {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.search-row {
    display: flex; align-items: center; gap: 10px;
}
.search-input-wrap {
    flex: 1; position: relative;
    display: flex; align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    padding: 0 12px;
    gap: 8px;
}
.search-input-wrap svg { flex-shrink: 0; color: var(--text-muted); }
.search-input-wrap input {
    flex: 1; border: none; background: transparent;
    font-size: 0.9rem; color: var(--text);
    padding: 10px 0; outline: none;
    font-family: inherit;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }
#clearSearch {
    display: none; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: 1.2rem; padding: 0;
    line-height: 1;
}
#clearSearch:hover { color: var(--text); }

/* ---- Filtro dropdown ---- */
.filter-wrap { position: relative; flex-shrink: 0; }
.filter-btn {
    display: flex; align-items: center; gap: 7px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
    font-size: 0.85rem; font-weight: 600; color: var(--text);
    cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    width: 260px; z-index: 200;
    overflow: hidden;
}
.filter-dropdown.open { display: block; }
.filter-search-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.filter-search-wrap input {
    width: 100%; border: 1px solid var(--border); border-radius: 7px;
    padding: 7px 10px; font-size: 0.85rem; font-family: inherit;
    background: var(--bg); color: var(--text); outline: none;
}
.filter-search-wrap input:focus { border-color: var(--accent); }
.filter-list { max-height: 240px; overflow-y: auto; padding: 6px 0; }
.filter-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; font-size: 0.87rem; color: var(--text);
    cursor: pointer; transition: background 0.1s;
}
.filter-item:hover { background: var(--bg); }
.filter-item input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.filter-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-top: 1px solid var(--border);
    gap: 8px;
}
.filter-footer button {
    flex: 1; padding: 8px; border-radius: 8px; font-size: 0.85rem;
    font-weight: 600; cursor: pointer; border: 1px solid var(--border);
    background: transparent; color: var(--text); transition: background 0.15s;
}
.filter-footer button:hover { background: var(--bg); }
.filter-footer .btn-aplicar { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-footer .btn-aplicar:hover { background: var(--accent-dark); }

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}
