/*
Theme Name: SemIA Brutalist
Theme URI: https://semia.eca.usp.br
Author: SemIA / ECA-USP
Description: Tema brutalist do grupo de pesquisa SemIA — Semiótica, Inteligência Artificial e Comunicação. Tipografia Ubuntu Mono, paleta P&B + laranja, bordas duras, marquee animado.
Version: 1.0.0
License: GPL v2 or later
Text Domain: semia
*/

@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono:wght@400;700&display=swap');

:root {
  --background: #ffffff;
  --foreground: #000000;
  --primary: #e8573c;
  --primary-foreground: #ffffff;
  --muted: #f5f5f5;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Ubuntu Mono', 'Courier New', monospace;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Ubuntu Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ======== Brutalist tokens ======== */
.label-meta {
  font-family: 'Ubuntu Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  font-weight: 700;
}
.brutal-border { border: 2px solid var(--foreground); }
.brutal-shadow { box-shadow: 6px 6px 0 0 var(--foreground); }
.brutal-shadow-primary { box-shadow: 6px 6px 0 0 var(--primary); }
.brutal-hover { transition: transform .1s, box-shadow .1s; }
.brutal-hover:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 0 var(--foreground); }
.brutal-hover-primary { transition: transform .1s, box-shadow .1s; }
.brutal-hover-primary:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 0 var(--primary); }

.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 24px;
  border: 2px solid var(--foreground);
  font-family: 'Ubuntu Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700;
  box-shadow: 6px 6px 0 0 var(--foreground);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 0 var(--foreground); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-inverse { background: var(--foreground); color: var(--background); }
.btn-outline { background: var(--background); color: var(--foreground); }

.tag-meta {
  display: inline-block;
  background: var(--foreground); color: var(--background);
  padding: 4px 12px;
  font-family: 'Ubuntu Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700;
}
.tag-primary { background: var(--primary); color: var(--primary-foreground); }

/* ======== Header ======== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--background);
  border-bottom: 2px solid var(--foreground);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 2px solid var(--foreground);
  background: var(--primary); color: var(--primary-foreground);
  font-weight: 700; font-size: 18px;
  transition: background .1s, color .1s;
}
.site-logo:hover .logo-mark { background: var(--foreground); color: var(--background); }
.logo-text { font-size: 20px; font-weight: 700; text-transform: uppercase; }
.logo-meta { font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700; opacity: .5; margin-left: 8px; }
@media (max-width: 768px) { .logo-meta { display: none; } }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 12px;
  font-family: 'Ubuntu Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; font-weight: 700;
  transition: background .1s, color .1s;
}
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav li { list-style: none; }
.main-nav a:hover, .main-nav a.active { background: var(--foreground); color: var(--background); }
.nav-cta {
  margin-left: 12px;
  padding: 8px 16px;
  border: 2px solid var(--foreground);
  background: var(--primary) !important; color: var(--primary-foreground) !important;
  box-shadow: 4px 4px 0 0 var(--foreground);
  transition: transform .1s;
}
.nav-cta:hover { transform: translate(-2px,-2px); background: var(--primary) !important; color: var(--primary-foreground) !important; }

.menu-toggle { display: none; border: 2px solid var(--foreground); padding: 8px; }
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .main-nav.open {
    display: block;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--background); border-top: 2px solid var(--foreground);
    padding: 16px 24px;
  }
  .main-nav.open a { display: block; padding: 12px 16px; border-bottom: 1px solid rgba(0,0,0,.2); }
  .main-nav.open .nav-cta { margin: 8px 0 0; }
}

/* ======== Marquee ======== */
.marquee {
  overflow: hidden;
  border-top: 2px solid var(--foreground);
  border-bottom: 2px solid var(--foreground);
  padding: 12px 0;
  background: var(--foreground); color: var(--background);
}
.marquee-track {
  display: inline-flex; white-space: nowrap;
  animation: marquee 40s linear infinite;
}
.marquee-track span {
  padding: 0 24px;
  font-family: 'Ubuntu Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 24px;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ======== Page hero ======== */
.page-hero {
  border-bottom: 2px solid var(--foreground);
  padding: 64px 0 96px;
}
.page-hero .meta-row { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.page-hero h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  margin-bottom: 32px;
  line-height: 0.95;
}
.page-hero .lead {
  font-size: 1.125rem;
  max-width: 720px;
  border-left: 2px solid var(--foreground);
  padding-left: 24px;
  line-height: 1.6;
}

/* ======== Home Hero ======== */
.home-hero { border-bottom: 2px solid var(--foreground); padding: 64px 0 96px; }
.home-hero h1 {
  font-size: clamp(3rem, 10vw, 6.5rem);
  line-height: 0.9;
  margin-bottom: 40px;
  max-width: 100%;
}
.home-hero h1 .accent { color: var(--primary); }
.home-hero .lead {
  font-size: 1.125rem; max-width: 640px;
  border-left: 2px solid var(--foreground);
  padding-left: 24px; margin-bottom: 40px; line-height: 1.6;
}
.home-hero .cta-row { display: flex; flex-wrap: wrap; gap: 16px; }

/* ======== Sections ======== */
.section { padding: 80px 0; border-bottom: 2px solid var(--foreground); }
.section-dark { background: var(--foreground); color: var(--background); }
.section-header {
  display: flex; flex-direction: column; gap: 24px;
  margin-bottom: 48px;
}
@media (min-width: 1024px) {
  .section-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.section-header h2 { font-size: clamp(2rem, 6vw, 4rem); line-height: 0.95; margin-top: 24px; }

/* ======== Metrics ======== */
.metrics {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-left: 2px solid var(--foreground);
  border-right: 2px solid var(--foreground);
}
@media (min-width: 1024px) { .metrics { grid-template-columns: repeat(4, 1fr); } }
.metric { padding: 32px 24px; border-right: 2px solid var(--foreground); }
.metric:last-child, .metric:nth-child(2):only-of-type { border-right: 0; }
@media (min-width: 1024px) { .metric:nth-child(4) { border-right: 0; } }
.metric-num { font-size: clamp(3rem, 6vw, 4rem); font-weight: 700; line-height: 1; }
.metric-label { font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700; opacity: .7; margin-top: 8px; }

/* ======== Cards ======== */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 768px) { .card-grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .card-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .card-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.bcard {
  border: 2px solid var(--foreground);
  background: var(--background); color: var(--foreground);
  padding: 24px;
  box-shadow: 6px 6px 0 0 var(--foreground);
  transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column;
}
.bcard:hover { transform: translate(-3px,-3px); box-shadow: 9px 9px 0 0 var(--foreground); }
.bcard-primary { box-shadow: 6px 6px 0 0 var(--primary); }
.bcard-primary:hover { box-shadow: 9px 9px 0 0 var(--primary); }
.bcard-num { font-size: 3.5rem; font-weight: 700; color: var(--primary); line-height: 1; }
.bcard h3 { font-size: 1.125rem; margin: 16px 0 12px; line-height: 1.2; }
.bcard p { font-size: 14px; line-height: 1.6; opacity: .85; }
.bcard .meta-divider {
  border-top: 2px solid var(--foreground);
  padding-top: 16px; margin-top: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.bcard .meta-divider .label-meta { opacity: .6; }
.bcard .meta-divider .val { font-weight: 700; font-size: 14px; }

/* ======== Featured ======== */
.featured { padding: 96px 0; background: var(--foreground); color: var(--background); border-bottom: 2px solid var(--foreground); }
.featured-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1024px) { .featured-grid { grid-template-columns: 4fr 8fr; } }
.featured h2 { font-size: clamp(2rem, 6vw, 4rem); line-height: 0.95; margin-bottom: 24px; }
.featured p { font-size: 1.125rem; line-height: 1.6; max-width: 640px; opacity: .9; margin-bottom: 32px; }

/* ======== Pub list ======== */
.pub-list { border: 2px solid var(--foreground); }
.pub-list.dark { border-color: var(--background); }
.pub-item {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  padding: 24px;
  border-bottom: 2px solid var(--foreground);
  transition: background .1s, color .1s;
}
.pub-list.dark .pub-item { border-bottom-color: var(--background); }
.pub-item:last-child { border-bottom: 0; }
.pub-item:hover { background: var(--primary); color: var(--primary-foreground); }
@media (min-width: 768px) {
  .pub-item { grid-template-columns: 2fr 7fr 3fr; gap: 24px; align-items: start; }
}
.pub-item h3 { font-size: 1rem; line-height: 1.2; margin-bottom: 8px; }
.pub-item .authors { font-size: 12px; opacity: .8; }
.pub-item .venue { font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700; opacity: .7; align-self: end; }

/* ======== FilterBar ======== */
.filterbar { display: inline-flex; flex-wrap: wrap; border: 2px solid var(--foreground); margin-bottom: 32px; max-width: 100%; overflow-x: auto; }
.filterbar button {
  padding: 12px 20px;
  border-right: 2px solid var(--foreground);
  font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700;
  background: var(--background); color: var(--foreground);
  white-space: nowrap;
}
.filterbar button:last-child { border-right: 0; }
.filterbar button.active { background: var(--primary); color: var(--primary-foreground); }
.filterbar button:not(.active):hover { background: var(--foreground); color: var(--background); }
.filterbar .count { opacity: .6; margin-left: 6px; }

/* ======== Collapse / Accordion ======== */
.collapse { border: 2px solid var(--foreground); margin-bottom: 16px; background: var(--background); }
.collapse-trigger {
  width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding: 24px; text-align: left;
  transition: background .15s, color .15s;
}
.collapse-trigger:hover { background: var(--foreground); color: var(--background); }
.collapse-trigger .meta-row { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.collapse-trigger h3 { font-size: 1.125rem; line-height: 1.2; }
.collapse-icon { border: 2px solid currentColor; padding: 4px 8px; flex-shrink: 0; font-weight: 700; }
.collapse-content {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  border-top: 0 solid var(--foreground);
}
.collapse.open .collapse-content { max-height: 1000px; border-top-width: 2px; }
.collapse-inner { padding: 24px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.keyword-list span {
  border: 2px solid var(--foreground); padding: 4px 12px;
  font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700;
  transition: background .1s, color .1s, border-color .1s;
}
.keyword-list span:hover { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* ======== Forms ======== */
.bform { display: flex; flex-direction: column; gap: 20px; }
.bform label { font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700; display: block; margin-bottom: 8px; }
.bform input, .bform textarea {
  width: 100%; background: var(--background);
  border: 2px solid var(--foreground); padding: 12px;
  font-family: 'Ubuntu Mono', monospace; font-size: 14px;
}
.bform input:focus, .bform textarea:focus { outline: none; background: rgba(232,87,60,0.08); }
.bform textarea { resize: vertical; min-height: 120px; }

/* ======== Footer ======== */
.site-footer { background: var(--foreground); color: var(--background); border-top: 2px solid var(--foreground); }
.site-footer .marquee { background: var(--primary); color: var(--primary-foreground); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 64px 0 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h4 {
  font-family: 'Ubuntu Mono', monospace; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.3);
  padding-bottom: 8px; margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 14px; transition: color .15s; }
.footer-col a:hover { color: var(--primary); }
.footer-brand { grid-column: span 2; }
@media (min-width: 768px) { .footer-brand { grid-column: span 1; } }
.footer-brand p { font-size: 14px; line-height: 1.6; opacity: .8; margin-top: 16px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.3);
  padding: 24px 0;
  display: flex; flex-direction: column; gap: 16px;
  justify-content: space-between;
}
@media (min-width: 768px) { .footer-bottom { flex-direction: row; align-items: center; } }

/* ======== WP content ======== */
.wp-content { line-height: 1.7; }
.wp-content > * + * { margin-top: 1rem; }
.wp-content h2 { font-size: 1.75rem; margin-top: 2rem; }
.wp-content h3 { font-size: 1.25rem; margin-top: 1.5rem; }
.wp-content a { text-decoration: underline; }
.wp-content a:hover { color: var(--primary); }
.wp-content strong { font-weight: 700; }
.wp-content ul, .wp-content ol { padding-left: 1.5rem; }

/* 404 */
.notfound { min-height: 60vh; display: grid; place-items: center; padding: 24px; }
.notfound-card { border: 2px solid var(--foreground); box-shadow: 6px 6px 0 0 var(--primary); padding: 40px; max-width: 480px; width: 100%; }
.notfound-card h1 { font-size: 4rem; line-height: 1; margin: 24px 0 16px; }
.notfound-card code { background: var(--foreground); color: var(--background); padding: 2px 8px; }
