/*
Theme Name: MatConIA
Theme URI: https://matconia.com.br
Author: MatConIA
Author URI: https://matconia.com.br
Description: Tema editorial MatConIA — paleta Anthropic-inspired (creme, preto, clay).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GPL v2 or later
Text Domain: matconia
*/

/* Custom overrides adicionais (theme.json controla a maioria do estilo) */

body {
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.035em;
}

/* Scrollbar sutil (mesma da landing) */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(26, 26, 26, 0.18) transparent;
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-thumb {
  background: rgba(26, 26, 26, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 26, 26, 0.32);
  background-clip: padding-box;
}

/* Overline style (igual landing) */
.is-style-overline {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wp--preset--color--text-muted);
  font-weight: 500;
}

/* Botão primário (bg preto, texto creme) */
.wp-element-button,
.wp-block-button__link {
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.wp-block-button__link:hover {
  opacity: 0.85;
}

/* Cards de post */
.wp-block-query .wp-block-post {
  background: var(--wp--preset--color--elevated);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--wp--preset--color--border);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.wp-block-query .wp-block-post:hover {
  border-color: rgba(26, 26, 26, 0.16);
  transform: translateY(-2px);
}

.wp-block-post-title a {
  color: var(--wp--preset--color--text-primary) !important;
  text-decoration: none;
}

.wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent) !important;
}

/* Featured image clean */
.wp-block-post-featured-image img {
  border-radius: 8px;
}

/* Links de conteúdo */
.wp-block-post-content a,
.entry-content a {
  color: var(--wp--preset--color--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.wp-block-post-content a:hover {
  color: var(--wp--preset--color--text-primary);
}

/* Citações */
.wp-block-quote {
  border-left: 3px solid var(--wp--preset--color--accent);
  padding-left: 20px;
  font-style: italic;
  color: var(--wp--preset--color--text-secondary);
}

/* Code inline */
code {
  background: rgba(26, 26, 26, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ============================================
   FOOTER (alinhado com landing)
   ============================================ */
.matconia-footer {
  background: #0F0F0F;
  color: #F5F1E8;
  padding: 96px 0 0;
  overflow: hidden;
  border-top: 1px solid rgba(245, 241, 232, 0.08);
  margin-top: 96px;
}
.matconia-footer-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.matconia-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.matconia-footer-loop h4 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F5F1E8;
  margin: 0 0 12px;
}
.matconia-footer-loop p {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(245, 241, 232, 0.7);
  margin: 0 0 24px;
  max-width: 360px;
}
.matconia-footer-form {
  position: relative;
  max-width: 360px;
  margin-bottom: 28px;
}
.matconia-footer-form input {
  width: 100%;
  padding: 14px 52px 14px 18px;
  border-radius: 6px;
  border: 1px solid rgba(245, 241, 232, 0.18);
  background: rgba(245, 241, 232, 0.06);
  font-family: inherit;
  font-size: 14px;
  color: #F5F1E8;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}
.matconia-footer-form input:focus {
  border-color: rgba(245, 241, 232, 0.4);
  background: rgba(245, 241, 232, 0.1);
}
.matconia-footer-form input::placeholder {
  color: rgba(245, 241, 232, 0.45);
}
.matconia-footer-form button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: #F5F1E8;
  color: #1A1A1A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.matconia-footer-form button:hover {
  background: #E8C8B0;
  transform: translateY(-50%) scale(1.05);
}
.matconia-footer-social {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.matconia-footer-handle {
  font-size: 14px;
  font-weight: 500;
  color: rgba(245, 241, 232, 0.75);
  letter-spacing: -0.01em;
}
.matconia-footer-socials {
  display: flex;
  gap: 16px;
  align-items: center;
}
.matconia-footer-socials a {
  color: rgba(245, 241, 232, 0.65);
  transition: color 0.2s;
  display: inline-flex;
}
.matconia-footer-socials a:hover {
  color: #E8C8B0;
}
.matconia-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.matconia-footer-cols h5 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #F5F1E8;
  margin: 0 0 18px;
}
.matconia-footer-cols ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.matconia-footer-cols a {
  font-size: 14px;
  color: rgba(245, 241, 232, 0.72);
  text-decoration: none;
  transition: color 0.2s;
}
.matconia-footer-cols a:hover {
  color: #E8C8B0;
}
.matconia-footer-wordmark {
  font-weight: 700;
  font-size: clamp(80px, 17.5vw, 260px);
  line-height: 0.9;
  letter-spacing: -0.055em;
  text-align: center;
  color: rgba(245, 241, 232, 0.07);
  margin-top: 64px;
  user-select: none;
  white-space: nowrap;
  width: 100%;
  display: block;
}
.matconia-footer-copy {
  text-align: center;
  font-size: 13px;
  color: rgba(245, 241, 232, 0.5);
  margin: 0;
  padding-bottom: 40px;
  padding-top: 16px;
}

@media (max-width: 900px) {
  .matconia-footer { padding-top: 64px; margin-top: 64px; }
  .matconia-footer-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .matconia-footer-cols {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
  .matconia-footer-wordmark { margin-top: 56px; }
}
@media (max-width: 560px) {
  .matconia-footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   TIPOGRAFIA DO POST (reduzida)
   ============================================ */
.wp-block-post-content p {
  font-size: 17px;
  line-height: 1.65;
}
.wp-block-post-content h2 {
  font-size: 26px;
  line-height: 1.25;
  margin-top: 48px;
  margin-bottom: 16px;
}
.wp-block-post-content h3 {
  font-size: 20px;
  line-height: 1.3;
  margin-top: 36px;
  margin-bottom: 12px;
}
.wp-block-post-content blockquote p {
  font-size: 18px;
}
.wp-block-post-content ul li,
.wp-block-post-content ol li {
  font-size: 17px;
  line-height: 1.65;
}

/* ============================================
   HEADER (replicado da landing page)
   ============================================ */
.matconia-lp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 232, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.matconia-lp-header.is-scrolled {
  background: rgba(245, 241, 232, 0.92);
  border-bottom-color: rgba(26, 26, 26, 0.08);
  box-shadow: 0 8px 24px -16px rgba(26, 26, 26, 0.18), 0 2px 6px -3px rgba(26, 26, 26, 0.08);
}
.matconia-lp-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.matconia-lp-wordmark {
  font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #1A1A1A;
  text-decoration: none;
  letter-spacing: -0.04em;
  line-height: 1;
}
.matconia-lp-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}
.matconia-lp-nav a {
  font-size: 14px;
  color: rgba(26, 26, 26, 0.7);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.matconia-lp-nav a:hover,
.matconia-lp-nav a[aria-current="page"] {
  color: #1A1A1A;
}
.matconia-lp-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.matconia-lp-link {
  font-size: 14px;
  color: #1A1A1A;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
}
.matconia-lp-btn {
  background: #1A1A1A;
  color: #F5F1E8;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.matconia-lp-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.matconia-lp-toggle {
  background: transparent;
  border: none;
  color: #1A1A1A;
  cursor: pointer;
  padding: 8px;
  display: none;
}

/* MOBILE */
.matconia-lp-mobile[hidden] { display: none !important; }
.matconia-lp-mobile {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: #F5F1E8;
  padding: 88px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.matconia-lp-mobile a:not(.matconia-lp-btn):not(.matconia-lp-link-mobile) {
  font-family: "Fraunces", Georgia, serif;
  font-size: 28px;
  color: #1A1A1A;
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}
.matconia-lp-mobile-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.matconia-lp-mobile-cta .matconia-lp-btn {
  justify-content: center;
  padding: 14px 18px;
  font-size: 15px;
}
.matconia-lp-link-mobile {
  text-align: center;
  color: #1A1A1A;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 18px;
  text-decoration: none;
  border: 1px solid rgba(26, 26, 26, 0.14);
  border-radius: 8px;
}

@media (max-width: 900px) {
  .matconia-lp-nav { display: none; }
  .matconia-lp-cta { display: none; }
  .matconia-lp-toggle { display: inline-flex; }
}

/* Esconder o header default do tema (template part antigo de navigação inline) */
header.wp-block-group:has(.wp-block-navigation) { display: none; }

/* Featured image do post: mostrar inteira, sem crop */
.wp-block-post-featured-image {
  width: 100%;
}
.wp-block-post-featured-image img.wp-post-image {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  aspect-ratio: auto !important;
  display: block;
}

/* Cards na home: também sem crop */
.wp-block-query .wp-block-post-featured-image img { display: block; }


/* ============================================
   CARDS DA HOME — layout com imagem colando na borda
   ============================================ */
.wp-block-query .wp-block-post > .wp-block-group {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.wp-block-query .wp-block-post .wp-block-post-featured-image {
  margin: 0 !important;
  height: 220px !important;
}
.wp-block-query .wp-block-post .wp-block-post-featured-image a,
.wp-block-query .wp-block-post .wp-block-post-featured-image img {
  height: 220px !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  display: block;
  width: 100%;
}
.wp-block-query .wp-block-post > .wp-block-group > *:not(.wp-block-post-featured-image) {
  padding-left: 24px;
  padding-right: 24px;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-date {
  padding-top: 14px;
  padding-bottom: 4px;
  text-align: left !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-date time {
  display: block;
  text-align: left;
}
.wp-block-query .wp-block-post > .wp-block-group > *:last-child {
  padding-bottom: 24px;
}


/* Força alinhamento esquerdo e reduz gaps nos cards da home */
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-date,
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-title,
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-excerpt {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  text-align: left !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-date time {
  text-align: left;
  display: block;
}
.wp-block-query .wp-block-post > .wp-block-group {
  --wp--style--block-gap: 0 !important;
  gap: 0 !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-date {
  padding-top: 14px !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-title {
  margin-top: 6px !important;
  margin-bottom: 10px !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-excerpt {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-excerpt p {
  margin-top: 0;
  margin-bottom: 14px;
}
.wp-block-query .wp-block-post > .wp-block-group > .wp-block-post-excerpt p:last-child {
  margin-bottom: 0;
}

/* ============================================
   WORDMARK ANIMADO (mesma lógica da landing)
   ============================================ */
.mk-wordmark {
  display: inline-block;
  user-select: none;
  white-space: nowrap;
}
.mk-wordmark--giant {
  font-weight: 700;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}
.mk-wordmark--inline {
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.mk-l {
  display: inline-block;
  transition: color 420ms ease-out;
}
/* Giant: apagado (footer escuro) */
.mk-wordmark--giant .mk-l {
  color: rgba(245, 241, 232, 0.07);
}
.mk-wordmark--giant.is-played .mk-l {
  animation: mk-flash-giant 1500ms cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
  animation-delay: calc(300ms + var(--i) * 120ms);
}
.mk-wordmark--giant.is-played .mk-l--ia {
  animation: mk-flash-giant-ia 1500ms cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
  animation-delay: calc(300ms + var(--i) * 120ms);
}
@keyframes mk-flash-giant {
  0%   { color: rgba(245, 241, 232, 0.07); }
  20%  { color: rgba(232, 166, 122, 0.55); }
  35%  { color: #FFE3CC; }
  55%  { color: #C8785A; }
  100% { color: rgba(245, 241, 232, 0.07); }
}
@keyframes mk-flash-giant-ia {
  0%   { color: rgba(245, 241, 232, 0.07); }
  20%  { color: rgba(232, 166, 122, 0.55); }
  35%  { color: #FFE3CC; }
  100% { color: #C8785A; }
}
/* Inline (header claro): começa em preto */
.mk-wordmark--inline .mk-l {
  color: #1A1A1A;
}
.mk-wordmark--inline.is-played .mk-l {
  animation: mk-flash-inline 1200ms cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
  animation-delay: calc(200ms + var(--i) * 90ms);
}
.mk-wordmark--inline.is-played .mk-l--ia {
  animation: mk-flash-inline-ia 1200ms cubic-bezier(0.22, 1, 0.36, 1) 1 forwards;
  animation-delay: calc(200ms + var(--i) * 90ms);
}
@keyframes mk-flash-inline {
  0%   { color: #1A1A1A; }
  40%  { color: #C8785A; }
  100% { color: #1A1A1A; }
}
@keyframes mk-flash-inline-ia {
  0%   { color: #1A1A1A; }
  40%  { color: #C8785A; }
  100% { color: #C8785A; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-wordmark.is-played .mk-l { animation: none; }
  .mk-wordmark.is-played .mk-l--ia {
    color: #C8785A;
    animation: none;
  }
}
