/* ==========================================
   MUNDO DAS MENSAGENS — Design System
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&family=DM+Serif+Display:ital@0;1&display=swap');

/* === TOKENS === */
:root {
  --c-brand:        #1a3a5c;
  --c-brand-mid:    #1d5fa6;
  --c-brand-light:  #e8f0f9;
  --c-accent:       #f57c2b;
  --c-accent-light: #fff3e8;
  --c-gold:         #c9952a;
  --c-gold-light:   #fdf6e3;
  --c-text:         #1e2535;
  --c-text-muted:   #6b7280;
  --c-border:       #e5e9f0;
  --c-surface:      #f8fafc;
  --c-white:        #ffffff;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  --shadow-xs:  0 1px 3px rgba(0,0,0,.07);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12);
  --shadow-brand: 0 4px 24px rgba(29,95,166,.20);

  --font-display: 'Playfair Display', serif;
  --font-serif:   'DM Serif Display', serif;
  --font-body:    'Inter', sans-serif;

  --header-h: 72px;
  --max-w:    1200px;
  --gap:      1.5rem;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* === LAYOUT === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); align-items: stretch; }

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-brand);
  box-shadow: 0 2px 16px rgba(0,0,0,.18);
  overflow: visible;
}
.site-header.site-header--cats-open {
  z-index: 150;
}
.site-header .container {
  max-width: 100%;
  padding: 0 1rem;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: visible;
  box-sizing: border-box;
}
/* Desktop: altura fixa da faixa logo + categorias + busca (só o painel de categorias abre por baixo). */
@media (min-width: 769px) {
  .site-header .header-inner {
    height: var(--header-h);
    min-height: var(--header-h);
    max-height: var(--header-h);
    flex-wrap: nowrap;
    padding: 0 0.15rem 0 0;
  }
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
  text-decoration: none;
  padding-right: 1rem;
  border-right: 1px solid rgba(255,255,255,.15);
  min-height: 2.75rem;
  align-self: center;
}
.site-logo svg { color: var(--c-white); }
.site-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.15;
}
.site-logo .logo-text span {
  display: block;
  font-size: .58rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: rgba(255,255,255,.6);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* Nav: até 5 categorias por linha; mais linhas via botão “mostrar mais” (JS) */
.header-nav {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.28rem 0.2rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  height: auto;
  min-height: 0;

}
.header-nav::-webkit-scrollbar { display: none; }

.nav-cat-item {
  flex: unset;
  scroll-snap-align: unset;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  padding: 0.35rem 0.25rem;
  text-decoration: none;
  transition: background .18s;
  border-radius: 0;
}
.nav-cat-item:hover { background: rgba(255,255,255,.12); }
.nav-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: var(--c-white);
  flex-shrink: 0;
  transition: background .18s;
}
.nav-cat-icon svg { width: 22px; height: 22px; display: block; }
.nav-cat-item:hover .nav-cat-icon { background: rgba(255,255,255,.28); }
.nav-cat-label {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  text-align: center;
  width: 100%;
  max-width: 6.5rem;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.nav-cat-item:hover .nav-cat-label { color: var(--c-white); }

/* Fallback links simples */
.header-nav a:not(.nav-cat-item) {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.82);
  padding: .4rem .75rem;
  transition: background .18s, color .18s;
}
.header-nav a:not(.nav-cat-item):hover { background: rgba(255,255,255,.12); color: var(--c-white); }

/* Ecrãs largos: rótulos numa linha com reticências */
@media (min-width: 1200px) {
  .nav-cat-label {
    white-space: nowrap;
    display: block;
    -webkit-line-clamp: unset;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* Faixa de categorias: 5 na barra; painel completo só no flyout (JS) */
.header-nav-outer {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-self: center;
}
@media (min-width: 769px) {
  .site-header .header-nav-outer {
    max-height: var(--header-h);
  }
}
.header-nav-row {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  width: 100%;
  min-height: 0;
}
.header-nav-middle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 100%;
}
.header-nav-clip {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center; /* centra verticalmente na topbar */
  align-self: center;
}
/* Garante via CSS puro que só 5 itens ficam visíveis no clip, independente do JS */
.header-nav-clip .header-nav > a:nth-child(n+6),
.header-nav-clip .header-nav > .nav-cat-item:nth-child(n+6) {
  display: none !important;
}
.header-nav-spacer {
  flex: 1 1 auto;
  min-width: 3rem;
  min-height: 3.25rem;
  pointer-events: none;
}
.header-nav-outer .header-nav {
  flex: 1 1 100%;
  min-width: 0;
  width: 100%;
}
.header-nav-outer .header-nav-middle > .header-nav-clip > .header-nav {
  max-height: 4.85rem;
}
.header-nav-row .header-nav-middle {
  flex: 1 1 auto;
  min-width: 0;
}

/* Painel completo: cobre todo o viewport abaixo da topbar */
.header-categories-flyout {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--header-h);
  bottom: 0;
  z-index: 151;
  background: var(--c-brand);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
  border-top: 1px solid transparent;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  transition:
    opacity 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
    visibility 0.3s,
    border-color 0.2s ease;
}
.header-categories-flyout--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  border-top-color: rgba(255, 255, 255, 0.14);
}
.header-categories-flyout-inner {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 1.5rem 2.5rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.header-categories-flyout-inner .header-nav {
  max-height: none;
  overflow: visible;
  /* No painel aberto: itens maiores e grelha com mais colunas */
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem 0.4rem;
}
.header-categories-flyout-inner .nav-cat-item {
  padding: 1rem 0.5rem;
}
.header-categories-flyout-inner .nav-cat-icon {
  width: 52px;
  height: 52px;
}
.header-categories-flyout-inner .nav-cat-icon svg {
  width: 28px;
  height: 28px;
}
.header-categories-flyout-inner .nav-cat-label {
  font-size: 0.7rem;
}

.header-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(15, 23, 35, 0.48);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.header-nav-backdrop--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.header-nav-flyout-active {
  overflow: hidden;
}

@media (min-width: 769px) {
  .site-header .site-logo,
  .site-header .header-search {
    align-self: center;
    flex-shrink: 0;
  }
}

/* Setas ‹ › antigas (scroll horizontal): ocultas — uso é “mostrar mais” por linhas */
.header-nav-btn--prev,
.header-nav-btn--next {
  display: none !important;
}

/* Linha ténue + seta centrada no ecrã (só com mais de 5 categorias; JS cria .header-nav-expand-bar) */
.header-nav-expand-bar {
  position: relative;
  width: 100%;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}
.header-nav-expand-bar[hidden] {
  display: none !important;
}
.header-nav-expand-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: none;
  top: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.14) 12%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(255, 255, 255, 0.14) 88%,
    transparent 100%
  );
  pointer-events: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.header-nav-expand-wrap {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -30%); /* ligeiramente mais baixo que o centro da linha */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 155;
  pointer-events: auto;
  padding: 0;
  transition:
    top 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    bottom 0.36s cubic-bezier(0.32, 0.72, 0, 1),
    transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}
/* Seta na borda inferior do painel (removida — a barra nunca entra no painel) */
.header-nav-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  color: rgba(255, 255, 255, 0.95);
  line-height: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.header-nav-expand:hover {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.34) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  border-color: rgba(255, 255, 255, 0.45);
}
.header-nav-expand:active {
  transform: scale(0.9);
}
.header-nav-expand:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
.header-nav-expand-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  flex-shrink: 0;
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.34, 1.25, 0.64, 1);
}
.header-nav-expand--open .header-nav-expand-icon {
  transform: rotate(180deg);
}
.header-nav-btn {
  display: none;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 2.05rem;
  height: 2.05rem;
  min-width: 2.05rem;
  max-width: 2.05rem;
  min-height: 2.05rem;
  max-height: 2.05rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.08) 100%
  );
  color: rgba(255, 255, 255, 0.95);
  line-height: 0;
  padding: 0;
  cursor: pointer;
  align-self: center;
  -webkit-tap-highlight-color: transparent;
  border-radius: 999px;
  aspect-ratio: 1;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    opacity 0.2s ease;
}
.header-nav-btn-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}
.header-nav-btn svg {
  pointer-events: none;
}
.header-nav-btn:hover:not(:disabled) {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.14) 100%
  );
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.header-nav-btn:active:not(:disabled) {
  transform: scale(0.94);
}
.header-nav-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}
.header-nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
.header-nav-btn--prev {
  margin-right: 0.28rem;
}
.header-nav-btn--next {
  margin-left: 0.28rem;
}

.header-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  padding: .35rem .7rem .35rem 1rem;
  gap: .5rem;
  border: 1px solid rgba(255,255,255,.18);
  transition: background .18s;
}
.header-search:focus-within { background: rgba(255,255,255,.2); }
.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: .85rem;
  width: 160px;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search svg { color: rgba(255,255,255,.6); flex-shrink: 0; }

/* === HERO === */
.hero {
  background: linear-gradient(135deg, var(--c-brand) 0%, #0d2a4a 40%, #162d4e 70%, #1d3a60 100%);
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(29,95,166,.25) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(245,124,43,.10) 0%, transparent 60%);
}
.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: center;
}
.hero-tagline {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.hero-tagline::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--c-accent);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}
.hero h1 em {
  font-style: italic;
  color: #f0c96a;
}
.hero p {
  color: rgba(255,255,255,.72);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--c-accent);
  color: var(--c-white);
  font-weight: 600;
  font-size: .9rem;
  padding: .75rem 1.75rem;
  border-radius: 99px;
  transition: transform .18s, box-shadow .18s, background .18s;
  box-shadow: 0 4px 16px rgba(245,124,43,.35);
}
.btn-primary:hover {
  background: #e06820;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(245,124,43,.45);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.78);
  font-size: .9rem;
  font-weight: 500;
  padding: .75rem 1.5rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,.25);
  transition: background .18s, color .18s;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: var(--c-white); }

/* Hero featured card */
.hero-featured {
  position: relative;
}
.hero-featured-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}
.hero-featured-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,124,43,.2), transparent);
}
.hero-featured-card .quote-icon {
  color: rgba(240,201,106,.4);
  margin-bottom: 1rem;
}
.hero-featured-card .quote-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255,255,255,.88);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.hero-featured-card .quote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-featured-card .quote-category {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-accent);
  background: rgba(245,124,43,.15);
  padding: .3rem .8rem;
  border-radius: 99px;
}

/* === CATEGORIES BAR === */
.categories-strip {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: 1.25rem 0;
}
.categories-strip-inner {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: stretch;
  padding-bottom: 2px; /* evitar cortar sombra */
}
.categories-strip-inner::-webkit-scrollbar { display: none; }

/* Card de categoria no strip — maior, com SVG */
.strip-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 88px;
  padding: .85rem .75rem .7rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  text-decoration: none;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.strip-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c-brand-light);
  color: var(--c-brand);
  flex-shrink: 0;
}
.strip-cat-icon svg { width: 20px; height: 20px; }
.strip-cat-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--c-text);
  text-align: center;
  line-height: 1.2;
}
.strip-cat-card:hover {
  border-color: var(--c-brand-mid);
  box-shadow: 0 4px 16px rgba(var(--c-brand-rgb, 107,70,40),.12);
  transform: translateY(-2px);
  background: var(--c-brand-light);
}
.strip-cat-card:hover .strip-cat-icon {
  background: var(--c-brand);
  color: var(--c-white);
}
.strip-cat-card:hover .strip-cat-label { color: var(--c-brand); }

/* cat-pill: mantido para páginas que ainda usam */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 500;
  color: var(--c-text-muted);
  padding: .42rem 1rem;
  border-radius: 99px;
  border: 1px solid var(--c-border);
  transition: all .18s;
  background: var(--c-surface);
}
.cat-pill svg { width: 14px; height: 14px; }
.cat-pill:hover {
  background: var(--c-brand-light);
  border-color: var(--c-brand-mid);
  color: var(--c-brand);
}
.cat-pill.active {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-white);
}

/* === SECTION HEADERS === */
.section { padding: 3.5rem 0; }
.section + .section { padding-top: 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--c-brand);
  line-height: 1.2;
}
.section-title span {
  color: var(--c-accent);
}
.section-subtitle {
  font-size: .88rem;
  color: var(--c-text-muted);
  margin-top: .3rem;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--c-brand-mid);
  white-space: nowrap;
  transition: gap .18s;
}
.section-link:hover { gap: .6rem; }
.section-link svg { width: 14px; height: 14px; }

/* === MESSAGE CARDS === */
.msg-card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--c-border);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
}
.msg-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #c9d8ea;
}

/* Card with image */
.msg-card.has-image .card-img {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--c-brand-light);
}
.msg-card.has-image .card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.msg-card.has-image:hover .card-img img { transform: scale(1.04); }
.msg-card.has-image .card-img .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,30,55,.5) 0%, transparent 60%);
}

/* Card text area */
.card-body {
  padding: 1rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
  margin-bottom: .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-card.has-image .card-title { color: var(--c-text); }
.card-category-tag {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-brand-mid);
  margin-bottom: .55rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.card-text {
  font-family: var(--font-body);
  font-size: .97rem;
  font-style: normal;
  font-weight: 400;
  color: var(--c-text);
  line-height: 1.7;
  max-height: calc(1.7rem * 7);
  overflow: hidden;
  flex: 1;
}
.search-highlight {
  background: rgba(245, 199, 74, .35);
  color: inherit;
  padding: 0 .14em;
  border-radius: .2rem;
  box-shadow: inset 0 -1px 0 rgba(245, 160, 50, .35);
}
.card-footer {
  margin-top: auto;   /* sempre no fundo, independente do tamanho do texto */
  padding-top: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Cards SEM imagem: título fixo no topo, categoria+texto centralizados, footer no fundo */
.msg-card.text-only .card-body {
  position: relative;
  padding: 1rem 1.25rem 3.5rem;
}
.msg-card.text-only .card-title {
  flex-shrink: 0;
  margin-bottom: 0;
}
/* espaçadores dividem o espaço livre igualmente → conteúdo fica no centro */
.card-spacer {
  flex: 1;
}
.msg-card.text-only .card-category-tag,
.msg-card.text-only .card-text {
  flex: 0 0 auto;
}
.msg-card.text-only .card-footer {
  position: absolute;
  bottom: 0;
  left: 1.25rem;
  right: 1.25rem;
  padding-bottom: .75rem;
  margin-top: 0;
}
.card-view-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--c-brand-mid);
  text-decoration: none;
  transition: all .18s;
  flex-shrink: 0;
}
.card-view-btn:hover { color: var(--c-brand); background: var(--c-brand-light); }
.card-view-btn svg { width: 16px; height: 16px; }

/* Text-only card variant */
.msg-card.text-only {
  background: linear-gradient(135deg, #fefefe 0%, #f8f9fc 100%);
}
.msg-card.text-only .card-text {
  font-size: 1.16rem;
  line-height: 1.65;
}

/* Quote decorative card */
.msg-card.quote-style {
  background: linear-gradient(135deg, var(--c-brand) 0%, #0d2a4a 100%);
  border-color: transparent;
}
.msg-card.quote-style .card-body { padding: 1.5rem; }
.msg-card.quote-style .card-category-tag { color: rgba(255,255,255,.55); }
.msg-card.quote-style .card-text { color: rgba(255,255,255,.9); }
.msg-card.quote-style::before {
  content: '"';
  position: absolute;
  top: -10px; right: 12px;
  font-family: var(--font-display);
  font-size: 9rem;
  line-height: 1;
  color: rgba(255,255,255,.05);
  pointer-events: none;
}

/* === CATEGORY GRID CARDS === */
.cat-card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all .2s;
  cursor: pointer;
}
.cat-card:hover {
  background: var(--c-brand-light);
  border-color: var(--c-brand-mid);
  transform: translateX(3px);
}
.cat-card-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  background: var(--c-brand-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--c-brand-mid);
  transition: background .2s;
}
.cat-card-icon svg { width: 26px; height: 26px; }
.cat-card:hover .cat-card-icon { background: var(--c-brand-mid); color: var(--c-white); }
.cat-card-info { flex: 1; min-width: 0; }
.cat-card-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-card-count {
  font-size: .75rem;
  color: var(--c-text-muted);
  margin-top: .15rem;
}
.cat-card-arrow { color: var(--c-text-muted); flex-shrink: 0; transition: transform .2s; }
.cat-card:hover .cat-card-arrow { transform: translateX(3px); color: var(--c-brand-mid); }

/* Página «Todas as Categorias» — grelha legível em telemóvel (cartões em coluna) */
.cats-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}
.cats-index-grid .cat-card {
  min-height: 4.75rem;
}

/* === ARTICLE CARDS === */
.article-card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--c-border);
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.article-card .card-img {
  aspect-ratio: 16/7;
  background: var(--c-brand-light);
  overflow: hidden;
  position: relative;
}
.article-card .card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.article-card:hover .card-img img { transform: scale(1.04); }
.article-card .card-img .article-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .25rem .65rem;
  border-radius: 99px;
}
.article-card .art-body { padding: 1.25rem; }
.article-card .art-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.35;
  margin-bottom: .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .art-date {
  font-size: .75rem;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* === FEATURED SECTION === */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

/* === LOAD MORE / PAGINATION === */
.load-more-wrap {
  text-align: center;
  margin-top: 2.5rem;
}
.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 2.25rem;
  border-radius: 99px;
  border: 2px solid var(--c-brand-mid);
  color: var(--c-brand-mid);
  font-weight: 600;
  font-size: .9rem;
  transition: all .2s;
  background: var(--c-white);
}
.btn-load-more:hover {
  background: var(--c-brand);
  border-color: var(--c-brand);
  color: var(--c-white);
  box-shadow: var(--shadow-brand);
}
.btn-load-more.loading { opacity: .6; pointer-events: none; }
.btn-load-more .spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
#search-loading .spinner {
  width: 18px; height: 18px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === BANNER / CTA === */
.cta-banner {
  background: linear-gradient(135deg, var(--c-brand) 0%, #0e2340 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  right: -60px; bottom: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  border: 60px solid rgba(255,255,255,.05);
}
.cta-banner::after {
  content: '';
  position: absolute;
  left: 40%; top: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 40px solid rgba(245,124,43,.08);
}
.cta-content { position: relative; z-index: 1; }
.cta-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: .5rem;
}
.cta-text { color: rgba(255,255,255,.7); font-size: .95rem; max-width: 420px; }

/* === TOAST / SHARE === */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e2535;
  color: #fff;
  padding: .75rem 1.5rem;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,40,.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: scale(.95) translateY(12px);
  transition: transform .25s;
  position: relative;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-surface);
  color: var(--c-text-muted);
  transition: all .18s;
  z-index: 10;
}
.modal-close:hover { background: var(--c-border); color: var(--c-text); }
.modal-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--c-brand-light);
}
.modal-body { padding: 2rem; }
.modal-category {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-brand-mid);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.modal-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.75;
  color: var(--c-text);
  white-space: pre-wrap;
  margin-bottom: 1.75rem;
}
.modal-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  font-weight: 600;
  padding: .6rem 1.25rem;
  border-radius: 99px;
  transition: all .18s;
}
.modal-btn-primary {
  background: var(--c-brand);
  color: var(--c-white);
}
.modal-btn-primary:hover { background: var(--c-brand-mid); }
.modal-btn-outline {
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
}
.modal-btn-outline:hover {
  border-color: var(--c-brand-mid);
  color: var(--c-brand-mid);
}
.share-action-btn {
  gap: .7rem !important;
}
.share-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-action-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* === FOOTER === */
.site-footer {
  background: var(--c-brand);
  color: rgba(255,255,255,.75);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo-text { font-size: 1.25rem; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.7; max-width: 260px; }
.footer-col-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.45);
  margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a {
  font-size: .85rem;
  transition: color .18s;
}
.footer-links a:hover { color: var(--c-white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
}

/* === LOADING STATES === */
.skeleton {
  background: linear-gradient(90deg, #e8ecf0 25%, #f0f4f8 50%, #e8ecf0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{ background-position: 200% 0} 100%{ background-position: -200% 0} }
.skeleton-card {
  background: var(--c-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  overflow: hidden;
  height: 200px;
}
.skeleton-card .sk-img { height: 120px; }
.skeleton-card .sk-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.skeleton-card .sk-line { height: 12px; border-radius: 3px; }
.skeleton-card .sk-line:last-child { width: 60%; }

/* === PAGE HEADER (category/message pages) === */
.page-header {
  background: var(--c-brand);
  padding: 2.5rem 0;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 40%; height: 100%;
  background: linear-gradient(to left, rgba(29,95,166,.15), transparent);
}
.page-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.page-header-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
}
.page-header-icon svg { width: 28px; height: 28px; }
.page-header-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.2;
}
.page-header-sub {
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  margin-top: .3rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  margin-bottom: .5rem;
  flex-wrap: wrap;
}
.breadcrumb-nav a { color: rgba(255,255,255,.55); transition: color .18s; }
.breadcrumb-nav a:hover { color: rgba(255,255,255,.85); }
.breadcrumb-nav .sep { color: rgba(255,255,255,.3); }
.breadcrumb-nav .current { color: rgba(255,255,255,.88); font-weight: 500; }

/* === MESSAGE DETAIL PAGE === */
.msg-detail-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
  padding: 3rem 0;
}
.msg-detail-card {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.msg-detail-img {
  width: 100%;
  background: var(--c-brand-light);
}
.msg-detail-img img { width: 100%; display: block; }
.msg-detail-body { padding: 2rem 2.25rem; }
.msg-detail-category {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-brand-mid);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .4rem;
}
.msg-detail-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--c-text);
  white-space: pre-wrap;
  margin-bottom: 2rem;
  border-left: 3px solid var(--c-accent);
  padding-left: 1.5rem;
}
.msg-detail-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

.sidebar-widget {
  background: var(--c-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}
.widget-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-text-muted);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--c-border);
}

/* === BACK TO TOP === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: var(--c-brand);
  color: var(--c-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 99;
}
.back-to-top.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
.back-to-top:hover { background: var(--c-brand-mid); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; }
  .hero-featured { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-main { grid-row: auto; }
}
@media (max-width: 768px) {
  /* Logo centrado (1.ª linha) + fila de categorias */
  :root { --header-h: 120px; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.9rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .msg-detail-wrap { grid-template-columns: 1fr; }
  .cta-banner { padding: 2rem; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; gap: .75rem; text-align: center; }
  .header-search { display: none; }

  /* Linha 1: logo sozinha. Linha 2: categorias em toda a largura (logo já não “esmaga” o menu). */
  .header-inner {
    flex-wrap: wrap;
    align-items: stretch;
    height: auto;
    min-height: 0;
    row-gap: 0;
  }
  .site-logo {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 50px;
    padding: 0.5rem 0;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
  }
  .site-logo .logo-text {
    text-align: center;
  }
  .site-logo .logo-text span {
    text-align: center;
  }
  .header-nav-outer {
    flex: 1 1 100%;
    width: 100%;
  }
  .header-nav-row {
    width: 100%;
    min-height: 56px;
    box-sizing: border-box;
  }
  .header-nav-outer .header-nav {
    padding: 0.15rem 0 0.35rem;
    height: auto;
    min-height: 56px;
  }

  /* Grelha 5 colunas: células flexíveis; ícone um pouco maior ao toque */
  .header-nav-outer .nav-cat-item {
    min-width: 0;
    max-width: none;
    padding: 0.32rem 0.12rem;
  }
  .header-nav-outer .nav-cat-icon {
    width: 38px;
    height: 38px;
  }

  /* Lista de categorias (página dedicada): blocos em grelha 2 colunas, texto em várias linhas */
  .cats-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
  }
  .cats-index-grid .cat-card {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.1rem 0.65rem;
    min-height: 7.25rem;
    gap: 0.55rem;
  }
  .cats-index-grid .cat-card:hover {
    transform: none;
  }
  .cats-index-grid .cat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
  }
  .cats-index-grid .cat-card-icon svg {
    width: 28px;
    height: 28px;
  }
  .cats-index-grid .cat-card-info {
    flex: none;
    width: 100%;
  }
  .cats-index-grid .cat-card-name {
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    font-size: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .cats-index-grid .cat-card-arrow {
    display: none;
  }
}

/* ≤1024px: landscape (telefone), tablets — setas visíveis e scroll (o breakpoint 768 deixa isso de fora) */
@media (max-width: 1024px) {
  .header-nav-expand-bar { display: none !important; }
  .header-categories-flyout { display: none !important; }

  .header-nav-row .header-nav-middle {
    min-width: 0 !important;
    overflow: hidden;
  }
  .header-nav-clip {
    overflow: hidden !important;
    height: auto !important;
    max-height: none !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
  }
  .header-nav-clip .header-nav > a:nth-child(n+6),
  .header-nav-clip .header-nav > .nav-cat-item:nth-child(n+6) {
    display: flex !important;
  }

  .header-nav-outer .header-nav-middle > .header-nav-clip > .header-nav {
    max-height: none !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    width: 100% !important;
  }
  .header-nav {
    display: flex !important;
    flex-direction: row !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0 !important;
    width: 100%;
    max-width: 100%;
    touch-action: pan-x;
  }
  .header-nav .nav-cat-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 72px;
    max-width: 90px;
  }

  .header-nav-btn.header-nav-btn--prev,
  .header-nav-btn.header-nav-btn--next {
    display: flex !important;
    position: relative;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    min-height: 48px;
    height: auto;
    align-self: stretch;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,0.2);
  }
  .header-nav-btn--prev:hover,
  .header-nav-btn--next:hover { background: rgba(255,255,255,0.2); }
  .header-nav-btn-icon { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
  .section { padding: 2.5rem 0; }

  /* Uma coluna: cartão tipo lista (ícone + texto em linha com respiro) */
  .cats-index-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
  .cats-index-grid .cat-card {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-height: auto;
    padding: 1rem 1.15rem;
    gap: 1rem;
  }
  .cats-index-grid .cat-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  .cats-index-grid .cat-card-info {
    flex: 1;
    min-width: 0;
    text-align: left;
  }
  .cats-index-grid .cat-card-name {
    -webkit-line-clamp: 2;
    font-size: 0.88rem;
  }
  .cats-index-grid .cat-card-arrow {
    display: flex;
  }
}
