/* ===========================
   Tokens de design
   =========================== */
:root {
  --color-bg: #f4f1ec;
  --color-bg-alt: #ffffff;
  --color-surface: #ffffff;
  --color-text: #1f2328;
  --color-text-muted: #6b7280;
  --color-border: #e7e3dc;

  --color-accent: #d64541;       /* 朱色 - vermelho japonês */
  --color-accent-strong: #b8322f;
  --color-accent-soft: #fce8e7;
  --color-ink: #1a1d24;          /* fundo escuro (sumi) */

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(26, 29, 36, 0.06);
  --shadow-md: 0 6px 20px rgba(26, 29, 36, 0.08);
  --shadow-lg: 0 16px 40px rgba(26, 29, 36, 0.12);

  --maxw: 1200px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --font-base: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Segoe UI", system-ui, sans-serif;
}

/* Tema escuro: automático (sistema) quando não há escolha manual,
   ou forçado via data-theme="dark". O toggle define data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #14161a;
    --color-bg-alt: #1c1f25;
    --color-surface: #1c1f25;
    --color-text: #eceef2;
    --color-text-muted: #9aa1ad;
    --color-border: #2a2e36;
    --color-accent-soft: #2a1c1c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  --color-bg: #14161a;
  --color-bg-alt: #1c1f25;
  --color-surface: #1c1f25;
  --color-text: #eceef2;
  --color-text-muted: #9aa1ad;
  --color-border: #2a2e36;
  --color-accent-soft: #2a1c1c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ===========================
   Reset
   =========================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ===========================
   Cabeçalho
   =========================== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-ink) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  color: #fff;
  border-bottom: 3px solid var(--color-accent);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    var(--color-accent) 0 40%,
    transparent 42%
  );
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.brand .tagline {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ===========================
   Barra de status de atualização
   =========================== */
.update-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.update-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.18);
  flex-shrink: 0;
}

.update-bar strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Botão de troca de tema (no header) */
.theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08);
}

/* ===========================
   Câmbio (為替)
   =========================== */
.rate-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--color-border);
}

.rate-row:last-child {
  border-bottom: none;
}

.rate-cur {
  font-weight: 600;
  font-size: 0.92rem;
}

.rate-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--color-accent);
}

/* ===========================
   Terremoto (地震)
   =========================== */
.quake-card {
  background: linear-gradient(145deg, #3a2418, #241a14);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.quake-scale {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffb74d;
}

.quake-place {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 4px 0;
}

.quake-time {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
}

.quake-empty {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ===========================
   Hero (boas-vindas)
   =========================== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1d24 0%, #2a1416 55%, #b8322f 140%);
  color: #fff;
}

/* Padrão japonês 青海波 (seigaiha) sutil sobreposto */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2'%3E%3Cpath d='M0 40c0-22 18-40 40-40s40 18 40 40'/%3E%3Cpath d='M-20 40c0-22 18-40 40-40s40 18 40 40'/%3E%3Cpath d='M20 40c0-22 18-40 40-40s40 18 40 40'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 40px;
  opacity: 0.9;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px;
}

.hero-greeting {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-date {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
}

.hero-date #hero-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #fff;
}

/* ===========================
   ⚽ ワールドカップ 日本代表応援バナー
   =========================== */
.worldcup {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 28px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  /* サムライブルー × 朱色: azul do Japão com acento vermelho */
  background: linear-gradient(135deg, #0a1f5c 0%, #16235f 50%, #b8322f 165%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* Padrão japonês 青海波 (seigaiha), igual ao hero */
.worldcup::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='2'%3E%3Cpath d='M0 40c0-22 18-40 40-40s40 18 40 40'/%3E%3Cpath d='M-20 40c0-22 18-40 40-40s40 18 40 40'/%3E%3Cpath d='M20 40c0-22 18-40 40-40s40 18 40 40'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 80px 40px;
  pointer-events: none;
}

.worldcup-inner {
  position: relative;
  z-index: 1;
}

.worldcup-tag {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffd34d;
  margin-bottom: 6px;
}

.worldcup-title {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 10px;
  color: #fff;
  border: none;
  padding: 0;
}

.worldcup-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
  max-width: 720px;
}

.worldcup-text strong {
  color: #fff;
}

.worldcup .button {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.worldcup .button:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ===========================
   Container
   =========================== */
.container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 8px 24px 48px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.section {
  background-color: var(--color-surface);
  margin-bottom: 24px;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.section h1,
.section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h1::before,
.section h2::before {
  content: "";
  width: 5px;
  height: 1.1em;
  background: linear-gradient(
    var(--color-accent),
    var(--color-accent-strong)
  );
  border-radius: 3px;
}

/* Texto introdutório das páginas de categoria */
.cat-intro {
  margin: -6px 0 20px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Marca clicável (volta para a home) */
.brand-link {
  text-decoration: none;
  color: inherit;
}

/* Link da categoria ativa na navegação */
nav a.is-active {
  background-color: var(--color-accent);
  color: #fff;
}

/* ===========================
   Blog — cantinho de últimas publicações
   =========================== */
.latest-posts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.latest-post {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: var(--transition);
}

.latest-post:hover {
  background-color: var(--color-bg);
}

.latest-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.latest-post-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ===========================
   Blog — artigo (post individual)
   =========================== */
.post-back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.post-back:hover {
  text-decoration: underline;
}

.post-title {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
}

.post-meta {
  display: flex;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 18px;
}

.post-cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.post-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--color-text);
}

.post-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 28px 0 12px;
}

.post-content p {
  margin-bottom: 16px;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

.post-tag {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ===========================
   Admin (painel de publicação)
   =========================== */
.container--narrow {
  display: block;
  max-width: 820px;
}

.button--primary {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.button--primary:hover {
  background-color: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  color: #fff;
}

.button--danger {
  color: var(--color-accent);
  border-color: var(--color-border);
}

.button--danger:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.post-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.field textarea {
  resize: vertical;
}

.cover-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.form-status {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.form-error {
  color: var(--color-accent);
  font-size: 0.88rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background-color: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.post-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-row-info a {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.post-row-info a:hover {
  color: var(--color-accent);
}

.post-row-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.post-row-actions {
  display: flex;
  gap: 8px;
}

/* ===========================
   Botões (links)
   =========================== */
.button-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text);
  text-decoration: none;
  padding: 9px 16px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.9rem;
}

.button-ico {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
  flex-shrink: 0;
}

.button:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===========================
   Notícias
   =========================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.news-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.news-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
}

.news-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #d64541 0%, #b8322f 100%);
  overflow: hidden;
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.news-item:hover .news-thumb img {
  transform: scale(1.06);
}

.news-thumb .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.85);
}

.news-item-content {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.news-item h3 {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.news-item h3 a {
  text-decoration: none;
  color: var(--color-text);
  transition: color var(--transition);
}

.news-item h3 a:hover {
  color: var(--color-accent);
}

.news-item p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-meta .source {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* Manchete em destaque (primeira notícia) */
.news-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.news-featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-accent) 40%, var(--color-border));
}

.news-featured .news-thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 220px;
}

.news-featured .news-item-content {
  padding: 24px;
  justify-content: center;
}

.news-featured .badge {
  align-self: flex-start;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.news-featured h3 {
  font-size: 1.35rem;
  line-height: 1.35;
}

.news-featured p {
  -webkit-line-clamp: 4;
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .news-featured {
    grid-template-columns: 1fr;
  }
  .news-featured .news-thumb {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }
}

/* Skeleton de carregamento */
.skeleton {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.skeleton .sk-thumb {
  aspect-ratio: 16 / 9;
}

.skeleton .sk-line {
  height: 12px;
  margin: 10px 14px;
  border-radius: 6px;
}

.skeleton .sk-thumb,
.skeleton .sk-line {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    color-mix(in srgb, var(--color-border) 50%, transparent) 50%,
    var(--color-border) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.empty-state {
  color: var(--color-text-muted);
  padding: 24px;
  text-align: center;
}

/* ===========================
   Barra lateral / clima
   =========================== */
.sidebar .section {
  margin-bottom: 24px;
}

#city-selector {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  margin-bottom: 16px;
  cursor: pointer;
}

#city-selector:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.weather-card {
  background: linear-gradient(145deg, #2c5364 0%, #203a43 60%, #0f2027 100%);
  border-radius: var(--radius-md);
  padding: 24px;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.weather-item h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.85);
}

.weather-item img {
  margin: 0 auto;
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.weather-item .temperature {
  font-size: 2.4rem;
  font-weight: 800;
  margin: 4px 0;
}

.weather-item .temperature span {
  font-size: inherit;
}

.weather-item .weather-desc {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.weather-item .windspeed,
.weather-item .local-time {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.weather-stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ===========================
   Anúncios (leves, laterais, não-invasivos)
   =========================== */
.ad-slot {
  background-color: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 24px;
  text-align: center;
  /* Reserva espaço para evitar deslocamento de layout (CLS) ao carregar */
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-label {
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  align-self: flex-start;
}

.ad-slot .adsbygoogle {
  flex: 1;
  min-height: 0;
}

/* Anúncio que acompanha levemente a rolagem na lateral */
.ad-slot--sticky {
  position: sticky;
  top: 96px; /* abaixo do header fixo */
}

/* Em telas estreitas o sidebar vira coluna única — nada de sticky/altura grande */
@media (max-width: 900px) {
  .ad-slot--sticky {
    position: static;
  }
  .ad-slot {
    min-height: 120px;
  }
}

/* ===========================
   Botão "voltar ao topo"
   =========================== */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--color-accent-strong);
  transform: translateY(-2px);
}

/* ===========================
   Banner de consentimento de cookies
   =========================== */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1000;
  width: min(720px, calc(100% - 32px));
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: cookie-in 0.4s ease;
}

.cookie-banner[hidden] {
  display: none;
}

@keyframes cookie-in {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.cookie-text a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: var(--transition);
  white-space: nowrap;
}

.cookie-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}

.cookie-btn--ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.cookie-btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.cookie-btn--primary:hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

@media (max-width: 560px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-actions {
    justify-content: flex-end;
  }
}

/* ===========================
   Páginas de conteúdo (legal / artigo)
   =========================== */
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.legal-page h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.legal-page .updated {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 36px 0 12px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-page h2::before {
  content: "";
  width: 5px;
  height: 1em;
  background: linear-gradient(var(--color-accent), var(--color-accent-strong));
  border-radius: 3px;
  flex-shrink: 0;
}

.legal-page p,
.legal-page li {
  color: var(--color-text);
  margin-bottom: 12px;
}

.legal-page ul {
  padding-left: 1.4em;
}

.legal-page a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page a:hover {
  color: var(--color-accent-strong);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 40px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* ===========================
   Rodapé
   =========================== */
footer {
  background-color: var(--color-ink);
  color: rgba(255, 255, 255, 0.8);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 48px;
  max-width: var(--maxw);
  margin: 0 auto 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer-links-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 3px;
  letter-spacing: 0.02em;
}

.footer-links-group a {
  font-size: 0.82rem;
  opacity: 0.72;
}

.footer-links-group a:hover {
  opacity: 1;
}

footer p + p {
  margin-top: 8px;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--color-accent);
}

/* ===========================
   Responsivo
   =========================== */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  nav {
    width: 100%;
  }
  .brand h1 {
    font-size: 1.25rem;
  }
}
