/* Accessibility: skip link, strip, color modes */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 10001;
  background: #000;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  outline: 3px solid #ff0;
}

.a11y-strip {
  background: #0f172a;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
}

.a11y-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 36px;
  padding: 4px 0;
}

.a11y-strip-link {
  color: #93c5fd;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.a11y-strip-link:hover,
.a11y-strip-link:focus {
  color: #fff;
  text-decoration: underline;
}

.a11y-strip-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.a11y-tool {
  border: 1px solid rgba(255, 255, 255, .25);
  background: transparent;
  color: #e2e8f0;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  letter-spacing: .03em;
}

.a11y-tool:hover,
.a11y-tool:focus {
  border-color: #fff;
  color: #fff;
}

.a11y-tool.active {
  background: var(--verde, #008e77);
  border-color: var(--verde, #008e77);
  color: #fff;
}

.a11y-shortcuts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 15px;
}

.a11y-shortcuts-table th,
.a11y-shortcuts-table td {
  border: 1px solid var(--borda, #ddd);
  padding: 10px 12px;
  text-align: left;
}

.a11y-shortcuts-table th {
  background: var(--surface-muted, #f5f5f5);
  font-weight: 700;
}

.a11y-shortcuts-table kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #f3f4f6;
  font-family: inherit;
  font-size: 12px;
  box-shadow: 0 1px 0 #bbb;
}

#main-content:focus {
  outline: 3px solid var(--verde-claro, #1bd4c0);
  outline-offset: 4px;
}

/* Dark mode */
html[data-color-mode="dark"] {
  --bg: #0f1419;
  --texto: #e8eef2;
  --surface: #1a222c;
  --surface-muted: #151c24;
  --borda: #2d3a47;
  --footer-bg: #0a1018;
  --link-ui: #5fe0cc;
}

html[data-color-mode="dark"] body {
  color: var(--texto);
  background: var(--bg);
}

html[data-color-mode="dark"] .topbar {
  background: var(--surface-muted);
  border-bottom-color: var(--borda);
}

html[data-color-mode="dark"] .logo,
html[data-color-mode="dark"] .menu a {
  color: var(--texto);
}

html[data-color-mode="dark"] .breadcrumb-bar {
  background: #060a0f;
  color: #cbd5e1;
}

html[data-color-mode="dark"] .post-single,
html[data-color-mode="dark"] .page-single,
html[data-color-mode="dark"] .post-card,
html[data-color-mode="dark"] .widget,
html[data-color-mode="dark"] .filter-info,
html[data-color-mode="dark"] .page-header {
  background: var(--surface);
  border-color: var(--borda);
  color: var(--texto);
}

html[data-color-mode="dark"] .page-header {
  background: linear-gradient(180deg, #1a2430 0%, var(--surface) 100%);
}

html[data-color-mode="dark"] .post-content,
html[data-color-mode="dark"] .page-body.post-content,
html[data-color-mode="dark"] .post-card-body p,
html[data-color-mode="dark"] .post-meta {
  color: #cbd5e1;
}

html[data-color-mode="dark"] .post-single h1,
html[data-color-mode="dark"] .page-header h1,
html[data-color-mode="dark"] .post-card-body h2 a {
  color: var(--verde-claro);
}

html[data-color-mode="dark"] .sidebar .widget,
html[data-color-mode="dark"] .search input {
  background: var(--surface);
  border-color: var(--borda);
  color: var(--texto);
}

html[data-color-mode="dark"] .affiliate-disclosure {
  background: #152028;
  border-color: #2d5a50;
  color: #cbd5e1;
}

html[data-color-mode="dark"] .contact-panel {
  background: #151c24;
  border-color: var(--borda);
}

html[data-color-mode="dark"] .contact-form input,
html[data-color-mode="dark"] .contact-form textarea {
  background: #0f1419;
  border-color: var(--borda);
  color: var(--texto);
}

html[data-color-mode="dark"] .a11y-shortcuts-table th {
  background: #1a2430;
  color: #fff;
}

html[data-color-mode="dark"] .a11y-shortcuts-table kbd {
  background: #0f1419;
  border-color: #555;
  color: #fff;
}

/* High contrast */
html[data-color-mode="high-contrast"] {
  --bg: #000;
  --texto: #fff;
  --surface: #000;
  --surface-muted: #000;
  --borda: #fff;
  --footer-bg: #000;
  --verde: #ffff00;
  --verde-escuro: #ffff00;
  --verde-claro: #ffff00;
  --link-ui: #ffff00;
}

html[data-color-mode="high-contrast"] body {
  color: #fff;
  background: #000;
}

html[data-color-mode="high-contrast"] a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

html[data-color-mode="high-contrast"] .topbar,
html[data-color-mode="high-contrast"] .post-single,
html[data-color-mode="high-contrast"] .page-single,
html[data-color-mode="high-contrast"] .post-card,
html[data-color-mode="high-contrast"] .widget,
html[data-color-mode="high-contrast"] .filter-info,
html[data-color-mode="high-contrast"] .page-header,
html[data-color-mode="high-contrast"] .sidebar .widget,
html[data-color-mode="high-contrast"] .contact-panel,
html[data-color-mode="high-contrast"] .affiliate-disclosure,
html[data-color-mode="high-contrast"] .cookie-modal-panel {
  background: #000 !important;
  border: 2px solid #fff !important;
  color: #fff !important;
  box-shadow: none !important;
}

html[data-color-mode="high-contrast"] .logo,
html[data-color-mode="high-contrast"] .menu a,
html[data-color-mode="high-contrast"] .post-single h1,
html[data-color-mode="high-contrast"] .page-header h1,
html[data-color-mode="high-contrast"] .post-content,
html[data-color-mode="high-contrast"] .post-meta,
html[data-color-mode="high-contrast"] .page-subtitle {
  color: #fff !important;
}

html[data-color-mode="high-contrast"] .read-more,
html[data-color-mode="high-contrast"] .search button,
html[data-color-mode="high-contrast"] .contact-submit,
html[data-color-mode="high-contrast"] .cookie-btn-save,
html[data-color-mode="high-contrast"] .a11y-tool.active {
  background: #ffff00 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
  font-weight: 800 !important;
}

html[data-color-mode="high-contrast"] .a11y-tool,
html[data-color-mode="high-contrast"] .share-btn,
html[data-color-mode="high-contrast"] .cookie-btn {
  border: 2px solid #fff !important;
}

html[data-color-mode="high-contrast"] .breadcrumb-bar,
html[data-color-mode="high-contrast"] .a11y-strip,
html[data-color-mode="high-contrast"] .footer-main,
html[data-color-mode="high-contrast"] .footer-bottom,
html[data-color-mode="high-contrast"] .cookie-banner {
  background: #000 !important;
  border-top: 2px solid #fff !important;
  border-bottom: 2px solid #fff !important;
  color: #fff !important;
}

html[data-color-mode="high-contrast"] img {
  outline: 2px solid #fff;
}

html[data-color-mode="high-contrast"] *:focus-visible {
  outline: 3px solid #ffff00 !important;
  outline-offset: 2px !important;
}

html[data-color-mode="high-contrast"] .a11y-shortcuts-table th,
html[data-color-mode="high-contrast"] .a11y-shortcuts-table td {
  border: 2px solid #fff;
  color: #fff;
  background: #000;
}

html[data-color-mode="high-contrast"] .a11y-shortcuts-table kbd {
  background: #000;
  border: 2px solid #fff;
  color: #ffff00;
}

@media (max-width: 620px) {
  .a11y-strip-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
  }
}
