/* =====================================================
   OLHAPAUTA — UX PREMIUM
   Overrides não-destrutivos de tipografia, single,
   homepage, mobile UX, acessibilidade e micro-detalhes.
   Carrega após critical.css.
===================================================== */

/* =====================================================
   MÓDULO 1 — TIPOGRAFIA FLUIDA (clamp)
===================================================== */

.entry-title {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.12;
  letter-spacing: -.02em;
}

.home .post-card--featured .title,
.blog .post-card--featured .title {
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.06;
  letter-spacing: -.03em;
}

.home .post-card--mini .title,
.blog .post-card--mini .title {
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 1.28;
}

.home .globo-hero .hero-title {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.32;
}

.home .section-title,
.blog .section-title {
  font-size: clamp(13px, 1.4vw, 18px);
  letter-spacing: .12em;
}

body:is(.category,.archive,.blog) .archive-post-title {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.25;
}

/* =====================================================
   MÓDULO 2 — UX DO SINGLE (leitura premium)
===================================================== */

.single .entry-text {
  max-width: 72ch;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.82;
  color: var(--text);
}

.single .entry-text p {
  margin-bottom: 1.65em;
}

.single .ad-break,
.single .in-content-ad-container {
  margin: 52px 0;
}

.single .entry-title {
  font-size: clamp(26px, 4.5vw, 42px);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin-bottom: 14px;
}

.single .entry-subtitle {
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 28px;
}

.single .entry-meta {
  font-size: 13px;
  color: var(--muted-2);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 24px;
}

.single .author-box {
  margin-top: 48px;
  border-radius: var(--radius-xl, 18px);
  border-left: 4px solid var(--accent, #e53935);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.single .author-box__name {
  font-size: 15px;
}

.single .author-box__bio {
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.single .related-grid .related-item,
.single .related-grid > a {
  border-radius: var(--radius-xl, 18px);
  box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.single .related-grid .related-item:hover,
.single .related-grid > a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(229,57,53,0.20);
}

.single .related-grid img {
  aspect-ratio: 3/2;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 10px;
}

.single .share-box {
  border-radius: var(--radius-xl, 18px);
  background: var(--surface-2);
}

/* Sprint 6 — entry-header-top (badge + categoria) */
.single .entry-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.single .entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.single .entry-meta__sep {
  opacity: 0.4;
}

/* =====================================================
   MÓDULO 3 — HOMEPAGE PREMIUM
===================================================== */

.home .post-card--featured,
.blog .post-card--featured {
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl, 18px);
  border: none;
}

.home .badge--destaque,
.blog .badge--destaque {
  background: #e53935;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.18), 0 2px 8px rgba(229,57,53,0.28);
  border-radius: 8px;
  font-size: 10px;
  letter-spacing: .10em;
}

.home .post-card--mini,
.blog .post-card--mini {
  border-radius: var(--radius-xl, 18px);
  border: none;
  box-shadow: var(--shadow-card);
}

.home .post-card.card-vertical,
.blog .post-card.card-vertical {
  box-shadow: var(--shadow-card);
  border: none;
  border-radius: var(--radius-xl, 18px);
}

.home .post-card.card-vertical:hover,
.blog .post-card.card-vertical:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.globo-col {
  background: var(--bg);
  border-radius: var(--radius-lg, 14px);
  padding: 18px;
  border: 1px solid var(--line-2, rgba(15,23,42,0.08));
  box-shadow: var(--shadow-sm);
}

.globo-item .item-thumb {
  border-radius: 8px;
  flex-shrink: 0;
}

.home .mag-big,
.blog .mag-big {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-xl, 18px);
}

.mag-small {
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(15,23,42,0.07);
}

.mag-small:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.home .section-head,
.blog .section-head {
  border-top: none;
  position: relative;
  padding-top: 18px;
}

.home .section-head::before,
.blog .section-head::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    var(--accent, #e53935) 0%,
    rgba(15,23,42,0.10) 40%,
    transparent 100%
  );
}

.home .section-more,
.blog .section-more {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}

.home .section-more:hover,
.blog .section-more:hover {
  transform: translateY(-1px);
}

/* =====================================================
   MÓDULO 4 — MOBILE UX
===================================================== */

@media (max-width: 768px) {

  .home .site-main,
  .blog .site-main {
    padding: 20px 0 48px;
  }

  .container {
    padding: 0 16px;
  }

  .home .post-card--featured .thumb,
  .blog .post-card--featured .thumb {
    min-height: 300px;
  }

  .globo-col {
    padding: 14px;
  }

  .globo-item {
    min-height: 56px;
    align-items: center;
  }

  .card-vertical .card-thumb-small {
    aspect-ratio: 4/3;
    height: auto;
  }

  .card-vertical .grid-title {
    font-size: 14px;
    line-height: 1.3;
  }

  .home .home-section,
  .blog .home-section {
    margin-top: 28px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .single .entry-meta {
    font-size: 12px;
  }

  .breadcrumbs {
    font-size: 10px;
  }

}

@media (max-width: 480px) {

  .home .post-card--featured .thumb,
  .blog .post-card--featured .thumb {
    min-height: 260px;
  }

  .home .featured-side,
  .blog .featured-side {
    grid-template-columns: 1fr;
  }

  .home .post-card--mini .thumb,
  .blog .post-card--mini .thumb {
    height: 180px;
  }

  .single .author-box__avatar img {
    width: 52px;
    height: 52px;
  }

  .globo-grid {
    gap: 20px;
  }

}

/* =====================================================
   MÓDULO 5 — CONSISTÊNCIA VISUAL
===================================================== */

.single .single-sidebar .widget-box {
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(15,23,42,0.07);
}

body:is(.category,.archive,.blog) .archive-card {
  border-radius: var(--radius-xl, 18px);
  box-shadow: var(--shadow-card);
  border-color: rgba(15,23,42,0.07);
}

body:is(.category,.archive,.blog) .archive-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

body:is(.category,.archive,.blog) .archive-sidebar .widget-box {
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg, 14px);
  border-color: rgba(15,23,42,0.07);
}

.site-footer {
  border-top: none;
  position: relative;
}

.site-footer::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--accent, #e53935) 30%,
    var(--accent, #e53935) 70%,
    transparent 100%
  );
}

.site-header a {
  transition: color .2s ease;
}

body:is(.category,.archive,.blog) .archive-title {
  font-size: clamp(20px, 3.5vw, 38px);
}

/* =====================================================
   MÓDULO 6 — MICRO-DETALHES PREMIUM
===================================================== */

html {
  scroll-behavior: smooth;
}

:focus-visible {
  outline: 2px solid rgba(229,57,53,0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(229,57,53,0.15);
  color: var(--text, #0f172a);
}

.single .post-category {
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 14px;
  box-shadow: 0 2px 8px rgba(229,57,53,0.25);
}

.breadcrumbs {
  border-radius: 999px;
}

.single .entry-image {
  box-shadow: var(--shadow-md);
}

.btn-load-more {
  letter-spacing: .06em;
  padding: 14px 40px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-load-more:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* =====================================================
   ACESSIBILIDADE WCAG (Sprint 8)
===================================================== */

.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--accent, #e53935);
  color: #fff !important;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 0 0 8px 8px;
  z-index: 100000;
  transition: top 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3.5px solid var(--accent, #e53935) !important;
  outline-offset: 2.5px !important;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Contraste mínimo WCAG 4.5:1 */
.single .entry-meta,
.archive-meta,
.search-count,
.error-404__post-date,
.newsletter-desc {
  color: var(--muted);
}

/* =====================================================
   LINKAGEM INTERNA AUTOMÁTICA (Sprint 12)
===================================================== */

.op-auto-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1.5px dashed rgba(229, 57, 53, 0.35);
  transition: border-bottom-color 0.2s ease, color 0.2s ease;
}

.op-auto-link:hover {
  color: var(--accent, #e53935) !important;
  border-bottom-color: var(--accent, #e53935) !important;
  border-bottom-style: solid;
}

/* =====================================================
   SHARE QUICK — barra de compartilhamento após imagem
===================================================== */

.share-quick {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
  padding: 14px 18px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line, rgba(15,23,42,0.09));
  border-radius: 12px;
}

.share-quick__label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted, rgba(15,23,42,0.55));
  white-space: nowrap;
  margin-right: 4px;
}

.share-quick__btn {
  font-size: 13px !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
}

/* =====================================================
   NEWSLETTER INLINE — CTA embutido no artigo
===================================================== */

.entry-newsletter-cta {
  margin: 36px 0;
  border-radius: 14px;
  overflow: hidden;
}

.entry-newsletter-cta .widget-newsletter {
  margin: 0;
  border-radius: 14px;
}

/* dark */
.op-dark-theme .share-quick {
  background: var(--surface);
  border-color: var(--line);
}

/* =====================================================
   FOOTER SOCIAL LINKS
===================================================== */

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  text-decoration: none;
}

.footer-social__link:hover {
  background: var(--accent, #e53935);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
}
