/* =========================================================
   PatinhasMAPS Blog — Design Tokens
   ========================================================= */
:root {
  /* Cor */
  --pm-bg: #0A0A0A;
  --pm-surface: #151310;
  --pm-surface-2: #1F1B16;
  --pm-border: #2A2620;
  --pm-text: #F5F1EA;
  --pm-text-muted: #8A8378;
  --pm-terracota: #E8834F;
  --pm-terracota-dark: #C86B3C;
  --pm-terracota-tint: rgba(232, 131, 79, 0.12);

  /* Tipografia */
  --pm-font-display: "Sora", system-ui, sans-serif;
  --pm-font-body: "Figtree", system-ui, sans-serif;
  --pm-font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Escala */
  --pm-radius: 14px;
  --pm-radius-sm: 8px;
  --pm-max-width: 1120px;
  --pm-gutter: 24px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =========================================================
   Reset leve
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--pm-bg);
  color: var(--pm-text);
  font-family: var(--pm-font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--pm-terracota); text-decoration: none; }
a:hover { color: var(--pm-terracota-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--pm-terracota);
  outline-offset: 3px;
  border-radius: 4px;
}
ul, ol { padding-left: 1.3em; }
h1, h2, h3, h4 {
  font-family: var(--pm-font-display);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

/* =========================================================
   Layout base
   ========================================================= */
.pm-container {
  max-width: var(--pm-max-width);
  margin: 0 auto;
  padding: 0 var(--pm-gutter);
}
.pm-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pm-terracota);
  color: #0A0A0A;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
  font-family: var(--pm-font-mono);
  font-size: 14px;
}
.pm-skip-link:focus { left: 0; }

/* =========================================================
   Header
   ========================================================= */
.pm-header {
  border-bottom: 1px solid var(--pm-border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
}
.pm-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--pm-gutter);
}
.pm-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pm-font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--pm-text);
}
.pm-header__brand img { height: 28px; width: auto; }
.pm-header__blog-tag {
  font-family: var(--pm-font-mono);
  font-size: 11px;
  color: var(--pm-terracota);
  border: 1px solid var(--pm-terracota-dark);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pm-header__nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
}
.pm-header__nav a { color: var(--pm-text-muted); }
.pm-header__nav a:hover { color: var(--pm-text); }
.pm-header__cta {
  font-family: var(--pm-font-mono);
  font-size: 13px;
  background: var(--pm-terracota);
  color: #0A0A0A !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}
.pm-header__cta:hover { background: var(--pm-terracota-dark); }

/* menu mobile simples */
.pm-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--pm-border);
  border-radius: 8px;
  color: var(--pm-text);
  padding: 8px 10px;
}
@media (max-width: 720px) {
  .pm-header__nav { display: none; }
  .pm-header__nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--pm-bg);
    border-bottom: 1px solid var(--pm-border);
    padding: 16px var(--pm-gutter) 22px;
    gap: 14px;
  }
  .pm-menu-toggle { display: inline-flex; }
}

/* =========================================================
   Trilha de patinhas — indicador de progresso de leitura
   (elemento de assinatura, só aparece em single.php)
   ========================================================= */
.pm-paw-trail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: var(--pm-border);
}
.pm-paw-trail__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pm-terracota-dark), var(--pm-terracota));
  transition: width 80ms linear;
}
.pm-paw-trail__marks {
  position: fixed;
  top: 6px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 var(--pm-gutter);
  pointer-events: none;
  z-index: 59;
  opacity: 0.55;
}
.pm-paw-trail__marks span {
  font-size: 11px;
  color: var(--pm-text-muted);
}

/* =========================================================
   Eyebrow / meta (mono)
   ========================================================= */
.pm-eyebrow {
  font-family: var(--pm-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pm-terracota);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pm-eyebrow::before { content: "🐾"; font-size: 11px; }
.pm-meta {
  font-family: var(--pm-font-mono);
  font-size: 13px;
  color: var(--pm-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.pm-meta__dot::before { content: "·"; margin-right: 14px; color: var(--pm-border); }

/* =========================================================
   Hero do blog (index / home do blog)
   ========================================================= */
.pm-hero {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--pm-border);
}
.pm-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
}
@media (min-width: 900px) {
  .pm-hero { padding: 64px 0 40px; }
  .pm-hero h1 { max-width: 32ch; }
}
.pm-hero p {
  color: var(--pm-text-muted);
  font-size: 16px;
  max-width: 52ch;
  margin: 12px 0 0;
}

/* =========================================================
   Grid de posts
   ========================================================= */
.pm-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px 0 72px;
}
.pm-card {
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 160ms ease, transform 160ms ease;
}
.pm-card:hover {
  border-color: var(--pm-terracota-dark);
  transform: translateY(-2px);
}
.pm-card__image {
  aspect-ratio: 16/10;
  background: var(--pm-surface-2);
  overflow: hidden;
}
.pm-card__image img { width: 100%; height: 100%; object-fit: cover; }
.pm-card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pm-card__title {
  font-family: var(--pm-font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.pm-card__title a { color: var(--pm-text); }
.pm-card__title a:hover { color: var(--pm-terracota); }
.pm-card__excerpt {
  color: var(--pm-text-muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

/* =========================================================
   Artigo (single.php)
   ========================================================= */
.pm-article-header {
  padding: 96px 0 32px;
  border-bottom: 1px solid var(--pm-border);
}
.pm-article-header h1 {
  font-size: clamp(28px, 4.5vw, 42px);
  margin: 14px 0 16px;
  max-width: 22ch;
}
.pm-article-cover {
  margin: 32px 0 0;
  border-radius: var(--pm-radius);
  overflow: hidden;
  border: 1px solid var(--pm-border);
}
.pm-article-cover img {
  width: 100%;
  height: auto;
  display: block;
}
/* Em telas largas, evita que uma foto muito vertical fique excessivamente
   alta — recorta com cuidado (crop centralizado) só a partir de desktop,
   onde há mais visão geral da imagem pra perder menos enquadramento. */
@media (min-width: 900px) {
  .pm-article-cover {
    max-height: 560px;
  }
  .pm-article-cover img {
    height: 560px;
    object-fit: cover;
    object-position: center 20%;
  }
}
.pm-article-body {
  max-width: 72ch;
  margin: 0 auto;
  padding: 48px var(--pm-gutter) 24px;
  font-size: 18px;
  line-height: 1.75;
}
.pm-article-body h2 {
  font-size: 27px;
  margin-top: 1.6em;
}
.pm-article-body h3 {
  font-size: 21px;
  margin-top: 1.4em;
  font-family: var(--pm-font-body);
  font-weight: 700;
}
.pm-article-body p { margin: 0 0 1.3em; }
.pm-article-body a { text-decoration: underline; text-underline-offset: 3px; }
.pm-article-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--pm-terracota);
  color: var(--pm-text-muted);
  font-style: italic;
}
.pm-article-body code {
  font-family: var(--pm-font-mono);
  background: var(--pm-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}
.pm-article-body img {
  border-radius: var(--pm-radius-sm);
  margin: 0.4em 0;
}
.pm-article-body ul li, .pm-article-body ol li { margin-bottom: 0.5em; }
.pm-article-body hr {
  border: none;
  border-top: 1px solid var(--pm-border);
  margin: 2.4em 0;
}

.pm-tags {
  max-width: 72ch;
  margin: 0 auto;
  padding: 0 var(--pm-gutter) 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pm-tag {
  font-family: var(--pm-font-mono);
  font-size: 12.5px;
  color: var(--pm-text-muted);
  border: 1px solid var(--pm-border);
  border-radius: 999px;
  padding: 5px 12px;
}
.pm-tag:hover { color: var(--pm-terracota); border-color: var(--pm-terracota-dark); }

/* CTA de volta pro diretório, ao final do post */
.pm-inline-cta {
  max-width: 72ch;
  margin: 0 auto 72px;
  padding: 28px var(--pm-gutter);
  border: 1px solid var(--pm-terracota-dark);
  background: var(--pm-terracota-tint);
  border-radius: var(--pm-radius);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pm-inline-cta p { margin: 0; font-size: 15px; color: var(--pm-text); }
.pm-inline-cta a {
  font-family: var(--pm-font-mono);
  font-size: 13.5px;
  font-weight: 600;
  background: var(--pm-terracota);
  color: #0A0A0A !important;
  padding: 10px 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.pm-inline-cta a:hover { background: var(--pm-terracota-dark); }

/* =========================================================
   Página estática (page.php)
   ========================================================= */
.pm-page-body {
  max-width: 72ch;
  margin: 0 auto;
  padding: 96px var(--pm-gutter) 72px;
}
.pm-page-body h1 { font-size: clamp(28px, 4.5vw, 40px); margin-bottom: 0.6em; }

/* =========================================================
   Busca / 404
   ========================================================= */
.pm-empty-state {
  max-width: 60ch;
  margin: 0 auto;
  padding: 120px var(--pm-gutter) 100px;
  text-align: center;
}
.pm-empty-state h1 { font-size: 30px; }
.pm-empty-state p { color: var(--pm-text-muted); }
.pm-search-form {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.pm-search-form input[type="search"] {
  flex: 1;
  background: var(--pm-surface);
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius-sm);
  color: var(--pm-text);
  padding: 11px 14px;
  font-family: var(--pm-font-body);
  font-size: 15px;
}
.pm-search-form input[type="search"]::placeholder { color: var(--pm-text-muted); }
.pm-search-form button {
  font-family: var(--pm-font-mono);
  background: var(--pm-terracota);
  border: none;
  color: #0A0A0A;
  border-radius: var(--pm-radius-sm);
  padding: 0 18px;
  font-weight: 600;
  cursor: pointer;
}
.pm-search-form button:hover { background: var(--pm-terracota-dark); }

/* =========================================================
   Paginação
   ========================================================= */
.pm-pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 0 72px;
  font-family: var(--pm-font-mono);
  font-size: 14px;
}
.pm-pagination a, .pm-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--pm-radius-sm);
  border: 1px solid var(--pm-border);
  color: var(--pm-text-muted);
}
.pm-pagination a:hover { border-color: var(--pm-terracota-dark); color: var(--pm-terracota); }
.pm-pagination .current {
  background: var(--pm-terracota);
  color: #0A0A0A;
  border-color: var(--pm-terracota);
}

/* =========================================================
   Footer
   ========================================================= */
.pm-footer {
  border-top: 1px solid var(--pm-border);
  padding: 40px 0;
  margin-top: 32px;
}
.pm-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pm-footer__copy {
  font-family: var(--pm-font-mono);
  font-size: 13px;
  color: var(--pm-text-muted);
}
.pm-footer__links { display: flex; gap: 18px; font-size: 14px; }
.pm-footer__links a { color: var(--pm-text-muted); }
.pm-footer__links a:hover { color: var(--pm-text); }

/* =========================================================
   Utilitários
   ========================================================= */
.pm-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
