/* ============================================
   LYKOS BLOG THEME - main.css
   Design System alinhado ao site principal
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap');

/* ---- Variáveis CSS ---- */
:root {
  --bg-main: #0d0810;
  --bg-section: #130c1a;
  --bg-card: #341d4a;
  --border-color: #4a2870;
  --orange-primary: #ff6620;
  --orange-hover: #ff8040;
  --text-primary: #f0eaf8;
  --text-secondary: #b09ac8;
  --text-muted: #7a6290;
  --gradient-headline: linear-gradient(90deg, #ff6620 0%, #c030a0 50%, #6b3fa0 100%);
  --font-family: 'Sora', sans-serif;
  --border-radius-card: 16px;
  --border-radius-btn: 8px;
  --transition: all 0.25s ease;
  --max-content: 720px;
  --max-layout: 1200px;
}

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

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-family);
  border: none;
  outline: none;
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 8, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(74, 40, 112, 0.4);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-layout);
  margin: 0 auto;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--orange-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
}

.site-logo:hover {
  color: var(--orange-hover);
}

.site-logo__img {
  height: 36px;
  width: auto;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  transition: var(--transition);
  position: relative;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--orange-primary);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.site-nav a:hover {
  color: var(--text-primary);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.site-nav a.active {
  color: var(--orange-primary);
}

/* ============================================
   LAYOUT GERAL
   ============================================ */
.site-main {
  margin-top: 64px;
  min-height: calc(100vh - 64px - 80px);
}

.container {
  max-width: var(--max-layout);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ============================================
   HERO DA LISTAGEM (index / tag)
   ============================================ */
.blog-hero {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-color);
  padding: 4rem 2rem;
  text-align: center;
}

.blog-hero__inner {
  max-width: var(--max-layout);
  margin: 0 auto;
}

.blog-hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.blog-hero__subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.blog-hero__tag-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.12);
  border: 1px solid rgba(255, 102, 32, 0.35);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   GRID DE POSTS
   ============================================ */
.posts-section {
  padding: 3rem 0 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

/* ============================================
   CARD DE POST
   ============================================ */
.post-card {
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.post-card:hover {
  border-color: var(--orange-primary);
  box-shadow: 0 0 24px rgba(255, 102, 32, 0.18), 0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

.post-card__image-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-card);
}

.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card__image {
  transform: scale(1.04);
}

.post-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-card) 0%, #1e1030 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card__image-placeholder svg {
  opacity: 0.25;
  width: 48px;
  height: 48px;
}

.post-card__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.post-card__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.1);
  border: 1px solid rgba(255, 102, 32, 0.3);
  border-radius: 100px;
  padding: 0.2rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  align-self: flex-start;
  transition: var(--transition);
}

.post-card__tag:hover {
  background: rgba(255, 102, 32, 0.2);
  border-color: var(--orange-primary);
}

.post-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  transition: var(--transition);
}

.post-card:hover .post-card__title {
  color: var(--orange-primary);
}

.post-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.5rem;
  border-top: 1px solid rgba(74, 40, 112, 0.3);
  margin-top: auto;
}

.post-card__meta-sep {
  color: var(--border-color);
}

/* ============================================
   PAGINAÇÃO
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 0 3rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--bg-section);
  transition: var(--transition);
}

.pagination a:hover {
  border-color: var(--orange-primary);
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.08);
}

.pagination .pagination__current {
  border-color: var(--orange-primary);
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.12);
}

/* ============================================
   HERO DO POST INDIVIDUAL
   ============================================ */
.post-hero {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border-color);
  padding: 3.5rem 2rem;
}

.post-hero__inner {
  max-width: var(--max-content);
  margin: 0 auto;
}

.post-hero__tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.1);
  border: 1px solid rgba(255, 102, 32, 0.3);
  border-radius: 100px;
  padding: 0.25rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

.post-hero__tag:hover {
  background: rgba(255, 102, 32, 0.2);
}

.post-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.post-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.post-hero__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-hero__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.post-hero__author-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.post-hero__meta-sep {
  color: var(--border-color);
}

.post-hero__cover {
  width: 100%;
  border-radius: var(--border-radius-card);
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 16 / 9;
}

.post-hero__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   CONTEUDO DO POST
   ============================================ */
.post-content-wrapper {
  padding: 3rem 2rem;
}

.post-content {
  max-width: var(--max-content);
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-family);
  font-weight: 700;
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  margin: 2rem 0 1rem;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.65rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.15rem; }

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content a {
  color: var(--orange-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}

.post-content a:hover {
  color: var(--orange-hover);
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content blockquote {
  border-left: 4px solid var(--orange-primary);
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  background: rgba(255, 102, 32, 0.06);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content code {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-size: 0.9em;
  font-family: 'Courier New', Courier, monospace;
  color: var(--orange-primary);
}

.post-content pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.post-content img {
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin: 1.5rem 0;
  width: 100%;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  text-align: left;
}

.post-content th {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
}

.post-content td {
  background: var(--bg-section);
  color: var(--text-primary);
}

/* ============================================
   CTA FINAL DO POST
   ============================================ */
.post-cta {
  max-width: var(--max-content);
  margin: 3rem auto 0;
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-card);
  padding: 2.5rem;
  text-align: center;
}

.post-cta__title {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-cta__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ============================================
   BOTAO PADRAO
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--orange-primary);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: var(--border-radius-btn);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.03em;
}

.btn:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 102, 32, 0.35);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--orange-primary);
  color: var(--orange-primary);
}

.btn--outline:hover {
  background: var(--orange-primary);
  color: #fff;
}

/* ============================================
   SECAO CONTINUE LENDO
   ============================================ */
.related-posts {
  background: var(--bg-section);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 2rem;
}

.related-posts__inner {
  max-width: var(--max-layout);
  margin: 0 auto;
}

.related-posts__title {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
  text-align: center;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-section);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
}

.site-footer__inner {
  max-width: var(--max-layout);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer__logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--orange-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: var(--transition);
}

.site-footer__logo:hover {
  color: var(--orange-hover);
}

.site-footer__social {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-link:hover {
  border-color: var(--orange-primary);
  color: var(--orange-primary);
  background: rgba(255, 102, 32, 0.08);
}

.site-footer__logo-img {
  height: 36px;
  width: auto;
  display: block;
  opacity: 0.85;
  transition: var(--transition);
}

.site-footer__logo:hover .site-footer__logo-img {
  opacity: 1;
}

.site-footer__copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================================
   PAGINA DE ERRO
   ============================================ */
.error-page {
  min-height: calc(100vh - 64px - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-page__inner {
  max-width: 560px;
}

.error-page__code {
  font-size: 6rem;
  font-weight: 700;
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.error-page__message {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ============================================
   UTILITARIOS
   ============================================ */
.text-gradient {
  background: var(--gradient-headline);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================
   RESPONSIVO
   ============================================ */

/* Tablet - 1024px */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet pequeno / Mobile grande - 768px */
@media (max-width: 768px) {
  .site-header {
    padding: 0 1.25rem;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .site-nav a {
    font-size: 0.85rem;
  }

  .blog-hero {
    padding: 3rem 1.25rem;
  }

  .posts-section {
    padding: 2rem 0 3rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .post-hero {
    padding: 2.5rem 1.25rem;
  }

  .post-content-wrapper {
    padding: 2rem 1.25rem;
  }

  .post-cta {
    padding: 2rem 1.25rem;
  }

  .related-posts {
    padding: 2.5rem 1.25rem;
  }

  .related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Koenig Editor: classes obrigatórias ---- */
.kg-width-wide {
  margin-left: calc(50% - 50vw + 2rem);
  margin-right: calc(50% - 50vw + 2rem);
  max-width: 1100px;
}

.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
}

.kg-image {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Mobile - 480px */
@media (max-width: 480px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }

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

  .site-nav {
    gap: 1rem;
  }

  .blog-hero__title {
    font-size: 1.75rem;
  }

  .post-hero__title {
    font-size: 1.5rem;
  }

  .post-content {
    font-size: 1rem;
  }

  .post-cta__title {
    font-size: 1.25rem;
  }

  .error-page__code {
    font-size: 4rem;
  }

  .pagination {
    flex-wrap: wrap;
  }
}
