/* ============================================================
   ContrateServicos — style.css
   Suporta: LTR + RTL (árabe), dark mode, 11 idiomas
   ============================================================ */

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

:root {
  --accent:       #2d6a4f;
  --accent2:      #40916c;
  --accent-light: #d8f3dc;
  --bg:           #ffffff;
  --bg2:          #f8fafb;
  --bg3:          #f1f5f4;
  --text:         #1a1a1a;
  --text2:        #4a5568;
  --text3:        #94a3b8;
  --border:       #e2e8f0;
  --border2:      #cbd5e1;
  --radius:       8px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --shadow:       0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg:    0 4px 24px rgba(0,0,0,.10);
  --header-h:     64px;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-title:   'Lora', Georgia, serif;
  --transition:   .2s ease;
}

[data-theme="dark"] {
  --bg:     #0f0f0d;
  --bg2:    #1a1a18;
  --bg3:    #242422;
  --text:   #f0ede6;
  --text2:  #b0a99a;
  --text3:  #6b6860;
  --border: #2a2a28;
  --border2:#3a3a38;
  --accent-light: #1b3d2a;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

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

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--article {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.site-logo span { color: var(--accent); }
.site-logo:hover { text-decoration: none; }

.main-nav { flex: 1; overflow: hidden; }
.nav-links {
  list-style: none;
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block;
  padding: .45rem .75rem;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

.lang-select {
  padding: .3rem .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: .78rem;
  cursor: pointer;
  font-family: inherit;
}
.lang-select:focus { outline: none; border-color: var(--accent); }

.btn-menu { display: none; }

/* ── Mobile Menu ─────────────────────────────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: min(320px, 100vw);
  height: 100vh;
  background: var(--bg);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 200;
  flex-direction: column;
  padding: 1.25rem;
  overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.mobile-nav-links { list-style: none; }
.mobile-nav-links li a {
  display: block;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
  color: var(--text);
}

/* ── Reading progress ────────────────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 999;
  transition: width .1s linear;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text2);
  margin-bottom: 1.75rem;
}

/* ── Search ──────────────────────────────────────────────── */
.search-bar {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  border: 2px solid var(--border2);
  border-radius: 100px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.search-input {
  flex: 1;
  padding: .65rem 1.25rem;
  border: none;
  background: transparent;
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
}
.search-input:focus { outline: none; }
.search-btn {
  padding: .65rem 1.25rem;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: .9rem;
  transition: background var(--transition);
}
.search-btn:hover { background: var(--accent2); }

/* ── Categories bar ──────────────────────────────────────── */
.categories-bar { padding: 1rem 0 1.5rem; }
.categories-inner {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .25rem;
}
.categories-inner::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: .4rem 1rem;
  border-radius: 100px;
  border: 1.5px solid var(--border2);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  transition: all var(--transition);
  background: var(--bg);
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Cards Grid ──────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg3);
}
.card-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  aspect-ratio: 16/9;
}
.card:hover .card-img-wrap img { transform: scale(1.04); }

.card-cat-badge {
  position: absolute;
  top: .75rem; left: .75rem;
  padding: .2rem .65rem;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card-content { padding: 1.25rem; }
.card-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .6rem;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt {
  font-size: .85rem;
  color: var(--text2);
  margin-bottom: .85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text3);
  flex-wrap: wrap;
}
.card-author-img {
  border-radius: 50%;
  object-fit: cover;
}
.card-meta-sep::after { content: '·'; }

/* ── Ad banner/inline ────────────────────────────────────── */
.ad-banner {
  padding: .75rem 0;
  text-align: center;
}
.ad-inline, .vp-ad-inline {
  margin: 2rem 0;
  text-align: center;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding: 1.5rem 0 3rem;
  flex-wrap: wrap;
}
.page-btn {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text2);
  background: var(--bg);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Article ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text3);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text3); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb-sep { opacity: .5; }

.article-header { margin-bottom: 2rem; }
.article-cat {
  display: inline-block;
  padding: .3rem .9rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
  text-decoration: none;
}
.article-title {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.22;
  margin-bottom: 1.25rem;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
  color: var(--text3);
  flex-wrap: wrap;
}
.article-meta-author {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.article-meta-author img { border-radius: 50%; }

.article-hero-img {
  width: 100%;
  aspect-ratio: 1200/630;
  object-fit: cover;
  border-radius: var(--radius-xl);
  margin: 1.5rem 0 2rem;
}

/* ── Article body typography ─────────────────────────────── */
.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}
.article-body h2 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.5rem 0 .9rem;
  color: var(--text);
  line-height: 1.3;
}
.article-body h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 .75rem;
  color: var(--text);
}
.article-body p { margin-bottom: 1.4rem; }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.4rem;
}
.article-body li { margin-bottom: .5rem; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: .75rem 1.25rem;
  margin: 1.75rem 0;
  background: var(--bg2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text2);
}
.article-body strong { font-weight: 600; color: var(--text); }
.article-body a { color: var(--accent); text-decoration: underline; }
.article-body img {
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
  width: 100%;
}

/* ── Tags ────────────────────────────────────────────────── */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 2rem 0;
}
.tag {
  padding: .3rem .85rem;
  border-radius: 100px;
  border: 1.5px solid var(--border2);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── Share buttons ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  transition: opacity var(--transition);
}
.btn-primary:hover { opacity: .88; }

/* ── Related section ─────────────────────────────────────── */
.related-section {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 3rem;
}
.section-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 3rem 0 0;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2.5rem;
}
.footer-brand .footer-desc {
  font-size: .85rem;
  color: var(--text3);
  margin-top: .75rem;
  line-height: 1.6;
}
.footer-col-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a {
  font-size: .85rem;
  color: var(--text2);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copyright { font-size: .8rem; color: var(--text3); }
.footer-legal { display: flex; gap: 1.25rem; }
.footer-legal a { font-size: .8rem; color: var(--text3); }
.footer-legal a:hover { color: var(--accent); text-decoration: none; }

/* ── Cookie banner ───────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem; left: 1.25rem;
  max-width: 380px;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 9990;
  font-size: .85rem;
}
.cookie-banner p { color: var(--text2); margin-bottom: 1rem; }
.cookie-banner a { color: var(--accent); }
.cookie-actions { display: flex; gap: .75rem; }
.btn-cookie-accept {
  flex: 1;
  padding: .5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-cookie-decline {
  padding: .5rem 1rem;
  background: transparent;
  color: var(--text3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
}

/* ── Back to top ─────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 9980;
  display: flex; align-items: center; justify-content: center;
}
.back-to-top.show { opacity: 1; pointer-events: auto; }

/* ── Visually hidden ─────────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── RTL (árabe) ─────────────────────────────────────────── */
[dir="rtl"] .card-cat-badge { left: auto; right: .75rem; }
[dir="rtl"] .article-body blockquote { border-left: none; border-right: 4px solid var(--accent); border-radius: var(--radius) 0 0 var(--radius); }
[dir="rtl"] .article-body ul, [dir="rtl"] .article-body ol { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .cookie-banner { left: auto; right: 1.25rem; }
[dir="rtl"] .back-to-top { right: auto; left: 1.5rem; }
[dir="rtl"] .breadcrumb-sep { transform: scaleX(-1); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .card--featured { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .btn-menu { display: flex; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .lang-select { font-size: .72rem; }
  .container--article { padding: 1.25rem 1rem 3rem; }
}

/* ── Core Web Vitals & Performance Optimizations ──────── */

/* 1. Header sem layout shift */
.site-header { contain: layout style; will-change: auto; }

/* 2. Nav scroll suave */
.main-nav { min-width: 0; }
.nav-links { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 3. ANTI-CLS: reserva espaço para imagens com aspect-ratio fixo */
.card-img-wrap {
  aspect-ratio: 16/9;
  background: var(--bg3);
  min-height: 0;
}
.card--featured .card-img-wrap { aspect-ratio: 16/9; min-height: 200px; }

/* 4. Imagem hero reserva espaço 1200x630 */
.article-hero-img {
  aspect-ratio: 1200 / 630;
  width: 100%;
  background: var(--bg3);
}

/* 5. Cards: animação só após JS adicionar classe (não bloqueia LCP) */
.card-wrapper.js-ready { opacity: 0; transform: translateY(12px); transition: opacity .35s ease, transform .35s ease; }
.card-wrapper.card-visible { opacity: 1; transform: translateY(0); }
.card-wrapper:first-child { opacity: 1 !important; transform: translateY(0) !important; }

/* 6. Font-display swap — evita FOIT */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('DM Sans Regular'), local('DMSans-Regular');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('DM Sans Medium'), local('DMSans-Medium');
}
@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Lora Regular'), local('Lora-Regular');
}

/* 7. LCP: imagens críticas visíveis imediatamente */
.card--featured img { content-visibility: visible; }
.article-hero-img { content-visibility: visible; }

/* 8. Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* 9. Nav média */
@media (max-width: 1024px) and (min-width: 641px) {
  .nav-links a { padding: .4rem .55rem; font-size: .8rem; }
  .lang-select { font-size: .75rem; padding: .25rem .4rem; }
}

/* 10. Ad inline */
.cs-ad-inline { margin: 2rem 0; text-align: center; }
.ad-inline, .vp-ad-inline { min-height: 90px; }
.adsbygoogle { display: block; min-height: 90px; }

/* 11. Google Discovery */
.card--featured .card-img-wrap img { aspect-ratio: 16/9; width: 100%; height: 100%; }

/* 12. Contraste WCAG AA */
.card-title a { color: var(--text); }
.nav-links a { color: var(--text2); }

/* 13. CLS: placeholder nos banners de ad */
.ad-banner { min-height: 90px; }

/* 14. Performance em elementos fixos */
.reading-progress { transform: translateZ(0); }
.back-to-top { transform: translateZ(0); }
