/* =====================================================
   Policymaking Theme — OJS
   Harmoniza o visual do OJS com o WordPress (policymaking.lat)
   Versão 1.0.0
   ===================================================== */

/* =====================================================
   TIPOGRAFIA
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&family=Roboto+Slab:wght@400;500&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;600;700&display=swap');

/* Corpo e elementos gerais — Roboto (igual WP) */
html, body, p, div, span, li, td, th, a, button, input, select, textarea, label {
  font-family: 'Roboto', sans-serif !important;
}

/* Títulos — Open Sans (igual WP h1/h2) */
h1, h2, h3, h4, h5, h6,
.pkp_structure_head .pkp_site_name,
.obj_article_summary .title,
.obj_issue_summary .title,
.page_issue .title {
  font-family: 'Open Sans', sans-serif !important;
  font-weight: 600 !important;
}


/* Secundário — Roboto Slab para subtítulos e metadados */
.obj_article_details .subtitle,
.obj_article_details .authors,
.obj_article_summary .subtitle,
blockquote {
  font-family: 'Roboto Slab', serif !important;
  font-weight: 400 !important;
}

/* =====================================================
   MODO CLARO FORÇADO
   ===================================================== */

html, body {
  background-color: #fff !important;
  color: #000 !important;
}
:root {
  color-scheme: light !important;
}
[data-theme="dark"], .dark {
  background: #fff !important;
  color: #000 !important;
}
.material-theme-selector, [data-component="themeSelector"], #theme-toggle {
  display: none !important;
}

/* =====================================================
   CORES DE LINKS
   ===================================================== */

body a, .pkp_structure_main a, .obj_article_details a {
  color: #D9631E !important;
  text-decoration: none !important;
}
body a:hover, .pkp_structure_main a:hover, .obj_article_details a:hover {
  color: #CA5917 !important;
  text-decoration: underline !important;
}

/* =====================================================
   BOTÕES — replica estilo do WordPress
   Normal: laranja preenchido | Hover: branco com borda laranja
   ===================================================== */

/* Botões padrão PKP + inputs + Tailwind (Material theme) */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.pkp_button,
.pkp_button_primary,
.pkp_button_submit,
.pkp_button_generic,
.pkp_form_button,
button.rounded-full,
button.rounded-md,
button[type="submit"].rounded-full,
button[type="submit"].rounded-md {
  background-color: #D9631E !important;
  color: #fff !important;
  border: 1px solid #D9631E !important;
  border-radius: 5px !important;
  padding: 0.5rem 1.25rem !important;
  font-family: 'Roboto', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  line-height: 22px !important;
  cursor: pointer !important;
  text-transform: none !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease !important;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
.pkp_button:hover,
.pkp_button_primary:hover,
.pkp_button_submit:hover,
.pkp_button_generic:hover,
.pkp_form_button:hover,
button.rounded-full:hover,
button.rounded-md:hover,
button[type="submit"].rounded-full:hover,
button[type="submit"].rounded-md:hover {
  background-color: #CA5917 !important;
  color: #fff !important;
  border-color: #CA5917 !important;
  text-decoration: underline !important;
  text-decoration-color: #fff !important;
}

/* Links galley (PDF, HTML) */
a.obj_galley_link,
a.obj_galley_link:link,
a.obj_galley_link:visited {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  background-color: #D9631E !important;
  color: #fff !important;
  border: 1px solid #D9631E !important;
  border-radius: 5px !important;
  padding: 0.45rem 1rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 22px !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease !important;
}
a.obj_galley_link:hover {
  background-color: #CA5917 !important;
  color: #fff !important;
  border-color: #CA5917 !important;
  text-decoration: underline !important;
  text-decoration-color: #fff !important;
}
a.obj_galley_link svg,
a.obj_galley_link svg * {
  fill: #fff !important;
}

/* Botões Login / Register (links estilizados como botão) */
a.login, a.register,
a.login:link, a.register:link,
a.login:visited, a.register:visited,
a.rounded-md.bg-slate-800,
a.rounded-md.bg-slate-700 {
  display: inline-block !important;
  background-color: #D9631E !important;
  color: #fff !important;
  border: 1px solid #D9631E !important;
  border-radius: 5px !important;
  padding: 0.45rem 1rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 22px !important;
  text-decoration: none !important;
  transition: background-color 0.2s ease, color 0.2s ease !important;
}
a.login:hover, a.register:hover,
a.rounded-md.bg-slate-800:hover,
a.rounded-md.bg-slate-700:hover {
  background-color: #CA5917 !important;
  color: #fff !important;
  border-color: #CA5917 !important;
  text-decoration: underline !important;
  text-decoration-color: #fff !important;
}

/* Remove sombras em links com classes Tailwind do Material theme */
a.flex.h-8.items-center.justify-center.rounded-xl.shadow-md,
a.flex.h-8.items-center.text-slate-500.justify-center.rounded-xl.shadow-md {
  box-shadow: none !important;
  border: none !important;
}

/* =====================================================
   HEADER
   ===================================================== */

header.sticky {
  position: relative !important;
  padding-top: 54px !important;
  padding-bottom: 64px !important;
  background: #fff !important;
  box-shadow: none !important;
  border: 0 !important;
  z-index: 50;
}

/* Faixa cinza superior */
header.sticky::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 48px; background: #E8E8E8; z-index: 0;
}

/* Área do usuário/busca na faixa cinza */
header.sticky > .flex.items-center.space-x-2 {
  position: absolute !important;
  top: 7px; right: 26px; z-index: 2; gap: 10px !important;
}

/* Ícone de busca */
.pkp_navigation_search_wrapper a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  border: 1px solid #EEE !important;
  border-radius: 6px !important;
  background: #fff !important;
}
.pkp_navigation_search_wrapper a svg { fill: #D9631E !important; }
.pkp_navigation_search_wrapper a:hover { background: #D9631E !important; }
.pkp_navigation_search_wrapper a:hover svg { fill: #fff !important; }

/* Botão de usuário */
#navigationUser li.profile > a {
  display: inline-flex !important;
  align-items: center !important;
  background: #fff !important;
  color: #D9631E !important;
  border: 1px solid #EEE !important;
  border-radius: 10px !important;
  padding: .4rem .9rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  font-weight: 500 !important;
}

/* =====================================================
   MENU PRINCIPAL (barra laranja)
   ===================================================== */

/* Oculta duplicata mobile */
header.sticky ul#navigationPrimary.block { display: none !important; }

/* Barra laranja */
header.sticky ul#navigationPrimary.space-x-2,
#navigationPrimary,
.pkp_navigation_primary {
  background-color: #D9631E !important;
}

header.sticky ul#navigationPrimary.space-x-2 {
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: .6rem 2rem !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 1;
}

/* Itens do menu */
header.sticky ul#navigationPrimary.space-x-2 > li > a,
header.sticky ul#navigationPrimary.space-x-2 > li .material-dropdown__trigger,
#navigationPrimary li a,
#navigationPrimary li .material-dropdown__trigger,
.pkp_navigation_primary li a,
.pkp_navigation_primary li .material-dropdown__trigger {
  display: inline-block !important;
  background: none !important;
  color: #fff !important;
  border: none !important;
  padding: .45rem 1rem !important;
  font-family: 'Roboto', sans-serif !important;
  font-weight: 500 !important;
  font-size: 1rem !important;
  text-transform: none !important;
  text-decoration: none !important;
  transition: color .2s ease;
}

header.sticky ul#navigationPrimary.space-x-2 > li > a:hover,
header.sticky ul#navigationPrimary.space-x-2 > li .material-dropdown__trigger:hover,
#navigationPrimary li:hover > a,
#navigationPrimary li:hover > .material-dropdown__trigger,
.pkp_navigation_primary li:hover > a,
.pkp_navigation_primary li:hover > .material-dropdown__trigger {
  color: #fff !important;
  background: transparent !important;
  text-decoration: underline !important;
}

/* Dropdowns */
header.sticky .material-dropdown__body,
#navigationPrimary .material-dropdown__body,
.pkp_navigation_primary .material-dropdown__body {
  background-color: #fff !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.12) !important;
  padding: .5rem 0 !important;
}
header.sticky .material-dropdown__item a,
#navigationPrimary .material-dropdown__item a,
.pkp_navigation_primary .material-dropdown__item a {
  color: #D9631E !important;
  background-color: #fff !important;
  padding: .4rem 1rem !important;
  display: block !important;
}
header.sticky .material-dropdown__item a:hover,
#navigationPrimary .material-dropdown__item a:hover,
.pkp_navigation_primary .material-dropdown__item a:hover {
  color: #D9631E !important;
  background-color: #f5f5f5 !important;
  text-decoration: underline !important;
}

/* =====================================================
   BREADCRUMB
   ===================================================== */

.cmp_breadcrumbs li:first-child,
.pkp_breadcrumbs li:first-child {
  display: none !important;
}

/* =====================================================
   FOOTER — replica layout do WordPress
   ===================================================== */

/* Oculta o footer padrão do Material theme */
footer.footer.bg-slate-50 {
  display: none !important;
}


.pm-footer {
  background-color: #fff;
  border-top: 3px solid #D9631E;
  font-family: 'Roboto', sans-serif;
}

.pm-footer__inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 3rem 2rem 2.5rem;
}

/* Logo ocupa ~36% do container */
.pm-footer__col--logo {
  flex: 0 0 34%;
  max-width: 34%;
  padding-right: 60px;
  display: flex;
  align-items: flex-start;
  box-sizing: border-box;
}

.pm-footer__logo {
  width: 100%;
  max-width: 469px;
  height: auto;
}

/* Colunas de links agrupadas à direita */
.pm-footer__cols-right {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: flex-end;
}

.pm-footer__col {
  min-width: 150px;
}

.pm-footer__heading {
  font-family: 'Poppins', sans-serif !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  text-transform: capitalize !important;
  letter-spacing: 0 !important;
  color: #000001 !important;
  margin: 0 0 0.85rem !important;
  line-height: 1.2em !important;
  font-style: normal !important;
  text-decoration: none !important;
}

.pm-footer__links {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pm-footer__links li {
  margin-bottom: 0.45rem;
}

.pm-footer__links a,
.pm-footer__links a:link,
.pm-footer__links a:visited {
  font-family: 'Roboto', sans-serif !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #324A6D !important;
  text-decoration: none !important;
  line-height: 1.5em !important;
  font-style: normal !important;
  letter-spacing: 0 !important;
  transition: color 0.2s ease;
}

.pm-footer__links a:hover {
  color: #D9631E !important;
  text-decoration: underline !important;
}

/* Barra inferior — fundo cinza igual ao WordPress */
.pm-footer__bottom {
  background-color: #E7E7E7;
  padding: 0.85rem 2rem;
  text-align: center;
}

.pm-footer__copyright {
  font-family: 'Roboto', sans-serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #585858 !important;
  margin: 0 !important;
}

/* =====================================================
   ABSTRACT EXCERPT — issue TOC expand/collapse
   ===================================================== */

/*
 * The hook output lands inside the outer flex row of each article.
 * JS sets flex-wrap:wrap on the parent; flex-basis:100% forces a new line.
 */
.pm-abstract-hook {
  flex-basis: 100% !important;
  width: 100% !important;
  min-width: 0;
  margin-top: 0.1rem;
  padding-bottom: 0.4rem;
}

.pm-abstract-short,
.pm-abstract-full {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.55;
  font-family: 'Roboto', sans-serif !important;
}

/* Initial state: full text and "ver menos" hidden */
.pm-abstract-full { display: none; }

.pm-toggle-link,
.pm-toggle-link:link,
.pm-toggle-link:visited {
  margin-top: 0.2rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #D9631E !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
.pm-toggle-link:hover {
  color: #CA5917 !important;
  text-decoration: underline !important;
}

/* .pm-less hidden initially; order matters (same specificity — later wins) */
.pm-more { display: inline-block !important; }
.pm-less { display: none !important; }

/* Expanded state toggled by JS via class on the hook */
.pm-abstract-hook.pm-expanded .pm-abstract-short { display: none; }
.pm-abstract-hook.pm-expanded .pm-abstract-full  { display: inline; }
.pm-abstract-hook.pm-expanded .pm-more           { display: none !important; }
.pm-abstract-hook.pm-expanded .pm-less           { display: inline-block !important; }

/* =====================================================
   ISSUE COVER IMAGE — maintain aspect ratio on mobile
   ===================================================== */

/* Material theme applies aspect-square on small screens, forcing 1:1.
   Override to preserve the image's natural proportions. */
.obj_issue_toc img {
  aspect-ratio: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border: 1px solid #e0e0e0 !important;
}

/* =====================================================
   CITATION BLOCK — Como Citar
   ===================================================== */

/* Fix broken icon: substitui FontAwesome (não carregado) por unicode */
.citation_display .citation_formats_button::after {
  font-family: inherit !important;
  content: " ▾" !important;
}
.citation_display .citation_formats_button[aria-expanded="true"]::after {
  content: " ▴" !important;
}

/* Abstract e keywords — cor do conteúdo (#474747 em vez do cinza claro padrão) */
.obj_article_details dd.text-slate-400 {
  color: #474747 !important;
}

/* Nome do formato ativo ao lado do título */
#pm-citation-format {
  font-size: 0.78em !important;
  font-weight: 400 !important;
  color: #888 !important;
  margin-left: 0.4em !important;
  font-family: 'Roboto', sans-serif !important;
}
