/* ============================================
   MÁRCIA PIRES — Portfólio
   Fonte: Cormorant Garamond (Google Fonts CDN)
   ============================================ */

/* ============================================
   VARIÁVEIS E RESET
   ============================================ */
:root {
  --rosa:          #eb6266;
  --preto:         #202020;
  --cinza:         #626262;
  --cinza-apoio:   #54595F;
  --branco:        #FFFFFF;
  --fundo-cinza:   rgba(237, 237, 237, 0.9);
  --verde-wp:      #25D366;
  --max-width:     1183px;
  --transition:    0.3s ease;
  --header-height: 72px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  color: var(--preto);
  background: var(--branco);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; border-radius: 0; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

::selection {
  background: var(--rosa);
  color: #ffffff;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  transition: background var(--transition), box-shadow var(--transition);
}
.header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 12px rgba(0,0,0,0.10);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img { height: 44px; width: auto; }

.nav > ul {
  display: flex;
  gap: 36px;
}
.nav a {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--cinza);
  transition: color var(--transition);
}
.nav a:hover,
.nav a.nav-active { color: var(--rosa); }

/* Submenu */
.nav-has-submenu {
  position: relative;
  padding-bottom: 20px;
  margin-bottom: -20px;
}
.nav-submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--branco);
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 140px;
  flex-direction: column;
  gap: 0;
  z-index: 200;
}
.nav-submenu li { display: block; }
.nav-submenu a {
  display: block;
  font-size: 15px;
  padding: 8px 20px;
  color: var(--cinza);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.nav-submenu a:hover {
  color: var(--rosa);
  background: rgba(235, 98, 102, 0.06);
}
.nav-has-submenu:hover .nav-submenu,
.nav-has-submenu:focus-within .nav-submenu {
  display: flex;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--cinza);
}

.submenu-toggle {
  display: none;
  background: none;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  font-size: 14px;
  color: var(--cinza);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: transform var(--transition);
}
.submenu-toggle.open { transform: rotate(180deg); }

/* ============================================
   BOTÕES
   ============================================ */
.btn {
  display: inline-block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: none;
  color: var(--branco);
  background: var(--rosa);
  border: 1px solid var(--rosa);
  border-radius: 37px;
  padding: 12px 32px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.btn:hover {
  background: var(--rosa);
  border-color: var(--rosa);
  opacity: 0.88;
}
.btn-outline {
  background: transparent;
  color: var(--rosa);
  border-color: var(--rosa);
}
.btn-outline:hover {
  background: var(--rosa);
  color: var(--branco);
}

/* ============================================
   ABAS
   ============================================ */
.portfolio-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: var(--header-height) 32px 0;
  background: var(--branco);
}

.tab-btn {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cinza);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 14px 36px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.tab-btn:hover {
  color: var(--rosa);
}

.tab-btn[aria-selected="true"],
.tab-btn.tab-active {
  color: var(--preto);
  border-bottom-color: var(--rosa);
}

/* ============================================
   LINHA DE CONTEXTO
   ============================================ */
.portfolio-context {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 2px;
  color: var(--cinza);
  padding: 16px 32px 0;
  background: var(--branco);
}

/* ============================================
   BOTÃO FILTROS (tablet + mobile)
   ============================================ */
.filter-toggle {
  display: none;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--branco);
  background: var(--rosa);
  border: 1px solid var(--rosa);
  border-radius: 37px;
  padding: 8px 22px;
  cursor: pointer;
  margin: 16px auto 0;
  transition: opacity var(--transition);
}
.filter-toggle:hover { opacity: 0.85; }

.filter-close {
  display: none;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cinza);
  background: none;
  border: 1px solid var(--cinza);
  border-radius: 37px;
  padding: 6px 18px;
  cursor: pointer;
  margin-bottom: 20px;
  transition: opacity var(--transition);
}
.filter-close:hover { opacity: 0.7; }

/* ============================================
   LAYOUT DUAS COLUNAS
   ============================================ */
.portfolio-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 32px 64px;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: start;
}

/* ============================================
   SIDEBAR
   ============================================ */
.portfolio-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rosa) transparent;
}

.portfolio-sidebar::-webkit-scrollbar {
  width: 4px;
}
.portfolio-sidebar::-webkit-scrollbar-thumb {
  background: var(--rosa);
  border-radius: 2px;
}

.filter-section { display: block; }
.filter-section[hidden] { display: none; }

.filter-group {
  margin-bottom: 28px;
}

.filter-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cinza-apoio);
  margin-bottom: 10px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}

.filter-list li { list-style: none; }

.filter-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.3px;
  color: var(--cinza);
  cursor: pointer;
  transition: color var(--transition);
}
.filter-list label:hover { color: var(--preto); }

.filter-list li.filter-unavailable { opacity: 0.35; pointer-events: none; }
.filter-list li.filter-unavailable label { cursor: default; }

.filter-list input[type="checkbox"] {
  accent-color: var(--rosa);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-search {
  width: 100%;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.3px;
  color: var(--preto);
  background: var(--branco);
  border: 1px solid rgba(98, 98, 98, 0.25);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--transition);
}
.filter-search:focus {
  border-color: var(--rosa);
}
.filter-search::placeholder { color: var(--cinza); opacity: 0.6; }

.filter-empty {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--cinza);
  letter-spacing: 0.3px;
  line-height: 1.6;
}

/* ============================================
   GALERIA JUSTIFICADA
   ============================================ */
.portfolio-grid-container {
  min-width: 0;
}

#portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jrow {
  display: flex;
  overflow: hidden;
  flex-shrink: 0;
}

.jitem {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--fundo-cinza);
  flex-shrink: 0;
}

.jitem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.jitem:hover img {
  transform: scale(1.04);
}

.jitem::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background var(--transition);
  pointer-events: none;
}

.jitem:hover::after {
  background: rgba(0, 0, 0, 0.12);
}

.portfolio-empty {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--cinza);
  text-align: center;
  padding: 48px 0;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 20, 20, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(90vw, 900px);
  width: 100%;
  gap: 16px;
}

.lightbox-img {
  max-height: 78vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

.lightbox-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.lightbox-location {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.lightbox-cta {
  font-size: 14px;
  padding: 10px 28px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  font-size: 36px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: color var(--transition);
  z-index: 510;
  padding: 4px;
}
.lightbox-close:hover { color: var(--branco); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  z-index: 510;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--branco);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--rosa);
  padding: 48px 32px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.footer-social a {
  color: var(--branco);
  opacity: 0.85;
  transition: opacity var(--transition);
}
.footer-social a:hover { opacity: 1; }
.footer-nav ul {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--branco);
  opacity: 0.85;
  transition: opacity var(--transition);
}
.footer-nav a:hover { opacity: 1; }

/* ============================================
   RESPONSIVO — TABLET (< 900px)
   ============================================ */
@media (max-width: 900px) {
  .portfolio-layout {
    display: block;
    padding: 24px 24px 48px;
  }

  .filter-toggle { display: block; }
  .filter-close  { display: block; }

  .portfolio-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--branco);
    padding: 24px 20px 32px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-110%);
    transition: transform 0.35s ease;
  }

  .portfolio-sidebar.sidebar-open,
  body.sidebar-open .portfolio-sidebar {
    transform: translateY(0);
  }

  .portfolio-grid-container { margin-top: 16px; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav ul { justify-content: center; }
}

/* ============================================
   RESPONSIVO — MOBILE (< 768px)
   ============================================ */
@media (max-width: 768px) {
  /* Abas */
  .portfolio-tabs {
    padding-top: 76px;
    gap: 0;
  }
  .tab-btn {
    font-size: 15px;
    padding: 12px 20px;
    letter-spacing: 1.5px;
  }

  /* Layout mobile */
  .portfolio-layout { padding: 20px 16px 48px; }

  /* Lightbox mobile — controles maiores */
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }

  .lightbox-img { max-height: 65vh; }
}

/* ============================================
   RESPONSIVO — MOBILE PEQUENO (< 480px)
   ============================================ */
@media (max-width: 480px) {
  .portfolio-tabs { flex-wrap: wrap; }
  .tab-btn { padding: 10px 16px; font-size: 14px; }
  .portfolio-context { font-size: 13px; padding: 12px 16px 0; }

}

/* ============================================
   HEADER MOBILE
   ============================================ */
@media (max-width: 600px) {
  .header-inner { padding: 12px 20px; }
  .nav { display: none; }
  .nav.open {
    display: block;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: white;
    padding: 24px 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  .nav.open ul { flex-direction: column; gap: 16px; }
  .nav-toggle { display: block; }
  .submenu-toggle { display: inline-block; }
  .nav-has-submenu .nav-submenu {
    display: none;
    position: static;
    transform: none;
    box-shadow: none;
    background: none;
    padding: 8px 0 0 16px;
    min-width: 0;
  }
  .nav-has-submenu .nav-submenu.open,
  .nav-has-submenu:focus-within .nav-submenu.open { display: flex; }
  .nav-has-submenu:hover .nav-submenu:not(.open) { display: none; }
  .nav-has-submenu:focus-within .nav-submenu:not(.open) { display: none; }
}
