/* KA Świnoujście – wersja kompaktowa, mobile-first */
:root {
  --bg: #f5f5f5;
  --card: #fff;
  --primary: #c0402a;
  --primary-hover: #a03522;
  --text: #333;
  --muted: #666;
  --border: #e0e0e0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* Header */
.header {
  background: var(--primary);
  color: #fff;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.header a { color: inherit; text-decoration: none; }
.logo-wrap { display: flex; align-items: center; gap: 0.5rem; }
.logo-wrap img { height: 40px; width: auto; display: block; border-radius: 4px; }
.logo-wrap span { font-weight: 700; font-size: 0.95rem; }
.tel { font-weight: 600; font-size: 1rem; white-space: nowrap; }
.tel a { text-decoration: underline; }

/* Nav toggle (mobile) */
.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.2);
  border: none;
  border-radius: var(--radius);
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.3); }
.nav-toggle[aria-expanded="true"] { background: rgba(255,255,255,.35); }
@media (min-width: 768px) { .nav-toggle { display: none; } }

/* Navigation */
.nav-wrap { width: 100%; }
.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255,255,255,.2);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}
.nav.collapsed { display: none; }
@media (min-width: 768px) {
  .nav-wrap { width: auto; }
  .nav { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .nav.collapsed { display: flex; }
}
.nav li { margin: 0; }
.nav a {
  display: block;
  padding: 0.4rem 0.6rem;
  color: rgba(255,255,255,.95);
  font-size: 0.875rem;
  border-radius: 4px;
}
.nav a:hover { background: rgba(255,255,255,.2); }
.nav .sub { padding-left: 1rem; font-size: 0.8rem; }

/* Main */
.main { max-width: 900px; margin: 0 auto; padding: 1rem; }
.main > .news-lead { animation: fadeIn 0.5s 0.15s ease-out both; }
.main > .card { animation: fadeInUp 0.45s 0.2s ease-out both; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.35rem;
}

/* Quick links (rozklady, schemat, jakdojade...) */
.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 480px) { .quick-links { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .quick-links { grid-template-columns: repeat(6, 1fr); } }
.quick-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  font-size: 0.75rem;
  text-align: center;
  min-height: 72px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.quick-links a:hover {
  background: #fff;
  box-shadow: 0 6px 16px rgba(192, 64, 42, .15);
  transform: translateY(-3px);
}
.quick-links a:active { transform: translateY(-1px); }
.quick-links img {
  max-height: 32px;
  width: auto;
  margin-bottom: 0.25rem;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.quick-links a:hover img { transform: scale(1.08); }

/* Aktualność */
.news-lead {
  background: linear-gradient(to right, #fffbe6 0%, #fff9dc 100%);
  border: 1px solid #e6d98a;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  transition: box-shadow 0.2s ease, border-left-color 0.2s ease;
}
.news-lead:hover { box-shadow: 0 2px 10px rgba(192, 64, 42, .12); }
.news-lead--pulse { animation: newsBorderPulse 3s ease-in-out infinite; }
@keyframes newsBorderPulse {
  0%, 100% { border-left-color: var(--primary); }
  50% { border-left-color: var(--primary-hover); }
}
.news-lead h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.news-lead h3 a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
.news-lead h3 a:hover { color: var(--primary-hover); text-decoration: underline; }
.news-lead p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.news-more { font-size: 0.85rem; margin-top: 1rem; }
.news-more a { transition: color 0.2s ease; }

/* Sekcje (accordion-style) */
.section { margin-bottom: 0.5rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.section-header:hover { background: #fafafa; }
.section-header::after {
  content: '';
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.section.open .section-header::after { transform: rotate(-135deg); }
.section.open .section-header { background: #fafafa; border-color: var(--primary); color: var(--primary); }
.section-content {
  display: none;
  padding: 0.6rem 0.9rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: -1px;
}
.section.open .section-content { display: block; }
.section-content ul { margin: 0; padding-left: 1.2rem; }
.section-content li { margin-bottom: 0.25rem; }
.section-content a { color: var(--primary); text-decoration: none; }
.section-content a:hover { text-decoration: underline; }

/* Zakładki (Komunikacja / Parkingi / Usługi) */
.card-tabs { padding: 0; }
.tabs { padding: 0; }
.tab-list {
  display: flex;
  border-bottom: 2px solid var(--border);
  padding: 0 0.5rem 0 0;
  gap: 0.25rem;
}
.tab-btn {
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel {
  padding: 1rem 1rem 1.25rem;
}
.quick-links--in-tab { margin-bottom: 1rem; }
.quick-links--in-tab .ql-item { min-height: 64px; }
.tab-panel-list { margin: 0; padding-left: 1.2rem; }
.tab-panel ul { margin: 0; padding-left: 1.2rem; }
.tab-panel li { margin-bottom: 0.35rem; }
.tab-panel a { color: var(--primary); text-decoration: none; }
.tab-panel a:hover { text-decoration: underline; }

/* Footer */
.footer {
  background: #2d2d2d;
  color: #ccc;
  padding: 1.25rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.8rem;
}
.footer a { color: #aad4ff; }
.footer-grid { display: grid; gap: 1rem; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-links { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid #444; }

/* Strony wewnętrzne */
.main.page { padding-top: 0.5rem; }
.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.9rem; color: var(--primary); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.article {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}
.article h1 { margin: 0 0 0.75rem; font-size: 1.2rem; color: var(--primary); }
.article h2, .article h3 { margin: 1rem 0 0.5rem; font-size: 1rem; }
.article p { margin: 0 0 0.75rem; }
.article ul, .article ol { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.article li { margin-bottom: 0.25rem; }
.article a { color: var(--primary); }
.article img { max-width: 100%; height: auto; border-radius: 4px; }

.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.content-table th,
.content-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  text-align: left;
}
.content-table th { background: #f0f0f0; font-weight: 600; }
.content-table td.text-center { text-align: center; }
.content-table tr:nth-child(even) { background: #fafafa; }

.contact-card {
  background: #f9f9f9;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.contact-card strong { display: block; margin-bottom: 0.25rem; }
.contact-card a { color: var(--primary); }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.news-list li:last-child { border-bottom: none; }
.news-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.news-list a:hover { color: var(--primary); }
.news-list time { font-size: 0.85rem; color: var(--muted); }

/* Paginacja */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  padding: 1rem 0;
}

.pagination-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
  font-size: 0.9rem;
}

.pagination-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination-current {
  padding: 0.4rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Szczegóły aktualności */
.aktualnosc-data {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.aktualnosc-data time {
  font-style: italic;
}

.aktualnosc-tresc {
  line-height: 1.6;
}

.aktualnosc-tresc h2,
.aktualnosc-tresc h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.aktualnosc-tresc h2 {
  font-size: 1.3rem;
}

.aktualnosc-tresc h3 {
  font-size: 1.1rem;
}

.aktualnosc-tresc p {
  margin-bottom: 1rem;
}

.aktualnosc-tresc ul,
.aktualnosc-tresc ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.aktualnosc-tresc li {
  margin-bottom: 0.5rem;
}

.aktualnosc-tresc a {
  color: var(--primary);
  text-decoration: none;
}

.aktualnosc-tresc a:hover {
  text-decoration: underline;
}

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.no-js .nav.collapsed { display: block; }
@media (min-width: 768px) { .no-js .nav.collapsed { display: flex; } }

/* Szanuj preferencję użytkownika: mniej ruchu */
@media (prefers-reduced-motion: reduce) {
  .main > .news-lead, .main > .card { animation: none; }
  .news-lead--pulse { animation: none; }
  .card, .quick-links a, .quick-links a img { transition: none; }
}

/* Rozkłady jazdy */
.rozklady-lista {
  margin-top: 1.5rem;
  overflow-x: auto;
}

.rozklady-tabela-lista {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.rozklady-tabela-lista thead {
  background: var(--primary);
  color: #fff;
}

.rozklady-tabela-lista th {
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
}

.rozklady-tabela-lista th:first-child {
  width: 40%;
  text-align: right;
}

.rozklady-tabela-lista th:nth-child(2) {
  width: 90px;
  text-align: center;
}

.rozklady-tabela-lista th:nth-child(3) {
  width: 40%;
  text-align: left;
}

.rozklady-tabela-lista tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.rozklady-tabela-lista tbody tr:hover {
  background: #fafafa;
}

.rozklady-tabela-lista tbody tr:hover .linia-cell {
  background: #f5f5f5;
}

.rozklady-tabela-lista tbody tr:last-child {
  border-bottom: none;
}

.linia-cell {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  font-weight: 600;
  color: var(--primary);
  background: #fafafa;
  border-right: 1px solid var(--border);
  font-size: 0.9rem;
  white-space: nowrap;
  text-align: center;
}

.kierunek-cell {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
}

.kierunek-cell:first-child {
  text-align: right;
}

.kierunek-cell:last-child {
  text-align: left;
}

.kierunek-link-tabela {
  color: var(--text);
  text-decoration: none;
  font-weight: 400;
  display: inline-block;
  padding: 0.25rem 0.4rem;
  margin: -0.25rem -0.4rem;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  font-size: 0.9rem;
}

.kierunek-link-tabela:hover {
  color: var(--primary);
  background: #f5f5f5;
  text-decoration: none;
}

.kierunek-cell:first-child .brak-danych {
  text-align: right;
}

.kierunek-cell:last-child .brak-danych {
  text-align: left;
}

.kierunki-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 600px) {
  .kierunki-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kierunek-link {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.kierunek-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.12);
  border-color: var(--primary);
}

.kierunek-nazwa {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.kierunek-data {
  font-size: 0.9rem;
  color: var(--muted);
}

.przystanki-list-kompakt {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.przystanki-list-kompakt li {
  border-bottom: 1px solid #f0f0f0;
}

.przystanki-list-kompakt li:last-child {
  border-bottom: none;
}

.przystanek-item-z-liniami {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.przystanek-link-kompakt {
  display: block;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, color 0.15s;
  font-size: 0.85rem;
  line-height: 1.35;
  flex: 1;
}

.przystanek-link-kompakt:hover {
  background: #f9f9f9;
  color: var(--primary);
}

.linie-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  padding-right: 0.65rem;
  align-items: center;
}

.linia-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: white;
  color: var(--primary);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, color 0.15s;
  white-space: nowrap;
  border: 1px solid var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.2;
}

.linia-badge:hover {
  background: var(--primary);
  transform: translateY(-1px);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.linia-badge-current {
  cursor: default;
  pointer-events: none;
  font-size: 1.7rem;
  padding: 0.5rem 1rem;
  line-height: 1.2;
}

.linia-badge-current:hover {
  background: white;
  color: var(--primary);
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.na-zadanie-link {
  font-size: 0.85em;
  color: #d97706;
  font-style: italic;
}

.przystanek-header {
  margin: 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.przystanek-header .przystanek-nazwa {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary);
}

.kierunek-info {
  background: #f0f7ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
}

.kierunek-info h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--primary);
}

.wazny-od {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.kierunek-header-kompakt {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
}

.wazny-od-kompakt {
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

.przystanek-header-kompakt {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.przystanek-header-content {
  flex: 1;
  min-width: 0;
}

.linie-badges-przystanek {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

.rozklady-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.przystanek-rozklad {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.przystanek-nazwa {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--primary);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.przystanek-nr {
  font-size: 0.9em;
  color: var(--muted);
  font-weight: normal;
}

.na-zadanie {
  font-size: 0.85em;
  color: #d97706;
  font-weight: normal;
  font-style: italic;
}

.rozklad-tabela-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.rozklad-tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.rozklad-tabela thead {
  background: var(--primary);
  color: #fff;
}

.rozklad-tabela th {
  padding: 0.2rem 0.3rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.08rem;
  width: 50%;
}

.rozklad-tabela tbody tr {
  border-bottom: none;
}

.rozklad-tabela tbody tr:hover {
  background: #f9f9f9;
}

.godziny-cell {
  padding: 0.15rem 0.3rem;
  vertical-align: top;
  width: 50%;
}

.godziny-cell .czas {
  display: inline-block;
  margin-right: 0.1rem;
  margin-bottom: 0;
  padding: 0.05rem 0.15rem;
  border-radius: 2px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  white-space: nowrap;
  font-size: 1.02rem;
}

.czas-powszedni {
  background: #f0f0f0;
}

.czas-swieto {
  background: #ffe0e0;
}

.godziny-cell .czas sup {
  font-size: 0.7em;
  color: var(--primary);
  font-weight: bold;
  margin-left: 0.1em;
}

.godziny-cell .brak {
  color: var(--muted);
  font-style: italic;
}

.brak-danych {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-style: italic;
}

.info-text {
  padding: 0.75rem 1rem;
  text-align: center;
  color: var(--muted);
  background: #f9f9f9;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .rozklady-form {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
  }
  
  .form-row {
    flex: 1;
    margin-bottom: 0;
  }
  
  .rozklad-tabela {
    font-size: 1rem;
  }
  
  .godziny-cell .czas {
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
  }
}
