/* ── Skierniewicki Węgiel — main stylesheet ── */

:root {
  --green:       #2d6a4f;
  --green-light: #52b788;
  --green-pale:  #d8f3dc;
  --gold:        #c9a84c;
  --dark:        #1b2a23;
  --gray:        #6b7c72;
  --bg:          #f8faf9;
  --white:       #ffffff;
  --radius:      10px;
  --shadow:      0 2px 14px rgba(0,0,0,.07);
  --shadow-md:   0 4px 24px rgba(0,0,0,.11);
  --font:        'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-light); }

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

/* ── Layout ──────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main { flex: 1; }

/* ── Nav ─────────────────────────────────────────── */

.navbar {
  background: var(--white);
  border-bottom: 1px solid #e4ece8;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
  white-space: nowrap;
}

.navbar__brand img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.navbar__brand span.accent { color: var(--green); }

.navbar__links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  list-style: none;
}

.navbar__links a {
  color: var(--gray);
  font-size: .93rem;
  font-weight: 500;
  letter-spacing: .01em;
  transition: color .2s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.navbar__links a:hover,
.navbar__links a.active {
  color: var(--green);
  border-bottom-color: var(--green-light);
}

.navbar__menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .3rem;
  color: var(--dark);
}

.navbar__menu-btn svg { width: 26px; height: 26px; }

/* ── Hero ─────────────────────────────────────────── */

.hero {
  color: var(--white);
  padding: 0;
  min-height: 520px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: var(--dark);
}

.hero__banner {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.hero__slide.active {
  opacity: 1;
}

.hero__banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  display: block;
  pointer-events: none;
  user-select: none;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(27,42,35,.50) 0%, rgba(26,71,49,.40) 100%);
}

.hero__inner {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 100%;
}

.hero__badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50px;
  padding: .25rem .9rem;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: .6rem;
}

.hero h1 span { color: var(--gold); }

.hero__sub {
  font-size: 1.05rem;
  opacity: .8;
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.hero__actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--gold);
  color: var(--dark);
}

.btn-primary:hover {
  background: #b8933f;
  color: var(--dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.5);
  color: var(--white);
}

.btn-outline:hover {
  background: rgba(255,255,255,.1);
  color: var(--white);
  border-color: var(--white);
}

.btn-green {
  background: var(--green);
  color: var(--white);
}

.btn-green:hover {
  background: #245940;
  color: var(--white);
  transform: translateY(-1px);
}

.btn-sm { padding: .4rem 1rem; font-size: .82rem; }

.btn-danger {
  background: #e85555;
  color: var(--white);
  border-color: transparent;
}

.btn-danger:hover { background: #cc3333; color: var(--white); }

/* ── Section headers ─────────────────────────────── */

.section { padding: 3.5rem 0; }
.section + .section { padding-top: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section__title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  position: relative;
  padding-bottom: .4rem;
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--green-light);
  border-radius: 2px;
}

.section__link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
}

.section__link:hover { color: var(--green-light); }

/* ── Cards ───────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
}

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

.card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: center top;
}

.card__img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--green-pale), #b7e4c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--green);
}

.card__body { padding: 1.1rem 1.25rem 1.3rem; }

.card__date {
  font-size: .75rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}

.card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .5rem;
  color: var(--dark);
}

.card__excerpt {
  font-size: .87rem;
  color: var(--gray);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card__footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid #edf2ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Grid ────────────────────────────────────────── */

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

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 560px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Announcements list ───────────────────────────── */

.ann-list { display: flex; flex-direction: column; gap: .75rem; }

.ann-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.4rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  transition: box-shadow .2s, transform .2s;
}

.ann-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.ann-item.pinned {
  border-left: 4px solid var(--gold);
}

.ann-item__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ann-item.pinned .ann-item__icon { background: #fdf3d5; }

.ann-item__content { flex: 1; min-width: 0; }

.ann-item__title {
  font-weight: 700;
  font-size: .97rem;
  color: var(--dark);
  margin-bottom: .2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ann-item__title a { color: inherit; }
.ann-item__title a:hover { color: var(--green); }

.ann-item__meta {
  font-size: .78rem;
  color: var(--gray);
}

.badge-pin {
  display: inline-block;
  background: #fdf3d5;
  color: #9a6f00;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-left: .4rem;
  vertical-align: middle;
}

/* ── Article ─────────────────────────────────────── */

.article {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.5rem;
  max-width: 780px;
  margin-inline: auto;
}

.article__header { margin-bottom: 1.5rem; }

.article__title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: .5rem;
}

.article__meta {
  font-size: .82rem;
  color: var(--gray);
}

.article__body {
  font-size: .97rem;
  line-height: 1.8;
  white-space: pre-wrap;
}

.article__back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.article__back:hover { color: var(--green); }

/* ── Gallery photo grid ───────────────────────────── */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .75rem;
}

.photo-grid__item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform .35s;
}

.photo-grid__item:hover img { transform: scale(1.05); }

/* ── Lightbox ─────────────────────────────────────── */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 1rem; right: 1.3rem;
  color: #fff;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.lightbox__nav:hover { background: rgba(255,255,255,.25); }
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }

/* ── Pagination ───────────────────────────────────── */

.pagination {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  padding: 0 .6rem;
  font-size: .88rem;
  font-weight: 600;
  border: 1px solid #dce8e1;
  background: var(--white);
  color: var(--gray);
}

.pagination a:hover { border-color: var(--green); color: var(--green); }
.pagination span.current { background: var(--green); color: var(--white); border-color: var(--green); }

/* ── Page title bar ───────────────────────────────── */

.page-bar {
  background: linear-gradient(90deg, #1c2b22 0%, #2d6a4f 100%);
  color: var(--white);
  padding: 2.2rem 0 1.8rem;
  margin-bottom: 2.5rem;
}

.page-bar h1 {
  font-size: 1.7rem;
  font-weight: 800;
}

.page-bar p {
  font-size: .9rem;
  opacity: .65;
  margin-top: .3rem;
}

/* ── Forms ────────────────────────────────────────── */

.form-group { margin-bottom: 1.2rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: .35rem;
}

input[type=text],
input[type=date],
input[type=email],
input[type=password],
textarea,
select {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid #d4dfd9;
  border-radius: 8px;
  font-size: .92rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  transition: border-color .2s, box-shadow .2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(82,183,136,.15);
}

textarea { resize: vertical; min-height: 140px; }

input[type=file] {
  padding: .5rem;
  font-size: .88rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.form-check input { width: auto; }
.form-check label { margin: 0; font-weight: 500; }

.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.5rem;
  max-width: 680px;
  margin-inline: auto;
}

/* ── Flash messages ───────────────────────────────── */

.flash-list { list-style: none; margin-bottom: 1.2rem; }

.flash {
  padding: .75rem 1.2rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

.flash-success { background: #d8f3dc; color: #1a5e32; }
.flash-error   { background: #fde8e8; color: #8b1a1a; }
.flash-info    { background: #e0f0ff; color: #1a3f6f; }

/* ── Admin sidebar layout ─────────────────────────── */

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
  gap: 0;
}

.admin-sidebar {
  background: var(--dark);
  padding: 1.5rem 0;
}

.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.4rem;
  color: #9db8a7;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: rgba(255,255,255,.07);
  color: var(--white);
}

.admin-sidebar__title {
  padding: 0 1.4rem .75rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #5a7a67;
  font-weight: 700;
}

.admin-content { padding: 2rem; background: var(--bg); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card__num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.stat-card__label {
  font-size: .78rem;
  color: var(--gray);
  margin-top: .15rem;
}

/* ── Admin table ─────────────────────────────────── */

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

th {
  text-align: left;
  padding: .65rem 1rem;
  background: var(--green-pale);
  color: var(--dark);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #edf2ef;
  color: var(--dark);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f5faf7; }

.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

/* ── Members grid ────────────────────────────────── */

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.member-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: center;
  transition: box-shadow .25s, transform .25s;
}

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

.member-card__photo {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--green-pale);
}

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

.member-card__avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--green);
}

.member-card__body {
  padding: 1.1rem 1rem .6rem;
}

.member-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: .2rem;
}

.member-card__role {
  font-size: .82rem;
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}

.member-card__bio {
  font-size: .83rem;
  color: var(--gray);
  line-height: 1.55;
}

.member-card__actions {
  padding: .6rem 1rem .9rem;
}

.member-edit-link {
  font-size: .75rem;
  color: var(--gray);
}

.member-edit-link:hover { color: var(--green); }

/* ── Footer ───────────────────────────────────────── */

footer {
  background: var(--dark);
  color: #7a9a88;
  text-align: center;
  padding: 1.8rem 1rem;
  font-size: .82rem;
  margin-top: auto;
}

footer strong { color: var(--green-light); }

/* ── Responsive nav ───────────────────────────────── */

@media (max-width: 700px) {
  .navbar__menu-btn { display: flex; }

  .navbar__links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid #e4ece8;
    padding: 1rem 1.25rem;
    gap: .75rem;
    z-index: 99;
    box-shadow: var(--shadow-md);
  }

  .navbar__links.open { display: flex; }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar { display: none; }

  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .article { padding: 1.25rem 1.1rem; }
  .form-card { padding: 1.25rem 1.1rem; }
}
