/*
Theme Name: A-temporal
Theme URI: https://atemporalrevista.wordpress.com
Author: Editora A (Recôncavo)
Description: Tema de blocos para a Revista A-temporal, com a estética de jornal da revista impressa: faixa superior, título com "Revista" em caixa vermelha, filetes e textos justificados. Responsivo para celular, tablet e PC.
Version: 1.2.0
Requires at least: 6.3
Tested up to: 6.8
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: a-temporal
Tags: full-site-editing, block-theme, blog, one-column, custom-colors, editor-style, responsive-layout
*/

:root {
  --at-red: #e60000;
  --at-red-dark: #a80000;
  --at-ink: #111;
  --at-muted: #555;
  --at-rule: #111;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, video, iframe, object { max-width: 100%; height: auto; }
p, li, h1, h2, h3, h4 { overflow-wrap: anywhere; }

a:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 3px solid var(--at-red);
  outline-offset: 3px;
}

/* ---------- Estrutura geral ---------- */
.at-wrap,
.at-main,
.at-header,
.at-footer {
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  padding-inline: clamp(14px, 4vw, 32px);
}
.at-main { padding-bottom: 40px; }

/* ---------- Faixa superior ---------- */
.at-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 18px 0 6px;
  border-bottom: 1.5px solid var(--at-rule);
  font-size: clamp(.72rem, 1.6vw, .95rem);
}
.at-topbar p { margin: 0; }
.at-topbar .at-issue {
  font-family: "Arial Narrow", Oswald, "Helvetica Neue", Arial, sans-serif;
  font-stretch: condensed;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.03em;
}

/* ---------- Título ---------- */
.at-title {
  margin: 0 !important;
  padding: clamp(6px, 1.5vw, 14px) 0;
  text-align: center;
  border-bottom: 1.5px solid var(--at-rule);
  font-family: "Times New Roman", Times, "Liberation Serif", serif;
  font-weight: 400;
  font-size: clamp(2.1rem, 8.5vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -.045em;
}
.at-title a { color: inherit; text-decoration: none; }
.at-title mark,
.at-title .at-box {
  background: var(--at-red);
  color: #fff;
  padding: 0 .12em .04em;
  margin-right: .05em;
}

/* ---------- Menu ---------- */
.at-nav {
  justify-content: center;
  padding: 8px 0;
  border-bottom: 1.5px solid var(--at-rule);
  font-size: .95rem;
  font-weight: 600;
}
.at-nav a { text-decoration: none; padding: 6px 10px; }
.at-nav a:hover { color: var(--at-red); }

/* ---------- Subtítulos de seção ---------- */
.at-h {
  margin: clamp(22px, 4vw, 40px) 0 14px;
  padding: 4px 0 4px 14px;
  border-top: 1.5px solid var(--at-rule);
  border-bottom: 1.5px solid var(--at-rule);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
}

/* ---------- Texto ---------- */
.at-main p,
.at-page p { text-align: justify; hyphens: auto; line-height: 1.6; }
.at-main .at-first { text-indent: 2.2em; }
.at-lede { font-size: clamp(1.05rem, 2vw, 1.25rem); }
.at-lede strong { color: var(--at-red); }

/* ---------- Abertura ---------- */
.at-open { gap: clamp(16px, 3vw, 32px) !important; align-items: flex-start; }
.at-open img { border: 1.5px solid var(--at-rule); width: 100%; height: auto; display: block; }
.at-open figcaption { font-size: .9rem; color: var(--at-muted); text-align: justify; }

/* ---------- Edições ---------- */
.at-eds { gap: clamp(12px, 2.5vw, 24px) !important; }
.at-ed {
  height: 100%;
  border: 1.5px solid var(--at-rule);
  padding: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.at-ed:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--at-red); }
.at-ed p { margin: 0 0 .6em; text-align: left; font-size: .92rem; }
.at-ed .at-num {
  font-family: "Arial Narrow", Oswald, Arial, sans-serif;
  font-stretch: condensed;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -.04em;
  transform-origin: left;
  transform: scaleX(.8);
}
.at-ed .at-date { color: var(--at-muted); font-size: .85rem; }
.at-ed .at-doi { color: var(--at-muted); font-size: .75rem; word-break: break-all; }
.at-ed a { color: var(--at-red); font-weight: 700; }

/* ---------- Expediente ---------- */
.at-info { gap: 4px clamp(16px, 4vw, 40px) !important; }
.at-info p { text-align: left; margin: 0 0 .7em; }
.at-info .at-label {
  display: block;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--at-red);
  font-weight: 700;
}

/* ---------- Botões ---------- */
.wp-block-buttons { gap: 10px; margin-top: 22px; }
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 0;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 1.5px solid var(--at-rule);
  background: #fff;
  color: var(--at-ink);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--at-ink); color: #fff; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link { background: var(--at-red); color: #fff; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background: var(--at-red-dark); }

/* ---------- Páginas internas e PDFs ---------- */
.at-page { max-width: 1000px; margin-inline: auto; padding: 0 clamp(14px, 4vw, 32px) 40px; }
.at-page .wp-block-post-title {
  margin: clamp(22px, 4vw, 40px) 0 14px;
  padding: 4px 0 4px 14px;
  border-top: 1.5px solid var(--at-rule);
  border-bottom: 1.5px solid var(--at-rule);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
}
.wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-block: 1.5rem 1rem; }
.wp-block-file__embed {
  width: 100% !important;
  height: min(80vh, 900px) !important;
  min-height: 420px;
  border: 1.5px solid var(--at-rule);
}
.wp-block-file a:not(.wp-block-file__button) { font-weight: 600; color: var(--at-red); }
.wp-block-file__button {
  border-radius: 0 !important;
  background: var(--at-red) !important;
  color: #fff !important;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.2rem;
}
hr.wp-block-separator { border-color: var(--at-rule); opacity: .6; }

/* ---------- Rodapé ---------- */
.at-footer-line {
  margin-top: 34px;
  padding-top: 10px;
  border-top: 1.5px solid var(--at-rule);
  font-size: .8rem;
  color: var(--at-muted);
  gap: 6px 16px;
}
.at-footer-line p { margin: 0; text-align: left; }
.at-footer { padding-bottom: 30px; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .at-eds.wp-block-columns { flex-wrap: wrap !important; }
  .at-eds.wp-block-columns > .wp-block-column { flex-basis: calc(50% - 12px) !important; }
}

/* ---------- Celular ---------- */
@media (max-width: 781px) {
  .at-eds.wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
  .at-main p, .at-page p { text-align: left; hyphens: none; }
  .at-open figcaption { text-align: left; }
  .wp-block-buttons { flex-direction: column; align-items: stretch; }
  .wp-block-buttons .wp-block-button,
  .wp-block-buttons .wp-block-button__link { width: 100%; }
  .wp-block-file__embed { display: none !important; }
  .wp-block-file { flex-direction: column; align-items: stretch; padding: 1rem; border: 1.5px solid var(--at-rule); }
  .wp-block-file .wp-block-file__button { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .at-topbar .at-right { display: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 1025px) {
  .wp-block-file__embed { height: 85vh !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .wp-block-buttons, .wp-block-file__button, .wp-block-file__embed, .at-nav { display: none !important; }
}

/* ---------- Listas dinâmicas de edições ---------- */
.at-issue-q, .at-issue-q .wp-block-post-template { margin: 0; padding: 0; list-style: none; }
.at-issue-q .wp-block-post-title { margin: 0; }
.at-eds .wp-block-post-template { list-style: none; margin: 0; padding: 0; gap: clamp(12px, 2.5vw, 24px); }
.at-eds .wp-block-post-title { margin: 0; }
.at-eds .wp-block-post-date,
.at-eds .wp-block-post-excerpt { margin: 0 0 .6em; }
.at-eds .wp-block-post-excerpt__excerpt,
.at-eds .wp-block-read-more { font-size: .92rem; text-align: left; }
.at-eds .wp-block-read-more { display: inline-block; margin-top: auto; padding-top: 6px; text-decoration: none; border-bottom: 2px solid var(--at-red); }
.at-eds .wp-block-query-pagination { margin-top: 24px; gap: 12px; }

@media (max-width: 900px) {
  .at-eds .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
  .at-eds .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr !important; }
}
