/* ===== BRAND TOKENS (FALLBACK) — Classificados App Mode =====
   If the page already defines these in <style>:root, that will win.
*/
:root{
  --accent: #00bcd4;
  --accent-dark: #008aa6;
  --accent-soft: #8be9ff;

  --sunset-orange: #ff9551;
  --sunset-deep: #ff6a00;
  --gold: #ffcf6b;

  --card-bg: rgba(0, 0, 0, 0.86);
  --border-soft: rgba(255, 255, 255, 0.18);

  --text-main: #ffffff;
  --text-soft: #e2e2e2;
}
/* ==========================================================================
   TRINDADE — CLASSIFICADOS UI POLISH (CSS OVERRIDE ONLY)
   Applies ONLY to classificados pages via <link>.
   Goals:
   - Fix image chaos (contain + cover)
   - Force 5 cards per row on desktop (25 per page = 5x5)
   - Improve spacing + centering
   - Keep existing tokens/colors

   CHANGELOG (Audit Mode)
   - 2026-03-04: Header glow + branded background polish
   - 2026-03-04: Mobile card image = 1x1 square (bigger, cleaner)
   - 2026-03-04: Mid-feed interrupt strip styles (Ninguém Dorme + CTAs)
   - 2026-03-04: Back button (Classificados app mode)
   ========================================================================== */


/* ---------- Section width (needed for 5 columns) ---------- */
.classificados-section {
  max-width: 1600px; /* was 1080px on membros */
  margin: 0 auto;
  padding: 44px 22px 80px;
}

/* Slightly tighten header spacing so grid sits better */
.classificados-header {
  margin-bottom: 18px;

  /* FUN BRANDED HEADER BACKDROP */
  position: relative;
  padding: 18px 16px 12px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(circle at 18% 10%, rgba(0, 188, 212, 0.18), transparent 58%),
    radial-gradient(circle at 86% 22%, rgba(255, 149, 81, 0.18), transparent 58%),
    radial-gradient(circle at 50% 0%, rgba(255, 207, 107, 0.10), transparent 60%),
    rgba(0,0,0,0.42);
  box-shadow: 0 18px 50px rgba(0,0,0,0.65);
}

/* Title: give Post! more life (on-brand gradient) */
.classificados-title {
  background: linear-gradient(
    90deg,
    var(--sunset-orange, #ff9551) 0%,
    #ffffff 45%,
    var(--accent, #00bcd4) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 14px 34px rgba(0,0,0,0.85);
}

/* Subtitle spacing tighter */
.classificados-subtitle {
  margin-top: 8px;
}

/* Mobile header tighten */
@media (max-width: 600px) {
  .classificados-section {
    padding: 28px 14px 70px;
  }

  .classificados-header {
    padding: 14px 12px 10px;
    border-radius: 18px;
  }
}


/* ---------- Hero (if present): make background image more translucent/controlled ---------- */
.hero-instagram {
  position: relative;
}

.hero-instagram::before {
  opacity: 0.45; /* reduce harshness */
  mix-blend-mode: screen;
}

/* Add a dark overlay for readability and “modern” feel */
.hero-instagram::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(0, 188, 212, 0.18), transparent 55%),
    radial-gradient(circle at 85% 25%, rgba(255, 149, 81, 0.18), transparent 55%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.72));
}


/* ---------- Grid: LOCK layout (5 per row desktop) ---------- */
.classificados-grid {
  width: 100%;
  margin-top: 26px;
  display: grid;
  gap: 16px;
  align-items: stretch;
}

/* Desktop / large screens: 5 columns */
@media (min-width: 1320px) {
  .classificados-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Medium desktop: 4 columns */
@media (min-width: 1080px) and (max-width: 1319px) {
  .classificados-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Tablet: 3 columns */
@media (min-width: 820px) and (max-width: 1079px) {
  .classificados-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Small tablet: 2 columns */
@media (min-width: 520px) and (max-width: 819px) {
  .classificados-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: 1 column */
@media (max-width: 519px) {
  .classificados-grid {
    grid-template-columns: 1fr;
  }
}


/* ---------- Card contract ---------- */
.classificados-grid .class-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  padding: 14px 14px 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.92);
  color: var(--text-main);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

/* Disable float animations if they exist */
.classificados-grid .class-card:nth-child(odd),
.classificados-grid .class-card:nth-child(even) {
  animation: none;
}

.classificados-grid .class-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 1);
  border-color: rgba(255, 255, 255, 0.62);
}

/* Inner wrapper (exists on both pages) */
.classificados-grid .class-card-inner {
  position: relative;
  z-index: 1;
}


/* ---------- Image containment (stops “photos go everywhere”) ---------- */
.classificados-grid .class-image {
  width: 100%;
  height: 180px; /* larger photo */
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 10px;
  background: radial-gradient(circle at 20% 20%, #2a2a2a, #000);
  display: flex;
  align-items: center;
  justify-content: center;
}

.classificados-grid .class-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ✅ MOBILE: make image big + 1x1 square (primary UX fix) */
@media (max-width: 600px) {
  .classificados-grid .class-card {
    padding: 14px 14px 14px;
  }

  .classificados-grid .class-image {
    height: 200px;
  aspect-ratio: auto;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .classificados-grid .class-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}


/* ---------- Category splash (works if cat-* classes exist) ---------- */
.classificados-grid .class-card::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -72%;
  width: 100%;
  height: 120%;
  opacity: 0.95;
  transition: bottom 0.28s ease-out;
  z-index: 0;
}

.classificados-grid .class-card:hover::before {
  bottom: 0;
}

/* Keep the same category gradients used on parceiros page */
.classificados-grid .class-card.cat-gastronomia::before,
.classificados-grid .class-card.cat-lanches::before {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(to top, var(--sunset-deep, #ff6a00), var(--sunset-orange, #ff9551));
}

.classificados-grid .class-card.cat-hospedagem::before {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(to top, #0072ff, #00c6ff);
}

.classificados-grid .class-card.cat-passeio::before,
.classificados-grid .class-card.cat-guiado::before {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(135deg, var(--sunset-deep, #ff6a00), #00c6ff);
}

.classificados-grid .class-card.cat-servico::before {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(135deg, #00c6ff, var(--gold, #ffcf6b));
}

.classificados-grid .class-card.cat-emprego::before {
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.85) 25%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(to top, #ffffff, #dfefff);
}


/* ---------- Typography tightened for 5-col ---------- */
.classificados-grid .class-title {
  font-family: "Fjalla One", sans-serif;
  font-size: 1.06rem;
  margin: 4px 0 4px;
  letter-spacing: 0.02em;
}

.classificados-grid .class-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  margin: 4px 0 10px;
  line-height: 1.35;
}

.classificados-grid .class-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.86);
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Hover tip */
.classificados-grid .class-hover-tip {
  font-size: 0.76rem;
  color: var(--accent-soft);
}


/* ---------- Branded background for classificados pages ---------- */
body {
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 188, 212, 0.18), transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(255, 106, 0, 0.20), transparent 55%),
    linear-gradient(to bottom, #000508 0%, #000000 60%);
}


/* ==========================================================================
   ACTIONS: Uniform look (Shaka + Tenho Interesse)
   ========================================================================== */

.classificados-grid .class-footer {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Keep Tenho Interesse as the main pill (uniform height) */
.classificados-grid .class-interested-btn {
  height: 48px;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 700;
  font-family: "Open Sans", sans-serif;
}

/* Gostei becomes icon-only shaka button */
.classificados-grid .class-gostei-btn {
  height: 48px;
  width: 48px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);

  font-size: 22px;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
}

/* Liked state (sunset orange) */
.classificados-grid .class-gostei-btn.liked {
  color: var(--sunset-orange);
  border-color: rgba(255, 149, 81, 0.75);
  box-shadow: 0 0 18px rgba(255, 149, 81, 0.35), 0 10px 24px rgba(0, 0, 0, 0.55);
}


/* ===== FEED INTERRUPT (MID-FEED CTA STRIP) ===== */
.feed-interrupt{
  margin: 50px 0;
  text-align: center;
}

.nd-pill{
  display: inline-block;
  padding: 8px 22px;
  border-radius: 999px;
  font-family: "Fjalla One", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(120deg, var(--accent, #00bcd4), var(--sunset-orange, #ff9551));
  box-shadow: 0 0 18px rgba(0,198,255,0.6);
  margin-bottom: 24px;
}

.interrupt-cta-row{
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 600px){
  .feed-interrupt{
    margin: 40px 0;
  }

  .interrupt-cta-row{
    flex-direction: column;
    align-items: stretch;
  }

  .nd-pill{
    font-size: 0.68rem;
    padding: 6px 16px;
  }
}


/* ===== BACK BUTTON — CLASSIFICADOS APP MODE ===== */
.back-home-btn{
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99999;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 10px 16px;
  border-radius: 999px;

  background: rgba(4, 8, 16, 0.88);
  border: 1px solid rgba(255,255,255,0.18);

  color: #ff9551;;
  text-decoration: none;

  font-family: "Fjalla One", system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.back-home-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(0,198,255,0.6);
  color: #00c6ff;
}

.back-home-arrow{
  font-size: 16px;
  line-height: 1;
}

@media (max-width: 600px){
  .back-home-btn{
    padding: 10px;
  }
  .back-home-text{
    display: none;
  }
/* ==========================================================================
   MODAL SAFETY — if your form modal looks HUGE, this re-locks it.
   (Safe even if you already have inline modal CSS.)
   ========================================================================== */
.modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 10080;
  padding: 18px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.75);
}

.modal-card{
  width: min(620px, 100%);
  max-height: 85vh;
  overflow: auto;

  border-radius: 20px;
  background: rgba(8,12,20,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 70px rgba(0,0,0,0.85);
}


/* ===== AUDIT PATCH: MOBILE CARD PHOTO (1:1) + LESS “BLACK BAR” ===== */
@media (max-width: 600px){

  /* Make the post photo feel like a real thumbnail (1:1) */
  .classificados-grid .class-image{
    height: auto !important;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .classificados-grid .class-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  /* Reduce the “black bar” area (text stack below image) */
  .classificados-grid .class-card{
    padding: 12px 12px 12px;
  }

  .classificados-grid .class-title{
    font-size: 1.02rem;
    margin: 4px 0 4px;
    line-height: 1.12;
  }

  .classificados-grid .class-meta{
    font-size: 0.74rem;
    margin-bottom: 8px;
    gap: 6px;
  }

  .classificados-grid .class-desc{
    font-size: 0.86rem;
    line-height: 1.28;
    margin: 4px 0 10px;

    /* clamp to keep the card compact */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Keep buttons tappable even if card becomes clickable later */
  .classificados-grid .class-gostei-btn,
  .classificados-grid .class-interested-btn{
    position: relative;
    z-index: 3;
  }
}
