/*
Theme Name: MBPS Sereď
Theme URI: https://mbps.dksered.eu/
Author: Codex
Description: Clean municipal company theme for MBPS Sereď.
Version: 0.1.0
Text Domain: mbps
*/

:root {
  --ink: #17202a;
  --muted: #5f6b76;
  --line: #d8dee6;
  --line-strong: #c5d0da;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f9fbfc;
  --band: #f4f7fa;
  --table-head: #edf3f7;
  --table-even: #fafbfd;
  --brand: #0a5c80;
  --brand-dark: #084b69;
  --brand-soft: #e8f3f8;
  --brand-2: #28724f;
  --link: #095f8a;
  --focus: #f2b705;
  --topbar-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(23, 32, 42, 0.08);
  --shadow-md: 0 10px 26px rgba(23, 32, 42, 0.11);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #edf4f8;
  --muted: #bccbd5;
  --line: #3d4b58;
  --line-strong: #526574;
  --surface: #101820;
  --surface-2: #17232d;
  --surface-3: #14202a;
  --band: #1d2b36;
  --table-head: #243646;
  --table-even: #14202a;
  --brand: #0f6f99;
  --brand-dark: #8fd5ff;
  --brand-soft: #142b3a;
  --brand-2: #2f7f5b;
  --link: #8fd5ff;
  --focus: #ffd24a;
  --topbar-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-underline-offset: 0.16em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--focus);
  color: #111;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.topbar {
  background: var(--brand);
  color: var(--topbar-ink);
  font-size: 14px;
}

.topbar a {
  color: var(--topbar-ink);
  font-weight: 700;
}

.topbar-inner,
.header-inner,
.site-main,
.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  padding: 8px 0;
}

.theme-toggle {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 4px;
  background: transparent;
  color: var(--topbar-ink);
  font: inherit;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.site-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}

.site-title a {
  color: var(--ink);
  text-decoration: none;
}

.site-description {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-menu a {
  display: block;
  min-height: 42px;
  padding: 10px 10px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a,
.nav-menu .current-menu-ancestor > a {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.site-main {
  padding: 34px 0 60px;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(23, 32, 42, 0.02);
}

.breadcrumbs {
  margin: -14px 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.breadcrumbs li:not(:last-child)::after {
  color: var(--line-strong);
  content: '/';
}

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

.breadcrumbs [aria-current="page"] {
  color: var(--muted);
  font-weight: 700;
}

.hero {
  margin: -32px calc(50% - 50vw) 32px;
  border-bottom: 5px solid var(--brand-2);
  background:
    linear-gradient(90deg, rgba(10, 92, 128, 0.96), rgba(40, 114, 79, 0.94)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 18px);
  color: #fff;
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 48px;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.1;
}

.hero p {
  max-width: 720px;
  margin: 16px 0 0;
  font-size: 18px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 34px;
}

.section-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}

.section-links:has(.quick-link:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-links:has(.quick-link:nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-links:has(.quick-link:nth-child(4):last-child) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-links .quick-link {
  min-width: 0;
  min-height: 82px;
  padding: 16px 14px 14px;
}

.quick-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.quick-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
  background: var(--brand);
}

.quick-link:hover {
  border-color: var(--brand);
  background: var(--band);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.quick-link strong {
  display: block;
  margin-bottom: 6px;
  padding-left: 2px;
  font-size: 18px;
  line-height: 1.25;
}

.quick-link span {
  color: var(--muted);
  line-height: 1.45;
}

.section-links .quick-link strong,
.section-links .quick-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-links .quick-link strong {
  font-size: 17px;
}

.section-links:has(.quick-link:nth-child(4):last-child) .quick-link strong {
  font-size: 16px;
}

.section-links:has(.quick-link:nth-child(4):last-child) .quick-link span {
  font-size: 14px;
}

.entry-header h1 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 32px;
  line-height: 1.2;
}

.entry-content {
  max-width: 100%;
}

.entry-content h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 23px;
  line-height: 1.25;
}

.entry-content p {
  max-width: 76ch;
}

.entry-content > p {
  max-width: none;
}

.mbps-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.mbps-table-tools,
.mbps-table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-3);
}

.mbps-table-tools label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.mbps-table-tools input,
.mbps-table-tools select {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
}

.mbps-table-tools input {
  width: min(320px, 70vw);
}

.mbps-table-status,
.mbps-page-info {
  color: var(--muted);
}

.mbps-table-pager button {
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.mbps-table-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.mbps-table-pager button:not(:disabled):hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.mbps-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.mbps-table caption {
  text-align: left;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mbps-table .is-number {
  text-align: right;
}

.mbps-table th,
.mbps-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.mbps-table th {
  background: var(--table-head);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.mbps-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.mbps-table tr:nth-child(even) td {
  background: var(--table-even);
}

.mbps-table tbody tr:hover td {
  background: var(--brand-soft);
}

.mbps-financial-table {
  min-width: 720px;
}

.mbps-financial-table td {
  text-align: right;
  white-space: nowrap;
}

.mbps-financial-table th[scope="rowgroup"] {
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-align: left;
}

.mbps-financial-table .is-total th,
.mbps-financial-table .is-total td,
.mbps-financial-table .is-result th,
.mbps-financial-table .is-result td {
  font-weight: 800;
  background: var(--surface-3);
}

.mbps-financial-table .is-result th,
.mbps-financial-table .is-result td {
  border-top: 2px solid var(--brand);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--band);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

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

.entry-content table:not(.mbps-table) {
  width: 100%;
  border-collapse: collapse;
}

.entry-content table:not(.mbps-table) th,
.entry-content table:not(.mbps-table) td {
  padding: 10px 12px;
  border: 1px solid var(--line);
}

.board-section {
  max-width: none;
}

.board-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.board-table th,
.board-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.board-table thead th {
  background: var(--table-head);
  color: var(--ink);
  font-weight: 700;
}

.board-table tbody th {
  width: 34%;
  font-weight: 700;
}

.board-table tbody td:last-child {
  width: 150px;
  white-space: nowrap;
}

.board-table tbody tr:nth-child(even) th,
.board-table tbody tr:nth-child(even) td {
  background: var(--table-even);
}

.board-table tbody tr:last-child th,
.board-table tbody tr:last-child td {
  border-bottom: 0;
}

.governance-section {
  max-width: none;
  margin-block: 28px 34px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: var(--surface-2);
}

.governance-section h2 {
  margin-top: 0;
}

.governance-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.governance-list div {
  display: grid;
  grid-template-columns: minmax(220px, 30%) 1fr;
  gap: 10px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.governance-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.governance-list dt {
  font-weight: 700;
}

.governance-list dd {
  margin: 0;
}

@media (max-width: 700px) {
  .governance-section {
    padding: 18px;
  }

  .governance-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.entry-content img {
  max-width: 100%;
  height: auto;
}

.about-intro {
  max-width: none;
  margin-bottom: 6px;
  font-size: 18px;
}

.about-intro p {
  max-width: none;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.about-card {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.about-card-wide {
  grid-column: 1 / -1;
}

.about-card h2 {
  margin-top: 0;
}

.action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.action-card p {
  max-width: none;
  margin-bottom: 0;
}

.about-highlight {
  margin: 6px 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-dark);
}

.fact-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.fact-list div {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.fact-list div:first-child {
  border-top: 0;
}

.fact-list dt {
  color: var(--muted);
  font-weight: 700;
}

.fact-list dd {
  margin: 0;
}

.fact-list.compact div {
  grid-template-columns: 105px 1fr;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--brand);
  border-radius: 4px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  background: var(--brand-dark);
  color: #fff;
}

.announcement-list {
  display: grid;
  gap: 16px;
}

.announcement-card,
.announcement-empty {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.announcement-card time {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.announcement-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.announcement-content p {
  max-width: none;
}

.contact-stack {
  display: grid;
  gap: 18px;
  margin: 12px 0 30px;
}

.contact-band {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.contact-band-primary {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.contact-band h2,
.office-hours-section h3 {
  margin-top: 0;
}

.service-band {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 22px;
  align-items: start;
}

.service-copy,
.service-map {
  min-width: 0;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.contact-list-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-list div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.contact-list dt {
  color: var(--muted);
  font-weight: 700;
}

.contact-list dd {
  margin: 0;
}

.office-hours-section {
  margin-top: 24px;
  grid-column: 1 / -1;
}

.service-map p {
  margin-top: 12px;
}

.hours-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}

.hours-table {
  width: 100%;
  border-collapse: collapse;
}

.hours-table th,
.hours-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.hours-table thead th {
  background: var(--table-head);
}

.hours-table tbody th {
  width: 28%;
}

.hours-table tr:last-child th,
.hours-table tr:last-child td {
  border-bottom: 0;
}

.hours-table .is-muted th,
.hours-table .is-muted td {
  color: var(--muted);
  background: var(--surface-3);
  font-weight: 700;
}

.map-embed {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-3);
  box-shadow: var(--shadow-sm);
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
}

@media (max-width: 760px) {
  .topbar-inner,
  .header-inner,
  .site-footer-inner {
    display: block;
  }

  .topbar-inner > * + * {
    display: block;
    margin-top: 8px;
  }

  .nav-menu {
    flex-wrap: wrap;
    margin-top: 16px;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .section-links {
    gap: 8px;
  }

  .section-links .quick-link {
    padding: 12px 10px;
  }

  .section-links .quick-link strong {
    font-size: 15px;
    white-space: normal;
  }

  .section-links .quick-link span {
    font-size: 13px;
    white-space: normal;
  }

  .contact-stack,
  .service-band,
  .contact-list-inline,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-card-wide {
    grid-column: auto;
  }

  .action-card {
    grid-template-columns: 1fr;
  }

  .fact-list div,
  .fact-list.compact div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .contact-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .site-main {
    padding-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .quick-link:hover {
    transform: none;
  }
}
