/*
Theme Name: Inútil Project
Theme URI: https://inutilproject.com
Author: Nik Neves
Author URI: https://www.nikneves.com
Description: Tema do Inútil Project (Projeto Inútil / Useless Project) — comics and visual narratives. Recria a grade de cartões do site original no Cargo: fundo cinza, cartões brancos, cabeçalho animado. Inclui importador do acervo em Aparência › Importar acervo.
Version: 1.2.8
Requires at least: 6.0
Requires PHP: 7.4
License: All Rights Reserved ⓒ Nik Neves (conteúdo). Código do tema: GPLv2 or later.
Text Domain: inutilproject
Tags: portfolio, grid-layout, blog, custom-logo, custom-menu, featured-images
*/

:root {
  --bg: #c4c4c4;
  --card: #ffffff;
  --ink: #111111;
  --ink-soft: #3d3d3d;
  --muted: #8a8a8a;
  --rule: #b3b3b3;
  --link-hover: #e8455a;
  --gap: 3px;
  --pad: 10px;
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  /* fonte atual, mantida nas legendas */
  --caption: "Trebuchet MS", "Lucida Grande", "Helvetica Neue", Arial, sans-serif;
  --sans: var(--serif);
  --text: var(--serif);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 100; top: 8px; left: 8px;
  background: #fff; padding: 8px 12px;
}

/* ---------- Header ---------- */
.site-header { padding: 28px 18px 14px; }
.site-branding { display: inline-block; text-decoration: none; }
.site-branding img { width: 280px; max-width: 100%; height: auto; }
.site-branding .logo-static { display: none; }
@media (prefers-reduced-motion: reduce) {
  .site-branding .logo-animated { display: none; }
  .site-branding .logo-static { display: block; width: 221px; }
}
.custom-logo { width: 280px; max-width: 100%; height: auto; }
.site-branding, .custom-logo-link { display: inline-block; cursor: pointer; transition: opacity .15s; }
.site-branding:hover, .custom-logo-link:hover { opacity: .8; }

.header-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px;
  margin-top: 16px; font-family: var(--sans); font-size: 13px;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.main-nav a, .social-link { text-decoration: none; color: inherit; }
.main-nav a:hover, .social-link:hover { color: var(--link-hover); }
.main-nav .current-menu-item > a, .main-nav .current_page_item > a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.social-link { color: var(--muted); }

.menu-toggle {
  display: none; background: none; border: 0; padding: 6px 0; cursor: pointer;
  font: 600 13px var(--sans); color: inherit; letter-spacing: .04em;
}
.menu-toggle .bars { display: inline-block; width: 18px; height: 12px; vertical-align: -1px; margin-right: 6px;
  background: linear-gradient(#333 0 0) top/100% 2px no-repeat, linear-gradient(#333 0 0) center/100% 2px no-repeat, linear-gradient(#333 0 0) bottom/100% 2px no-repeat; }

@media (max-width: 640px) {
  .site-header { padding: 18px 12px 10px; }
  .site-branding img, .custom-logo { width: 191px; }
  .menu-toggle { display: inline-block; }
  .header-bar { display: block; }
  .header-bar .main-nav, .header-bar .social-link { display: none; }
  .header-bar.is-open .main-nav, .header-bar.is-open .social-link { display: block; }
  .header-bar.is-open .main-nav ul { flex-direction: column; gap: 10px; padding: 12px 0 6px; font-size: 16px; }
  .header-bar.is-open .social-link { font-size: 16px; padding-bottom: 8px; }
}

/* ---------- Grid (index) ---------- */
.site-main { padding: 0 18px 40px; }
@media (max-width: 640px) { .site-main { padding: 0 8px 30px; } }

.archive-title {
  font: 700 13px var(--sans); text-transform: lowercase; color: var(--ink);
  margin: 4px 0 12px; letter-spacing: .02em;
}
.archive-title span { color: var(--muted); font-weight: 400; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  grid-auto-rows: 1px;
  gap: 0 var(--gap);
  align-items: start;
}
.grid.no-js-grid { grid-auto-rows: auto; gap: var(--gap); }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
  background: var(--card);
  padding: var(--pad) var(--pad) 14px;
  margin-bottom: var(--gap);
  font-size: 11.5px; line-height: 1.65; color: var(--ink-soft);
}
.card-link { text-decoration: none; color: inherit; display: block; }
.card-thumb { margin: 0 0 14px; background: #f2f2f2; }
.card-thumb img { width: 100%; }
.card-title {
  font: 700 12.5px/1.45 var(--serif); color: var(--ink); margin: 0 0 8px; letter-spacing: .01em;
}
.card-link:hover .card-title { color: var(--link-hover); }
.card-excerpt { margin: 0 0 10px; }
.card-excerpt p { margin: 0; }
.card-tags { font-size: 11px; color: var(--muted); }
.card-tags a { color: var(--muted); text-underline-offset: 2px; }
.card-tags a:hover { color: var(--link-hover); }

@media (max-width: 480px) {
  .card { padding: 0 0 18px; background: transparent; }
  .card { background: var(--card); padding: 8px 8px 12px; }
  .card-excerpt { display: none; }
  .card-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.editor-styles-wrapper .printed-issues-grid { grid-auto-rows: auto; gap: var(--gap); }
.editor-styles-wrapper .printed-issues-grid .card-excerpt { display: block; }
.editor-styles-wrapper .printed-issues-grid .components-base-control { margin-bottom: 12px; }

/* ---------- Single / page ---------- */
.entry { max-width: 820px; margin: 10px auto 40px; }
.entry-header { margin-bottom: 22px; }
.entry-title { font: 700 21px/1.35 var(--serif); margin: 0; }
.entry-content { font-size: 14px; line-height: 1.8; }
.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content figure { margin: 0 0 22px; }
figcaption, .wp-element-caption, .entry-content figcaption {
  font-family: var(--caption); font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 6px;
}
.entry-content a { text-underline-offset: 3px; }
.entry-content .wp-block-image img { margin: 0 auto; }
.entry-content .lang-note { font: 700 11px var(--sans); color: var(--muted); letter-spacing: .08em; margin-top: 2em; }
.entry-content .see-video a {
  display: inline-block; font: 700 12px var(--sans); letter-spacing: .08em; text-decoration: none;
  background: #111; color: #fff; padding: 7px 12px;
}
.entry-content .see-video a:hover { background: var(--link-hover); color: #fff; }
.entry-content .shrug { font-size: 22px; margin-top: 1.6em; }

.entry-meta {
  border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 30px;
  font: 12px var(--sans); color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--link-hover); }

.post-nav { display: flex; justify-content: space-between; gap: 20px; font: 13px var(--sans); margin-top: 18px; }
.post-nav a { text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }

.more-heading { font: 700 13px var(--sans); color: var(--ink); margin: 30px 0 12px; }

/* Alternate Printed Issues page */
.printed-issues-page { max-width: 1100px; }
.printed-issues-page .entry-header { margin-bottom: 16px; }
.printed-issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
  grid-auto-rows: 1px;
  gap: 0 var(--gap);
  align-items: start;
}
.printed-issues-grid.no-js-grid { grid-auto-rows: auto; gap: var(--gap); }
.printed-issue-card { margin-bottom: var(--gap); min-width: 0; }
.printed-issue-card .card-excerpt { margin-bottom: 0; }
.printed-issue-book { position: relative; cursor: pointer; }
.printed-issue-book:hover .card-title { color: var(--link-hover); }
.printed-issue-book > ._df_thumb {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: .001 !important;
  cursor: pointer !important;
}
.printed-issue-book > ._df_thumb:focus-visible { opacity: .01 !important; outline: 2px solid var(--ink); }
.printed-issue-unavailable { cursor: default; }
@media (max-width: 480px) {
  .printed-issues-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Printed issues */
.issues > .wp-block-group__inner-container { display: contents; }
.issues { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 26px; margin-top: 10px; }
.issues figure { margin: 0; }
.issues img { width: 100%; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.issues figcaption, .entry-content .issues figcaption { font: 700 13px var(--sans); color: var(--ink); margin-top: 10px; }
.issues figcaption small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 2px; }

/* Pagination */
.pagination { font: 13px var(--sans); margin-top: 20px; display: flex; gap: 14px; }
.pagination a { text-decoration: none; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 22px 18px 34px; font: 11px var(--sans); color: var(--ink);
  display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between;
}
.site-footer a { color: var(--ink); }

/* Gutenberg alignments */
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }

@media (max-width: 640px) { .entry { padding: 0 6px; } .entry-title { font-size: 19px; } }


/* ================================================================
 * v1.1 — logotipo no índice, posts em duas colunas, carrossel,
 * imagem destacada lateral nas páginas
 * ================================================================ */

/* Logotipo: 280px (desktop) / 191px (celular) em todas as páginas; link para o índice */

/* Posts: texto à esquerda, imagens/vídeo à direita (desktop) */
.entry { margin-left: 0; margin-right: auto; }
.entry-split { max-width: 1320px; }
.entry-split.has-media {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "head media" "body media";
  grid-template-rows: auto 1fr;
  column-gap: 48px;
  align-items: start;
}
.entry-split.has-media .entry-header { grid-area: head; }
.entry-split.has-media .entry-body { grid-area: body; }
.entry-split.has-media .entry-media { grid-area: media; position: sticky; top: 16px; padding-top: 4px; }
.entry-split .entry-body { max-width: 560px; }
.entry-media figure { margin: 0; }
.entry-media img { margin: 0 auto; max-height: calc(100vh - 96px); width: auto; max-width: 100%; }
.entry-media .carousel img { max-height: calc(100vh - 140px); }
.entry-media .wp-block-embed { margin: 0; }
.entry-media .wp-block-embed__wrapper { position: relative; }
.entry-media .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.entry-media .wp-has-aspect-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 900px) {
  .entry-split.has-media { display: block; }
  .entry-split.has-media .entry-media { position: static; margin-bottom: 26px; }
  .entry-media img { max-height: none; }
}

/* Carrossel minimalista */
.carousel { position: relative; }
.carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain; align-items: flex-start;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.carousel-slide { flex: 0 0 100%; scroll-snap-align: start; display: flex; justify-content: center; }
.carousel-slide > * { width: 100%; }
.carousel-nav {
  display: flex; align-items: center; justify-content: center;
  margin-top: 10px; font-family: var(--caption); font-size: 11px; color: var(--muted);
}
.carousel-nav button {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(255,255,255,.82); border: 1px solid rgba(0,0,0,.18); color: var(--ink);
  width: 38px; height: 38px; border-radius: 50%; font-size: 16px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background-color .15s, color .15s, opacity .15s;
}
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
.carousel-nav button:hover { background: var(--ink); color: #fff; }
.carousel-nav button:disabled { opacity: 0; pointer-events: none; }
.carousel-count { min-width: 3.2em; text-align: center; letter-spacing: .05em; }

/* Páginas com imagem destacada pequena à esquerda do texto */
.entry-side-thumb {
  display: grid; grid-template-columns: 205px minmax(0, 1fr); column-gap: 36px; align-items: start;
  max-width: 900px;
}
.entry-side-thumb .side-thumb { margin: 4px 0 0; }
.entry-side-thumb .side-thumb img { width: 100%; }
@media (max-width: 640px) {
  .entry-side-thumb { grid-template-columns: 1fr; }
  .entry-side-thumb .side-thumb { width: 45%; margin: 0 0 20px; }
}
