/*
Theme Name: Revista Alma
Theme URI: https://revistaalma.com.br
Author: Revista Alma
Description: Tema editorial mobile-first da Revista Alma, orientado a publicação, leitura, Search/Discover e monetização modular.
Version: 0.5.0-beta
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: revista-alma
*/

:root {
  --alma-navy: #071a3d;
  --alma-navy-deep: #040b1a;
  --alma-gold: #d4a63a;
  --alma-gold-soft: #e3c878;
  --alma-cream: #f7f2e9;
  --alma-paper: #fffdfa;
  --alma-ink: #181818;
  --alma-muted: #6f6a64;
  --alma-line: #ddd5c8;
  --alma-wide: 1440px;
  --alma-editorial: 1240px;
  --alma-reading: 68ch;
  --alma-gutter: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--alma-paper); color: var(--alma-ink); font-family: Arial, Helvetica, sans-serif; font-size: 18px; line-height: 1.6; text-rendering: optimizeLegibility; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .14em; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.alma-container { width: min(calc(100% - (var(--alma-gutter) * 2)), var(--alma-editorial)); margin-inline: auto; }
.alma-wide { width: min(calc(100% - (var(--alma-gutter) * 2)), var(--alma-wide)); margin-inline: auto; }
.alma-reading { width: min(calc(100% - (var(--alma-gutter) * 2)), var(--alma-reading)); margin-inline: auto; }
.alma-kicker { margin: 0 0 8px; color: #8a6617; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.alma-meta { color: var(--alma-muted); font-size: 14px; line-height: 1.35; }
.alma-divider { border: 0; border-top: 1px solid var(--alma-line); margin: 32px 0; }

.alma-site-header { background: var(--alma-paper); border-bottom: 1px solid var(--alma-line); }
.alma-header-main { min-height: 68px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; }
.alma-icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--alma-navy); text-decoration: none; }
.alma-icon-button svg { display: block; }
.alma-masthead { justify-self: center; color: var(--alma-navy); font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 700; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.alma-masthead img { display: block; max-height: 54px; width: auto; }
.alma-header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.alma-enter { display: none; color: var(--alma-navy); font-size: 14px; font-weight: 700; text-decoration: none; }
.alma-category-nav { display: none; border-top: 1px solid rgba(221,213,200,.7); }
.alma-category-nav.is-open { display: block; }
.alma-category-nav-inner { display: flex; gap: 22px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.alma-category-nav-inner::-webkit-scrollbar { display: none; }
.alma-category-nav a { flex: 0 0 auto; color: var(--alma-navy); font-size: 14px; font-weight: 700; text-decoration: none; }

.alma-ad { width: 100%; display: grid; place-items: center; overflow: hidden; }
.alma-ad:empty { display: none; }
.alma-ad-label { display: block; margin-bottom: 6px; color: #8a8680; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; text-align: center; }

.alma-home { padding-bottom: 40px; }
.alma-home-zero { padding-bottom: 0; }
.alma-home-zero + .alma-site-footer { margin-top: 0; }
.alma-home-hero { padding: 28px 0 30px; }
.alma-home-hero h1 { max-width: 18ch; margin: 0 0 14px; color: var(--alma-navy-deep); font: 700 40px/1.05 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.alma-deck { max-width: 44ch; margin: 0 0 16px; color: #47433f; font: 400 19px/1.42 Georgia, "Times New Roman", serif; }
.alma-hero-media { margin-top: 22px; aspect-ratio: 16/9; overflow: hidden; background: #eee7dc; }
.alma-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.alma-home-grid { display: grid; gap: 0; }
.alma-story-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 18px 0; border-top: 1px solid var(--alma-line); }
.alma-story-card img { width: 120px; aspect-ratio: 3/2; object-fit: cover; }
.alma-story-card h2 { margin: 3px 0 6px; color: var(--alma-navy-deep); font: 700 20px/1.2 Georgia, "Times New Roman", serif; }
.alma-section { padding: 44px 0 0; }
.alma-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 3px solid var(--alma-navy); padding-top: 12px; margin-bottom: 16px; }
.alma-section-header h2 { margin: 0; color: var(--alma-navy); font: 700 28px/1.1 Georgia, "Times New Roman", serif; }
.alma-section-header a { color: #765817; font-size: 13px; font-weight: 700; }
.alma-state-zero { padding: 54px 0 58px; background: linear-gradient(145deg, var(--alma-navy-deep), var(--alma-navy)); color: white; }
.alma-state-zero-inner { max-width: 760px; }
.alma-state-zero .alma-kicker { color: var(--alma-gold-soft); }
.alma-state-zero h1 { max-width: 15ch; margin: 10px 0 18px; font: 600 42px/1.06 Georgia, "Times New Roman", serif; letter-spacing: -.015em; }
.alma-state-zero p { max-width: 52ch; margin: 0; color: #ddd8cf; font-size: 18px; line-height: 1.55; }

.alma-article { padding-bottom: 28px; }
.alma-article-header {
  width: min(calc(100% - (var(--alma-gutter) * 2)), 1080px);
  margin-inline: auto;
  padding: 36px 0 28px;
}
.alma-article-header h1 {
  max-width: 30ch;
  margin: 0 0 14px;
  color: var(--alma-navy-deep);
  font: 700 38px/1.06 Georgia, "Times New Roman", serif;
  letter-spacing: -.025em;
}
.alma-article-header .alma-deck { max-width: 54ch; }
.alma-article-byline { margin-top: 18px; color: #37332f; font-size: 14px; }
.alma-article-media {
  width: min(calc(100% - (var(--alma-gutter) * 2)), var(--alma-editorial));
  margin: 0 auto 24px;
}
.alma-article-media img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.alma-caption {
  width: 100%;
  margin: 8px auto 0;
  color: var(--alma-muted);
  font-size: 12px;
  line-height: 1.45;
}
.alma-image-credit {
  width: 100%;
  margin: 3px auto 0;
  color: #8a8680;
  font-size: 11px;
  line-height: 1.4;
}
.alma-article-content {
  margin-top: 6px;
  font: 400 18px/1.62 Georgia, "Times New Roman", serif;
}
.alma-article-content p { margin: 0 0 1.15em; }
.alma-article-content > p:first-of-type::first-letter {
  float: left;
  margin: .02em .10em 0 0;
  color: var(--alma-navy-deep);
  font: 700 2.9em/.82 Georgia, "Times New Roman", serif;
}
.alma-article-content h2 { margin: 1.6em 0 .55em; color: var(--alma-navy-deep); font: 700 28px/1.14 Georgia, "Times New Roman", serif; }
.alma-article-content h3 { margin: 1.45em 0 .5em; color: var(--alma-navy-deep); font: 700 23px/1.2 Georgia, "Times New Roman", serif; }
.alma-article-content a { color: #775713; font-weight: 600; }
.alma-article-content blockquote { margin: 1.5em 0; padding-left: 18px; border-left: 3px solid var(--alma-gold); color: #38332e; font-size: 1.18em; }
.alma-author-box { margin-top: 40px; padding: 22px 0; border-top: 1px solid var(--alma-line); border-bottom: 1px solid var(--alma-line); }
.alma-author-box h2,
.alma-author-name {
  max-width: 100%;
  margin: 0 0 8px;
  color: var(--alma-navy-deep);
  font: 700 clamp(22px, 5.8vw, 26px)/1.15 Georgia, "Times New Roman", serif;
  overflow-wrap: anywhere;
}
.alma-author-box p { margin: 0 0 12px; color: #47433f; font-size: 16px; line-height: 1.55; }
.alma-profile-link { display: inline-block; color: var(--alma-navy); font-size: 15px; font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; }
.alma-related { margin-top: 48px; }

.alma-site-footer { margin-top: 48px; padding: 36px 0 26px; background: var(--alma-navy-deep); color: #e8e3db; }
.alma-home + .alma-site-footer,
.alma-article + .alma-site-footer { margin-top: 0; }
.alma-footer-brand { color: white; font: 700 24px Georgia, "Times New Roman", serif; }
.alma-footer-links { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 20px; font-size: 13px; }
.alma-footer-links a { color: #d7d2ca; }
.alma-footer-legal { margin-top: 30px; color: #959084; font-size: 11px; }

@media (min-width: 760px) {
  :root { --alma-gutter: 28px; }
  body { font-size: 19px; }
  .alma-header-main { min-height: 104px; grid-template-columns: 1fr auto 1fr; }
  .alma-menu-toggle { justify-self: start; }
  .alma-masthead { font-size: 42px; }
  .alma-masthead img { max-height: 68px; }
  .alma-enter { display: inline-flex; }
  .alma-category-nav { display: block; }
  .alma-category-nav-inner { justify-content: center; padding: 13px 0 15px; }
  .alma-home-hero { padding: 36px 0 38px; display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.35fr); gap: 34px; align-items: center; }
  .alma-home-hero h1 { font-size: 50px; }
  .alma-state-zero { padding: 64px 0 70px; }
  .alma-state-zero h1 { font-size: 52px; font-weight: 500; }
  .alma-state-zero p { font-size: 19px; }
  .alma-hero-media { margin-top: 0; }
  .alma-home-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .alma-story-card { display: block; border-top: 1px solid var(--alma-line); }
  .alma-story-card img { width: 100%; margin-bottom: 12px; }
  .alma-story-card h2 { font-size: 23px; }
  .alma-article-header { width: min(calc(100% - (var(--alma-gutter) * 2)), 1060px); padding: 46px 0 24px; }
  .alma-article-header h1 { max-width: 34ch; font-size: 54px; line-height: 1.04; }
  .alma-article-header .alma-deck { max-width: 64ch; font-size: 21px; }
  .alma-article-media { margin-bottom: 28px; }
  .alma-article-content { font-size: 20px; line-height: 1.6; }
  .alma-article-content h2 { font-size: 34px; }
  .alma-article-content h3 { font-size: 26px; }
}

@media (min-width: 1180px) {
  .alma-home-hero h1 { font-size: 58px; }
  .alma-article-header { width: min(calc(100% - 64px), 1040px); }
  .alma-article-header h1 { max-width: 34ch; font-size: 58px; }
  .alma-article-media { width: min(calc(100% - 80px), 1240px); }
}

@media (max-width: 759px) {
  .alma-article-header h1 { font-size: 38px; line-height: 1.08; }
  .alma-article-content > p:first-of-type::first-letter { font-size: 2.55em; margin-right: .08em; }
}

/* Ajustes consolidados de links editoriais e foco */
.alma-home-hero h1 a,
.alma-story-card h2 a { color: inherit; text-decoration: none; }
.alma-home-hero h1 a:hover,
.alma-story-card h2 a:hover { color: #1c3157; }
.alma-home-hero h1 a:focus-visible,
.alma-story-card h2 a:focus-visible,
.alma-profile-link:focus-visible,
.alma-icon-button:focus-visible { outline: 2px solid var(--alma-gold); outline-offset: 4px; }

@media (max-width: 759px) {
  .alma-site-footer { padding: 30px 0 22px; }
  .alma-footer-brand { font-size: 22px; }
  .alma-footer-legal { margin-top: 22px; }
}
