/* ═══════════════════════════════════════════════════════════════════════════
   NEWS — editorial layout
   Page rhythm: DARK hero (masthead) → LIGHT GRAY reading body → DARK newsletter
   Thumbnails are light with saturated icons + per-tone tints (so cards don't
   look like dark holes against the gray reading surface).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────── PAGE HEADER (dark masthead) ─────────────── */
#news-head {
  position: relative;
  padding: 180px 0 60px;
  text-align: center;
  overflow: hidden;
  background: var(--bg);
}

#news-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(123,45,255,.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(0,204,255,.06), transparent 70%);
  pointer-events: none;
}

#news-head::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0, rgba(255,255,255,.014) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0, rgba(255,255,255,.014) 1px, transparent 1px, transparent 40px);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.5), transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(0,0,0,.5), transparent 80%);
  pointer-events: none;
}

.news-head-inner {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 32px;
}

.news-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--purple);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(123,45,255,.06);
  border: 1px solid rgba(123,45,255,.18);
  margin-bottom: 28px;
  opacity: 0;
  animation: fade-up .7s var(--ease) .2s both;
}

.news-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px rgba(123,45,255,.6);
  animation: pulse 1.8s ease-in-out infinite;
}

.news-title {
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.03em;
  color: #fff;
  margin-bottom: 24px;
}

.news-title .rl {
  display: inline-block;
}

.news-sub {
  font-size: 16px;
  font-weight: 300;
  color: #9ea3b4;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
  opacity: 0;
  animation: fade-up .8s var(--ease) .9s both;
}

/* ═══════════════════ LIGHT BODY — editorial reading surface ═══════════════════ */

/* ─────────────── CATEGORY FILTER (sticky bar over light bg) ─────────────── */
.news-filter {
  position: sticky;
  top: 72px;
  z-index: 20;
  /* Solid → fade so content scrolls cleanly under without backdrop-filter (perf). */
  background: linear-gradient(to bottom, #f5f5f7 0%, #f5f5f7 78%, rgba(245,245,247,0) 100%);
  padding: 22px 0 28px;
  margin-bottom: 12px;
}

.news-filter-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.news-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: #4b5563;
  background: #ffffff;
  border: 1px solid rgba(15,20,35,0.08);
  border-radius: 999px;
  cursor: pointer;
  transition: color .25s, background .25s, border-color .25s, transform .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(15,20,35,0.04);
}

.news-pill:hover {
  color: #0f1116;
  border-color: rgba(15,20,35,0.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15,20,35,0.06);
}

.news-pill.active {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(123,45,255,.28);
}

.news-pill .count {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15,20,35,0.06);
  color: inherit;
  opacity: .75;
}

.news-pill.active .count {
  background: rgba(255,255,255,.22);
  opacity: 1;
}

/* ─────────────── CONTENT WRAPPER ─────────────── */
.news-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 40px;
}

.news-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.news-section-label h2 {
  font-size: 22px;
  font-weight: 400;
  color: #0f1116;
  letter-spacing: -.01em;
}

.news-section-label .count-info {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ─────────────── FEATURED POST ─────────────── */
.news-featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  padding: 40px;
  background: #ffffff;
  border: 1px solid rgba(15,20,35,0.08);
  border-radius: 24px;
  margin-bottom: 72px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,20,35,0.04), 0 12px 40px rgba(15,20,35,0.06);
  transition: border-color .4s, box-shadow .4s, transform .4s var(--ease);
}

.news-featured::before {
  content: '';
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(123,45,255,.55) 0%, transparent 40%, transparent 60%, rgba(0,204,255,.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.news-featured:hover {
  border-color: rgba(15,20,35,0.12);
  transform: translateY(-3px);
  box-shadow: 0 1px 3px rgba(15,20,35,0.04), 0 28px 80px rgba(15,20,35,0.10);
}

.news-featured:hover::before { opacity: 1; }

/* Thumbnail keeps a DARK media surface — editorial contrast on white card. */
.news-featured-thumb {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(123,45,255,.18), #f5f5f7 75%);
  border: 1px solid var(--l-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-featured-thumb.tone-purple { background: radial-gradient(ellipse at center, rgba(123,45,255,.18), #f5f5f7 75%); }
.news-featured-thumb.tone-cyan   { background: radial-gradient(ellipse at center, rgba(0,204,255,.18),  #f5f5f7 75%); }
.news-featured-thumb.tone-blue   { background: radial-gradient(ellipse at center, rgba(0,102,255,.16),  #f5f5f7 75%); }
.news-featured-thumb.tone-green  { background: radial-gradient(ellipse at center, rgba(34,197,94,.14),  #f5f5f7 75%); }

.news-featured-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(15,20,35,.035) 0, rgba(15,20,35,.035) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(15,20,35,.035) 0, rgba(15,20,35,.035) 1px, transparent 1px, transparent 24px);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 70%);
}

.news-featured-thumb svg {
  position: relative;
  z-index: 1;
  color: var(--cyan);
  filter: drop-shadow(0 6px 16px rgba(0,102,255,.18));
  opacity: 1;
  transition: transform 6s cubic-bezier(.22,1,.36,1), opacity .4s;
}
.news-featured-thumb.tone-purple svg { color: var(--purple); filter: drop-shadow(0 6px 16px rgba(123,45,255,.22)); }
.news-featured-thumb.tone-cyan   svg { color: var(--cyan);   filter: drop-shadow(0 6px 16px rgba(0,204,255,.22)); }
.news-featured-thumb.tone-blue   svg { color: var(--blue);   filter: drop-shadow(0 6px 16px rgba(0,102,255,.22)); }
.news-featured-thumb.tone-green  svg { color: #16a34a;       filter: drop-shadow(0 6px 16px rgba(34,197,94,.22));  }

.news-featured:hover .news-featured-thumb svg {
  transform: scale(1.08);
  opacity: 1;
}

.news-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.news-featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--purple);
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(123,45,255,.07);
  border: 1px solid rgba(123,45,255,.22);
}

.news-featured-tag::before {
  content: '';
  width: 14px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.news-featured-title {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 400;
  color: #0f1116;
  line-height: 1.2;
  letter-spacing: -.02em;
}

.news-featured-title a {
  color: inherit;
  transition: color .3s;
}

.news-featured-title a:hover {
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.news-featured-excerpt {
  font-size: 14px;
  font-weight: 300;
  color: #4b5563;
  line-height: 1.8;
}

.news-featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: .04em;
}

.news-featured-meta .sep {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #c4c8d1;
}

.news-featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  color: #4b5563;
  padding: 12px 20px;
  border: 1px solid rgba(15,20,35,0.12);
  border-radius: 10px;
  align-self: flex-start;
  margin-top: 6px;
  background: transparent;
  transition: all .3s;
}

.news-featured-cta:hover {
  color: #0f1116;
  border-color: rgba(15,20,35,0.30);
  background: rgba(15,20,35,0.04);
  gap: 12px;
}

.news-featured-cta svg { transition: transform .3s; }
.news-featured-cta:hover svg { transform: translateX(3px); }

/* ─────────────── POST GRID ─────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(15,20,35,0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .3s;
  opacity: 0;
  box-shadow: 0 1px 3px rgba(15,20,35,0.04), 0 8px 28px rgba(15,20,35,0.05);
}

.news-card.visible { opacity: 1; }

.news-card.filtering-out {
  opacity: 0;
  transform: scale(.97);
  pointer-events: none;
}

.news-card:hover {
  transform: translateY(-6px);
  border-color: rgba(15,20,35,0.14);
  box-shadow: 0 1px 3px rgba(15,20,35,0.04), 0 24px 60px rgba(15,20,35,0.10);
}

/* Thumbnail kept DARK on white card — editorial media-block pattern. */
.news-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--l-border);
}

.news-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(15,20,35,.025) 0, rgba(15,20,35,.025) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(90deg, rgba(15,20,35,.025) 0, rgba(15,20,35,.025) 1px, transparent 1px, transparent 20px);
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 75%);
  transition: opacity .4s;
}

.news-thumb svg {
  position: relative;
  z-index: 1;
  transition: transform 1.2s cubic-bezier(.22,1,.36,1), filter .4s;
  opacity: 1;
  filter: drop-shadow(0 4px 10px rgba(15,20,35,.10));
}

.news-card:hover .news-thumb svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 18px currentColor) drop-shadow(0 4px 10px rgba(15,20,35,.10));
  opacity: 1;
}

/* Thumb color variants — light theme */
.news-thumb.tone-purple { background: radial-gradient(ellipse at center, rgba(123,45,255,.16), #ffffff 75%); color: var(--purple); }
.news-thumb.tone-cyan   { background: radial-gradient(ellipse at center, rgba(0,204,255,.16),  #ffffff 75%); color: var(--cyan);   }
.news-thumb.tone-blue   { background: radial-gradient(ellipse at center, rgba(0,102,255,.14),  #ffffff 75%); color: var(--blue);   }
.news-thumb.tone-green  { background: radial-gradient(ellipse at center, rgba(34,197,94,.12),  #ffffff 75%); color: #16a34a;       }

.news-card-body {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.news-card-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

/* Tag colors tuned for AA contrast on white. */
.news-card-tag.tag-api    { color: #0080a8; background: rgba(0,204,255,.09);   border: 1px solid rgba(0,204,255,.26); }
.news-card-tag.tag-ia     { color: #6b21d6; background: rgba(123,45,255,.07);  border: 1px solid rgba(123,45,255,.24); }
.news-card-tag.tag-guia   { color: #1f63d6; background: rgba(0,102,255,.07);   border: 1px solid rgba(0,102,255,.24); }
.news-card-tag.tag-outros { color: #198047; background: rgba(34,197,94,.09);   border: 1px solid rgba(34,197,94,.26); }

.news-card-title {
  font-size: 16px;
  font-weight: 500;
  color: #0f1116;
  line-height: 1.35;
  letter-spacing: -.01em;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-title a {
  color: inherit;
  transition: color .25s;
}
.news-card:hover .news-card-title a { color: #000; }

.news-card-excerpt {
  font-size: 12.5px;
  font-weight: 300;
  color: #4b5563;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(15,20,35,0.06);
}

.news-card-date {
  font-size: 10.5px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.news-card-date svg { opacity: .55; }

.news-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  color: #4b5563;
  transition: color .2s, gap .25s;
}

.news-card:hover .news-card-cta {
  color: var(--blue);
  gap: 10px;
}

/* Empty state */
.news-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 80px 20px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 400;
  opacity: 0;
  transition: opacity .3s;
}

.news-empty.visible { opacity: 1; }

/* ─────────────── NEWSLETTER (dark — bookend with hero / footer) ─────────────── */
.news-newsletter {
  margin-top: 96px;
  margin-bottom: 40px;
  padding: 56px 40px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(123,45,255,.18), transparent 70%),
    radial-gradient(ellipse at 80% 50%, rgba(0,204,255,.10), transparent 70%),
    #0a0a12;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 24px 70px rgba(15,20,35,0.10);
}

.news-newsletter::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0, rgba(255,255,255,.02) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0, rgba(255,255,255,.02) 1px, transparent 1px, transparent 32px);
  mask-image: radial-gradient(ellipse 90% 100% at 50% 50%, rgba(0,0,0,.5), transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 100% at 50% 50%, rgba(0,0,0,.5), transparent 80%);
  pointer-events: none;
}

.news-newsletter-inner {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin: 0 auto;
}

.news-newsletter h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 300;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.news-newsletter p {
  font-size: 13px;
  font-weight: 300;
  color: #9ea3b4;
  line-height: 1.7;
  margin-bottom: 24px;
}

.news-newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 5px;
  transition: border-color .3s, background .3s;
  position: relative;
  flex-wrap: wrap;
}

.news-newsletter-form:focus-within {
  border-color: rgba(123,45,255,.4);
  background: rgba(255,255,255,.06);
}

.news-newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .01em;
}

.news-newsletter-form input::placeholder { color: #82869a; }

.news-newsletter-form input.has-error {
  outline: 1px solid rgba(255,77,94,.55);
  background: rgba(255,77,94,.06);
}
.news-newsletter-form .field-error {
  flex-basis: 100%;
  margin-top: 8px;
  min-height: 14px;
  font-size: 11.5px;
  font-weight: 400;
  color: #ff8a98;
  text-align: left;
}
.news-newsletter-form .field-error:empty { display: none; }
.news-newsletter-success {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(34,197,94,.10);
  border: 1px solid rgba(34,197,94,.28);
  color: #7fd9b0;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 400;
}

.news-newsletter-form button {
  padding: 10px 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  font-family: inherit;
}

.news-newsletter-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(123,45,255,.3);
}

/* ═════════════════ RESPONSIVE ═════════════════ */
@media (max-width: 1024px) {
  .news-featured {
    grid-template-columns: 1fr;
    padding: 28px;
    gap: 28px;
  }
  .news-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
  #news-head { padding: 130px 0 40px; }
  .news-head-inner { padding: 0 20px; }
  .news-title { font-size: 42px; }
  .news-container { padding: 0 20px 40px; }
  .news-filter { top: 64px; padding: 16px 0 20px; }
  .news-filter-inner { padding: 0 20px; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .news-filter-inner::-webkit-scrollbar { display: none; }
  .news-pill { flex-shrink: 0; }
  .news-featured { padding: 20px; gap: 20px; }
  .news-grid { grid-template-columns: 1fr; }
  .news-newsletter { padding: 40px 24px; margin-top: 64px; }
  .news-newsletter-form { flex-direction: column; padding: 8px; }
  .news-newsletter-form button { padding: 12px; }
}
