/*
Theme Name: Rafael Canovas
Theme URI: https://rafaelcanovas.com.br
Author: Rafael Canovas
Description: Tema personalizado, minimalista e editorial para o portfólio de ilustração de Rafael Canovas. Sem construtores visuais (Elementor/Divi) — HTML/CSS enxuto, interações em CSS puro (menu, filtro, carrossel) e um único script leve para o comportamento do cabeçalho no scroll.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rafael-canovas
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

:root {
  --bg: #F7F5F1;
  --text: #1A1A1A;
  --text-soft: #8C8C8C;
  --divider: #E5E5E3;
  --overlay-bg: #FDFCFA;
  --max-width: 1600px;
  --side-margin: clamp(24px, 8vw, 160px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --header-height: 84px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
main { flex: 1; }

.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ===== Header (some ao rolar para baixo, aparece ao rolar para cima) ===== */
main { padding-top: var(--header-height); }

.site-header {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--side-margin);
  background: var(--bg);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  transform: translateY(0);
  transition: transform .35s ease;
}

.site-header.header-hidden { transform: translateY(-100%); }

.logo {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ===== Menu hamburguer (CSS puro, sem JS) ===== */
.menu-toggle { display: none; }

.menu-icon {
  width: 19px;
  height: 13px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 210;
}

.menu-icon span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: #B8B8B3;
  transition: transform .35s ease, opacity .35s ease;
}

.menu-toggle:checked + .site-header .menu-icon span:nth-child(1) { height: 1px; transform: translateY(6px) rotate(45deg); }
.menu-toggle:checked + .site-header .menu-icon span:nth-child(2) { opacity: 0; }
.menu-toggle:checked + .site-header .menu-icon span:nth-child(3) { height: 1px; transform: translateY(-6px) rotate(-45deg); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.35);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity .45s ease;
  z-index: 180;
}

.menu-toggle:checked ~ .menu-backdrop {
  opacity: 1;
  visibility: visible;
}

body:has(.menu-toggle:checked) { overflow: hidden; }

.overlay-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 82vw);
  background: var(--overlay-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  transform: translateX(100%);
  transition: transform .45s ease;
  box-shadow: -12px 0 40px rgba(13, 13, 13, 0.06);
  z-index: 190;
}

.menu-toggle:checked ~ .overlay-menu {
  transform: translateX(0);
}

.overlay-menu nav { text-align: left; }

.overlay-menu a {
  display: block;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  padding: 12px 0;
  letter-spacing: 0.18em;
  transition: opacity .25s ease;
}

.overlay-menu a:hover { opacity: 0.5; }

.submenu-toggle { display: none; }

.submenu-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  padding: 12px 0;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.submenu-label::after {
  content: "+";
  font-size: 14px;
  color: var(--text-soft);
  transition: transform .3s ease;
}

.submenu-toggle:checked + .submenu-label::after { transform: rotate(45deg); }

.submenu {
  max-height: 0;
  overflow: hidden;
  padding: 0 0 0 4px;
  transition: max-height .35s ease;
}

.submenu-toggle:checked ~ .submenu { max-height: 220px; }

.submenu a {
  display: block;
  font-size: 12px;
  font-weight: 300;
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  padding: 8px 0;
}

.submenu a:hover { color: var(--text); opacity: 1; }

/* ===== Footer ===== */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px var(--side-margin);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-top: 1px solid var(--divider);
  margin-top: 100px;
}

.site-footer .footer-left { display: flex; align-items: center; gap: 20px; }
.site-footer .footer-left a { display: flex; align-items: center; }

.site-footer a:hover { color: var(--text); }

/* ===== Home / Trabalhos — Galeria (masonry) ===== */
.masonry {
  column-count: 3;
  column-gap: 14px;
  padding: 14px var(--side-margin) 60px;
}

.masonry-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 14px;
}

.masonry-item .img-wrap {
  position: relative;
  overflow: hidden;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .6s ease;
}

.masonry-item:hover img { transform: scale(1.04); }

.masonry-item .reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  padding: 24px;
  background: rgba(13, 13, 13, 0.45);
  opacity: 0;
  transition: opacity .35s ease;
}

.masonry-item:hover .reveal { opacity: 1; }

.reveal-title {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.reveal-tech {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ===== Filtro por categoria (CSS puro, via :has()) ===== */
.filter-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 8px var(--side-margin) 64px;
  flex-wrap: wrap;
}

.filter-row input[type="radio"] { display: none; }

.filter-row label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  cursor: pointer;
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  transition: color .25s ease, border-color .25s ease;
}

.filter-row input:checked + label { color: var(--text); border-bottom-color: var(--text); }

/* As regras :has() por termo são geradas dinamicamente em page-obras.php,
   uma por categoria cadastrada na taxonomia categoria_obra. */

/* ===== Página da obra ===== */
.obra-topbar {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--side-margin);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.obra-topbar a:hover { color: var(--text); }

.obra-meta {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px var(--side-margin) 48px;
  text-align: center;
}

.obra-meta h1 { font-size: 13px; font-weight: 400; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 10px; }
.obra-meta .tech { font-size: 13px; color: var(--text-soft); letter-spacing: 0.01em; }
.obra-meta p { font-size: 13px; color: var(--text-soft); margin-top: 14px; max-width: 56ch; margin-left: auto; margin-right: auto; }

.obra-main-image { padding: 0 0 60px; background: var(--bg); }

.carousel { position: relative; overflow: hidden; }

.carousel input[type="radio"] { display: none; }

.carousel-track {
  display: flex;
  transition: transform .45s ease;
}

.carousel-slide {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - var(--header-height) - 40px);
}

.carousel-slide img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* As regras #s{n}:checked ~ .carousel-track (transform) e a exibição das
   setas correspondentes (.nav-{n}) são geradas dinamicamente em single-obra.php,
   conforme a quantidade real de imagens de cada obra. */

.carousel-nav {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-soft);
  pointer-events: auto;
  transition: color .25s ease;
}

.arrow:hover { color: var(--text); }
.arrow.prev { left: 16px; }
.arrow.next { right: 16px; }
.arrow svg { width: 22px; height: 22px; }

.obra-nav {
  display: flex;
  justify-content: space-between;
  padding: 36px var(--side-margin) 100px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.obra-nav a:hover { color: var(--text-soft); }

/* ===== Sobre ===== */
.about {
  max-width: 960px;
  margin: 0 auto;
  padding: 50px var(--side-margin) 100px;
  display: flex;
  align-items: flex-start;
  gap: 64px;
  text-align: left;
}

.about-photo {
  width: 300px;
  height: 380px;
  object-fit: cover;
  flex-shrink: 0;
}

.about-text { flex: 1; }

.about-text p { font-size: 13px; margin-bottom: 22px; max-width: 60ch; }

.about-text .section-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 48px 0 20px;
  padding-top: 32px;
  border-top: 1px solid var(--divider);
}

@media (max-width: 700px) {
  .about { flex-direction: column; }
  .about-photo { width: 100%; height: auto; aspect-ratio: 4 / 5; }
}

/* ===== Contato ===== */
.contact {
  max-width: 980px;
  margin: 0 auto;
  padding: 50px var(--side-margin) 100px;
  display: flex;
  align-items: flex-start;
  gap: 80px;
  text-align: left;
}

.contact-form-col { flex: 1.3; }

.contact-info {
  flex: 1;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.8;
  padding-top: 6px;
}

.page-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 24px;
}

.contact-info .location { margin-top: 20px; }

.contact-info a { display: block; color: var(--text-soft); }
.contact-info a:hover { color: var(--text); }

@media (max-width: 700px) {
  .contact { flex-direction: column; gap: 48px; }
}

.form-field { text-align: left; margin-bottom: 30px; }

.form-field label {
  display: block;
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-field input, .form-field textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  padding: 8px 0;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  resize: none;
}

.form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--text);
}

.submit-btn {
  border: 1px solid var(--text);
  background: none;
  padding: 12px 36px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
  font-family: inherit;
  transition: background .3s ease, color .3s ease;
}

.submit-btn:hover { background: var(--text); color: var(--bg); }

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .masonry { column-count: 2; }
}

@media (max-width: 600px) {
  :root { --side-margin: 24px; }
  .site-footer { flex-direction: column; gap: 14px; text-align: center; }
  .site-footer .footer-left { flex-direction: column; gap: 8px; }
  .masonry { column-count: 1; }
	
}/* Página tem pouco conteúdo — reduz respiro inferior para evitar rolagem desnecessária */
.page-template-template-contato-php .contact { padding-bottom: 50px; }
.page-template-template-contato-php .site-footer { margin-top: 40px; }
.logo-image { display: flex; align-items: center; }
.logo-image img { max-height: 36px; width: auto; }


