/*
Theme Name: Hora da Indústria
Theme URI: https://horadaindustria.com.br/
Author: Hora da Indústria
Author URI: https://horadaindustria.com.br/
Description: Tema editorial leve e responsivo para o portal Hora da Indústria.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: hora-da-industria
*/

:root {
  --hd-primary: #ed7900;
  --hd-primary-dark: #bd5e00;
  --hd-ink: #202020;
  --hd-muted: #686868;
  --hd-surface: #ffffff;
  --hd-soft: #f5f5f3;
  --hd-border: #e3e3df;
  --hd-container: 1240px;
  --hd-reading: 780px;
  --hd-radius: 4px;
  --hd-shadow: 0 14px 34px rgba(18, 18, 18, 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--hd-ink);
  background: var(--hd-surface);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--hd-primary-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.container { width: min(calc(100% - 40px), var(--hd-container)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: 8px; left: 8px; width: auto; height: auto; padding: 12px 16px;
  clip: auto; color: #fff; background: var(--hd-ink); border-radius: 3px;
}

/* Cabeçalho */
.site-header { background: #fff; border-bottom: 1px solid var(--hd-border); }
.site-header__top { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.site-branding { flex: 0 1 480px; }
.site-logo { display: inline-block; }
.site-logo img, .custom-logo { width: min(100%, 430px); max-height: 105px; object-fit: contain; object-position: left center; }
.site-title { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.05; }
.site-description { margin: 5px 0 0; color: var(--hd-muted); }
.header-search { flex: 0 1 360px; }
.search-form { display: flex; width: 100%; }
.search-field {
  width: 100%; min-width: 0; padding: 11px 13px; color: var(--hd-ink); background: #fff;
  border: 1px solid #cfcfca; border-right: 0; border-radius: var(--hd-radius) 0 0 var(--hd-radius);
}
.search-submit {
  min-width: 48px; padding: 0 15px; color: #fff; background: var(--hd-primary); border: 0;
  border-radius: 0 var(--hd-radius) var(--hd-radius) 0; font-weight: 800;
}
.search-submit:hover { background: var(--hd-primary-dark); }
.main-navigation { color: #fff; background: var(--hd-ink); border-top: 4px solid var(--hd-primary); }
.nav-wrap { display: flex; align-items: stretch; justify-content: space-between; }
.menu-toggle {
  display: none; padding: 14px 0; color: #fff; background: transparent; border: 0; font-weight: 750;
}
.menu-toggle__icon, .menu-toggle__icon::before, .menu-toggle__icon::after {
  display: inline-block; width: 22px; height: 2px; background: currentColor; content: ""; vertical-align: middle;
}
.menu-toggle__icon { position: relative; margin-right: 9px; }
.menu-toggle__icon::before { position: absolute; top: -7px; left: 0; }
.menu-toggle__icon::after { position: absolute; top: 7px; left: 0; }
.primary-menu, .primary-menu ul { margin: 0; padding: 0; list-style: none; }
.primary-menu { display: flex; flex-wrap: wrap; }
.primary-menu > li > a {
  display: block; padding: 15px 13px; color: #fff; font-size: .87rem; font-weight: 750; letter-spacing: .01em;
}
.primary-menu > li:first-child > a { padding-left: 0; }
.primary-menu a:hover, .primary-menu .current-menu-item > a, .primary-menu .current-menu-ancestor > a { color: #ffae55; }

/* Espaços publicitários */
.ad-slot { margin-block: 24px; text-align: center; }
.ad-slot:empty { display: none; }
.ad-slot img { margin-inline: auto; }

/* Componentes editoriais */
.site-main { min-height: 55vh; }
.section { padding-block: 48px; }
.section--soft { background: var(--hd-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; border-bottom: 2px solid var(--hd-ink); }
.section-title { position: relative; margin: 0 0 -2px; padding: 0 0 10px; font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.12; }
.section-title::after { position: absolute; bottom: 0; left: 0; width: 72px; height: 5px; background: var(--hd-primary); content: ""; }
.section-link { padding-bottom: 11px; color: var(--hd-muted); font-size: .88rem; font-weight: 750; }
.eyebrow, .post-card__category {
  color: var(--hd-primary-dark); font-size: .75rem; font-weight: 850; letter-spacing: .075em; line-height: 1.2; text-transform: uppercase;
}
.post-card__title { margin: 8px 0 0; font-size: 1.12rem; line-height: 1.25; }
.post-card__title a:hover { text-decoration: underline; text-decoration-color: var(--hd-primary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--hd-muted); font-size: .8rem; }
.post-card__image { display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #deded9; border-radius: var(--hd-radius); }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__image img { transform: scale(1.035); }
.post-card__excerpt { margin: 10px 0 0; color: var(--hd-muted); font-size: .94rem; line-height: 1.55; }
.image-placeholder {
  display: grid; width: 100%; height: 100%; place-items: center; color: #777; background: linear-gradient(135deg, #ecece8, #d9d9d3);
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}

/* Home */
.hero-section { padding: 28px 0 12px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr); grid-template-rows: repeat(2, 225px); gap: 12px; }
.hero-card { position: relative; overflow: hidden; min-height: 0; color: #fff; background: #333; border-radius: var(--hd-radius); }
.hero-card:first-child { grid-row: 1 / 3; }
.hero-card__image, .hero-card__image img { width: 100%; height: 100%; }
.hero-card__image img { object-fit: cover; transition: transform .45s ease; }
.hero-card:hover .hero-card__image img { transform: scale(1.025); }
.hero-card__overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.2) 65%, rgba(0,0,0,.08) 100%); }
.hero-card__content { position: absolute; inset: auto 0 0; z-index: 1; padding: 22px; }
.hero-card:first-child .hero-card__content { padding: clamp(24px, 4vw, 44px); }
.hero-card .eyebrow { display: inline-block; padding: 5px 8px; color: #fff; background: var(--hd-primary); border-radius: 2px; }
.hero-card__title { margin: 10px 0 0; max-width: 820px; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.14; text-wrap: balance; }
.hero-card:first-child .hero-card__title { font-size: clamp(1.9rem, 4vw, 3.4rem); }
.hero-card .post-meta { color: rgba(255,255,255,.78); }
.latest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.category-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 30px; }
.category-main .post-card__title { font-size: clamp(1.35rem, 2.2vw, 2rem); }
.category-side { display: grid; gap: 18px; }
.post-card--horizontal { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 15px; align-items: start; }
.post-card--horizontal .post-card__title { margin-top: 5px; font-size: 1rem; }
.columnists-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.column-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 15px; padding: 20px; background: #fff; border: 1px solid var(--hd-border); border-top: 4px solid var(--hd-primary); }
.column-card__avatar img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.column-card__author { margin: 0; color: var(--hd-primary-dark); font-size: .8rem; font-weight: 800; text-transform: uppercase; }
.column-card__title { margin: 5px 0 0; font-size: 1.07rem; line-height: 1.3; }

/* Arquivos e busca */
.page-header { padding: 44px 0 28px; background: var(--hd-soft); border-bottom: 1px solid var(--hd-border); }
.page-title { margin: 0; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.08; }
.archive-description { max-width: 720px; color: var(--hd-muted); }
.archive-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 7px; }
.page-numbers { display: grid; min-width: 42px; height: 42px; padding: 0 10px; place-items: center; border: 1px solid var(--hd-border); border-radius: 3px; font-weight: 700; }
.page-numbers.current, .page-numbers:hover { color: #fff; background: var(--hd-primary); border-color: var(--hd-primary); }
.empty-state { padding: 60px 0; text-align: center; }
.empty-state .search-form { max-width: 480px; margin: 24px auto 0; }

/* Artigo */
.article-header { padding: clamp(42px, 7vw, 80px) 0 34px; }
.article-header__inner { width: min(calc(100% - 40px), 980px); margin-inline: auto; }
.article-title { margin: 12px 0 16px; font-size: clamp(2.2rem, 5.7vw, 4.65rem); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.article-excerpt { max-width: 850px; margin: 0 0 20px; color: var(--hd-muted); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.55; }
.featured-image { width: min(calc(100% - 40px), var(--hd-container)); margin: 0 auto 44px; }
.featured-image img { width: 100%; max-height: 690px; object-fit: cover; border-radius: var(--hd-radius); }
.article-layout { display: grid; grid-template-columns: minmax(0, var(--hd-reading)) minmax(250px, 320px); gap: 72px; align-items: start; justify-content: center; }
.entry-content { font-family: Georgia, "Times New Roman", serif; font-size: 1.16rem; line-height: 1.84; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 1.45em; }
.entry-content h2, .entry-content h3, .entry-content h4 { margin: 1.65em 0 .65em; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.18; }
.entry-content h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
.entry-content h3 { font-size: 1.45rem; }
.entry-content a { color: var(--hd-primary-dark); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin: 2em 0; padding: 8px 0 8px 24px; border-left: 5px solid var(--hd-primary); color: #454545; font-size: 1.2em; }
.entry-content figure { margin: 2em 0; }
.entry-content figcaption { color: var(--hd-muted); font-family: Inter, sans-serif; font-size: .78rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-family: Inter, sans-serif; font-size: .92rem; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--hd-border); }
.article-sidebar { position: sticky; top: 24px; }
.widget { margin-bottom: 30px; padding-bottom: 28px; border-bottom: 1px solid var(--hd-border); }
.widget-title { margin: 0 0 14px; font-size: 1.1rem; }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { margin-bottom: 10px; }
.author-box { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 20px; margin-top: 48px; padding: 28px; background: var(--hd-soft); border-left: 5px solid var(--hd-primary); }
.author-box img { border-radius: 50%; }
.author-box__name { margin: 0; font-size: 1.25rem; }
.author-box__bio { margin: 7px 0 0; color: var(--hd-muted); font-size: .94rem; }
.post-navigation { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--hd-border); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { font-weight: 750; }

/* Páginas */
.page-content-wrap { width: min(calc(100% - 40px), var(--hd-reading)); padding: 56px 0; margin-inline: auto; }
.page-content-wrap .entry-title { font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.08; }

/* Rodapé */
.site-footer { margin-top: 60px; color: #d3d3d3; background: #1d1d1d; border-top: 6px solid var(--hd-primary); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; padding-block: 52px; }
.footer-brand img { width: 300px; max-width: 100%; filter: brightness(0) invert(1); opacity: .94; }
.footer-brand p { max-width: 440px; color: #adadad; }
.footer-title { margin: 0 0 14px; color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-menu { margin: 0; padding: 0; list-style: none; columns: 2; }
.footer-menu li { margin-bottom: 7px; break-inside: avoid; }
.footer-menu a:hover { color: #ffae55; }
.footer-bottom { padding: 18px 0; color: #999; border-top: 1px solid #363636; font-size: .82rem; }

/* Gutenberg */
.alignwide { width: min(100vw - 40px, 1050px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }
.wp-block-button__link { color: #fff; background: var(--hd-primary); border-radius: 3px; }

@media (max-width: 980px) {
  .latest-grid, .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .columnists-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: minmax(0, var(--hd-reading)); gap: 36px; }
  .article-sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--hd-container)); }
  .site-header__top { min-height: 84px; gap: 12px; }
  .site-logo img, .custom-logo { width: min(100%, 280px); max-height: 75px; }
  .header-search { display: none; }
  .nav-wrap { display: block; }
  .menu-toggle { display: block; width: 100%; text-align: left; }
  .primary-menu { display: none; padding-bottom: 12px; }
  .main-navigation.is-open .primary-menu { display: block; }
  .primary-menu > li > a, .primary-menu > li:first-child > a { padding: 10px 0; }
  .hero-grid { grid-template-columns: 1fr; grid-template-rows: 390px repeat(2, 240px); }
  .hero-card:first-child { grid-row: auto; }
  .hero-card:first-child .hero-card__title { font-size: clamp(1.75rem, 8vw, 2.6rem); }
  .category-layout { grid-template-columns: 1fr; }
  .category-side { grid-template-columns: 1fr 1fr; }
  .post-card--horizontal { display: block; }
  .post-card--horizontal .post-card__image { margin-bottom: 10px; }
  .article-header__inner, .featured-image { width: min(calc(100% - 28px), 980px); }
  .article-title { font-size: clamp(2rem, 10vw, 3.3rem); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: auto; }
}

@media (max-width: 520px) {
  .section { padding-block: 38px; }
  .latest-grid, .archive-grid, .columnists-grid, .category-side { grid-template-columns: 1fr; }
  .hero-grid { grid-template-rows: 360px repeat(2, 220px); }
  .hero-card__content, .hero-card:first-child .hero-card__content { padding: 20px; }
  .post-card--horizontal { display: grid; grid-template-columns: 118px minmax(0, 1fr); }
  .post-card__excerpt { display: none; }
  .author-box { grid-template-columns: 64px minmax(0, 1fr); padding: 20px; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-navigation .nav-next { text-align: left; }
  .footer-menu { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
