/* =====================================================
   Sołectwo Rylowa – style.css
   ===================================================== */

/* ---- Variables ---- */
:root {
  --green:       #2e7d32;
  --green-light: #4caf50;
  --green-dark:  #1b5e20;
  --cream:       #f9f6f0;
  --dark:        #1a2332;
  --dark2:       #243040;
  --text:        #333d47;
  --text-muted:  #6b7a8d;
  --white:       #ffffff;
  --border:      #e2e8f0;
  --shadow:      0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.14);
  --radius:      12px;
  --radius-lg:   20px;
  --transition:  0.3s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Lato', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- Typography helpers ---- */
h1,h2,h3 { font-family: 'Playfair Display', serif; line-height: 1.25; color: var(--dark); }

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
  transition: background var(--transition);
}
.brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--green-dark);
}
.brand-icon { font-size: 1.5rem; }
.nav-links {
  display: flex; gap: 0.25rem;
  align-items: center;
}
.nav-links a {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem; font-weight: 600;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover { background: var(--green-light); color: #fff; }
.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: var(--transition);
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b5e20 0%, #33691e 40%, #2e7d32 70%, #1a237e 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(76,175,80,0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(129,199,132,0.2) 0%, transparent 50%);
}
.hero-overlay {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
  position: relative; z-index: 1;
  text-align: center; padding: 2rem;
  max-width: 720px;
}
.hero-tag {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.9);
  padding: 0.3rem 1rem; border-radius: 20px;
  font-size: 0.85rem; letter-spacing: 0.05em;
  margin-bottom: 1.2rem;
}
.hero-content h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--white);
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.25rem; color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
  font-weight: 300;
}
.btn-primary {
  display: inline-block;
  background: var(--white);
  color: var(--green-dark);
  padding: 0.85rem 2.4rem;
  border-radius: 40px;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }
.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  animation: bounce 2s infinite;
}
.hero-scroll svg { width: 36px; fill: rgba(255,255,255,0.7); }
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%     { transform: translateX(-50%) translateY(8px); }
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section { padding: 90px 0; }
.section-dark { background: var(--dark); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-dark .section-desc { color: rgba(255,255,255,0.65); }
.section-green { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); }
.section-map  { background: var(--cream); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  background: rgba(46,125,50,0.1);
  color: var(--green);
  border: 1px solid rgba(46,125,50,0.25);
  padding: 0.2rem 0.8rem; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-tag.light {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}
.section-header h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 0.75rem; }
.section-desc { color: var(--text-muted); font-size: 1.05rem; max-width: 520px; margin: 0 auto; }

/* =====================================================
   TWO-COL
   ===================================================== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.text-block h3 { font-size: 1.3rem; color: var(--green-dark); margin-bottom: 0.9rem; }
.text-block p  { color: var(--text); margin-bottom: 0.9rem; }

/* =====================================================
   STATS GRID
   ===================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.stat-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition), background var(--transition);
}
.stat-card:hover { background: rgba(255,255,255,0.1); transform: translateY(-4px); }
.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem; font-weight: 700;
  color: var(--white); line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-unit { font-size: 1.4rem; font-weight: 400; }
.stat-label { font-size: 1rem; font-weight: 700; color: rgba(255,255,255,0.85); }
.stat-sub   { font-size: 0.8rem; color: rgba(255,255,255,0.45); margin-top: 0.25rem; }

/* =====================================================
   CARDS GRID
   ===================================================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.card-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.card h3 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: 0.7rem; }
.card p  { font-size: 0.95rem; color: var(--text-muted); }

/* =====================================================
   SPORT
   ===================================================== */
.sport-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 2.5rem;
  align-items: start;
}
.sport-main, .sport-infra {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow);
}
.sport-badge { font-size: 3rem; margin-bottom: 1rem; }
.sport-main h3, .sport-infra h3 { font-size: 1.4rem; color: var(--green-dark); margin-bottom: 1rem; }
.sport-main p { color: var(--text-muted); margin-bottom: 0.8rem; }
.sport-list { margin-top: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.sport-list li { font-size: 0.95rem; color: var(--text); }
.infra-list { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.9rem; }
.infra-list li { display: flex; align-items: center; gap: 0.9rem; font-size: 0.95rem; color: var(--text); }
.infra-icon { font-size: 1.4rem; flex-shrink: 0; }

/* =====================================================
   AUTHORITY
   ===================================================== */
.authority-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.authority-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.authority-card.primary {
  border-color: var(--green-light);
  background: linear-gradient(135deg, #e8f5e9, #f9f6f0);
}
.auth-avatar { font-size: 3rem; margin-bottom: 0.8rem; }
.authority-card h3 { font-size: 1.3rem; color: var(--green-dark); margin-bottom: 0.3rem; }
.auth-title { font-weight: 700; color: var(--text); font-size: 0.9rem; margin-bottom: 0.2rem; }
.auth-term  { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.auth-info  { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }
.auth-note  { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.auth-note small { color: var(--text-muted); font-size: 0.82rem; }

/* ---- Nowy układ sekcji Sołectwo ---- */
.solectwo-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.solectwo-soltys {
  /* trochę wyróżniony – zostaje .primary */
}
.solectwo-ug {
  /* wyrównany z sołtysem */
}

/* ---- Nagłówek Rady Sołeckiej ---- */
.rada-header {
  text-align: center;
  margin-bottom: 1.8rem;
}
.rada-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}
.rada-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ---- Karty Rady Sołeckiej ---- */
.rada-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}
.rada-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.rada-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-light);
}
.rada-avatar {
  font-size: 2.4rem;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.8rem;
  border: 2px solid #c8e6c9;
}
.rada-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 700;
  margin-bottom: 0.2rem;
  line-height: 1.3;
}
.rada-info span {
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .solectwo-top { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto 2rem; }
  .rada-grid    { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .rada-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   MAP
   ===================================================== */
.map-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}
.map-details {
  display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap;
}
.map-detail {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  box-shadow: var(--shadow);
}
.map-icon { font-size: 1.5rem; }
.map-detail strong { display: block; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.map-detail span { font-size: 0.95rem; color: var(--text); font-weight: 600; }

/* =====================================================
   CONTACT
   ===================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.contact-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
}
.contact-icon { font-size: 2.5rem; margin-bottom: 0.9rem; }
.contact-card h3 { font-size: 1.15rem; color: var(--white); margin-bottom: 1rem; }
.contact-list { display: flex; flex-direction: column; gap: 0.6rem; }
.contact-list li { font-size: 0.92rem; color: rgba(255,255,255,0.7); }
.contact-list a { color: var(--green-light); text-decoration: underline; }
.contact-list a:hover { color: var(--white); }

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  background: var(--dark2);
  color: rgba(255,255,255,0.55);
  padding: 2rem 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-brand {
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--white);
}
.footer-brand strong { color: var(--white); font-size: 1.05rem; }
.footer-brand span { color: rgba(255,255,255,0.5); font-size: 0.9rem; }
.footer-copy { font-size: 0.82rem; }
.back-top {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem; font-weight: 600;
  transition: background var(--transition);
}
.back-top:hover { background: var(--green); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .stats-grid      { grid-template-columns: repeat(2, 1fr); }
  .cards-grid      { grid-template-columns: repeat(2, 1fr); }
  .two-col         { grid-template-columns: 1fr; gap: 2rem; }
  .sport-grid      { grid-template-columns: 1fr; }
  .authority-grid  { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .contact-grid    { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .navbar { padding: 0 1rem; }
  .nav-links {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 1rem; width: 100%; }
  .nav-toggle { display: flex; }
  .stats-grid    { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .cards-grid    { grid-template-columns: 1fr; }
  .map-details   { flex-direction: column; align-items: stretch; }
  .footer-inner  { flex-direction: column; text-align: center; }
  .section { padding: 60px 0; }
}

/* =====================================================
   NOWE SEKCJE
   ===================================================== */

/* ---- Section variant: cream ---- */
.section-cream { background: var(--cream); }

/* =====================================================
   TIMELINE – Historia
   ===================================================== */
.timeline {
  position: relative;
  padding: 1rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--green-light), var(--green-dark));
  transform: translateX(-50%);
}
.tl-item {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0 1.5rem;
  margin-bottom: 2.5rem;
  align-items: center;
}
.tl-item .tl-year {
  text-align: right;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--green-dark);
  line-height: 1;
  grid-column: 1;
}
.tl-item .tl-dot {
  width: 18px; height: 18px;
  background: var(--green-light);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--green-light);
  justify-self: center;
  grid-column: 2;
  z-index: 1;
}
.tl-item .tl-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow);
  grid-column: 3;
  border-left: 4px solid var(--green-light);
  transition: transform var(--transition), box-shadow var(--transition);
}
.tl-item.tl-right .tl-year {
  grid-column: 3;
  text-align: left;
  order: 3;
}
.tl-item.tl-right .tl-dot  { grid-column: 2; order: 2; }
.tl-item.tl-right .tl-card {
  grid-column: 1; order: 1;
  border-left: none;
  border-right: 4px solid var(--green-dark);
}
.tl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tl-card h3 { font-size: 1.05rem; color: var(--green-dark); margin-bottom: 0.5rem; }
.tl-card p  { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }

@media (max-width: 700px) {
  .timeline::before { left: 20px; }
  .tl-item, .tl-item.tl-right {
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
  }
  .tl-item .tl-year, .tl-item.tl-right .tl-year {
    grid-column: 2; grid-row: 1;
    text-align: left; font-size: 1.2rem; order: 1;
  }
  .tl-item .tl-dot, .tl-item.tl-right .tl-dot {
    grid-column: 1; grid-row: 1 / 3;
    align-self: start; margin-top: 0.2rem; order: 0;
  }
  .tl-item .tl-card, .tl-item.tl-right .tl-card {
    grid-column: 2; grid-row: 2;
    border-left: 4px solid var(--green-light) !important;
    border-right: none !important;
    order: 2;
  }
}

/* =====================================================
   DYNAMIC SECTIONS (Aktualności, Inwestycje)
   ===================================================== */
.dynamic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  min-height: 200px;
}
.section-footer { text-align: center; margin-top: 2rem; }
.btn-load-more {
  background: var(--white);
  color: var(--green);
  border: 2px solid var(--green);
  padding: 0.7rem 2rem;
  border-radius: 30px;
  font-weight: 700; font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-load-more:hover { background: var(--green); color: var(--white); }

/* Loading & empty states */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dynamic cards – news */
.dyn-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.dyn-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.dyn-card-img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; background: var(--cream);
  display: block;
}
.dyn-card-img-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.dyn-card-body { padding: 1.2rem; flex: 1; }
.dyn-card-meta {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.dyn-card-meta .dot { width: 4px; height: 4px; background: var(--border); border-radius: 50%; }
.dyn-card-body h3 { font-size: 1.05rem; color: var(--dark); margin-bottom: 0.5rem; }
.dyn-card-body p  { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* =====================================================
   EVENTS SECTION
   ===================================================== */
.events-tabs {
  display: flex; gap: 0.5rem; margin-bottom: 2rem;
}
.ev-tab {
  padding: 0.5rem 1.4rem; border-radius: 30px;
  border: 2px solid var(--border); background: var(--white);
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.ev-tab.active { background: var(--green); color: var(--white); border-color: var(--green); }
.ev-tab:hover:not(.active) { border-color: var(--green-light); color: var(--green); }

#eventsGrid { display: flex; flex-direction: column; gap: 1rem; min-height: 140px; }

.event-row {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1.2rem;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.event-row:hover { transform: translateX(4px); box-shadow: var(--shadow-lg); }
.event-date-badge {
  text-align: center;
  background: var(--green);
  color: var(--white);
  border-radius: 12px;
  padding: 0.6rem 0.4rem;
}
.event-date-badge .ev-day  { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.event-date-badge .ev-mon  { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.85; }
.event-date-badge .ev-year { font-size: 0.7rem; opacity: 0.7; }
.event-info h3   { font-size: 1.05rem; color: var(--dark); margin-bottom: 0.25rem; }
.event-info p    { font-size: 0.9rem; color: var(--text-muted); }
.event-info .ev-location { font-size: 0.82rem; color: var(--green); margin-top: 0.2rem; }
.event-time-badge {
  background: #e8f5e9; color: var(--green-dark);
  padding: 0.3rem 0.7rem; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700;
  white-space: nowrap;
}

/* =====================================================
   INWESTYCJE FILTERS
   ===================================================== */
.invest-filters {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 2rem;
}
.inv-filter {
  padding: 0.4rem 1.1rem; border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.7);
  font-weight: 700; font-size: 0.85rem; cursor: pointer;
  transition: all var(--transition);
}
.inv-filter.active  { background: var(--white); color: var(--green-dark); }
.inv-filter:hover:not(.active) { background: rgba(255,255,255,0.15); color: var(--white); }

/* Investment cards */
.inv-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition), background var(--transition);
}
.inv-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.1); }
.inv-card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 1rem;
}
.inv-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.inv-card h3 { font-size: 1.05rem; color: var(--white); }
.inv-status {
  flex-shrink: 0;
  padding: 0.2rem 0.65rem; border-radius: 20px;
  font-size: 0.73rem; font-weight: 700;
}
.inv-status.planned     { background: rgba(21,101,192,0.3); color: #90caf9; }
.inv-status.in_progress { background: rgba(245,124,0,0.3);  color: #ffcc80; }
.inv-status.completed   { background: rgba(46,125,50,0.3);  color: #a5d6a7; }
.inv-card-desc { font-size: 0.9rem; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: 0.8rem; }
.inv-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.inv-budget { font-size: 0.88rem; color: rgba(255,255,255,0.8); font-weight: 600; }
.inv-year   { font-size: 0.8rem; color: rgba(255,255,255,0.45); }

/* =====================================================
   OSP SECTION
   ===================================================== */
.osp-grid {
  display: grid;
  grid-template-columns: 3fr 3fr 2fr;
  gap: 2rem;
  align-items: start;
}
.osp-main, .osp-tasks, .osp-info {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
}
.osp-emblem { font-size: 3rem; margin-bottom: 0.8rem; }
.osp-main h3, .osp-tasks h3, .osp-info h3 {
  font-size: 1.2rem; color: var(--green-dark);
  margin-bottom: 1rem; padding-bottom: 0.5rem;
  border-bottom: 2px solid #e8f5e9;
}
.osp-main p { color: var(--text-muted); margin-bottom: 0.8rem; font-size: 0.95rem; }

.osp-list { display: flex; flex-direction: column; gap: 1.1rem; }
.osp-list li { display: flex; align-items: flex-start; gap: 0.9rem; }
.osp-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.osp-list li strong { display: block; color: var(--dark); font-size: 0.95rem; margin-bottom: 0.15rem; }
.osp-list li p { font-size: 0.85rem; color: var(--text-muted); }

.osp-info-grid { display: flex; flex-direction: column; gap: 1rem; }
.osp-info-item {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.7rem;
  align-items: center;
}
.osp-info-icon { font-size: 1.4rem; grid-row: 1 / 3; }
.osp-info-item strong { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.osp-info-item span, .osp-info-item a { font-size: 0.95rem; color: var(--dark); font-weight: 600; }
.osp-tel { color: #d32f2f !important; font-size: 1.4rem !important; font-weight: 800 !important; }

@media (max-width: 900px) {
  .osp-grid { grid-template-columns: 1fr 1fr; }
  .osp-info { grid-column: 1 / -1; }
  .dynamic-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .osp-grid { grid-template-columns: 1fr; }
  .dynamic-grid { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 60px 1fr; }
  .event-time-badge { display: none; }
  .invest-filters { gap: 0.4rem; }
}

/* =====================================================
   PHP ELEMENTS – Admin bar, Nav admin, Footer
   ===================================================== */

/* Pasek admina nad sekcjami dynamicznymi */
.admin-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1.2rem;
}
.admin-bar-dark { /* dla ciemnego tła sekcji inwestycje */ }
.admin-bar-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--green);
  color: #fff;
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  font-size: 0.85rem; font-weight: 700;
  transition: background var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.admin-bar-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
.admin-bar-dark .admin-bar-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
}
.admin-bar-dark .admin-bar-btn:hover { background: rgba(255,255,255,0.25); }

/* Link "⚙️ Panel" w navbarze (admin) */
.nav-admin-link {
  background: var(--green) !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 0.35rem 0.9rem !important;
}
.nav-admin-link:hover { background: var(--green-dark) !important; }

/* Link "🔒 Admin" w navbarze (niezalogowany) */
.nav-admin-login {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
  opacity: 0.75;
}
.nav-admin-login:hover { opacity: 1; color: var(--green) !important; background: transparent !important; }

/* Stopka z linkami admina */
.footer-actions {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.footer-admin-link {
  display: inline-block;
  background: rgba(46,125,50,0.25);
  color: var(--white);
  padding: 0.3rem 0.85rem;
  border-radius: 16px;
  font-size: 0.82rem; font-weight: 600;
  transition: background var(--transition);
}
.footer-admin-link:hover { background: var(--green); }
.footer-logout-link {
  display: inline-block;
  background: rgba(200,50,50,0.2);
  color: rgba(255,150,150,0.9);
  padding: 0.3rem 0.85rem;
  border-radius: 16px;
  font-size: 0.82rem; font-weight: 600;
  transition: background var(--transition);
}
.footer-logout-link:hover { background: rgba(200,50,50,0.4); color: #fff; }

/* =====================================================
   LINKI "Czytaj więcej / Szczegóły" w kartach
   ===================================================== */
.dyn-more-link {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--green);
  font-weight: 700; font-size: 0.88rem;
  transition: color var(--transition);
}
.dyn-more-link:hover { color: var(--green-dark); text-decoration: underline; }

.dyn-more-link-light {
  display: inline-block;
  color: rgba(255,255,255,0.65);
  font-weight: 700; font-size: 0.85rem;
  transition: color var(--transition);
}
.dyn-more-link-light:hover { color: var(--white); text-decoration: underline; }

/* =====================================================
   STRONY SZCZEGÓŁÓW (wydarzenie / aktualnosc / inwestycja)
   ===================================================== */
.detail-body { background: var(--cream); }

.detail-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 1.5rem 4rem;
}

/* Breadcrumb */
.detail-breadcrumb {
  font-size: 0.82rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; margin-bottom: 2rem;
}
.detail-breadcrumb a { color: var(--green); }
.detail-breadcrumb a:hover { text-decoration: underline; }

/* Artykuł */
.detail-article {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Nagłówek artykułu */
.detail-header { padding: 2.5rem 2.5rem 1.5rem; border-bottom: 1px solid var(--border); }
.detail-meta {
  display: flex; align-items: center; gap: 0.75rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.detail-tag {
  background: #e8f5e9; color: var(--green);
  padding: 0.25rem 0.8rem; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700;
}
.detail-date, .detail-time { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.detail-location { font-size: 0.9rem; color: var(--green); font-weight: 600; }
.detail-title {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.25; color: var(--dark); margin-bottom: 0.5rem;
}
.detail-lead {
  font-size: 1.1rem; color: var(--text-muted);
  line-height: 1.7; margin-top: 0.75rem; font-style: italic;
}
.detail-budget {
  font-size: 0.92rem; color: var(--text); font-weight: 700;
  background: #fff8e1; padding: 0.2rem 0.7rem; border-radius: 20px;
}
.detail-status-badge {
  display: inline-block;
  padding: 0.2rem 0.75rem; border-radius: 20px;
  font-size: 0.82rem; font-weight: 700;
}
.detail-status-green  { background: #e8f5e9; color: #2e7d32; }
.detail-status-orange { background: #fff3e0; color: #e65100; }
.detail-status-blue   { background: #e3f2fd; color: #1565c0; }

/* Zdjęcie główne */
.detail-hero-img { width: 100%; max-height: 480px; overflow: hidden; }
.detail-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Treść Rich Text */
.detail-content { padding: 2.5rem; }
.rich-text h1, .rich-text h2, .rich-text h3 {
  font-family: 'Playfair Display', serif;
  color: var(--green-dark); margin: 1.5rem 0 0.75rem; line-height: 1.3;
}
.rich-text h1 { font-size: 1.8rem; }
.rich-text h2 { font-size: 1.4rem; }
.rich-text h3 { font-size: 1.15rem; }
.rich-text p  { margin-bottom: 1rem; line-height: 1.8; color: var(--text); }
.rich-text ul, .rich-text ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.rich-text ul li { list-style: disc; }
.rich-text ol li { list-style: decimal; }
.rich-text li    { margin-bottom: 0.4rem; line-height: 1.7; }
.rich-text a     { color: var(--green); text-decoration: underline; }
.rich-text a:hover { color: var(--green-dark); }
.rich-text blockquote {
  border-left: 4px solid var(--green-light);
  padding: 0.75rem 1.25rem; margin: 1.25rem 0;
  background: #f9f6f0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-muted);
}
.rich-text strong { font-weight: 700; }
.rich-text em     { font-style: italic; }

/* Film główny */
.detail-video { padding: 0 2.5rem 2rem; }
.detail-video video { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Galeria */
.detail-gallery { padding: 2rem 2.5rem; border-top: 1px solid var(--border); }
.detail-gallery-title { font-size: 1.3rem; color: var(--dark); margin-bottom: 1.25rem; }
.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.detail-gallery-item {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4/3; display: block;
  background: var(--cream);
  transition: transform var(--transition), box-shadow var(--transition);
}
.detail-gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform var(--transition);
}
.detail-gallery-item:hover { box-shadow: var(--shadow-lg); }
.detail-gallery-item:hover img { transform: scale(1.04); }
.detail-gallery-video { aspect-ratio: 16/9; }
.detail-gallery-video video { width: 100%; height: 100%; object-fit: cover; }

/* Stopka artykułu */
.detail-footer-nav {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.detail-back-btn {
  display: inline-block;
  background: var(--cream); color: var(--text);
  padding: 0.55rem 1.3rem; border-radius: 30px;
  font-weight: 700; font-size: 0.92rem;
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.detail-back-btn:hover { background: var(--green); color: var(--white); border-color: var(--green); }
.detail-edit-btn {
  display: inline-block;
  background: var(--green); color: var(--white);
  padding: 0.55rem 1.3rem; border-radius: 30px;
  font-weight: 700; font-size: 0.92rem;
  transition: background var(--transition);
}
.detail-edit-btn:hover { background: var(--green-dark); }

@media (max-width: 700px) {
  .detail-page { padding: 80px 1rem 3rem; }
  .detail-header, .detail-content, .detail-video,
  .detail-gallery, .detail-footer-nav {
    padding-left: 1.25rem; padding-right: 1.25rem;
  }
  .detail-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
