/*
Theme Name: Gradient Ride
Theme URI: https://gradientride.com
Description: Tema filho do Twenty Twenty-Five para o Gradient Ride (design "Modernist": cantos retos, imagens em grayscale, tipografia Archivo).
Author: Gradient Ride
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gradient-ride
*/

/* ------------------------------------------------------------------
   Gradient Ride — layout editorial
   A fonte Archivo é carregada em functions.php (já não há @import aqui).
   ------------------------------------------------------------------ */

:root {
  --gr-bg: #f3f2f2;
  --gr-surface: #eae9e9;
  --gr-text: #201e1d;
  --gr-muted: #6b6663;
  --gr-line: #201e1d;
  --gr-rule: #cfcbc9;
  --gr-accent: #ec3013;
  --gr-accent-dark: #b8250e;
  --gr-font: 'Archivo', system-ui, sans-serif;
  --gr-max: 1320px;
}

/* --- Base --------------------------------------------------------- */
body.gr,
body {
  background: var(--gr-bg);
  color: var(--gr-text);
  font-family: var(--gr-font);
}
.gr a { color: var(--gr-accent-dark); }
.gr a:hover { color: var(--gr-accent); }
.gr *, .gr *::before, .gr *::after { border-radius: 0 !important; }
.gr :focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; }

.gr-wrap { max-width: var(--gr-max); margin: 0 auto; padding: 0 24px; }

/* --- Cabeçalho + barra de categorias ------------------------------ */
.gr-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--gr-bg);
  border-bottom: 2px solid var(--gr-line);
}
.gr-header__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 18px 0 14px;
}
.gr-brand {
  font-weight: 800; font-size: 28px; letter-spacing: -0.02em;
  text-transform: uppercase; text-decoration: none; color: var(--gr-text);
}
.gr-brand span { color: var(--gr-accent); }
.gr-nav { display: flex; flex-wrap: wrap; gap: 0 26px; padding: 0 0 12px; }
.gr-nav a {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none; color: var(--gr-text);
}
.gr-nav .current-menu-item a,
.gr-nav a:hover { color: var(--gr-accent); }

/* --- Grelhas ------------------------------------------------------ */
.gr-hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 36px; padding: 28px 0 32px; border-bottom: 2px solid var(--gr-line);
}
.gr-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px; padding: 32px 0; border-bottom: 2px solid var(--gr-line);
}
.gr-body__main { grid-column: span 2; min-width: 0; }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 28px; }

/* --- Cabeçalho de secção ------------------------------------------ */
.gr-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding-bottom: 8px; margin-bottom: 24px;
  border-bottom: 2px solid var(--gr-accent);
}
.gr-section-head h2 {
  margin: 0; font-size: 20px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.gr-section-head a {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none;
}

/* --- Cards -------------------------------------------------------- */
.gr-card { display: flex; flex-direction: column; gap: 10px; }
.gr-card__media { display: block; width: 100%; aspect-ratio: 16/10; overflow: hidden; }
.gr-card__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.gr-card h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.2; text-wrap: pretty; }
.gr-card h3 a { color: inherit; text-decoration: none; }
.gr-card__meta { font-size: 12px; color: var(--gr-muted); }

.gr-card--lede h1,
.gr-card--lede h2 { margin: 0; font-size: 38px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
.gr-card--lede .gr-card__media { aspect-ratio: 16/9; }
.gr-card--lede p { margin: 0; font-size: 17px; line-height: 1.5; color: #3d3835; max-width: 60ch; }

.gr-card--row {
  display: grid; grid-template-columns: minmax(0,100px) minmax(0,1fr);
  gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--gr-rule);
}
.gr-card--row:last-child { border-bottom: 0; padding-bottom: 0; }
.gr-card--row .gr-card__media { aspect-ratio: 1/1; }
.gr-card--row h3 { font-size: 18px; }

/* --- Etiqueta de categoria ---------------------------------------- */
.gr-tag {
  align-self: flex-start;
  display: inline-block; padding: 4px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none;
  background: var(--gr-surface); color: var(--gr-text);
}
.gr-tag--accent { background: var(--gr-accent-dark); color: #fff; }
.gr-tag--accent a { color: #fff; }
.gr-tag a { text-decoration: none; }

/* --- Barra lateral ------------------------------------------------ */
.gr-aside { min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.gr-aside h2 {
  margin: 0 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--gr-line);
  font-size: 16px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.gr-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.gr-list li { padding-bottom: 14px; border-bottom: 1px solid var(--gr-rule); }
.gr-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.gr-list a { font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--gr-text); text-decoration: none; }
.gr-list--ranked li { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 10px; }
.gr-list--ranked li::before {
  counter-increment: gr-rank; content: counter(gr-rank);
  font-size: 20px; font-weight: 800; color: var(--gr-accent);
}
.gr-list--ranked { counter-reset: gr-rank; }

/* --- Bloco de afiliados ------------------------------------------- */
.gr-affiliate { border: 2px solid var(--gr-line); padding: 18px; }
.gr-affiliate__label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gr-muted);
}
.gr-affiliate h2 { border: 0; padding: 0; margin: 10px 0 14px; font-size: 18px; text-transform: none; letter-spacing: 0; }
.gr-product { display: grid; grid-template-columns: minmax(0,64px) minmax(0,1fr); gap: 12px; align-items: center; margin-bottom: 14px; }
.gr-product img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gr-product__name { font-size: 13px; font-weight: 700; line-height: 1.2; display: block; }
.gr-product__price { font-size: 13px; font-weight: 700; color: var(--gr-accent-dark); }

/* --- Botões ------------------------------------------------------- */
.gr-btn {
  display: inline-block; box-sizing: border-box; padding: 10px 16px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  text-decoration: none; text-align: left; border: 2px solid var(--gr-line);
  background: transparent; color: var(--gr-text);
}
.gr-btn--primary { background: var(--gr-accent-dark); border-color: var(--gr-accent-dark); color: #fff; }
.gr-btn--primary:hover { background: var(--gr-text); border-color: var(--gr-text); color: #fff; }
.gr-btn--block { display: block; width: 100%; }

/* --- Artigo ------------------------------------------------------- */
.gr-article h1 { margin: 0 0 16px; font-size: 44px; font-weight: 800; line-height: 1.03; letter-spacing: -0.025em; max-width: 24ch; }
.gr-article__lede { margin: 0 0 20px; font-size: 19px; line-height: 1.45; color: #3d3835; max-width: 62ch; }
.gr-article__meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 14px 0;
  border-top: 2px solid var(--gr-line); border-bottom: 2px solid var(--gr-line);
  font-size: 13px; color: var(--gr-muted);
}
.gr-article .entry-content { max-width: 68ch; }
.gr-article .entry-content p { font-size: 17px; line-height: 1.6; }
.gr-article .entry-content h2 { font-size: 24px; font-weight: 800; line-height: 1.15; margin: 32px 0 12px; }
.gr-article .entry-content blockquote {
  margin: 24px 0; padding: 0 0 0 20px; border-left: 2px solid var(--gr-accent);
  font-size: 22px; font-weight: 800; line-height: 1.25;
}
.gr-article .entry-content img { filter: grayscale(1); }

/* --- Rodapé ------------------------------------------------------- */
.gr-footer { border-top: 2px solid var(--gr-line); }
.gr-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 28px; padding: 32px 24px; max-width: var(--gr-max); margin: 0 auto; }
.gr-footer a { display: block; font-size: 13px; color: var(--gr-text); text-decoration: none; margin-bottom: 8px; }
.gr-footer__legal { border-top: 1px solid var(--gr-rule); font-size: 12px; color: var(--gr-muted); }

/* --- Telemóvel ---------------------------------------------------- */
@media (max-width: 781px) {
  .gr-body__main { grid-column: span 1; }
  .gr-card--lede h1, .gr-card--lede h2 { font-size: 28px; }
  .gr-article h1 { font-size: 30px; }
  .gr-nav { gap: 6px 14px; overflow-x: visible; flex-wrap: wrap; }
}

/* ==========================================================================
   Adaptações para a estrutura real de blocos do WordPress
   Ficheiro original de Vitor acima, inalterado. As regras abaixo resolvem
   o facto de o Query Loop gerar <ul class="wp-block-post-template">
   <li class="wp-block-post"> em vez da marcação plana do protótipo estático,
   e outros ajustes de integração. Adicionado por Claude a 13/09/2026.
   ========================================================================== */

/* Resets base sem depender da classe .gr no <body> (sem acesso a
   functions.php do tema-filho neste momento) */
a { color: var(--gr-accent-dark); }
a:hover { color: var(--gr-accent); }
*, *::before, *::after { border-radius: 0 !important; }
:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; }

/* Largura confortável do site — o tema por defeito assume 645px/1340px */
:root {
  --wp--style--global--content-size: var(--gr-max);
  --wp--style--global--wide-size: var(--gr-max);
}

/* .gr-grid aplicado diretamente ao bloco Post Template (a <ul> real) */
ul.wp-block-post-template.gr-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Lista em "linha" (miniatura + texto) construída com Query Loop: a <ul>
   fica em coluna simples e é cada <li> (um post) que vira a grelha de
   2 colunas — nunca a <ul> inteira. */
ul.wp-block-post-template.gr-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gr-row-list > li.wp-block-post {
  display: grid;
  grid-template-columns: minmax(0,100px) minmax(0,1fr);
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--gr-rule);
}
.gr-row-list > li.wp-block-post:last-child { border-bottom: 0; padding-bottom: 0; }
.gr-row-list > li.wp-block-post .gr-card__media { aspect-ratio: 1/1; }
.gr-row-list > li.wp-block-post h3 { font-size: 18px; margin: 0; font-weight: 800; line-height: 1.2; }

/* Variante maior, usada na lista principal do arquivo de categoria */
.gr-row-list--lg { gap: 26px; }
.gr-row-list--lg > li.wp-block-post {
  grid-template-columns: minmax(0,220px) minmax(0,1fr);
  gap: 20px;
  padding-bottom: 26px;
}
.gr-row-list--lg > li.wp-block-post .gr-card__media { aspect-ratio: 16/10; }
.gr-row-list--lg > li.wp-block-post h3 { font-size: 22px; }
.gr-row-list--lg > li.wp-block-post p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--gr-muted); }

/* .gr-list construída com Query Loop (barra lateral "Últimas notícias") */
ul.wp-block-post-template.gr-list {
  margin: 0; padding: 0; list-style: none;
}
.gr-list > li.wp-block-post .wp-block-post-title { margin: 0; }
.gr-list > li.wp-block-post .wp-block-post-title a {
  font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--gr-text); text-decoration: none;
}

/* Paginação do Query Loop ("Carregar mais artigos"), estilizada como gr-btn */
.wp-block-query-pagination { display: flex; gap: 12px; padding-top: 8px; }
.wp-block-query-pagination .wp-block-query-pagination-next,
.wp-block-query-pagination .wp-block-query-pagination-previous {
  display: inline-block; padding: 10px 16px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  text-decoration: none; border: 2px solid var(--gr-line);
  background: transparent; color: var(--gr-text);
}
.wp-block-query-pagination .wp-block-query-pagination-next:hover,
.wp-block-query-pagination .wp-block-query-pagination-previous:hover {
  background: var(--gr-line); color: #fff;
}

/* Imagem de abertura do artigo (fora do entry-content, como no protótipo) */
.gr-article__figure .gr-card__media { aspect-ratio: 16/9; }
.gr-article__figure figcaption { font-size: 12px; color: var(--gr-muted); margin-top: 8px; }

/* Banner de newsletter a vermelho, largura total */
.gr-newsletter { background: var(--gr-accent); color: #fff; }
.gr-newsletter .gr-wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 24px; align-items: end; padding-top: 40px; padding-bottom: 40px;
}
.gr-newsletter h2 { margin: 0; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; }
.gr-newsletter input[type="email"] {
  width: 100%; box-sizing: border-box; padding: 10px 14px; border: 2px solid var(--gr-line);
  font-family: var(--gr-font); font-size: 14px; background: #fff;
}
.gr-newsletter .gr-btn--primary { background: #fff; border-color: #fff; color: var(--gr-accent-dark); }
.gr-newsletter .gr-btn--primary:hover { background: var(--gr-bg); border-color: var(--gr-bg); }

/* Fila de filtros/etiquetas no topo do arquivo de categoria */
.gr-filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0; border-bottom: 2px solid var(--gr-line); }
.gr-cat-head { padding: 28px 0 20px; border-bottom: 2px solid var(--gr-line); }
.gr-cat-head__label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gr-muted); }
.gr-cat-head h1 { margin: 8px 0 10px; font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.gr-cat-head p { margin: 0; font-size: 16px; line-height: 1.5; color: #3d3835; max-width: 60ch; }

/* Breadcrumb do artigo */
.gr-breadcrumb { display: flex; gap: 8px; align-items: center; padding: 20px 0; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gr-muted); }
.gr-breadcrumb a { color: var(--gr-muted); text-decoration: none; }
.gr-breadcrumb a:hover { color: var(--gr-accent); }

@media (max-width: 781px) {
  .gr-row-list--lg > li.wp-block-post,
  .gr-row-list > li.wp-block-post { grid-template-columns: 1fr; }
  .gr-newsletter .gr-wrap { padding-top: 28px; padding-bottom: 28px; }
}


/* Esconde o título automático da Página na homepage (não faz parte do mockup) */
body.home .wp-block-post-title:not(.wp-block-query *) { display: none; }


/* Reduz o espaço em branco no topo da homepage (era o padding reservado para o título da Página, que está escondido) */
body.home main > .wp-block-group.alignfull.has-global-padding {
  padding-top: 12px !important;
}


/* Gradient Ride — homepage hero: align highlights top with lede image */
body.home .gr-hero .gr-highlights {
  margin-top: 0 !important;
}


/* Gradient Ride — alinhar topo da sidebar (Mais lidos) com a coluna de Últimos guias */
body.home .gr-body .gr-aside {
  margin-top: 0 !important;
}


/* Gradient Ride — alinhar cartões da grelha "Últimos guias" (imagens e textos por linha) */
body.home .gr-grid.wp-block-post-template > li {
  margin-top: 0 !important;
}

/* --- Selo "novo" e data relativa (homepage) ------------------------ */
.gr-flags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; align-self: flex-start; margin: 0; }
.gr-new {
  display: inline-block; padding: 4px 8px; line-height: 1;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--gr-text); color: #fff;
}

/* --- Cabecalho em ecras pequenos ----------------------------------- */
@media (max-width: 600px) {
  .gr-header__top > div:last-child > span { display: none; }
  .gr-brand { white-space: nowrap; }
}
@media (max-width: 420px) {
  .gr-brand { font-size: 24px; }
}
