/* Rota Front — frontendbr.digital | palette: tech-blue-gray | archetype: data-light-newsroom */
:root {
  --rf-bg: #f3f5f7;
  --rf-surface: #ffffff;
  --rf-text: #1c2430;
  --rf-text-muted: #5c6b7a;
  --rf-accent: #2a5f9e;
  --rf-accent-hover: #1e4a7c;
  --rf-accent-soft: #e4ecf4;
  --rf-border: #cdd6e0;
  --rf-tag: #4a6278;
  --rf-footer-bg: #1a2433;
  --rf-footer-text: #c8d2dc;

  --rf-space-xs: 8px;
  --rf-space-sm: 16px;
  --rf-space-md: 24px;
  --rf-space-lg: 32px;
  --rf-space-xl: 48px;

  --rf-radius-sm: 4px;
  --rf-radius-md: 6px;
  --rf-radius-lg: 8px;

  --rf-container: 960px;
  --rf-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --rf-line: 1.65;
  --rf-transition: 0.2s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--rf-font);
  font-size: 1rem;
  line-height: var(--rf-line);
  color: var(--rf-text);
  background: var(--rf-bg);
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--rf-accent);
  text-decoration: none;
  transition: color var(--rf-transition);
}

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

.container {
  width: 100%;
  max-width: var(--rf-container);
  margin: 0 auto;
  padding: 0 var(--rf-space-sm);
}

/* Header */
.site-header {
  background: var(--rf-surface);
  border-bottom: 1px solid var(--rf-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rf-text);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--rf-accent);
}

.logo:hover {
  color: var(--rf-text);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-sm);
  padding: var(--rf-space-xs);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--rf-text);
  transition: transform var(--rf-transition), opacity var(--rf-transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
  display: none;
}

.site-nav.is-open {
  display: block;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--rf-surface);
  padding: var(--rf-space-md);
  overflow-y: auto;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--rf-space-xs);
}

.site-nav a {
  display: block;
  padding: var(--rf-space-sm);
  color: var(--rf-text);
  font-weight: 500;
  border-radius: var(--rf-radius-sm);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--rf-accent-soft);
  color: var(--rf-accent);
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    padding: 0;
    background: transparent;
    overflow: visible;
  }

  .site-nav ul {
    flex-direction: row;
    gap: var(--rf-space-xs);
  }

  .site-nav a {
    padding: var(--rf-space-xs) var(--rf-space-sm);
    font-size: 0.9375rem;
  }
}

/* Hero — text-only lead */
.hero-lead {
  padding: var(--rf-space-xl) 0 var(--rf-space-lg);
}

.hero-lead .tag {
  margin-bottom: var(--rf-space-sm);
}

.hero-lead h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 var(--rf-space-sm);
  letter-spacing: -0.03em;
}

.hero-lead .lead-meta {
  color: var(--rf-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--rf-space-md);
}

.hero-lead .lead-excerpt {
  font-size: 1.125rem;
  color: var(--rf-text-muted);
  max-width: 42rem;
  margin: 0 0 var(--rf-space-md);
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rf-tag);
  background: var(--rf-accent-soft);
  padding: 4px var(--rf-space-xs);
  border-radius: var(--rf-radius-sm);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--rf-space-xs) var(--rf-space-md);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--rf-radius-md);
  cursor: pointer;
  transition: background var(--rf-transition), color var(--rf-transition), border-color var(--rf-transition);
  border: 1px solid transparent;
}

.btn-ghost {
  background: transparent;
  color: var(--rf-accent);
  border-color: var(--rf-border);
}

.btn-ghost:hover {
  background: var(--rf-accent-soft);
  color: var(--rf-accent-hover);
  border-color: var(--rf-accent);
}

/* Homepage layout */
.home-layout {
  padding-bottom: var(--rf-space-xl);
}

.section-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 var(--rf-space-md);
  padding-bottom: var(--rf-space-xs);
  border-bottom: 2px solid var(--rf-accent);
  display: inline-block;
}

/* Numbered article list */
.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: article-counter;
}

.article-list li {
  counter-increment: article-counter;
  border-bottom: 1px solid var(--rf-border);
  padding: var(--rf-space-md) 0;
}

.article-list li:first-child {
  padding-top: 0;
}

.article-list a.item-link {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--rf-space-sm);
  align-items: start;
  color: inherit;
}

.article-list a.item-link:hover h3 {
  color: var(--rf-accent);
}

.article-list .item-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rf-accent);
  line-height: 1;
  padding-top: 4px;
}

.article-list .item-num::before {
  content: counter(article-counter, decimal-leading-zero);
}

.article-list h3 {
  margin: 0 0 var(--rf-space-xs);
  font-size: 1.0625rem;
  transition: color var(--rf-transition);
}

.article-list .item-meta {
  font-size: 0.8125rem;
  color: var(--rf-text-muted);
}

.article-list .item-excerpt {
  font-size: 0.9375rem;
  color: var(--rf-text-muted);
  margin: var(--rf-space-xs) 0 0;
}

/* Cards — flat */
.card {
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-md);
}

.card-flat {
  box-shadow: none;
}

/* Images — rounded corners */
.img-rounded {
  border-radius: var(--rf-radius-lg);
  overflow: hidden;
}

.thumb-wrap {
  margin-top: var(--rf-space-sm);
}

.thumb-wrap img,
.thumb-wrap svg {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--rf-radius-lg);
}

/* Article split layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--rf-space-lg);
  padding: var(--rf-space-lg) 0 var(--rf-space-xl);
}

.article-main h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.125rem);
  line-height: 1.25;
  margin: 0 0 var(--rf-space-sm);
  letter-spacing: -0.02em;
}

.article-meta {
  color: var(--rf-text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--rf-space-md);
}

.article-body h2 {
  font-size: 1.25rem;
  margin: var(--rf-space-lg) 0 var(--rf-space-sm);
}

.article-body h3 {
  font-size: 1.0625rem;
  margin: var(--rf-space-md) 0 var(--rf-space-xs);
}

.article-body p {
  margin: 0 0 var(--rf-space-sm);
}

.article-body ul,
.article-body ol {
  margin: 0 0 var(--rf-space-sm);
  padding-left: var(--rf-space-md);
}

.article-body blockquote {
  margin: var(--rf-space-md) 0;
  padding: var(--rf-space-sm) var(--rf-space-md);
  border-left: 3px solid var(--rf-accent);
  background: var(--rf-accent-soft);
  color: var(--rf-text-muted);
  border-radius: 0 var(--rf-radius-md) var(--rf-radius-md) 0;
}

/* Sidebar — author widget only */
.article-rail {
  order: -1;
}

.author-bio-box {
  background: var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-lg);
  padding: var(--rf-space-md);
}

.author-bio-box h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rf-text-muted);
  margin: 0 0 var(--rf-space-sm);
}

.author-bio-box .author-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--rf-radius-lg);
  margin-bottom: var(--rf-space-sm);
}

.author-bio-box .author-name {
  font-weight: 600;
  margin: 0 0 4px;
}

.author-bio-box .author-role {
  font-size: 0.8125rem;
  color: var(--rf-accent);
  margin: 0 0 var(--rf-space-sm);
}

.author-bio-box p {
  font-size: 0.875rem;
  color: var(--rf-text-muted);
  margin: 0;
}

@media (min-width: 768px) {
  .article-layout {
    grid-template-columns: 1fr 280px;
  }

  .article-rail {
    order: 1;
  }
}

/* Related articles */
.related-articles {
  margin-top: var(--rf-space-lg);
  padding-top: var(--rf-space-md);
  border-top: 1px solid var(--rf-border);
}

.related-articles h2 {
  font-size: 1rem;
  margin: 0 0 var(--rf-space-sm);
}

.related-articles ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-articles li {
  padding: var(--rf-space-xs) 0;
  border-bottom: 1px solid var(--rf-border);
  font-size: 0.9375rem;
}

/* Page content */
.page-content {
  padding: var(--rf-space-lg) 0 var(--rf-space-xl);
}

.page-content h1 {
  font-size: 1.75rem;
  margin: 0 0 var(--rf-space-md);
}

.page-content h2 {
  font-size: 1.125rem;
  margin: var(--rf-space-lg) 0 var(--rf-space-sm);
}

.page-content p,
.page-content li {
  margin-bottom: var(--rf-space-sm);
}

/* Articles index */
.articles-grid {
  display: grid;
  gap: var(--rf-space-md);
}

.article-card {
  display: grid;
  gap: var(--rf-space-sm);
}

@media (min-width: 600px) {
  .article-card {
    grid-template-columns: 200px 1fr;
    align-items: start;
  }
}

.article-card h2 {
  font-size: 1.125rem;
  margin: 0 0 var(--rf-space-xs);
}

.article-card h2 a {
  color: inherit;
}

.article-card h2 a:hover {
  color: var(--rf-accent);
}

/* Contact form */
.contact-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 0.9375rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: var(--rf-space-xs) var(--rf-space-sm);
  border: 1px solid var(--rf-border);
  border-radius: var(--rf-radius-md);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: var(--rf-space-sm);
  background: var(--rf-surface);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* Footer — stacked links */
.site-footer {
  background: var(--rf-footer-bg);
  color: var(--rf-footer-text);
  padding: var(--rf-space-lg) 0 var(--rf-space-md);
  margin-top: auto;
}

.footer-stack {
  display: flex;
  flex-direction: column;
  gap: var(--rf-space-md);
}

.footer-brand {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.footer-brand span {
  color: #7eb3e8;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--rf-space-xs);
}

.footer-links a {
  color: var(--rf-footer-text);
  font-size: 0.9375rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-meta {
  font-size: 0.8125rem;
  color: #8a9aab;
  margin-top: var(--rf-space-sm);
}

/* Cookie — inline footer note */
.cookie-note {
  background: var(--rf-accent-soft);
  border-top: 1px solid var(--rf-border);
  padding: var(--rf-space-sm) 0;
  font-size: 0.8125rem;
  color: var(--rf-text-muted);
}

.cookie-note .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--rf-space-sm);
}

.cookie-note p {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.cookie-note .btn-ghost {
  font-size: 0.8125rem;
  padding: 6px var(--rf-space-sm);
}

.cookie-note.is-hidden {
  display: none;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-muted {
  color: var(--rf-text-muted);
}
