:root {
  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1ede6;
  --text-main: #1f2421;
  --text-muted: #525b56;
  --primary: #1b4332;
  --primary-hover: #2d6a4f;
  --accent: #bc4749;
  --accent-soft: #f8edeb;
  --gold: #dda15e;
  --border: #e2dcd2;
  --shadow-sm: 0 4px 14px rgba(27, 67, 50, 0.06);
  --shadow-md: 0 12px 30px rgba(27, 67, 50, 0.1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 0.25s ease;
}

[data-theme="dark"] {
  --bg-page: #121715;
  --bg-surface: #1b221f;
  --bg-surface-alt: #242d29;
  --text-main: #eef2ef;
  --text-muted: #a6b3ac;
  --primary: #52b788;
  --primary-hover: #74c69d;
  --accent: #e07a5f;
  --accent-soft: #2f2220;
  --gold: #e9c46a;
  --border: #2e3833;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  transition: background-color var(--transition), color var(--transition);
}

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

/* === GÓRNY PASEK I NAWIGACJA === */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #ffffff;
  border: 2px solid var(--gold);
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

nav a {
  display: inline-block;
  padding: 0.55rem 0.95rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.94rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

nav a:hover {
  background-color: var(--bg-surface-alt);
  color: var(--primary);
}

nav a.active {
  background-color: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] nav a.active {
  color: #121715;
}

.nav-toggle {
  display: none;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* === SEKCJA POWITALNA (HERO) === */
.hero-split {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}

.hero-split-box {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-md);
}

.hero-badge {
  display: inline-block;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-split-content h2 {
  font-size: clamp(1.85rem, 3.2vw, 2.65rem);
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero-split-content p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero-split-media img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 4px solid var(--bg-surface-alt);
  box-shadow: var(--shadow-sm);
}

/* Baner dla podstron */
.page-banner {
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.92), rgba(45, 106, 79, 0.86)),
    var(--hero-image) center/cover no-repeat;
  color: #ffffff;
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.page-banner-inner {
  max-width: 800px;
  margin: 0 auto;
}

.page-banner h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 0.65rem;
}

.page-banner p {
  opacity: 0.92;
  font-size: 1.05rem;
}

/* === GŁÓWNY KONTENER === */
.main-container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* === KARTY DZIAŁAŃ NA STRONIE GŁÓWNEJ === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.feature-card-body {
  padding: 1.5rem;
}

.feature-card-body h3 {
  color: var(--primary);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.feature-card-body p {
  color: var(--text-muted);
}

/* === SEKCJE PODSTRON (O NAS, AKTUALNOŚCI, GALERIA, KONTAKT) === */
.about-section,
.donation-wrapper,
.admin-table-wrap,
.contact-card,
.stat-card,
.news-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.admin-table-wrap {
  overflow-x: auto;
}

.about-section h2,
.donation-wrapper h2,
.admin-table-wrap h2,
.contact-card h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.45rem;
}

.about-thumb {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.history-highlight {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-alt);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.history-highlight span {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
}

.mission-grid,
.members-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.mission-grid article,
.member-card,
.gallery-card {
  background: var(--bg-surface-alt);
  padding: 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.member-card {
  text-align: center;
}

.member-card img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--gold);
}

.gallery-card {
  padding: 0.75rem;
}

.gallery-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.gallery-card figcaption {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  text-align: center;
}

.achievement-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* === AKTUALNOŚCI === */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.news-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 0.75rem;
}

.news-layout-no-image {
  grid-template-columns: 1fr;
}

.news-thumb {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.post-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-event {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-news {
  background: var(--bg-surface-alt);
  color: var(--primary);
}

.news-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* === KONTAKT I FORMULARZE === */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.donation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row.full {
  grid-column: 1 / -1;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.68rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.96rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.amount-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.amount-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
}

.form-help {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.form-error {
  color: var(--accent);
  font-size: 0.83rem;
  min-height: 1.1em;
}

.form-message {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.form-message.success {
  background: #d8f3dc;
  color: #1b4332;
}

.form-message.error {
  background: #f8edeb;
  color: #9b2226;
}

/* === PRZYCISKI === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

[data-theme="dark"] .btn-primary {
  color: #121715;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
}

[data-theme="dark"] .btn-outline:hover {
  color: #121715;
}

.btn-muted {
  background: var(--bg-surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
}

/* === PANEL ADMINA === */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.stat-card p {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.35rem;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

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

th,
td {
  text-align: left;
  padding: 0.8rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-surface-alt);
  font-weight: 700;
}

.status {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status.new {
  background: #ffe8d6;
  color: #9c3d00;
}

.status.done {
  background: #d8f3dc;
  color: #1b4332;
}

.admin-post-list,
.admin-gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.admin-post-item,
.admin-gallery-item {
  background: var(--bg-surface-alt);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.admin-gallery-item img {
  height: 150px;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

/* === PRZEŁĄCZNIK MOTYWU I ANIMACJE === */
.theme-toggle {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 999;
  background: var(--primary);
  color: #ffffff;
  border: 2px solid var(--gold);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-toggle {
  color: #121715;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === STOPKA === */
footer {
  flex-shrink: 0;
  width: 100%;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* === RESPONSYWNOŚĆ === */
@media (max-width: 850px) {
  .topbar-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-block;
  }

  nav {
    width: 100%;
  }

  nav.js-nav ul {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.75rem;
  }

  nav.js-nav.is-open ul {
    display: flex;
  }

  .hero-split-box,
  .features-grid,
  .donation-grid,
  .news-layout {
    grid-template-columns: 1fr;
  }

  .hero-split-box {
    padding: 1.75rem;
  }

  .hero-split-media img {
    height: 250px;
  }
}

/* === SIATKA ALBUMÓW === */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.album-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.album-card:hover,
.album-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  outline: none;
}

.album-cover {
  position: relative;
  height: 200px;
  background: var(--bg-surface);
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
}

.album-info {
  padding: 16px;
}

.album-info small {
  color: var(--text-muted);
}

.album-info h3 {
  margin: 6px 0 8px;
  color: var(--primary);
}

/* === OKNO MODALNE ZE ZDJĘCIAMI === */
.album-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 1100;
  overflow-y: auto;
  padding: 30px 16px;
}

.album-modal.open {
  display: block;
}

.album-modal-content {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border);
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: var(--shadow-md);
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 2rem;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus-visible {
  color: var(--accent);
  outline: none;
}

.modal-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.modal-photos-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.modal-photos-grid img:hover,
.modal-photos-grid img:focus-visible {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--gold);
}

/* === POWIĘKSZENIE POJEDYNCZEGO ZDJĘCIA (LIGHTBOX) === */
.photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.photo-lightbox.open {
  display: flex;
}

.photo-lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.photo-lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.photo-lightbox-caption {
  color: #ffffff;
  font-size: 0.95rem;
  text-align: center;
}

.close-lightbox {
  position: fixed;
  top: 16px;
  right: 22px;
  font-size: 2.4rem;
  line-height: 1;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.close-lightbox:hover,
.close-lightbox:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
  outline: none;
}
.history-article {
  padding: 2.5rem;
  margin-bottom: 2rem;
}

.history-article h2 {
  margin-bottom: 1rem;
  font-size: 1.85rem;
}

.history-article h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.history-article p {
  line-height: 1.75;
  margin-bottom: 1.1rem;
}

.timeline-list {
  list-style: none;
  margin: 1.5rem 0;
  border-left: 3px solid currentColor;
  padding-left: 1.5rem;
}

.timeline-list li {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.timeline-year {
  font-weight: 700;
  display: inline-block;
  margin-right: 0.4rem;
}

.archive-figure {
  margin: 1.5rem 0;
}

.archive-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.archive-caption {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 0.6rem;
  line-height: 1.5;
}

.noble-box {
  padding: 1.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  margin: 1.5rem 0;
}

.noble-box ul {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
}

.noble-box li {
  margin-bottom: 0.65rem;
  line-height: 1.65;
}

/* Kursor i delikatny efekt najazdu na zdjęcia do powiększenia */
.zoomable-img {
  cursor: zoom-in;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.zoomable-img:hover {
  opacity: 0.92;
}

/* Lightbox – pełnoekranowy podgląd zdjęcia */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 14, 18, 0.92);
  padding: 2rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-image {
  max-width: 95vw;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  color: #f1f5f9;
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: center;
  max-width: 800px;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.75rem;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
}

.lightbox-close:hover {
  opacity: 0.75;
}
@media (max-width: 768px) {
  .topbar-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .brand {
    flex-direction: column;
    align-items: center;
  }

  nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0;
  }

  nav ul li a {
    display: inline-block;
    padding: 8px 12px;
    font-size: 14px;
  }
}