/* ============================================
   Clima e Tempo — Pure CSS Design System
   Weather-inspired: sky blue / storm gray
   ============================================ */

:root {
  /* Primary palette */
  --sky-50: #f0f7ff;
  --sky-100: #e0efff;
  --sky-200: #b9ddff;
  --sky-300: #7cc4ff;
  --sky-400: #36a9ff;
  --sky-500: #0c8ce9;
  --sky-600: #006ec6;
  --sky-700: #0058a1;
  --sky-800: #024b85;
  --sky-900: #083f6e;
  --sky-950: #062849;

  /* Storm grays */
  --storm-50: #f6f7f9;
  --storm-100: #eceef2;
  --storm-200: #d5d9e2;
  --storm-300: #b1b9c9;
  --storm-400: #8694ab;
  --storm-500: #677791;
  --storm-600: #526078;
  --storm-700: #434e62;
  --storm-800: #3a4353;
  --storm-900: #333a47;
  --storm-950: #1e232d;

  /* Accents */
  --sun-400: #fbbf24;
  --sun-500: #f59e0b;
  --rain-400: #38bdf8;
  --alert-500: #ef4444;
  --success-500: #22c55e;

  /* Semantic */
  --bg: #ffffff;
  --bg-alt: var(--sky-50);
  --bg-card: #ffffff;
  --text: var(--storm-900);
  --text-secondary: var(--storm-600);
  --text-muted: var(--storm-500);
  --border: var(--storm-200);
  --primary: var(--sky-600);
  --primary-hover: var(--sky-700);
  --primary-light: var(--sky-100);
  --link: var(--sky-600);
  --link-hover: var(--sky-800);

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 0.2s ease;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --bg-alt: #1a2332;
    --bg-card: #1a2332;
    --text: #e8edf4;
    --text-secondary: var(--storm-300);
    --text-muted: var(--storm-400);
    --border: var(--storm-800);
    --primary: var(--sky-400);
    --primary-hover: var(--sky-300);
    --primary-light: rgba(54,169,255,0.1);
    --link: var(--sky-400);
    --link-hover: var(--sky-300);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  line-height: 1.3;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1em; }

/* ---- Container ---- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }
.content-width { max-width: var(--content-width); margin: 0 auto; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--primary); color: #fff;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---- Header / Nav ---- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.25rem; max-width: var(--max-width); margin: 0 auto;
}
.site-logo {
  font-size: 1.35rem; font-weight: 800; color: var(--primary);
  text-decoration: none; display: flex; align-items: center; gap: 0.5rem;
}
.site-logo:hover { color: var(--primary-hover); text-decoration: none; }
.site-logo .logo-icon { font-size: 1.5rem; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 0.5rem; min-width: 44px; min-height: 44px;
  color: var(--text); font-size: 1.5rem;
}
.nav-menu { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.nav-menu a {
  display: block; padding: 0.5rem 0.875rem; border-radius: var(--radius);
  color: var(--text-secondary); font-weight: 500; font-size: 0.925rem;
  text-decoration: none; min-height: 44px; display: flex; align-items: center;
  transition: all var(--transition);
}
.nav-menu a:hover, .nav-menu a[aria-current="page"] {
  background: var(--primary-light); color: var(--primary);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 0.5rem 1rem; gap: 0;
    box-shadow: var(--shadow-md);
  }
  .nav-menu.active { display: flex; }
  .nav-menu a { width: 100%; padding: 0.75rem 1rem; }
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  padding: 0.75rem 0; font-size: 0.875rem; color: var(--text-muted);
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.breadcrumbs li::after { content: "›"; margin-left: 0.5rem; color: var(--storm-400); }
.breadcrumbs li:last-child::after { display: none; }
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--primary); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--sky-600) 0%, var(--sky-800) 100%);
  color: #fff; padding: 3.5rem 0; text-align: center;
}
@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(135deg, var(--sky-900) 0%, var(--storm-950) 100%); }
}
.hero h1 { color: #fff; font-size: 2.5rem; margin-top: 0; margin-bottom: 0.5rem; }
.hero p { font-size: 1.15rem; opacity: 0.92; max-width: 640px; margin: 0 auto 2rem; }

.hero-stats {
  display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 2rem;
}
.hero-stat { text-align: center; }
.hero-stat .stat-number { font-size: 2rem; font-weight: 800; display: block; }
.hero-stat .stat-label { font-size: 0.85rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Cards Grid ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  transition: all var(--transition); display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { margin-top: 0; font-size: 1.15rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--primary); }
.card p { color: var(--text-secondary); font-size: 0.925rem; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.8rem; color: var(--text-muted); margin-top: 1rem;
  padding-top: 0.75rem; border-top: 1px solid var(--border);
}

/* ---- Section ---- */
.section { padding: 3rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.75rem; margin-bottom: 0.5rem; margin-top: 0;
  text-align: center;
}
.section-subtitle {
  color: var(--text-secondary); text-align: center;
  margin-bottom: 2rem; font-size: 1.05rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; border: none;
  transition: all var(--transition);
  min-height: 44px; min-width: 44px;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-white { background: rgba(255,255,255,0.15); color: #fff; border: 2px solid rgba(255,255,255,0.3); }
.btn-white:hover { background: #fff; color: var(--sky-700); text-decoration: none; }

/* ---- Article / Single ---- */
.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-header h1 { font-size: 2rem; margin-top: 0; }
.article-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: 0.875rem; margin-top: 0.75rem; }
.article-content { font-size: 1.05rem; line-height: 1.75; }
.article-content h2 { margin-top: 2.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.article-content h3 { margin-top: 2rem; }
.article-content ul, .article-content ol { margin: 1em 0; padding-left: 1.5em; }
.article-content li { margin-bottom: 0.5em; }
.article-content blockquote {
  border-left: 4px solid var(--primary); padding: 1rem 1.5rem;
  background: var(--bg-alt); margin: 1.5em 0; border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content code {
  background: var(--bg-alt); padding: 0.15em 0.4em;
  border-radius: 4px; font-size: 0.9em; font-family: var(--font-mono);
}
.article-content pre { background: var(--storm-950); color: #e8edf4; padding: 1.25rem; border-radius: var(--radius); overflow-x: auto; margin: 1.5em 0; }
.article-content pre code { background: none; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.article-content th, .article-content td { padding: 0.75rem 1rem; border: 1px solid var(--border); text-align: left; }
.article-content th { background: var(--bg-alt); font-weight: 600; }

/* ---- Glossary grid ---- */
.glossary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.glossary-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: all var(--transition);
}
.glossary-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.glossary-item h3 { margin-top: 0; font-size: 1rem; }
.glossary-item h3 a { color: var(--text); }
.glossary-item h3 a:hover { color: var(--primary); }
.glossary-item p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 0; }

/* ---- FAQ ---- */
.faq-list { max-width: var(--content-width); margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 0.75rem; overflow: hidden;
}
.faq-question {
  width: 100%; background: var(--bg-card); border: none;
  padding: 1.25rem 1.5rem; text-align: left;
  font-size: 1rem; font-weight: 600; color: var(--text);
  cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; min-height: 44px;
  font-family: var(--font-sans);
  transition: background var(--transition);
}
.faq-question:hover { background: var(--bg-alt); }
.faq-question::after { content: "+"; font-size: 1.25rem; color: var(--primary); font-weight: 700; transition: transform var(--transition); }
.faq-item.active .faq-question::after { content: "−"; }
.faq-answer { padding: 0 1.5rem 1.25rem; color: var(--text-secondary); line-height: 1.7; display: none; }
.faq-item.active .faq-answer { display: block; }

/* ---- Tags ---- */
.tag {
  display: inline-block; background: var(--primary-light); color: var(--primary);
  padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.8rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition);
}
a.tag:hover { background: var(--primary); color: #fff; text-decoration: none; }
.tags-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0; }
.pagination a, .pagination span {
  padding: 0.5rem 1rem; border-radius: var(--radius); border: 1px solid var(--border);
  font-weight: 500; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.pagination a:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Footer ---- */
.site-footer {
  background: var(--storm-950); color: var(--storm-300);
  padding: 3rem 0 1.5rem; margin-top: 3rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem; margin-bottom: 2rem;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-top: 0; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--storm-400); font-size: 0.9rem; }
.footer-col a:hover { color: #fff; }
.footer-col p { font-size: 0.9rem; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid var(--storm-800); padding-top: 1.5rem;
  text-align: center; font-size: 0.85rem; color: var(--storm-500);
}

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--sky-600), var(--sky-800));
  color: #fff; padding: 2.5rem; border-radius: var(--radius-lg);
  text-align: center; margin: 2rem 0;
}
@media (prefers-color-scheme: dark) {
  .cta-banner { background: linear-gradient(135deg, var(--sky-800), var(--storm-950)); border: 1px solid var(--sky-700); }
}
.cta-banner h2 { color: #fff; margin-top: 0; }
.cta-banner p { opacity: 0.92; margin-bottom: 1.5rem; }

/* ---- Weather icon decorations ---- */
.weather-emoji { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 0; }
  .hero-stats { gap: 1.5rem; }
  .section { padding: 2rem 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
