/*
Theme Name: O Brasil de Cima
Theme URI: https://obrasildecima.com.br
Author: José Lucas Rodrigues
Author URI: https://github.com/zezindev
Description: Tema editorial customizado para o portal O Brasil de Cima.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: obrasildecima
*/

:root {
  /* Cores — modo claro */
  --color-bg: #ffffff;
  --color-accent: #ffca00;

  --color-title: #111111;
  --color-text: #333333;

  --color-ui-dark: #111111;
  --color-border-login: #dadada;
  --color-border-secondary: #717171;
  --color-footer-bg: #111111;

  /* Tipografia */
  --font-title: "Montserrat", sans-serif;
  --font-text: "Open Sans", sans-serif;

  /* Escala tipográfica (1rem = 10px) */
  --fs-xs: 1.2rem;
  --fs-sm: 1.4rem;
  --fs-md: 1.6rem;
  --fs-lg: 2rem;
  --fs-xl: 2.4rem;
  --fs-2xl: 3.2rem;

  /* Thumbs dos posts */
  --radius-lg: 10px;
  --radius-md: 8px;
  --transition: 0.35s ease;
  --hover-overlay: rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] {
  --color-bg: #202125;
  --color-accent: #ffca00;

  --color-title: #ffffff;
  --color-text: #c2c2c2;

  --color-ui-dark: #ffffff;
  --color-border-login: #333333;
  --color-border-secondary: #333333;
  --color-footer-bg: #181a1b;
}

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

html {
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: var(--font-text);
  font-size: var(--fs-md);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-title);
  color: var(--color-title);
  line-height: 1.2;
}

h1 {
  font-size: 2.8rem;
}

h2 {
  font-size: 2.4rem;
  margin-bottom: 12px;
  font-weight: 600;
}

h3 {
  font-size: 2rem;
  margin-bottom: 10px;
  font-weight: 600;
}

h4 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  font-weight: 600;
}

h5 {
  font-size: 1.6rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  h3 {
    font-size: 1.8rem;
  }

  h4 {
    font-size: 1.6rem;
  }

  h5 {
    font-size: 1.4rem;
  }
}

p {
  font-family: var(--font-text);
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
  font-family: var(--font-title);
  font-weight: 400;
}

span {
  font-family: var(--font-title);
  font-weight: 500;
}

button {
  font-family: var(--font-title);
  font-size: var(--fs-sm);
  cursor: pointer;
  background: none;
  border: none;
}

.btn-solid {
  position: relative;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;

  background-color: var(--color-ui-dark);
  color: var(--color-bg);
  font-weight: 500;
  font-size: 1.4rem;

  padding: 8px 20px;
  border-radius: 100px;

  overflow: hidden;
  border: 1px solid transparent;

  transition:
    color 0.3s ease,
    border 0.3s ease;
}

/* camada animada */
.btn-solid::before {
  content: "";
  position: absolute;
  inset: 0;

  background-color: var(--color-bg);
  transform: translateX(-100%);
  transition: transform 0.3s ease;

  z-index: 0;
}

/* mantém conteúdo acima */
.btn-text,
.btn-icon {
  position: relative;
  z-index: 1;
  transition:
    color 0.1s ease,
    filter 0.1s ease;
}

/* hover animação */
.btn-solid:hover::before {
  transform: translateX(0);
}

/* texto no hover */
.btn-solid:hover {
  color: var(--color-title);
  border: 1px solid var(--color-ui-dark);
}

/* ícone no hover: o fundo do botão inverte, então o ícone inverte junto (só CSS, sem trocar a imagem) */
.btn-solid:hover .btn-icon {
  filter: invert(1);
}

/* ícone (transição suave) */
.btn-icon {
  width: 18px;
  margin-bottom: -7px;
  transition: filter 0.3s ease;
}

.btn-outline {
  position: relative;

  border: 1px solid var(--color-ui-dark);
  color: var(--color-ui-dark);
  font-weight: 500;
  font-size: 1.4rem;

  padding: 8px 20px;
  border-radius: 100px;

  overflow: hidden;

  transition:
    color 0.3s ease,
    border 0.3s ease;

  z-index: 0;
}

/* camada animada */
.btn-outline::before {
  content: "";
  position: absolute;
  inset: 0;

  background-color: var(--color-ui-dark);
  transform: translateX(-100%);
  transition: transform 0.3s ease;

  z-index: 0; /* fica atrás */
}

/* garante que o TEXTO fique na frente */
.btn-outline span {
  position: relative;
  z-index: 1;
}

/* hover animação */
.btn-outline:hover::before {
  transform: translateX(0);
}

/* troca de cor do texto */
.btn-outline:hover {
  color: var(--color-bg);
}

.container {
  max-width: 1280px;
  padding: 0 2.4rem;
  margin: 0 auto;
}

/* =========================================
   HERO POSTS
   Medidas do Figma (desktop 1248px): 297 | 614 | 297, espaço de 20px
   ========================================= */

img {
  max-width: 100%;
}

.featured-news {
  max-width: 1280px;
  padding: 2.4rem 2rem 0;
  margin: 0 auto;

  display: grid;
  grid-template-columns: minmax(0, 297fr) minmax(0, 614fr) minmax(0, 297fr);
  gap: 2rem;
  align-items: start;
}

.featured-left,
.featured-right {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.featured-news a {
  text-decoration: none;
  color: inherit;
}

/* =========================================
   EFEITO DAS IMAGENS
   ========================================= */

.hero-thumb,
.thumb {
  position: relative;
  overflow: hidden;
  background-color: var(--color-border-login);
}

.hero-thumb {
  border-radius: var(--radius-md);
}

.thumb {
  border-radius: var(--radius-md);
}

.hero-thumb img,
.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform var(--transition),
    filter var(--transition);
}

.hero-thumb::after,
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition);
  pointer-events: none;
}

.hero-post:hover .hero-thumb::after,
.side-post:hover .thumb::after,
.mini-post:hover .thumb::after {
  background: var(--hover-overlay);
}

.hero-post:hover .hero-thumb img,
.side-post:hover .thumb img,
.mini-post:hover .thumb img {
  transform: scale(1.03);
}

/* Títulos sublinhados no hover (mesmo efeito dos cards da home) */
.hero-post:hover h2,
.side-post:hover h3,
.mini-post:hover h4 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* =========================================
   HERO (destaque central)
   ========================================= */

.hero-thumb {
  aspect-ratio: 614 / 345;
}

.hero-post h2 {
  margin: 1.7rem 0 0;
  font-size: 2.4rem;
  line-height: 1.2;
  font-weight: 700;
}

.hero-post .hero-excerpt {
  display: none;
}

/* =========================================
   CARD GRANDE (laterais da hero)
   ========================================= */

.side-post {
  border-bottom: 1px solid var(--color-border-login);
  padding-bottom: 2rem;
}

.side-post .thumb {
  aspect-ratio: 297 / 140;
}

.side-post h3 {
  margin: 0.8rem 0;
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.22;
}

.side-post p {
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--color-text);
}

/* =========================================
   CARD PEQUENO (laterais da hero)
   ========================================= */

.mini-post a {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.mini-post .thumb {
  flex-shrink: 0;
  width: 106px;
  height: 106px;
}

.mini-post h4 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
}

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

@media (max-width: 1024px) {
  .featured-news {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Ordem: destaque central primeiro */
  .featured-center {
    order: 1;
  }

  .featured-left {
    order: 2;
  }

  .featured-right {
    order: 3;
  }

  .featured-left,
  .featured-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 768px) {
  .featured-news {
    padding-top: 2rem;
  }

  .featured-left,
  .featured-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .featured-left {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border-login);
  }

  .hero-thumb,
  .side-post .thumb {
    aspect-ratio: 350 / 207;
  }

  .hero-post h2,
  .side-post h3 {
    margin-top: 0.8rem;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.22;
  }

  .hero-post .hero-excerpt {
    display: block;
    margin-top: 0.8rem;
    font-size: 1.4rem;
    line-height: 1.35;
    color: var(--color-text);
  }

  .side-post {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .side-post p {
    display: none;
  }

  .mini-post .thumb {
    width: 73px;
    height: 73px;
  }

  .mini-post h4 {
    font-size: 1.4rem;
    line-height: 1.22;
  }
}
