/* OSP Ściechów - główny arkusz stylów. Mobile-first, bez frameworków. */

:root {
  --bg: #faf9f7;
  --bg-alt: #f0efeb;
  --surface: #ffffff;
  --border: #e0ddd6;
  --text: #1c1b19;
  --text-muted: #5c5952;
  --text-faint: #85817a;
  --dark: #17181a;
  --dark-alt: #232427;
  --dark-text: #f2f1ee;
  --dark-text-muted: #b7b4ad;
  --red: #c8102e;
  --red-dark: #93081f;
  --red-tint: #fdecee;
  --focus: #1d6fd6;
  --radius: 3px;
  --max-width: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--red-dark);
}

a:hover {
  color: var(--red);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.1rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--red);
  color: #fff;
  padding: 0.6em 1em;
  z-index: 1000;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Pasek alarmowy 112 --- */
.emergency-bar {
  background: var(--dark);
  color: var(--dark-text);
  font-size: 0.85rem;
  padding: 0.4rem 0;
}
.emergency-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.emergency-bar strong {
  color: #fff;
}
.emergency-bar a.tel112 {
  color: #fff;
  background: var(--red);
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.emergency-bar a.tel112:hover {
  background: var(--red-dark);
}

/* --- Nagłówek / nawigacja --- */
.site-header {
  background: var(--dark);
  color: var(--dark-text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--red);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: #fff; }
.brand svg { flex-shrink: 0; }
.brand .brand-sub {
  display: block;
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--dark-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  background: none;
  border: 1px solid #45464a;
  color: #fff;
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--red); }

.main-nav {
  display: none;
  flex-direction: column;
  padding: 0.5rem 0 1rem;
  border-top: 1px solid #2c2d31;
}
.main-nav.is-open { display: flex; }
.main-nav a {
  color: var(--dark-text);
  text-decoration: none;
  padding: 0.65rem 0.2rem;
  border-bottom: 1px solid #2a2b2f;
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
}
.main-nav a.active { color: var(--red); }
.main-nav a.cta-ai {
  color: #fff;
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .main-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    border-top: none;
    padding: 0;
  }
  .main-nav a {
    border-bottom: none;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius);
  }
  .main-nav a:hover { background: var(--dark-alt); }
  .main-nav a.active { background: var(--dark-alt); }
}

/* --- Hero --- */
.hero {
  background: var(--dark);
  color: var(--dark-text);
  padding: 2.75rem 0 3rem;
  border-bottom: 1px solid #2a2b2f;
}
.hero .container {
  display: grid;
  gap: 1.5rem;
}
.hero-eyebrow {
  color: var(--red);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.hero h1 { color: #fff; }
.hero p.lead {
  color: var(--dark-text-muted);
  font-size: 1.05rem;
  max-width: 60ch;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
@media (min-width: 760px) {
  .hero { padding: 4.5rem 0 4rem; }
}

/* --- Przyciski --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-outline {
  background: transparent;
  border-color: #52535a;
  color: #fff;
}
.btn-outline:hover { border-color: #fff; color: #fff; }
.btn-dark {
  background: var(--dark);
  color: #fff;
}
.btn-dark:hover { background: var(--dark-alt); color: #fff; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* --- Sekcje ogólne --- */
.section {
  padding: 2.75rem 0;
}
.section-alt {
  background: var(--bg-alt);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.6rem;
}
.section-head h2 { margin: 0; }
.section-head .more { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* --- Karty --- */
.grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-img {
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.card-date {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card h3 { margin: 0; font-size: 1.05rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--red-dark); }
.card p { color: var(--text-muted); font-size: 0.93rem; margin: 0; }

.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
}
.tile h3 { margin-bottom: 0.4rem; }
.tile p { color: var(--text-muted); }

/* --- Kafel AI OSP na stronie głównej --- */
.ai-tile {
  background: linear-gradient(155deg, var(--dark) 0%, #2a1113 100%);
  color: var(--dark-text);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  display: grid;
  gap: 1rem;
  border: 1px solid #34191c;
}
.ai-tile .ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--red);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ai-tile h2, .ai-tile h3 { color: #fff; }
.ai-tile p { color: var(--dark-text-muted); }

/* --- Galeria --- */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pill {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.pill:hover { border-color: var(--red); color: var(--red-dark); }
.pill.active { background: var(--dark); color: #fff; border-color: var(--dark); }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
@media (min-width: 640px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-grid a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-height: 88vh; max-width: 100%; border-radius: 2px; }
.lightbox-caption { color: #eee; text-align: center; margin-top: 0.6rem; font-size: 0.9rem; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 1rem;
}

/* --- Formularze --- */
.form-field {
  margin-bottom: 1.1rem;
}
.form-field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}
.form-field .hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.3rem;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="file"], textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 8rem; resize: vertical; }
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.checkbox-field input { margin-top: 0.3rem; width: auto; }
.checkbox-field label { font-weight: 500; font-size: 0.88rem; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 560px;
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.alert-error { background: var(--red-tint); border-color: #f2c3c9; color: var(--red-dark); }
.alert-success { background: #eaf6ec; border-color: #bfe3c5; color: #1e6b2c; }
.alert-info { background: #eaf1fb; border-color: #c4d8f2; color: #1a4d8f; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pending { background: #fdf3d6; color: #8a6600; }
.status-approved { background: #e2f4e4; color: #1e6b2c; }
.status-rejected { background: #f6dede; color: #93081f; }
.status-published { background: #e2f4e4; color: #1e6b2c; }
.status-draft { background: #ececec; color: #5c5952; }

/* --- AI OSP --- */
.chat-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-window {
  min-height: 320px;
  max-height: 520px;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-alt);
}
.chat-msg {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--dark);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.chat-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}
.chat-msg-bot .chat-sources {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-faint);
  border-top: 1px dashed var(--border);
  padding-top: 0.4rem;
}
.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem;
  border-top: 1px solid var(--border);
}
.chat-input-row textarea {
  min-height: 2.6rem;
  max-height: 8rem;
}
.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.9rem 0.9rem;
}
.quick-questions button {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text);
}
.quick-questions button:hover { border-color: var(--red); color: var(--red-dark); }

/* --- Kontakt / listy poradników --- */
.info-list dt { font-weight: 700; margin-top: 0.7rem; }
.info-list dd { margin: 0.1rem 0 0; color: var(--text-muted); }

.guide {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5.5rem;
}
.guide h3 { margin-bottom: 0.3rem; }
.guide .summary { color: var(--text-muted); margin-bottom: 0.8rem; }
.guide ul { margin: 0; padding-left: 1.2rem; }
.guide li { margin-bottom: 0.45rem; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.source-pending-note {
  border: 1px dashed #c7b23a;
  background: #fdf9e6;
  color: #6b5900;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin: 1.2rem 0;
}

/* --- Stopka --- */
.site-footer {
  background: var(--dark);
  color: var(--dark-text-muted);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
  font-size: 0.88rem;
}
.footer-grid {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.7rem; }
.site-footer a { color: var(--dark-text-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #2a2b2f;
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-faint);
}

.breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--text-faint); }

.pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.5rem;
}
.pagination a, .pagination span {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--text);
}
.pagination .current { background: var(--dark); color: #fff; border-color: var(--dark); }

.news-body { max-width: 68ch; font-size: 1rem; }
.news-body p { margin-bottom: 1.1em; }

.mesh-hero {
  background: linear-gradient(155deg, #14181c 0%, #1d2733 100%);
  color: #fff;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #26313d;
}
.mesh-hero p { color: #c7d1da; }
