/*
Theme Name: CDPHA
Theme URI: https://cdpha.com
Author: HFGitec
Author URI: https://hfgitec.com.br
Description: Tema editorial customizado para o Centro de Documentação e Pesquisa Helena Antipoff — UFMG
Version: 1.0.0
License: Privado
Text Domain: cdpha
*/

/* ===== TOKENS ===== */
:root {
  --cream:        #F5EFE4;
  --cream2:       #EDE4D5;
  --cream3:       #E0D4B8;
  --ink:          #1A1410;
  --ink-mid:      #3D3528;
  --muted:        #8C7E6A;
  --musgo:        #2D3D2A;
  --musgo-mid:    #3A5035;
  --musgo-light:  #4E6B47;
  --orange:       #C8400A;
  --orange-light: #E85E2A;
  --gold:         #9B7D3A;
  --gold-light:   #C4A44E;
  --border:       rgba(26,20,16,0.11);
  --border-strong:rgba(26,20,16,0.22);
  --musgo-border: rgba(245,239,228,0.09);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ===== TOPBAR ===== */
.topbar {
  background: var(--musgo);
  padding: 7px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: rgba(245,239,228,0.42);
  border-bottom: 1px solid var(--musgo-border);
}
.topbar a { color: rgba(245,239,228,0.52); }
.topbar a:hover { color: rgba(245,239,228,0.9); }
.topbar-right { display: flex; gap: 20px; align-items: center; }
.topbar-sep { opacity: 0.25; }

/* ===== HEADER ===== */
header {
  background: var(--cream);
  padding: 14px 48px 0;
  border-bottom: 2px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(26,20,16,0.04);
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.logo-area { display: flex; align-items: center; gap: 14px; }
.logo-img { width: 80px; height: 80px; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.logo-name {
  font-family: 'IM Fell English', serif;
  font-size: 21px;
  color: var(--ink);
  font-style: italic;
  line-height: 1.1;
}
.logo-dates {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 1px;
}
.header-right { display: flex; gap: 14px; align-items: center; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  padding: 7px 13px;
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: border-color 0.18s;
}
.search-wrap:hover { border-color: var(--musgo-light); }
.lang-switch {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 5px;
  letter-spacing: 0.1em;
  align-items: center;
}
.lang-switch span { cursor: pointer; transition: color 0.15s; }
.lang-switch span.active { color: var(--musgo-light); font-weight: 600; }
.lang-switch .sep { opacity: 0.3; cursor: default; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--musgo);
  transition: all 0.22s;
  display: block;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== NAV ===== */
nav.main-nav {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
nav.main-nav::-webkit-scrollbar { display: none; }
nav.main-nav a {
  padding: 11px 17px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
nav.main-nav a:hover,
nav.main-nav a.current-menu-item { color: var(--musgo); border-bottom-color: var(--musgo); }

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--musgo);
  padding: 8px 0;
  border-top: 2px solid var(--border-strong);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 13px 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(245,239,228,0.7);
  border-bottom: 1px solid var(--musgo-border);
  transition: color 0.15s, background 0.15s;
}
.mobile-nav a:hover { color: var(--cream); background: var(--musgo-mid); }

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  min-height: 400px;
  border-bottom: 2px solid var(--border-strong);
}
.hero-img { position: relative; overflow: hidden; }
.hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.82) contrast(1.06) saturate(0.9);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(26,20,16,0.62) 0%, rgba(26,20,16,0.28) 55%, transparent 100%);
}
.hero-caption { position: absolute; bottom: 32px; left: 40px; right: 40px; }
.hero-eyebrow {
  font-size: 9.5px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: 12px; font-weight: 500;
}
.hero-title {
  font-family: 'IM Fell English', serif;
  font-size: 52px; line-height: 0.95;
  color: #F5EFE4; margin-bottom: 16px;
}
.hero-title em { font-style: italic; color: var(--gold-light); }
.hero-rule { width: 44px; height: 2px; background: var(--gold); margin-bottom: 16px; }
.hero-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 12.5px; font-style: italic; line-height: 1.75;
  color: rgba(245,239,228,0.88);
  max-width: 400px; margin-bottom: 24px;
  background: rgba(26,20,16,0.38);
  padding: 10px 14px;
  backdrop-filter: blur(1px);
}
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
  background: var(--musgo); color: var(--cream);
  padding: 10px 22px; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.11em; text-transform: uppercase;
  border: none; cursor: pointer; display: inline-block;
  transition: background 0.18s;
}
.btn-primary:hover { background: var(--musgo-mid); }
.btn-ghost {
  background: none; color: rgba(245,239,228,0.78);
  padding: 9px 22px; font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.11em; text-transform: uppercase;
  border: 1px solid rgba(245,239,228,0.28);
  cursor: pointer; display: inline-block;
  transition: border-color 0.18s, color 0.18s;
}
.btn-ghost:hover { border-color: rgba(245,239,228,0.65); color: var(--cream); }

/* Stats panel */
.hero-stats { background: var(--musgo); display: flex; flex-direction: column; }
.stat-block {
  flex: 1; padding: 22px 26px;
  border-bottom: 1px solid var(--musgo-border);
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative;
}
.stat-block::before {
  content: ''; position: absolute; left: 26px; top: 22px;
  width: 18px; height: 1px; background: var(--gold); opacity: 0.45;
}
.stat-block:last-child { border-bottom: none; }
.stat-num {
  font-family: 'IM Fell English', serif;
  font-size: 48px; color: var(--orange-light); line-height: 1;
  display: block; margin-top: 18px;
}
.stat-label {
  font-size: 9.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(245,239,228,0.36); margin-top: 5px; font-weight: 500;
}

/* ===== EVENT BAR ===== */
.event-bar {
  background: var(--orange); padding: 12px 48px;
  display: flex; align-items: center; gap: 22px;
  overflow-x: auto; scrollbar-width: none;
}
.event-bar::-webkit-scrollbar { display: none; }
.event-bar-label {
  font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.58); white-space: nowrap; font-weight: 600;
}
.event-bar-sep { width: 1px; height: 16px; background: rgba(255,255,255,0.2); flex-shrink: 0; }
.event-bar-item {
  display: flex; gap: 10px; align-items: center; cursor: pointer;
  padding-right: 22px; border-right: 1px solid rgba(255,255,255,0.14);
  white-space: nowrap; flex-shrink: 0;
}
.event-bar-item:last-child { border-right: none; padding-right: 0; }
.event-bar-num { font-family: 'IM Fell English', serif; font-size: 22px; color: #fff; line-height: 1; }
.event-bar-info { display: flex; flex-direction: column; }
.event-bar-title { font-size: 12px; font-weight: 500; color: #fff; }
.event-bar-sub { font-size: 9.5px; color: rgba(255,255,255,0.58); margin-top: 1px; }

/* ===== MAIN GRID ===== */
.main-grid { display: grid; grid-template-columns: 1fr 308px; border-bottom: 2px solid var(--border-strong); }
.content-col { padding: 44px 48px; border-right: 2px solid var(--border-strong); }
.sidebar-col { padding: 44px 28px; background: var(--cream2); }

.section-label {
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Feature card */
.feature-card {
  background: var(--musgo); padding: 28px 30px; margin-bottom: 20px;
  border-left: 3px solid var(--orange); cursor: pointer; transition: border-color 0.18s;
}
.feature-card:hover { border-left-color: var(--orange-light); }
.feature-tag { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange-light); font-weight: 700; margin-bottom: 10px; }
.feature-title { font-family: 'IM Fell English', serif; font-size: 22px; color: var(--cream); line-height: 1.2; margin-bottom: 10px; }
.feature-title em { font-style: italic; color: var(--gold-light); }
.feature-desc { font-size: 12px; color: rgba(245,239,228,0.5); font-style: italic; font-family: 'Libre Baskerville', serif; line-height: 1.65; }

/* Content photo */
.content-photo { width: 100%; height: 190px; object-fit: cover; object-position: center 38%; margin-bottom: 2px; filter: grayscale(18%) brightness(0.96); }

/* News grid */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.news-item { background: var(--cream); padding: 18px; cursor: pointer; transition: background 0.14s; }
.news-item:hover { background: var(--cream2); }
.news-tag { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; margin-bottom: 7px; }
.tag-ev  { color: var(--orange); }
.tag-pub { color: var(--musgo-light); }
.tag-ac  { color: var(--gold); }
.news-title { font-family: 'Libre Baskerville', serif; font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.4; margin-bottom: 7px; }
.news-date { font-size: 10px; color: var(--muted); letter-spacing: 0.07em; }

/* ===== SIDEBAR ===== */
.sidebar-section { margin-bottom: 32px; }
.sidebar-title { font-family: 'IM Fell English', serif; font-size: 18px; color: var(--ink); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--musgo); }
.event-item { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; cursor: pointer; align-items: flex-start; transition: opacity 0.14s; }
.event-item:hover { opacity: 0.8; }
.event-badge { background: var(--musgo); color: var(--cream); padding: 6px 8px; text-align: center; min-width: 42px; flex-shrink: 0; }
.event-day { font-family: 'IM Fell English', serif; font-size: 18px; line-height: 1; display: block; }
.event-month { font-size: 8px; letter-spacing: 0.1em; color: var(--gold-light); display: block; margin-top: 2px; font-weight: 500; }
.event-info-title { font-family: 'Libre Baskerville', serif; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.35; margin-bottom: 3px; }
.event-info-sub { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.pub-item { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; cursor: pointer; transition: opacity 0.14s; }
.pub-item:hover { opacity: 0.75; }
.pub-marcador { font-family: 'IM Fell English', serif; font-size: 16px; color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.pub-title { font-family: 'Libre Baskerville', serif; font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.4; margin-bottom: 2px; }
.pub-meta { font-size: 10px; color: var(--muted); letter-spacing: 0.06em; }
.sidebar-about { font-family: 'Libre Baskerville', serif; font-size: 12px; font-style: italic; color: var(--ink-mid); line-height: 1.78; margin-bottom: 14px; }
.sidebar-address { font-size: 11px; color: var(--muted); line-height: 1.9; padding: 12px; border: 1px solid var(--border); background: var(--cream); }

/* ===== GALLERY STRIP ===== */
.gallery-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--border); }
.gallery-item { position: relative; overflow: hidden; cursor: pointer; }
.gallery-item img { width: 100%; height: 175px; object-fit: cover; object-position: center 20%; filter: grayscale(28%) brightness(0.87); transition: filter 0.32s, transform 0.32s; }
.gallery-item:hover img { filter: grayscale(0%) brightness(1); transform: scale(1.05); }
.gallery-label { position: absolute; bottom: 8px; left: 10px; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(245,239,228,0.72); background: rgba(26,20,16,0.55); padding: 3px 8px; }

/* ===== FOOTER ===== */
footer { background: var(--musgo); }
.footer-ornamento { text-align: center; padding: 9px; background: var(--musgo-mid); border-bottom: 1px solid rgba(155,125,58,0.18); font-size: 11px; color: var(--gold); letter-spacing: 0.45em; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; border-bottom: 1px solid rgba(245,239,228,0.07); }
.footer-col { padding: 30px 36px; border-right: 1px solid rgba(245,239,228,0.07); }
.footer-col:last-child { border-right: none; }
.footer-brand { font-family: 'IM Fell English', serif; font-size: 19px; color: var(--cream); margin-bottom: 10px; line-height: 1.2; }
.footer-brand em { font-style: italic; color: var(--gold-light); }
.footer-desc { font-size: 12px; font-style: italic; font-family: 'Libre Baskerville', serif; color: rgba(245,239,228,0.38); line-height: 1.72; margin-bottom: 14px; }
.footer-address { font-size: 10px; letter-spacing: 0.05em; color: rgba(245,239,228,0.2); line-height: 1.9; }
.footer-col-title { font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 14px; font-weight: 700; }
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-link { font-family: 'Libre Baskerville', serif; font-size: 12px; font-style: italic; color: rgba(245,239,228,0.3); transition: color 0.15s; }
.footer-link:hover { color: rgba(245,239,228,0.78); }
.footer-bottom { padding: 12px 36px; display: flex; justify-content: space-between; align-items: center; font-size: 10px; letter-spacing: 0.07em; color: rgba(245,239,228,0.14); }

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 960px) {
  .topbar { padding: 7px 24px; }
  header { padding: 16px 24px 0; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-stats { flex-direction: row; border-top: 2px solid var(--border-strong); }
  .stat-block { border-bottom: none; border-right: 1px solid var(--musgo-border); padding: 18px 20px; justify-content: center; align-items: center; text-align: center; }
  .stat-block:last-child { border-right: none; }
  .stat-block::before { display: none; }
  .stat-num { font-size: 38px; margin-top: 0; }
  .event-bar { padding: 12px 24px; }
  .main-grid { grid-template-columns: 1fr; }
  .content-col { padding: 32px 24px; border-right: none; border-bottom: 2px solid var(--border-strong); }
  .sidebar-col { padding: 32px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col { padding: 24px; }
}
@media (max-width: 640px) {
  .topbar { padding: 7px 16px; font-size: 10px; }
  .topbar-left-text { display: none; }
  header { padding: 14px 16px 0; }
  .logo-img { width: 56px; height: 56px; }
  .logo-name { font-size: 17px; }
  .logo-dates { display: none; }
  .search-wrap { display: none; }
  .hamburger { display: flex; }
  nav.main-nav { display: none; }
  .hero { display: block; }
  .hero-img img { height: 320px; width: 100%; object-fit: cover; }
  .hero-caption { bottom: 24px; left: 20px; right: 20px; }
  .hero-title { font-size: 36px; }
  .hero-desc { font-size: 12px; max-width: 100%; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stat-num { font-size: 30px; }
  .stat-label { font-size: 8.5px; }
  .event-bar { padding: 10px 16px; gap: 14px; }
  .content-col { padding: 24px 16px; }
  .sidebar-col { padding: 24px 16px; }
  .news-grid { grid-template-columns: 1fr; }
  .gallery-strip { grid-template-columns: 1fr 1fr; }
  .gallery-item img { height: 130px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col { padding: 20px 16px; border-right: none; border-bottom: 1px solid rgba(245,239,228,0.07); }
  .footer-bottom { padding: 12px 16px; flex-direction: column; gap: 4px; text-align: center; }
}
@media (max-width: 380px) {
  .hero-title { font-size: 30px; }
  .hero-ctas { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; text-align: center; padding: 12px; }
  .gallery-strip { grid-template-columns: 1fr; }
}
