/* ================================================================
   LITORAL BOLADÃO — CSS Principal
   Branding retrô-surf: cores tropicais, tipografia marcante
   Feed temático completo com detalhe de notícia e abas de versão
   ================================================================ */

:root {
  /* ── Paleta Retrô-Surf ── */
  --color-sun: #f7b32b; /* sol tropical quente */
  --color-sunset: #f4845f; /* pôr-do-sol laranja */
  --color-sand: #e8d5b0; /* areia da Meia Praia */
  --color-ocean: #17876d; /* verde-água tropical */
  --color-deep-ocean: #094545; /* fundo do mar */
  --color-coral: #e85d5d; /* coral vibrante */
  --color-coral-dark: #c0392b; /* coral profundo */
  --color-foam: #faf8f2; /* espuma do mar */
  --color-ink: #1a1a2e; /* tinta */
  --color-ink-light: #52527a; /* tinta suave */
  --color-white: #ffffff;
  --color-mustard: #d49a1a; /* mostarda retrô 70s */

  /* ── Tipografia ── */
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;

  /* ── Espaçamento ── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* ── Bordas ── */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--color-foam);
  color: var(--color-ink);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-ocean);
  text-decoration: none;
}
a:hover {
  color: var(--color-deep-ocean);
  text-decoration: underline;
}

/* ── Waves Background ── */
body {
  background:
    radial-gradient(
      ellipse at 20% 0%,
      rgba(23, 118, 109, 0.05) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 80% 100%,
      rgba(244, 132, 95, 0.06) 0%,
      transparent 60%
    ),
    var(--color-foam);
}

/* ── Container ── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  background: linear-gradient(
    170deg,
    #063535 0%,
    var(--color-deep-ocean) 25%,
    var(--color-ocean) 60%,
    #1ea896 100%
  );
  color: white;
  padding: var(--space-xl) 0 var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Bottom stripe */
.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-sun) 0px,
    var(--color-sun) 20px,
    var(--color-coral) 20px,
    var(--color-coral) 34px,
    var(--color-white) 34px,
    var(--color-white) 42px
  );
  z-index: 2;
}

/* Waves overlay */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 15% 80%,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 85% 70%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 50% 90%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 40%
    );
  z-index: 0;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

/* ── Bodinho Mascot ── */
.bodinho {
  flex-shrink: 0;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.2));
  animation: bodinho-float 3s ease-in-out infinite;
}

@keyframes bodinho-float {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-6px) rotate(2deg);
  }
}

.bodinho svg {
  display: block;
  width: 90px;
  height: 90px;
}

@media (max-width: 500px) {
  .bodinho svg {
    width: 64px;
    height: 64px;
  }
  .header-inner {
    gap: var(--space-md);
  }
}

/* ── Brand Block ── */
.brand-block {
  text-align: left;
}

.brand-block .logo-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
  line-height: 1;
  margin: 0;
  color: white;
}

.brand-block .logo-title .accent {
  color: var(--color-sun);
}

.brand-block .tagline {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.85;
  margin-top: var(--space-xs);
  letter-spacing: 0.3px;
}

.brand-block .tagline .emoji-sparkle {
  display: inline-block;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.2) rotate(15deg);
  }
}

/* ── Back button ── */
.header-inner .back-link-wrap {
  width: 100%;
  text-align: left;
  margin-bottom: var(--space-sm);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  cursor: pointer;
}
.back-link:hover {
  opacity: 1;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════════
   NEWS LIST
   ═══════════════════════════════════════════════════════════════ */
.news-list {
  padding: var(--space-2xl) 0;
}

.news-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--color-coral);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  border-left-color: var(--color-sun);
}

.news-card:focus-visible {
  outline: 3px solid var(--color-ocean);
  outline-offset: 2px;
}

/* Card accent line */
.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(
    135deg,
    transparent 50%,
    rgba(23, 118, 109, 0.05) 50%
  );
  border-radius: 0 0 0 60px;
}

.news-card .news-date {
  font-size: 0.82rem;
  color: var(--color-ink-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-card .news-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--color-ink);
  margin: var(--space-sm) 0;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.news-card .news-excerpt {
  color: var(--color-ink-light);
  font-size: 0.95rem;
  margin-top: var(--space-sm);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card .news-link-hint {
  display: inline-block;
  margin-top: var(--space-md);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-ocean);
}

/* ═══════════════════════════════════════════════════════════════
   NEWS DETAIL
   ═══════════════════════════════════════════════════════════════ */
.news-detail {
  padding: var(--space-2xl) 0;
}

.news-detail .meta-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px dashed var(--color-sand);
}

.news-detail .meta-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-detail .meta-source {
  font-size: 0.8rem;
  color: var(--color-ocean);
  font-weight: 500;
}

.news-detail .detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  color: var(--color-ink);
  letter-spacing: 1px;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
}

/* ── Version Tabs ── */
.version-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.version-tab {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  background: var(--color-white);
  border: none;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  color: var(--color-ink-light);
  position: relative;
  text-align: center;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.version-tab:not(:last-child) {
  border-right: 1px solid var(--color-sand);
}

.version-tab:hover {
  background: #f0f0f0;
  color: var(--color-ink);
}

.version-tab.active {
  background: var(--color-deep-ocean);
  color: white;
  box-shadow: inset 0 -3px 0 var(--color-sun);
}

.version-tab:focus-visible {
  outline: 2px solid var(--color-coral);
  outline-offset: -2px;
  z-index: 1;
}

.version-tab .tab-label {
  display: block;
}

.version-tab .tab-icon {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

/* ── Article Content ── */
.article-body {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.article-body p {
  margin-bottom: var(--space-md);
}

/* ── Detail loading ── */
.detail-loading {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--color-ink-light);
}

.detail-loading .loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-sand);
  border-top-color: var(--color-ocean);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-ink-light);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: var(--space-sm);
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════
   RETRO DECORATIVE ELEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Wave Divider ── */
.wave-divider {
  height: 32px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      var(--color-sand) 4px,
      var(--color-sand) 8px
    ),
    linear-gradient(180deg, var(--color-sun) 0%, var(--color-sunset) 100%);
  position: relative;
  overflow: hidden;
}

.wave-divider::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 16px;
  background:
    radial-gradient(ellipse at 0% 100%, var(--color-foam) 70%, transparent 71%),
    radial-gradient(
      ellipse at 14% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 28% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 42% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 56% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 70% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 84% 100%,
      var(--color-foam) 70%,
      transparent 71%
    ),
    radial-gradient(
      ellipse at 100% 100%,
      var(--color-foam) 70%,
      transparent 71%
    );
  background-size: 14.28% 100%;
  background-repeat: no-repeat;
}

/* ── Palm Silhouette (pseudo-element on container) ── */
.palm-decor::before {
  content: "";
  position: fixed;
  bottom: 0;
  right: max(-40px, -5vw);
  width: clamp(80px, 15vw, 140px);
  height: clamp(120px, 25vh, 200px);
  background:
    /* trunk */
    linear-gradient(
      75deg,
      transparent 45%,
      rgba(148, 118, 78, 0.08) 45%,
      rgba(148, 118, 78, 0.08) 55%,
      transparent 55%
    ),
    /* fronds */
    radial-gradient(
        ellipse at 30% 10%,
        rgba(148, 118, 78, 0.06) 0%,
        transparent 60%
      ),
    radial-gradient(
      ellipse at 70% 25%,
      rgba(148, 118, 78, 0.07) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 40% 35%,
      rgba(148, 118, 78, 0.05) 0%,
      transparent 40%
    );
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

@media (max-width: 600px) {
  .palm-decor::before {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--color-ink-light);
  font-size: 0.82rem;
  border-top: 2px solid var(--color-sand);
  margin-top: var(--space-xl);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .site-header {
    padding: var(--space-lg) 0 var(--space-lg);
  }
  .brand-block .logo-title {
    font-size: 1.7rem;
    letter-spacing: 1px;
  }
  .brand-block .tagline {
    font-size: 0.8rem;
  }

  .news-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  .news-card .news-title {
    font-size: 1.2rem;
  }

  .news-detail .detail-title {
    font-size: 1.4rem;
  }

  .version-tabs {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }
  .version-tab {
    border-right: none !important;
    border-bottom: 1px solid var(--color-sand);
    font-size: 0.9rem;
    min-height: 44px;
  }

  .article-body {
    padding: var(--space-md);
    font-size: 1rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
