/*
Theme Name: Fabiolog
Theme URI: https://fabiofariasf.com.br
Author: Fábio Figueiroa
Description: Tema pessoal Neo-Brutalist — tipografia pura, sem imagens
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: fabiolog
*/

/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
  --bg: #ffffff;
  --text: #000000;
  --border: #000000;
  --font-serif: 'Playfair Display', serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =============================================
   LAYOUT
   ============================================= */
.site-wrapper {
  flex: 1;
  width: 100%;
  max-width: 672px; /* max-w-2xl = 42rem */
  margin: 0 auto;
  padding-bottom: 96px; /* pb-24 — space for fixed bottom nav */
}

/* =============================================
   SITE HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
}

.search-toggle {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.search-toggle:hover {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.search-toggle .material-symbols-outlined {
  font-size: 20px;
}

/* Header actions group (search + hamburger) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Hamburger menu toggle — desktop only */
.menu-toggle {
  display: none;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.menu-toggle:hover {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.menu-toggle .material-symbols-outlined {
  font-size: 20px;
}

/* Desktop nav overlay */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.desktop-nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  z-index: 91;
  background-color: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 3rem 4rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.desktop-nav-overlay.is-open {
  transform: translateX(0);
}

.desktop-nav-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s, color 0.15s;
}

.desktop-nav-close:hover {
  background-color: #000000;
  color: #ffffff;
}

.desktop-nav-links {
  display: flex;
  flex-direction: column;
}

.desktop-nav-links a {
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: block;
  transition: opacity 0.15s;
}

.desktop-nav-links a:first-child {
  border-top: 1px solid var(--border);
}

.desktop-nav-links a:hover {
  opacity: 0.45;
}

/* =============================================
   POST FEED
   ============================================= */
.post-feed {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.post-feed article {
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-feed article > div {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Post Meta */
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.5rem;
}

.post-date {
  font-weight: 600;
}

.post-category a,
.post-category {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.875rem;
  text-transform: none;
  letter-spacing: normal;
  color: inherit;
  text-decoration: none;
}

/* Post Title */
.post-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 0.95;
  margin-top: 0.5rem;
}

.post-title a {
  color: inherit;
  text-decoration: none;
}

/* Post Excerpt */
.post-excerpt {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.7;
  margin-top: 0.25rem;
}

.post-excerpt p {
  margin: 0;
}

/* Read More */
.read-more-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid currentColor;
  padding: 0.25rem 0.5rem;
  display: inline-block;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.read-more-arrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination-wrap {
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
}

.pagination-wrap .nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pagination-wrap a,
.pagination-wrap span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 1rem 2rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
  display: inline-block;
}

.pagination-wrap a:hover {
  background-color: #000000;
  color: #ffffff;
}

.pagination-wrap .current {
  background-color: #000000;
  color: #ffffff;
}

.no-posts {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  letter-spacing: 0.05em;
}

/* =============================================
   BOTTOM NAV (FIXED)
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  background-color: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}

.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
}

.nav-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
  border-right: 1px solid var(--border);
}

.nav-item:last-child {
  border-right: none;
}

.nav-item:hover {
  background-color: #000000;
  color: #ffffff;
}

.nav-item .material-symbols-outlined {
  font-size: 24px;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =============================================
   SEARCH OVERLAY
   ============================================= */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.search-overlay[hidden] {
  display: none;
}

.search-overlay .search-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-overlay label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.search-overlay input[type="search"],
.search-overlay input[type="text"] {
  width: 100%;
  font-family: var(--font-serif);
  font-size: 2rem;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.search-overlay button[type="submit"] {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0.75rem 2rem;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s, color 0.15s;
}

.search-overlay button[type="submit"]:hover {
  background-color: #000000;
  color: #ffffff;
}

.search-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.15s, color 0.15s;
}

.search-close:hover {
  background-color: #000000;
  color: #ffffff;
}

/* =============================================
   SINGLE POST
   ============================================= */
.single-post {
  padding: 0 1.5rem;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  width: 100%;
  transition: color 0.15s;
}

.post-back:hover {
  color: #555555;
}

.single-post .post-header {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.single-post .post-meta {
  margin-bottom: 1.5rem;
}

.single-post .post-title {
  font-size: 3rem;
  line-height: 0.95;
  margin: 0;
}

.single-post .post-content {
  padding: 2.5rem 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 65ch;
}

.single-post .post-content p {
  margin-bottom: 1.5rem;
}

.single-post .post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 2.5rem 0 1rem;
}

.single-post .post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 2rem 0 0.75rem;
}

.single-post .post-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1.5rem;
  font-style: italic;
  margin: 2rem 0;
}

.single-post .post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #f0f0f0;
  padding: 0.1em 0.3em;
}

.single-post .post-content pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: #f0f0f0;
  border: 1px solid var(--border);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.single-post .post-content pre code {
  background: none;
  padding: 0;
}

.single-post .post-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-post .post-content ul,
.single-post .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.single-post .post-content li {
  margin-bottom: 0.5rem;
}

/* =============================================
   SOBRE PAGE
   ============================================= */

/* Hero */
.sobre-hero {
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.sobre-hero-photo {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.sobre-hero-photo img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.sobre-hero-info {
  padding: 2rem 1.5rem 2.5rem;
}

.sobre-hero-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: 0.75rem;
}

.sobre-hero-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 0.95;
  margin-bottom: 0.75rem;
}

.sobre-hero-tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  opacity: 0.6;
}

/* Bio content */
.sobre-content {
  padding: 0 1.5rem 4rem;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 65ch;
}

.sobre-content p {
  margin-bottom: 1.5rem;
}

.sobre-content h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  margin: 2.5rem 0 1rem;
}

.sobre-content h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 2.5rem 0 1rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
}

.sobre-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* All images inside content: contained */
.sobre-content img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Single figure (speaking photo etc.) */
.sobre-content > figure.wp-block-image {
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.sobre-content > figure.wp-block-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Certificates / photos grid */
.sobre-certs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0 1.5rem 4rem;
  max-width: 65ch;
}

.sobre-certs .cert-item {
  margin: 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

.sobre-certs .cert-item img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 480px) {
  .sobre-certs {
    grid-template-columns: 1fr;
  }

  .sobre-hero-photo img {
    height: 320px;
  }

  .sobre-hero-name {
    font-size: 2rem;
  }
}

/* =============================================
   STATIC PAGE (e.g. Sobre)
   ============================================= */
.page-content-wrap {
  padding: 0 1.5rem;
}

.page-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 3rem;
  line-height: 0.95;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-content {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.8;
  max-width: 65ch;
  padding-bottom: 3rem;
}

.page-content p {
  margin-bottom: 1.5rem;
}

.page-content h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}

.page-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =============================================
   ARCHIVE
   ============================================= */
.archive-header {
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.archive-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.archive-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
}

/* =============================================
   SEARCH RESULTS
   ============================================= */
.search-header {
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.search-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.search-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
}

.search-query {
  font-style: italic;
}

/* =============================================
   404
   ============================================= */
.error-404 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 4rem 1.5rem;
  gap: 1rem;
}

.error-404-code {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.error-404-message {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  width: 100%;
}

.error-404 .home-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  padding: 0.75rem 2rem;
  color: var(--text);
  text-decoration: none;
  margin-top: 1.5rem;
  transition: background-color 0.15s, color 0.15s;
  display: inline-block;
}

.error-404 .home-link:hover {
  background-color: #000000;
  color: #ffffff;
}

/* =============================================
   SEARCHFORM (standalone / sidebar)
   ============================================= */
.search-form {
  display: flex;
  gap: 0;
}

.search-form input[type="search"] {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
  border-right: none;
  -webkit-appearance: none;
}

.search-form button[type="submit"] {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}

.search-form button[type="submit"]:hover {
  background-color: #000000;
  color: #ffffff;
}

/* =============================================
   MATERIAL SYMBOLS — force outlined style
   ============================================= */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Desktop: hamburger menu, no bottom nav */
@media (min-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .bottom-nav {
    display: none;
  }

  .site-wrapper {
    padding-bottom: 2rem; /* no bottom nav clearance needed */
  }
}

/* Mobile: bottom nav, no desktop hamburger */
@media (max-width: 767px) {
  .menu-toggle {
    display: none;
  }

  .desktop-nav-overlay {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .post-title {
    font-size: 1.75rem;
  }

  .single-post .post-title {
    font-size: 2.25rem;
  }

  .page-title {
    font-size: 2.25rem;
  }
}
