/*
Theme Name: Fellipe Soares
Theme URI: https://fellipesoares.com.br
Author: Fellipe Soares
Author URI: https://fellipesoares.com.br
Description: Tema editorial moderno, acessível e performático para o blog de Fellipe Soares.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: fellipe-soares
*/

:root {
  --fs-bg: #f5f4ef;
  --fs-surface: #fff;
  --fs-ink: #171716;
  --fs-muted: #66645f;
  --fs-line: #dcd9d0;
  --fs-accent: #6d3cff;
  --fs-accent-dark: #4c21d5;
  --fs-highlight: #d7ff5f;
  --fs-dark: #16151a;
  --fs-radius: 1.5rem;
  --fs-shadow: 0 22px 60px rgba(30, 24, 48, .09);
  --fs-container: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--fs-ink);
  background: var(--fs-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.menu-open { overflow: hidden; }

a {
  color: inherit;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

a:hover { color: var(--fs-accent-dark); }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea { font: inherit; }

:focus-visible {
  outline: 3px solid var(--fs-accent);
  outline-offset: 4px;
}

.container {
  width: min(calc(100% - 2.5rem), var(--fs-container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--fs-dark);
  border-radius: .5rem;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(220, 217, 208, .8);
  background: rgba(245, 244, 239, .88);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--fs-dark);
  border-radius: 50%;
  font-size: .75rem;
  letter-spacing: -.06em;
}

.custom-logo {
  width: auto;
  max-height: 42px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.site-nav a {
  font-size: .91rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav .current-menu-item > a { color: var(--fs-accent); }

/* O Polylang não aplica a classe .pll-flag nesta imagem e ainda escreve
   width/height inline, então o !important é o que permite dimensionar a
   bandeira pela folha de estilos. */
.lang-switcher img {
  width: 22px !important;
  height: auto !important;
  border-radius: 3px;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  display: none;
  padding: 0;
  border: 1px solid var(--fs-line);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  width: 18px;
  height: 2px;
  display: block;
  margin: 4px auto;
  content: "";
  background: currentColor;
  transition: transform .2s, opacity .2s;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.5rem;
  color: var(--fs-accent-dark);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 2.25rem;
  height: 2px;
  content: "";
  background: currentColor;
}

.button {
  flex: none;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: .8rem 1.25rem;
  color: #fff;
  background: var(--fs-dark);
  border: 1px solid var(--fs-dark);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}

.button:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(23, 23, 22, .18);
}

.button-light {
  color: var(--fs-dark);
  background: var(--fs-highlight);
  border-color: var(--fs-highlight);
}

.section { padding: clamp(4rem, 8vw, 7rem) 0; }

.page-title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4rem);
  letter-spacing: -.06em;
  line-height: 1;
}

.text-link {
  font-weight: 800;
  white-space: nowrap;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  color: var(--fs-muted);
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Índice da página inicial */

.index-page { padding: clamp(2rem, 5vw, 3.25rem) 0 0; }

.featured-block {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  border-radius: 1.15rem;
}

.featured-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.5rem;
  list-style: none;
  cursor: pointer;
}

.featured-block > summary::-webkit-details-marker { display: none; }

.featured-block__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.featured-block__toggle {
  flex: none;
  padding: .35rem .95rem;
  color: var(--fs-accent-dark);
  border: 1px solid var(--fs-line);
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.featured-block__toggle::after { content: attr(data-label-closed); }
.featured-block[open] .featured-block__toggle::after { content: attr(data-label-open); }
.featured-block > summary:hover .featured-block__toggle { border-color: var(--fs-accent); }

.featured-list {
  margin: 0;
  padding: 0 1.5rem 1.25rem;
  list-style: none;
}

.featured-list li {
  padding: .7rem 0;
  border-top: 1px solid rgba(220, 217, 208, .75);
}

.featured-list__date {
  margin-right: .4rem;
  color: var(--fs-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .78rem;
  white-space: nowrap;
}

.featured-list__date::after { content: " —"; }

.featured-list__link {
  font-weight: 700;
  text-decoration: none;
}

.featured-list__link:hover { text-decoration: underline; }

.index-toolbar {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.view-toggle {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  border-radius: 999px;
}

.view-toggle button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1rem;
  color: var(--fs-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}

.view-toggle button[aria-pressed="true"] {
  color: #fff;
  background: var(--fs-dark);
}

.index-grid { display: none; }
[data-index-view="grid"] .index-list { display: none; }
[data-index-view="grid"] .index-grid { display: block; }

.index-month + .index-month { margin-top: clamp(2.25rem, 4vw, 3.25rem); }

.index-month__header {
  margin-bottom: .75rem;
  padding-bottom: .6rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--fs-line);
}

.index-month__header h2 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.index-month__count {
  flex: none;
  color: var(--fs-muted);
  font-size: .78rem;
  font-weight: 700;
}

.index-list__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-list__items li {
  padding: .7rem 0;
}

.index-list__items li + li { border-top: 1px dashed rgba(220, 217, 208, .9); }

.index-list__link {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.35;
  text-decoration: none;
}

.index-list__link:hover { text-decoration: underline; }

.term-chips {
  margin-top: .2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .75rem;
}

.term-chip {
  color: var(--fs-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .76rem;
  text-decoration: none;
}

.term-chip:hover { color: var(--fs-accent-dark); }

.index-grid__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.index-card {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: 1.35rem;
  background: var(--fs-surface);
  border: 1px solid var(--fs-line);
  border-radius: 1rem;
  transition: transform .25s, box-shadow .25s;
}

.index-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--fs-shadow);
}

.index-card__date {
  color: var(--fs-muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.index-card__title {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: -.03em;
  line-height: 1.25;
}

.index-card__title a { text-decoration: none; }

.index-card__excerpt {
  margin: .35rem 0 0;
  color: var(--fs-muted);
  font-size: .9rem;
}

.index-about { padding-bottom: 0; }

.about-strip {
  overflow: hidden;
  color: #fff;
  background: var(--fs-accent);
  border-radius: var(--fs-radius);
}

.about-inner {
  padding: clamp(2.5rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: clamp(2rem, 6vw, 6rem);
}

.about-strip h2 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -.06em;
  line-height: .95;
}

.about-copy {
  color: rgba(255, 255, 255, .85);
  font-size: 1.12rem;
}

.about-copy p:first-child { margin-top: 0; }

.content-area { padding: clamp(4rem, 8vw, 7rem) 0; }

.archive-header {
  max-width: 800px;
  margin-bottom: 3.5rem;
}

.archive-description {
  color: var(--fs-muted);
  font-size: 1.15rem;
}

.article-shell {
  width: min(calc(100% - 2.5rem), 820px);
  margin-inline: auto;
}

.article-header { margin-bottom: 3rem; }

.article-header h1 {
  margin: 1rem 0 1.25rem;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  letter-spacing: -.065em;
  line-height: .98;
}

.article-thumbnail {
  width: min(calc(100% - 2.5rem), var(--fs-container));
  max-height: 700px;
  margin: 0 auto 4rem;
  overflow: hidden;
  border-radius: var(--fs-radius);
}

.article-thumbnail img {
  width: 100%;
  max-height: 700px;
  object-fit: cover;
}

.entry-content {
  color: #292826;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.25rem);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 2.2em 0 .6em;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.04em;
  line-height: 1.15;
}

.entry-content h2 { font-size: 2em; }
.entry-content h3 { font-size: 1.5em; }

.entry-content a { color: var(--fs-accent-dark); }

.entry-content blockquote {
  margin: 2rem 0;
  padding: .5rem 0 .5rem 1.75rem;
  border-left: 5px solid var(--fs-accent);
  font-size: 1.2em;
  font-style: italic;
}

.entry-content code {
  padding: .15em .35em;
  background: #e9e6df;
  border-radius: .25rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .88em;
}

.entry-content pre {
  overflow-x: auto;
  padding: 1.5rem;
  color: #f4f1ff;
  background: var(--fs-dark);
  border-radius: 1rem;
}

.entry-content pre code { padding: 0; background: transparent; }

.entry-content img { border-radius: 1rem; }

.entry-content > *:first-child { margin-top: 0; }

.post-navigation {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--fs-line);
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.nav-links a { font-weight: 800; }

.pagination {
  margin-top: 3rem;
  text-align: center;
}

.pagination .nav-links { justify-content: center; }

.page-numbers {
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 .65rem;
  text-decoration: none;
  border-radius: 999px;
}

.page-numbers.current {
  color: #fff;
  background: var(--fs-dark);
}

.search-form {
  max-width: 620px;
  display: flex;
  gap: .75rem;
}

.search-field {
  width: 100%;
  min-height: 52px;
  padding: .8rem 1rem;
  border: 1px solid var(--fs-line);
  background: #fff;
  border-radius: 999px;
}

.empty-state {
  max-width: 700px;
  padding: 3rem;
  background: #fff;
  border-radius: var(--fs-radius);
}

.site-footer {
  margin-top: 4rem;
  padding: 5rem 0 2rem;
  color: #fff;
  background: var(--fs-dark);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 4rem;
}

.footer-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  letter-spacing: -.065em;
  line-height: .98;
}

.footer-title em {
  color: var(--fs-highlight);
  font-family: Georgia, serif;
  font-weight: 400;
}

.footer-links {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li { margin-top: .75rem; }

.footer-links a { color: rgba(255, 255, 255, .8); }

.footer-bottom {
  margin-top: 5rem;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(255, 255, 255, .55);
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: .85rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.comments-area {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--fs-line);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.comments-title,
.comment-reply-title {
  font-size: 1.75rem;
  letter-spacing: -.04em;
}

.comment-list {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.comment-list .children { list-style: none; }

.comment-body {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--fs-line);
  border-radius: 1rem;
}

.comment-meta {
  color: var(--fs-muted);
  font-size: .85rem;
}

.comment-form label {
  display: block;
  margin-bottom: .3rem;
  font-weight: 700;
}

.comment-form input:not([type="checkbox"]),
.comment-form textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 1px solid var(--fs-line);
  background: #fff;
  border-radius: .75rem;
}

.comment-form .submit {
  min-height: 48px;
  padding: .7rem 1.2rem;
  color: #fff;
  background: var(--fs-dark);
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 900px) {
  .index-grid__cards { grid-template-columns: repeat(2, 1fr); }
  .about-inner,
  .footer-grid { grid-template-columns: 1fr; }

  .menu-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 77px 0 auto;
    padding: 2rem 1.25rem;
    visibility: hidden;
    opacity: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--fs-bg);
    border-bottom: 1px solid var(--fs-line);
    transform: translateY(-10px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }

  .lang-switcher { border-top: 1px solid var(--fs-line); }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .site-nav ul {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .site-nav li + li { border-top: 1px solid var(--fs-line); }
  .site-nav a { display: block; padding: 1rem 0; font-size: 1.1rem; }

  .menu-toggle[aria-expanded="true"] span { opacity: 0; }
  .menu-toggle[aria-expanded="true"]::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"]::after { transform: translateY(-6px) rotate(-45deg); }
}

@media (max-width: 640px) {
  .container,
  .article-shell,
  .article-thumbnail { width: min(calc(100% - 1.5rem), var(--fs-container)); }
  .index-grid__cards { grid-template-columns: 1fr; }
  .featured-block > summary,
  .featured-list { padding-inline: 1.15rem; }
  .index-toolbar { justify-content: stretch; }
  .view-toggle { flex: 1; }
  .view-toggle button { flex: 1; justify-content: center; }
  .footer-bottom,
  .nav-links { flex-direction: column; }
  .search-form { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
