/* carropedia.css */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
  color:#111;
  background:#f3f3f3;
}

:root{
  --sidebar-w: 320px;
  --gap: 12px;            /* ✅ mais compacto */
  --radius: 16px;
  --panel: #fff;
  --line: rgba(0,0,0,.10);
  --muted: rgba(0,0,0,.60);
  --shadow: 0 10px 24px rgba(0,0,0,.06);
  --shadow2: 0 16px 34px rgba(0,0,0,.10);

  --brand: #c95711;
  --brand2: #f9b43b;
}

/* ===== TOPBAR ===== */
.topbar{
  position:sticky; top:0; z-index:50;
  background: rgba(243,243,243,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: 1600px;
  margin:0 auto;
  padding: 12px 18px;
  display:flex;
  gap:12px;
  align-items:center;
}

.brand{
  display:flex; align-items:center; gap:10px;
  min-width: 180px;
}
.brand .logo{
  width:34px;height:34px;border-radius:12px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}
.brand .name{ font-weight: 900; letter-spacing: -.3px; }

.searchbox{
  flex:1;
  display:flex;
  gap:10px;
  align-items:center;
  background:#fff;
  border:1px solid rgba(201,87,17,.35);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 10px 22px rgba(0,0,0,.05);
}
.searchbox:focus-within{
  border-color: rgba(201,87,17,.70);
  box-shadow:
    0 10px 22px rgba(0,0,0,.05),
    0 0 0 4px rgba(249,180,59,.35);
}
.searchbox input{
  flex:1;
  border:0;
  outline:0;
  font-size: 14px;
  background:transparent;
  padding: 4px 6px;
}
.searchbox button{
  border:1px solid #111;
  cursor:pointer;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  background:#fff;
  color:#111;
}
.searchbox button:hover{ background: rgba(249,180,59,.20); }

.top-actions{ display:flex; gap:10px; align-items:center; }
.pill{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding: 9px 12px;
  font-weight:900;
  cursor:pointer;
  user-select:none;
}

/* ===== LAYOUT ===== */
.page{
  max-width: 1600px; margin: 0 auto;
  padding: 14px 18px 26px;
  display:flex; gap: var(--gap); align-items:flex-start;
}

.sidebar{
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  position: sticky; top: 72px;
  height: calc(100vh - 92px);
  overflow:auto; padding-right: 6px;
}

/* ===== CARDS LADO ESQUERDO ===== */
.card{
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px; /* ✅ menor */
  margin-bottom: var(--gap);
}
.card h3{
  margin:0 0 8px 0;
  font-size: 13px;
  letter-spacing: -.2px;
  font-weight: 900;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.muted{ color: var(--muted); font-size: 12.5px; line-height: 1.35; }

.card.filters{
  border-radius: 18px;
  box-shadow: var(--shadow2);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
  border-color: rgba(201,87,17,.18);
}

.filters-topline{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom: 6px; /* ✅ menor */
}

.row{
  display:flex;
  gap:10px;
  align-items:flex-end;
  margin: 8px 0; /* ✅ menor */
}

label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,.72);
  display:block;
  margin-bottom: 4px; /* ✅ menor */
}

.field{ width:100%; }

/* ✅ selects/inputs mais compactos */
.field select, .field input{
  width:100%;
  border:1px solid rgba(201,87,17,.22);
  border-radius: 12px;       /* ✅ levemente menor */
  padding: 7px 10px;         /* ✅ menor */
  background:#fff;
  font-weight:800;
  outline:0;
  font-size: 13.5px;         /* ✅ compacto */
  line-height: 1.2;
}
.field select{ padding-right: 28px; }

.field select:focus, .field input:focus{
  border-color: rgba(201,87,17,.70);
  box-shadow: 0 0 0 4px rgba(249,180,59,.30);
}
.field input::placeholder{ color: rgba(0,0,0,.40); font-weight:700; }

.filters-actions{ display:flex; gap:10px; margin-top: 8px; }

.btn{
  flex:1;
  border:1px solid #111;
  border-radius: 12px;
  padding: 9px 10px;         /* ✅ menor */
  font-weight: 900;
  cursor:pointer;
  background:#fff;
  color:#111;
  font-size: 13px;
}
.btn:hover{ background: rgba(249,180,59,.18); }

details.advanced{ margin-top: 10px; }
details.advanced summary{
  cursor:pointer;
  font-weight: 900;
  font-size:12.5px;
  color:#111;
  user-select:none;
  padding: 9px 10px;         /* ✅ menor */
  border-radius:12px;
  background: #fff;
  border:1px solid rgba(201,87,17,.22);
  list-style:none;
}
details.advanced summary::-webkit-details-marker{ display:none; }

.advanced-box{
  margin-top:8px;
  padding-top:8px;
  border-top:1px dashed rgba(201,87,17,.18);
}

.year-help{
  margin-top: 5px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
}
.year-err{
  margin-top: 5px;
  font-size: 12px;
  color: #b00020;
  font-weight: 900;
  display:none;
}

/* ===== DESTAQUE ===== */
.promo{
  padding:0;
  overflow:hidden;
  border-radius: 18px;
  border: 1px solid rgba(201,87,17,.18);
  box-shadow: var(--shadow2);
  background: linear-gradient(135deg, #111, #1a1a1a);
  color: #fff;
}
.promo .hero{
  padding: 12px;
  background:
    radial-gradient(900px 240px at 30% 0%, rgba(249,180,59,.20), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(201,87,17,.20), rgba(255,255,255,0));
}
.promo .hero h4{ margin:0 0 6px 0; font-size: 14px; font-weight: 900; letter-spacing: -.2px; }
.promo .hero p{ margin:0; color: rgba(255,255,255,.78); font-size: 12.5px; line-height: 1.35; }
.promo .img{
  height: 110px;
  background:
    linear-gradient(0deg, rgba(0,0,0,.35), rgba(0,0,0,0)),
    url('https://picsum.photos/800/400?blur=2') center/cover no-repeat;
  border-top: 1px solid rgba(255,255,255,.10);
}
.promo .cta{
  padding: 10px 12px;
  display:flex; gap:10px; align-items:center; justify-content:space-between;
  border-top: 1px solid rgba(255,255,255,.10);
}
.promo .cta a{
  color:#111; background: var(--brand2);
  text-decoration:none;
  font-weight: 900;
  padding: 9px 10px;
  border-radius: 12px;
  display:inline-block;
}
.promo .cta span{ font-size: 12px; color: rgba(255,255,255,.72); font-weight: 800; }

/* ===== INSTITUCIONAL ===== */
.insta-links{ display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.insta-links a{
  text-decoration:none;
  color:#111;
  font-weight: 900;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(201,87,17,.20);
  background: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
  transition: transform .12s ease, box-shadow .12s ease;
  font-size: 13px;
}
.insta-links a:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 26px rgba(0,0,0,.08);
  border-color: rgba(201,87,17,.45);
}

/* ===== CONTENT (DIREITA) ===== */
.content{ flex:1; min-width:0; }
.content-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 10px; }
.results-meta{ font-weight:900; letter-spacing:-.2px; }

.sort select{
  border:1px solid rgba(201,87,17,.20);
  border-radius: 12px;
  padding: 8px 10px;
  background:#fff;
  font-weight:900;
  cursor:pointer;
  font-size: 13px;
}

.notice{
  border:1px solid rgba(201,87,17,.25);
  background: rgba(249,180,59,.22);
  color:#111;
  border-radius: 16px;
  padding: 12px 12px;
  margin-bottom: 12px;
  font-weight: 900;
  display:none;
}

/* ✅ HOME DIV (conteúdo do /api/conteudo.php) */
.home-hero{
  border:1px solid rgba(201,87,17,.20);
  background:#fff;
  border-radius: 18px;
  box-shadow: 0 10px 22px rgba(0,0,0,.05);
  padding: 14px;
  margin-bottom: 12px;
  display:none;
}

.grid{ display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

a.item{
  background:#fff; border:1px solid var(--line); border-radius: 16px;
  overflow:hidden; box-shadow: 0 10px 22px rgba(0,0,0,.05);
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration:none; color:#111; display:block;
}
a.item:hover{ transform: translateY(-2px); box-shadow: 0 16px 30px rgba(0,0,0,.08); }

.thumb{ width:100%; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #d9d9d9, #bfbfbf); position:relative; }
.thumb img{ width:100%; height:100%; object-fit:cover; display:block; }

/* ✅ badge (marca) mais legível: weight 600 + cantos pouco arredondados */
.badge{
  position:absolute;
  left:10px;
  top:10px;
  background: rgba(201,87,17,.92);
  color:#fff;
  font-size: 11px;
  font-weight: 600;        /* ✅ era 900 */
  padding: 6px 8px;
  border-radius: 8px;      /* ✅ era pill */
  letter-spacing: 0;
}

.year-stamp{
  position:absolute; right:10px; bottom:8px;
  font-size:32px; font-weight:900; font-style: italic; letter-spacing:-0.8px;
  color: rgba(255,255,255,.60);
  line-height: 1;
  text-shadow: 0 6px 18px rgba(0,0,0,.35);
  pointer-events:none;
  user-select:none;
}

.info{ padding: 12px 12px 14px; }
.title{ margin:0; font-weight:900; letter-spacing:-.3px; font-size: 14px; line-height: 1.2; }
.sub{ margin:6px 0 0 0; font-size: 12.5px; color: var(--muted); }

.pager{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top: 16px; }
.pager button{
  border:1px solid #111; background:#fff; color:#111;
  border-radius: 12px; padding: 9px 10px; font-weight:900; cursor:pointer;
  font-size: 13px;
}
.pager button:hover{ background: rgba(249,180,59,.18); }
.pager button:disabled{ opacity:.45; cursor:not-allowed; }

/* ===== ficha (mantive como estava) ===== */
.ficha{
  background:#fff; border:1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.ficha-top{
  display:flex; gap:14px; padding:14px;
  border-bottom:1px solid var(--line);
}
.ficha-top .img{
  width: 260px; min-width:260px;
  aspect-ratio: 16/10;
  border-radius: 16px;
  overflow:hidden;
  background:#ddd;
  border:1px solid var(--line);
}
.ficha-top .img img{ width:100%; height:100%; object-fit:cover; display:block; }
.ficha-top h1{ margin:0; font-size: 22px; letter-spacing:-.4px; }
.ficha-top .meta{ margin-top:8px; color:var(--muted); font-weight:800; }

.ficha-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.k{
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 10px 10px;
  background:#fff;
}
.k b{ display:block; font-size:12px; color:var(--muted); margin-bottom:6px; }
.k span{ font-weight:900; }

@media (max-width: 1250px){
  :root{ --sidebar-w: 300px; }
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ficha-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px){
  .page{ flex-direction:column; }
  .sidebar{ position:relative; top:auto; height:auto; width:100%; min-width:0; overflow:visible; padding-right:0; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand{ min-width:auto; }
  .ficha-top{ flex-direction:column; }
  .ficha-top .img{ width:100%; min-width:0; }
  .home-hero{ margin-top: 8px; }
}
@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
  .topbar-inner{ flex-wrap:wrap; }
  .searchbox{ width:100%; }
  .ficha-grid{ grid-template-columns: 1fr; }
  .year-stamp{ font-size: 28px; }
}



/* =========================================================
   MOBILE TOPBAR + DRAWERS (hambúrguer / institucional / filtros)
   ========================================================= */

.no-scroll{ overflow:hidden; }

.d-only{ display:block; }
.m-burger, .m-filterBtn{ display:none; }

/* Hambúrguer */
.m-burger{
  width:42px; height:42px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  border-radius: 14px;
  display:none;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
}
.m-burger span{
  display:block;
  width:18px;
  height:2px;
  background:#111;
  margin:2px 0;
  border-radius: 2px;
}

/* Botão filtro no mobile (fica à direita da busca) */
.m-filterBtn{
  border:1px solid #111;
  cursor:pointer;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 900;
  background:#fff;
  color:#111;
  white-space: nowrap;
}
.m-filterBtn:hover{ background: rgba(249,180,59,.20); }

/* Drawer base */
.drawer-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.42);
  z-index: 80;
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease;
}
.drawer-backdrop.is-open{
  opacity:1;
  pointer-events:auto;
}

.drawer{
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  width: 84vw;
  max-width: 340px;
  background:#fff;
  z-index: 90;
  transform: translateX(-105%);
  transition: transform .18s ease;
  border-right: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  display:flex;
  flex-direction:column;
}
.drawer.is-open{ transform: translateX(0); }

.drawer-head{
  padding: 14px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.drawer-title{ font-weight: 900; letter-spacing: -.2px; }
.drawer-close{
  width:40px; height:40px;
  border-radius: 14px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  cursor:pointer;
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
}
.drawer-body{ padding: 12px 14px; display:flex; flex-direction:column; gap:10px; }
.drawer-link{
  display:block;
  text-decoration:none;
  color:#111;
  font-weight: 900;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(201,87,17,.20);
  background:#fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
}
.drawer-link:hover{ border-color: rgba(201,87,17,.45); }

/* =========================================================
   Mobile behavior
   - mostra hambúrguer
   - esconde pill desktop
   - mostra botão Filtro dentro da busca
   - sidebar vira drawer (filtros escondidos por padrão)
   ========================================================= */
@media (max-width: 980px){
  .d-only{ display:none !important; }
  .m-burger{ display:flex; }
  .m-filterBtn{ display:inline-block; }

  /* Sidebar (filtros) vira drawer */
  .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    height:100vh !important;
    width: 86vw !important;
    max-width: 360px !important;
    background: #f3f3f3 !important;
    z-index: 90 !important;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
    border-right: 1px solid rgba(0,0,0,.10);
    padding: 14px 12px !important;
    overflow:auto !important;
  }
  .sidebar.is-open{
    transform: translateX(0);
  }

  /* Topbar: deixa tudo “com cara de mobile” sem mexer no desktop */
  .topbar-inner{
    padding: 10px 12px;
  }
  .brand{ min-width:auto; }
  .brand .name{ font-weight: 900; }

  /* Busca no mobile com botão filtro acoplado */
  .searchbox{
    padding: 7px 8px;
    gap:8px;
  }
  .d-searchBtn{ display:none; } /* some o "Buscar" no mobile */
  .searchbox input{ font-size: 14px; }
}

