/* Wikipedia-style CSS for Fábio Soares Ribeiro */

* {
  box-sizing: border-box;
}

:root {
  --primary-color: #003366;
  --secondary-color: #f8f9fa;
  --border-color: #a7d7f9;
  --text-color: #202122;
  --link-color: #0645ad;
  --visited-link-color: #0b0080;
  --background-color: #ffffff;
  --heading-font: "Linux Libertine", "Georgia", "Times", serif;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
}

/* Header/Navigation */
header {
  background-color: #ffffff;
  border-bottom: 1px solid #a2a9b1;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-family: var(--heading-font);
  font-size: 20px;
  margin: 0;
  padding: 4px 0;
}

.header-title a,
.header-title a:visited {
  color: #000;
}

/* Main content wrapper */
.wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.page-heading {
  grid-column: 1 / -1;
  grid-row: 1;
}

main {
  grid-column: 1;
  grid-row: 2;
}

.no-sidebar main {
  grid-column: 1 / -1;
  max-width: 900px;
}

/* Infobox (sidebar) */
.sidebar {
  grid-column: 2;
  grid-row: 2;
}

.infobox {
  border: 1px solid var(--border-color);
  background-color: var(--secondary-color);
  padding: 10px;
  width: 100%;
  font-size: 13px;
}

.infobox-title {
  background-color: var(--border-color);
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  padding: 8px;
  margin: -10px -10px 10px -10px;
  color: var(--primary-color);
}

.infobox-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: start;
  border-bottom: 1px solid #e8e8e8;
  padding: 8px 0;
}

.infobox-row:last-child {
  border-bottom: none;
}

.infobox-label {
  font-weight: 600;
  padding-right: 10px;
  color: var(--text-color);
  min-width: 120px;
  text-align: right;
}

.infobox-value {
  color: var(--text-color);
}

/* Typography */
h1, h2 {
  font-family: var(--heading-font);
  font-weight: normal;
  color: #000;
}

h1 {
  font-size: 2.1em;
  line-height: 1.3;
  margin: 0;
  padding: 0 0 4px 0;
  border-bottom: 1px solid #a2a9b1;
}

h2 {
  font-size: 1.6em;
  line-height: 1.3;
  margin: 1.2em 0 0.5em 0;
  padding: 0 0 2px 0;
  border-bottom: 1px solid #a2a9b1;
}

h3 {
  font-size: 1.15em;
  line-height: 1.4;
  margin: 1.2em 0 0.4em 0;
  color: var(--text-color);
  font-weight: bold;
}

h4, h5, h6 {
  margin: 15px 0 10px 0;
  color: var(--text-color);
  font-weight: bold;
}

/* Article title block */
.page-subtitle {
  font-size: 0.92em;
  color: #54595d;
  margin: 6px 0 0 0;
}

.hatnote {
  font-style: italic;
  padding-left: 1.6em;
  margin-bottom: 1em;
  color: #54595d;
}

/* Paragraphs and text elements */
p {
  margin: 0 0 1em 0;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  background: transparent;
}

a:visited {
  color: var(--visited-link-color);
}

a:hover {
  text-decoration: underline;
  cursor: pointer;
}

a:active {
  color: #ae3883;
}

/* Lists */
ul, ol {
  margin: 0 0 1em 1.6em;
  padding: 0;
}

li {
  margin: 0.5em 0;
}

dl {
  margin: 0.5em 0;
}

dt {
  font-weight: 600;
  margin: 0.5em 0 0 0;
}

dd {
  margin: 0 0 0.5em 1.6em;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--border-color);
  margin: 0.5em 0;
  padding: 0.5em 1em;
  background-color: var(--secondary-color);
  color: #565656;
  font-style: italic;
}

/* Code */
code, tt {
  background-color: var(--secondary-color);
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
  padding: 2px 5px;
  border-radius: 3px;
  color: #000;
}

pre {
  background-color: var(--secondary-color);
  border: 1px solid #c8ccd1;
  border-radius: 3px;
  font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
  padding: 10px 15px;
  margin: 1em 0;
  overflow-x: auto;
}

pre code {
  background-color: transparent;
  border: none;
  padding: 0;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  background-color: var(--background-color);
}

table.wikitable {
  border: 1px solid #c8ccd1;
}

table.wikitable td, table.wikitable th {
  border: 1px solid #c8ccd1;
  padding: 8px;
  text-align: left;
}

table.wikitable th {
  background-color: var(--border-color);
  font-weight: 600;
  color: var(--primary-color);
}

table.wikitable tr:nth-child(odd) {
  background-color: var(--secondary-color);
}

td, th {
  padding: 8px;
  border-bottom: 1px solid #c8ccd1;
}

th {
  background-color: var(--border-color);
  color: var(--primary-color);
  font-weight: 600;
  text-align: left;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em 0;
  border: 1px solid #c8ccd1;
  padding: 3px;
}

figure {
  margin: 1em 0;
  text-align: center;
}

figcaption {
  font-size: 0.95em;
  color: #565656;
  margin-top: 5px;
  font-style: italic;
}

/* TOC (Table of Contents) */
.toc {
  display: inline-block;
  background-color: var(--secondary-color);
  border: 1px solid #a2a9b1;
  padding: 8px 16px 8px 12px;
  margin: 0.5em 0 1em 0;
  font-size: 0.95em;
}

.toc-title {
  font-weight: bold;
  text-align: center;
  margin: 0 0 6px 0;
}

.toc ul {
  list-style-type: none;
  counter-reset: toc-item;
  margin: 0;
  padding: 0;
}

.toc li::before {
  counter-increment: toc-item;
  content: counters(toc-item, ".") " ";
  color: var(--text-color);
  padding-right: 4px;
}

.toc ul ul {
  margin-left: 1.5em;
}

.toc li {
  margin: 0.15em 0;
}

.toc a {
  color: var(--link-color);
}

/* Short lists shown side by side */
.columns {
  column-count: 3;
  column-gap: 2em;
}

.columns li {
  margin: 0;
  padding: 0.25em 0;
  break-inside: avoid;
}

/* Story attribution */
.story-credit {
  font-size: 0.92em;
  font-style: italic;
  color: #54595d;
}

/* Testimonials */
blockquote.depoimento {
  font-style: normal;
  color: var(--text-color);
  margin: 1em 0 1.5em 0;
}

blockquote.depoimento-resumo p {
  font-style: italic;
  font-size: 1.05em;
}

blockquote.depoimento footer {
  font-size: 0.95em;
  color: #54595d;
}

/* Timeline */
table.timeline {
  width: auto;
}

table.timeline td:first-child {
  white-space: nowrap;
  font-weight: bold;
}

/* Photo gallery */
.gallery {
  list-style: none;
  margin: 1em 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallerybox {
  margin: 0;
  background-color: var(--secondary-color);
  border: 1px solid #c8ccd1;
  padding: 8px;
}

.gallerybox img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin: 0;
}

.gallerytext {
  font-size: 0.92em;
  line-height: 1.4;
  margin-top: 6px;
  text-align: center;
}

/* "+N fotos" tile linking to the album */
.gallerybox-more a {
  position: relative;
  display: block;
}

.gallery-more-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--heading-font);
  font-size: 1.6em;
  line-height: 1.2;
}

.gallerybox-more a:hover .gallery-more-label {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-all {
  margin-top: -0.25em;
}

/* Lightbox */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  margin: 0;
  max-width: 92vw;
  text-align: center;
}

.lightbox img {
  max-width: 92vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 0;
  padding: 0;
}

.lightbox figcaption {
  color: #eaecf0;
  font-size: 0.95em;
  margin-top: 10px;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  opacity: 0.8;
  padding: 12px 16px;
  line-height: 1;
}

.lightbox button:hover,
.lightbox button:focus-visible {
  opacity: 1;
}

.lightbox-close {
  top: 8px;
  right: 8px;
  font-size: 36px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
}

.lightbox-prev {
  left: 4px;
}

.lightbox-next {
  right: 4px;
}

/* Infobox photo caption */
.infobox-caption {
  text-align: center;
  font-size: 0.92em;
  line-height: 1.4;
  margin: 0 4px 8px 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

/* Footer */
body > footer {
  background-color: var(--secondary-color);
  border-top: 1px solid #c8ccd1;
  padding: 20px;
  margin-top: 40px;
  text-align: center;
  color: #565656;
  font-size: 12px;
}

/* Utility classes */
.mw-editsection {
  font-size: 0.9em;
  font-style: normal;
  margin-left: 10px;
}

.mw-editsection a {
  color: var(--link-color);
}

.reference {
  font-size: 0.9em;
  vertical-align: super;
}

.infobox-profile-img {
  max-width: 240px;
  width: 100%;
  height: auto;
  margin: 0 auto 6px auto;
}

/* Responsive design */
@media (max-width: 900px) {
  .wrapper {
    display: block;
    padding: 12px 16px;
  }

  .page-heading {
    margin-bottom: 16px;
  }

  .infobox {
    float: none;
    margin: 0 auto 20px auto;
    max-width: 400px;
  }

  table, .wikitable {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 1.8em;
  }

  h2 {
    font-size: 1.4em;
  }

  .infobox {
    max-width: 100%;
  }

  .infobox-row {
    grid-template-columns: 100px 1fr;
  }

  .infobox-label {
    min-width: 0;
  }

  .columns {
    column-count: 2;
  }
}

/* Print styles */
@media print {
  header, body > footer, .toc, .hatnote {
    display: none;
  }

  .wrapper {
    max-width: 100%;
    display: block;
  }
}
