/* Global Word Wrap Fix */
* {
  overflow-wrap: anywhere;
}

:root {
  --primary-color: #004481;
  /* Deep Blue */
  --primary-dark: #003366;
  --secondary-color: #e0e0e0;
  --accent-color: #3b82f6;
  /* Light Blue (previously red) */
  --accent-gold: #3b82f6;
  /* Changed from gold to blue */
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --text-color: #334155;
  --text-light: #64748b;
  --bg-color: #f8fafc;
  --white: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius-md: 0.375rem;
  --font-main: 'Inter', 'Segoe UI', sans-serif;
  --max-width: 1200px;
}

/* --- Ergo Hestia Style Tiles (Exact Match) --- */

/* Top Content Row (News + Monitoruj + Service) */
.top-content-section {
  padding: 3rem 0 2rem;
  background-color: white;
}

.top-content-grid {
  display: grid;
  grid-template-columns: 4fr 4fr 2fr;
  /* News 40%, Monitor 40%, Service 20% */
  gap: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Feature Tiles - Second Row */
.feature-tiles-wrapper {
  position: relative;
  z-index: 10;
  margin-top: 0;
  /* No overlap */
  padding: 2rem 0 4rem;
  background-color: #f8fafc;
}

.feature-tiles-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 0 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-tile {
  /* Background moved to ::before to enable blur */
  padding: 6rem 2rem 2rem;
  border-radius: 0 0 0 32px;
  /* Unique Ergo Hestia corner radius - only bottom-left */
  border-top: 2px solid transparent;
  /* Start invisible, appears on hover */
  /* Red top border */
  box-shadow: none;
  /* Flat design - no shadows */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  min-height: 560px;
  /* Reduced by 50% from 1120px */
  color: white;
  z-index: 1;
  /* Establish stacking context */
}

.feature-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  transition: all 0.5s ease;
  z-index: -1;
  /* Place behind text */
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.3)), #334155;
}

.feature-tile:hover {
  transform: translateY(-4px);
  border-top-color: #BF1528;
  /* Red border appears on hover */
}

.feature-tile:hover::before {
  filter: blur(3px);
  /* Use specific selector for analysis tile if needed, but general rule is okay if no filter on base */
}

/* Background images for each tile moved to ::before */
.feature-tile:nth-child(1)::before {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)), url('network-internet.jpg');
  filter: brightness(1.4);
  /* Make image 40% brighter */
}

#tile-analiza::before {
  background-color: #2c3e50;
  /* Fallback color */
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)), url('images/AnalizaGrunt.jpg');
  filter: brightness(1.4);
  /* Make image 40% brighter */
}

#tile-wiedza::before {
  background-color: #1e3a5f;
  /* Fallback color */
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)), url('images/bazaWiedzy.jpg');
  filter: brightness(1.4);
  /* Make image 40% brighter */
}

.feature-tile:nth-child(3)::before {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.3)),
    url('geoportal.jpg');
}

/* Eyebrow / small text above title */
.feature-tile-eyebrow {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
  color: white;
}

/* Icons - simple, no background */
.feature-tile-icon {
  display: none;
  /* Ergo Hestia doesn't use icons in these tiles */
}

/* Main heading */
.feature-tile h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* Description text */
.feature-tile p {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Button - outline style - now an actual link */
.feature-tile-link {
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: white;
  border: 2px solid white;
  background: transparent;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  align-self: flex-start;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
  /* Ensure button is above tile */
}

.feature-tile-link:hover {
  background: white;
  color: var(--primary-color);
}

.feature-tile-link i {
  display: none;
  /* No arrows in Ergo Hestia buttons */
}

/* Custom Tile Styles */
.tile-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.95);
}

.tile-description {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(20px);
  transition: all 0.4s ease-out;
  margin-bottom: 0 !important;
  /* Override default margin */
}

.feature-tile:hover .tile-description {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 2rem !important;
  /* Restore margin on hover */
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .top-content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-tiles-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feature-tiles-wrapper {
    padding: 1.5rem 0 2rem;
  }
}

/* --- Content Sections --- */
.news-container.compact {
  width: 100%;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.monitoruj-promo-card {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.info-sidebar-card {
  background: #f8f9fa;
  /* Light gray background */
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  height: auto;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

html {
  scroll-padding-top: 200px;
}

main {
  flex: 1 0 auto;
  /* Grow to fill space, stick footer to bottom */
  width: 100%;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s;
}

a:hover {
  color: var(--accent-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 9999;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Accessibility Toolbar */
.accessibility-toolbar {
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

.accessibility-controls {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.accessibility-btn {
  background: #1e293b;
  border: 1px solid #1e293b;
  color: white;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 500;
}

.accessibility-btn:hover {
  background: #0f172a;
  border-color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Active states for accessibility buttons */
.accessibility-btn.active {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
}

.accessibility-btn.active:hover {
  background: #e5a82a;
  border-color: #e5a82a;
  transform: translateY(-1px);
}

.accessibility-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.sticky-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

body {
  padding-top: 190px;
  /* Approximate height of header + safety buffer */
}

/* Navbar */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  /* Removed individual sticky to allow wrapper control */
}

.nav-container {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 1rem;
}

.nav-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-menu-row {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.logo-img {
  height: 50px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
  color: var(--primary-color);
  line-height: 1.2;
  text-align: left;
  align-items: flex-start;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--primary-color);
  background-color: #f1f5f9;
}

.nav-links a.active {
  color: var(--primary-color);
  font-weight: 600;
  background-color: #e0f2fe;
}

/* Dropdown Menu */
.nav-links li {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  min-width: 220px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.1s;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.nav-links li:hover .dropdown-content,
.nav-links li:focus-within .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessible carets */
.fa-caret-down {
  margin-left: 0.25rem;
  font-size: 0.8em;
  color: #94a3b8;
}

/* Mobile Menu Button */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 5px 0;
  transition: 0.3s;
}

/* Search Box (in Nav) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.25rem;
}

.search-input {
  border: none;
  padding: 0.25rem 0.5rem;
  outline: none;
  font-size: 0.9rem;
}

.search-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

/* Hero Carousel */
.hero-carousel {
  position: relative;
  background: #1e293b;
  color: white;
  overflow: hidden;
  height: 600px;
  /* Increased from 450px to match Ergo Hestia */
  width: 100%;
  /* Fix strictly required to prevent collapse with max-width */
  max-width: var(--max-width);
  /* Match tile container width (1200px) */
  margin: 0 auto;
  /* Center the carousel */
  border-radius: 32px 32px 0 0;
  /* Rounded top corners requested by user */
}

.carousel-track-container {
  height: 100%;
  position: relative;
}

.carousel-track {
  height: 100%;
  position: relative;
  transform: none !important;
  /* PREVENT OLD JS FROM MOVING TRACK IF CACHED */
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100px);
  /* More pronounced entrance from right */
  display: flex;
  align-items: center;
  background: #334155;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 1;
}

.carousel-slide.current-slide {
  opacity: 1 !important;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

/* Optional: Slide moving out to the left can be added if we track the previous slide in JS */

/* Pseudo-element for background image with zoom effect */
.carousel-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  /* Removed transition to allow Ken Burns animation */
  z-index: 0;
}

/* Removed hover effect - conflicts with Ken Burns */

/* Hardcoded BG Images for Slides (on ::before for zoom effect) */
.carousel-slide:nth-child(1)::before {
  background-image: url('images/BanerKupMape.jpg');
}

.carousel-slide:nth-child(2)::before {
  background-image: url('images/BanerPraca.jpg');
}

.carousel-slide:nth-child(3)::before {
  background-image: url('images/BanerBdot10k.jpg');
}

.carousel-slide:nth-child(4)::before {
  background-image: url('images/AnalizaGruntuBaner.jpg');
}

.carousel-slide:nth-child(5)::before {
  background-image: url('images/OdDanychHero.png');
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.1) 100%);
  z-index: 2;
  /* Above ::before pseudo-element */
}

.hero-content {
  position: relative;
  z-index: 3;
  /* Above overlay */
  max-width: var(--max-width);
  /* Match tile container width */
  margin: 0 auto;
  /* Center the content */
  padding: 0 1.5rem;
  /* Match tile container padding */
  color: white;
  /* Ensure text is visible */
}

.hero-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background-color: #a00f28;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

.carousel-button {
  display: none;
  /* Hidden - Ergo Hestia style uses dots only */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  padding: 1rem;
  cursor: pointer;
  z-index: 10;
}

.carousel-button:hover {
  background: rgba(0, 0, 0, 0.8);
}

.carousel-button--left {
  left: 1rem;
}

.carousel-button--right {
  right: 1rem;
}

.carousel-nav {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 3rem;
  position: absolute;
  bottom: 40px;
  right: 0;
  width: auto;
  z-index: 10;
  gap: 0.75rem;
}

.carousel-indicator {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  /* Slightly darker track for better visibility */
  border: none;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.carousel-indicator .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: #ffffff;
  /* Pure white for the fill */
}

.carousel-indicator.current-slide .progress-bar {
  animation: progressFill 5s linear forwards;
}

@keyframes progressFill {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* When paused, freeze the animation */
.carousel-paused .carousel-indicator.current-slide .progress-bar {
  animation-play-state: paused;
}

.carousel-indicator.current-slide {
  background: rgba(255, 255, 255, 0.3);
}

/* Pause Button */
.carousel-pause-btn {
  position: absolute;
  bottom: 32px;
  right: calc(3rem + (4 * 60px) + (4 * 0.75rem) + 10px);
  /* Positioned to the left of the bars */
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  color: white;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.carousel-pause-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Quick Access / Services Grid */
.section {
  padding: 4rem 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  position: relative;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 5px solid var(--primary-color);
  min-height: 250px;
  transition: transform 0.2s;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.service-card.accent-green {
  border-color: var(--accent-green);
}

.service-card.accent-purple {
  border-color: var(--accent-purple);
}

.service-card.accent-blue {
  border-color: #3b82f6;
}

.service-card.accent-gold {
  border-color: var(--accent-gold);
}

.service-content {
  z-index: 2;
  position: relative;
}

.service-content .icon {
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.service-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Footer */
.footer {
  background-color: var(--primary-dark);
  color: #e2e8f0;
  padding: 3rem 0 1rem;
  margin-top: auto;
  /* Flexbox sticky footer */
  flex-shrink: 0;
  /* Prevent footer from shrinking */
  font-family: var(--font-main) !important;
  font-size: 1rem;
  /* Enforce standard size to override page-specific body styles (e.g. kompozycje.css 13px) */
}

.footer h4,
.footer p,
.footer a,
.footer li,
.footer span {
  font-family: var(--font-main) !important;
}

.footer h4 {
  display: block;
  color: white;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
  padding-top: 1rem;
  margin-bottom: 0.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Standardized Footer Grids (matching index.html inline styles) */
.footer-main-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  padding: 3rem 0;
}

.footer-columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 991px) {
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0;
  }

  .footer-columns-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  }

  .footer-logo-section {
    max-width: 200px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .footer-columns-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col {
  text-align: left;
}

.footer a {
  color: #cbd5e1;
}

.footer a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.85rem;
}

/* Page Header (Subpages) */
.page-header {
  background-color: var(--primary-dark);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Subpage Grid */
.map-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.resource-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.resource-card-img-container {
  height: 200px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-content {
  padding: 1.5rem;
}

.resource-description p {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
}

/* HIGH CONTRAST MODE */
html.high-contrast {
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.high-contrast .navbar,
html.high-contrast .accessibility-toolbar,
html.high-contrast .footer,
html.high-contrast .service-card,
html.high-contrast .resource-card,
html.high-contrast .hero-carousel,
html.high-contrast .page-header {
  background-color: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffff00 !important;
  box-shadow: none !important;
}

/* FONT SIZE MODES */
html.font-medium {
  font-size: 110%;
}

html.font-large {
  font-size: 125%;
}

html.high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

html.high-contrast button,
html.high-contrast .btn,
html.high-contrast .search-input {
  background-color: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast img {
  filter: grayscale(100%) contrast(120%);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 1.75rem;
  }

  /* Hide Contact link in mobile menu */
  .nav-links li a[href="#kontakt"] {
    display: none;
  }
}

/* --- Udostępnianie Sub-Navigation & Layout --- */
.udostepnianie-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-title {
  text-align: center;
  margin: 3rem 0 2rem;
  font-size: 1.8rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.infographic-placeholder {
  background-color: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  min-height: 250px;
  /* Use min-height instead of fixed height */
  padding: 2rem;
  display: flex;
  flex-direction: column;
  /* Force vertical stacking for better mobile view */
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Ensure text is centered */
  color: var(--text-light);
  font-weight: 500;
  font-size: 1.25rem;
  margin-bottom: 2rem;
  position: relative;
  transition: all 0.3s ease;
}

.infographic-placeholder:hover {
  border-color: var(--primary-color);
  background-color: #f1f5f9;
}

.infographic-placeholder i {
  margin-right: 0;
  /* Removing right margin since we are vertical now */
  margin-bottom: 1rem;
  color: var(--primary-color);
  /* Make icon brand color */
  opacity: 0.8;
}

.infographic-placeholder h3 {
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.infographic-placeholder p {
  font-size: 0.95rem;
  max-width: 600px;
}

.infographic-placeholder::after {
  content: "";
  /* Removed text content from after element to avoid duplication if content exists */
  display: none;
}

.sub-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--white);
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sub-nav-link {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sub-nav-link:hover,
.sub-nav-link.active {
  background-color: var(--primary-color);
  color: white;
}

/* --- Footer Contact Form --- */
.footer-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-form h4 {
  margin-bottom: 1rem;
}

.contact-form-embedded {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.form-control {
  padding: 0.5rem;
  border: 1px solid #475569;
  border-radius: 4px;
  background-color: #1e293b;
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  background-color: #0f172a;
}

.btn-submit {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  align-self: flex-start;
}

.btn-submit:hover {
  background-color: #a00f28;
}

/* High Contrast tweaks for new elements */
html.high-contrast .sub-nav,
html.high-contrast .infographic-placeholder,
html.high-contrast .form-control {
  background-color: black !important;
  color: white !important;
  border-color: yellow !important;
}

html.high-contrast .sub-nav-link {
  border-color: yellow !important;
  color: yellow !important;
}

html.high-contrast .sub-nav-link.active {
  background-color: yellow !important;
  color: black !important;
}

/* Main Choices Layout (Udostępnianie) */
/* Main Choices Layout (Udostępnianie) */
.choice-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  padding: 0 1rem;
}

.choice-card {
  position: relative;
  height: 450px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.choice-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.tile-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  z-index: 0;
}

.choice-card:hover .tile-bg {
  transform: scale(1.1);
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0.95) 100%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  transition: background 0.3s ease;
}

.choice-card:hover .tile-overlay {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.9) 40%, rgba(255, 255, 255, 1) 100%);
}

.tile-content {
  color: #1a1a1a !important;
  transform: translateY(0);
  transition: transform 0.3s ease;
  z-index: 10 !important;
  position: relative !important;
}

.choice-card:hover .tile-content {
  transform: translateY(0);
}

.tile-title {
  font-size: 2rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.5rem !important;
  color: #1a1a1a !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 100 !important;
}

.tile-desc {
  font-size: 1.1rem !important;
  margin-bottom: 1rem !important;
  color: #2d2d2d !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6) !important;
  max-height: none !important;
  overflow: visible !important;
}

.tile-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.choice-card:hover .tile-details {
  max-height: 200px;
  opacity: 1;
}

.tile-details p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.btn-tile {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-tile:hover {
  background-color: white;
  color: var(--primary-color);
  border-color: white;
}

.btn-tile i {
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.btn-tile:hover i {
  transform: translateX(3px);
}

/* High Contrast for Choices */
html.high-contrast .choice-card {
  background-color: black !important;
  border: 2px solid yellow !important;
  color: white !important;
}

html.high-contrast .choice-icon,
html.high-contrast .choice-title {
  color: yellow !important;
}

/* --- Layout Grid System (Added for Subpages) --- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 900px) {
  .content-grid {
    grid-template-columns: 300px 1fr;
    align-items: start;
  }
}

.sidebar-left {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.news-box h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.files-list li {
  margin-bottom: 0.75rem;
}

.files-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-color);
  transition: color 0.2s;
}

.files-list a:hover {
  color: var(--primary-color);
}

.files-list a::before {
  content: "\f15b";
  /* fa-file */
  font-family: "Font Awesome 5 Free";
  font-weight: 400;
  color: var(--accent-color);
}

/* --- Main Article Content --- */
.main-article h2 {
  font-size: 1.75rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.main-article h2:first-child {
  margin-top: 0;
}

.main-article p {
  margin-bottom: 1rem;
  color: #334155;
  line-height: 1.7;
}

.styled-list {
  list-style: none;
  /* Reset default */
  padding-left: 0;
}

.styled-list>li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.styled-list>li::before {
  content: "\f00c";
  /* fa-check */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--accent-green);
  font-size: 0.8em;
}

/* --- Data Tables --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: white;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
  /* For rounded corners on headers */
}

.data-table thead {
  background-color: var(--primary-color);
  color: white;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.data-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #f1f5f9;
}

.data-table a {
  font-weight: 600;
  color: var(--primary-color);
}

.data-table a:hover {
  text-decoration: underline;
}

/* Highlight Box */
.contact-highlight {
  background: #f0f9ff;
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.contact-highlight h3 {
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.contact-highlight p {
  margin-bottom: 0;
  color: #334155;
}

/* --- Resource Card Images (Added for Analizy Glebowe) --- */
.resource-card-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* --- Page Title (Added for Udostepnianie Pages) --- */
.page-title {
  margin: 2rem 0;
  text-align: center;
}

.page-title h1 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

/* --- Alert Boxes --- */
.alert-box {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  border-left: 4px solid;
  background-color: #f8fafc;
}

.alert-box.info {
  border-left-color: #3b82f6;
  background-color: #eff6ff;
}

.alert-box.warning {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
}

.alert-box.success {
  border-left-color: var(--accent-green);
  background-color: #f0fdf4;
}

/* --- Button Variants --- */
.btn-secondary {
  background-color: #64748b;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background-color: #475569;
  color: white;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* --- Intro Text --- */
.intro-text {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* --- Hours List Styling --- */
.hours-list {
  list-style: none;
  padding: 0;
}

.hours-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hours-list li:last-child {
  border-bottom: none;
}

.hours-list span {
  font-weight: 600;
  color: white;
}

/* --- Partner Links --- */
.partner-logos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.partner-link {
  display: inline-block;
  padding: 0.5rem 0;
  transition: transform 0.2s;
}

.partner-link:hover {
  transform: translateX(5px);
}

/* --- Page Header (Banner) --- */
.page-header {
  color: white;
  text-align: center;
  padding: 6rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin: 0;
}

.page-header p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 1rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h1,
.section-header h2 {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto;
}

/* Modern News Section Styling */
.news-section {
  background: #ffffff;
  padding: 3rem 0 !important;
  position: relative;
  overflow: hidden;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.news-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width=\"100\" height=\"100\" xmlns=\"http://www.w3.org/2000/svg\"><defs><pattern id=\"grid\" width=\"40\" height=\"40\" patternUnits=\"userSpaceOnUse\"><path d=\"M 40 0 L 0 0 0 40\" fill=\"none\" stroke=\"rgba(255,255,255,0.05)\" stroke-width=\"1\"/></pattern></defs><rect width=\"100\" height=\"100\" fill=\"url(%23grid)\"/></svg>');
  opacity: 0.3;
}

#news_iframe_scroll {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  height: 100%;
}

#news_iframe_scroll:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.news_scroll-title {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.news_scroll-title br {
  display: none;
}

iframe[name="NewsIFrame"] {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* Layout for News + Sidebar */
.news-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 240px;
  /* Newsy wiodące, sidebar znacznie węższy */
  gap: 3rem;
  align-items: start;
  max-width: 1400px;
  /* Szerszy kontener, przesuwa środek ciężkości w lewo */
  margin: 0 auto;
}

@media (max-width: 992px) {
  .news-with-sidebar {
    grid-template-columns: 1fr;
    max-width: 800px;
  }
}

/* --- Analysis Map Tiles --- */
.map-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.resource-card-tile {
  display: block;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  /* Aspect ratio handled by image or content, but 100% height for vertical look */
  height: 100%;
}

.resource-card-tile img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

/* Hover effects */
.resource-card-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.resource-card-tile:hover img {
  transform: scale(1.05);
}

.tile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  /* Dark overlay */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
  text-align: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.resource-card-tile:hover .tile-overlay {
  opacity: 1;
}

.tile-overlay i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--accent-gold);
}

.tile-overlay span {
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}

/* --- Search Results Dropdown --- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-results-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  margin-top: 0.5rem;
}

.search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-light);
}

.search-result-item a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  display: block;
}

.search-no-results {
  padding: 1rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Unified Dashboard Grid (24 Columns) --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  grid-auto-rows: 75px;
  /* New base unit for 5:4 ratio */
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* News Container (6 cols x 5 units = 25% width, 375px height) */
/* "Wydłuż Wiadomości o 50%" (250px -> 375px) */
.news-container {
  grid-column: 1 / span 6;
  grid-row: span 6;
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  border-top: 0;
  /* Removed accents as requested */
}

/* Monitoruj Card (12 cols x 5 units = 50% width, 375px height) */
/* "Wydłuż Monitoruj o 50%" (250px -> 375px) */
.monitoruj-promo-card {
  grid-column: 7 / span 12;
  height: 100%;
  aspect-ratio: auto;
  /* Approx ratio for typical banner, will adjust */
  grid-row: span 6;
  position: relative;
  overflow: hidden;
  background-image: url('images/hydrograf.jpg');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}


.monitoruj-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(59, 130, 246, 0.75) 100%);
  z-index: 1;
}

.monitoruj-content {
  position: relative;
  z-index: 2;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 2rem;
}

.monitoruj-content h3 {
  color: white;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.monitoruj-content p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.monitoruj-cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: rgba(251, 191, 36, 0.9);
  color: #1e293b;
  font-weight: 600;
  border-radius: 0.375rem;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
  align-self: flex-start;
}

.monitoruj-cta:hover {
  background: rgba(251, 191, 36, 1);
  transform: translateY(-2px);
}

/* Info Sidebar Card (6 cols x 9 units = 25% width, 675px height) */
/* Aligned to top, spanning full height. Background light grey. */
.info-sidebar-card {
  grid-column: 19 / span 6;
  grid-row: 1 / span 6;
  height: 100%;
  background-color: #f8fafc;
  /* Light grey background */
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Base Service Card */
.service-card {
  height: 100%;
  min-height: 0;
  position: relative;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 5px solid var(--primary-color);
  transition: transform 0.2s;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Zakup Map - Bottom Row Left (6 cols) */
.service-card:nth-child(4) {
  grid-column: 1 / span 6;
  grid-row: 7 / span 5;
  border-left: 0;
  /* Remove side border as requested */
}

/* Analiza - Bottom Row Right (12 cols) */
.service-card:nth-child(5) {
  grid-column: 7 / span 12;
  grid-row: 7 / span 5;
  border-left: 0;
  /* Remove side border as requested */
}

.service-card:nth-child(5) .service-bg {
  background-size: 100% 100%;
}

/* New Tile "Dowiedz się więcej" - Bottom Row Far Right (6 cols) */
.service-card:nth-child(6) {
  grid-column: 19 / span 6;
  grid-row: 7 / span 5;
}

/* Responsiveness */
@media (max-width: 1200px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }

  .news-container,
  .monitoruj-promo-card,
  .info-sidebar-card,
  .service-card:nth-child(4),
  .service-card:nth-child(5),
  .service-card:nth-child(6) {
    grid-column: span 1;
    /* Change to span 1 so they sit side-by-side in 2-col grid? No, standard is span 2 (full width) or 1 (half). existing code said span 2 in a 2-col grid = full width. */
    /* Wait, standard breakdown: 2 col grid.
       If I want them 2 per row, span 1.
       If I want them full width, span 2.
       Previous code had "grid-column: span 2" for all of them. That means strictly vertical stacking.
       Let's stick to span 2 (stacking) or maybe span 1 for tiles?
       User said "responsywność". Stacking 6 big tiles is a lot of scroll.
       Maybe items 4,5,6 can be span 1 (2 per row)?
       Let's stick to SAFE stacking (span 2) and just add child 6.
    */
    grid-column: span 2;
    grid-row: auto;
    min-height: 250px;
    /* Ensure visibility of graphics */
  }

  .info-sidebar-card {
    order: 10;
    min-height: 400px;
  }

  .news-container {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .news-container,
  .monitoruj-promo-card,
  .info-sidebar-card,
  .service-card,
  .service-card:nth-child(4),
  .service-card:nth-child(5),
  .service-card:nth-child(6) {
    grid-column: span 1;
    min-height: 200px;
  }

  /* Mobile Menu */
  .hamburger {
    display: block;
  }

  .nav-menu-row {
    padding: 0;
    border: none;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: white;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    max-height: 80vh;
    /* Allow scrolling */
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    position: relative;
    /* Context for dropdown */
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
  }

  /* Mobile Dropdown Fix */
  .dropdown-content {
    position: static !important;
    /* Push content down */
    box-shadow: none !important;
    border: none !important;
    padding-left: 1.5rem !important;
    /* Indent */
    background: #f8fafc !important;
    display: none;
    /* Hidden by default, toggled by JS */
    width: 100% !important;
    min-width: auto !important;
  }

  .dropdown-content a {
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
  }
}

.news-item:hover {
  background: white;
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.news-content {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-color);
  padding-bottom: 0;
  padding-right: 40px;
  /* Space for arrow button */
}

.news-item {
  position: relative;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.btn-expand-subtle {
  position: absolute;
  bottom: 5px;
  right: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  width: 24px;
  height: 24px;
}

.btn-expand-subtle:hover {
  background: #f1f5f9;
  transform: scale(1.1);
}

.btn-expand-subtle svg {
  width: 18px;
  height: 18px;
  fill: #64748b;
}

.news-item:hover .btn-expand-subtle svg {
  fill: var(--primary-color);
}

.news-item.expanded .news-content {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  overflow: visible;
}

.news-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: #a0826d;
  /* Light brown */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.btn-read-more {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
  text-transform: uppercase;
  font-weight: 600;
}

.btn-read-more:hover {
  background: var(--primary-color);
  color: white;
}

.news-item.expanded {
  background: white;
  border-color: var(--accent-gold);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.news-item.expanded .news-title {
  white-space: normal;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.news-item.expanded .news-header {
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.news-item.expanded .btn-read-more {
  background: var(--secondary-color);
  color: var(--text-color);
  border-color: var(--secondary-color);
}


/* News List limit to 3 items by default */
/* .news-list .news-item:nth-child(n+4) {
  display: none;
} */

/* .news-list.show-all .news-item:nth-child(n+4) {
  display: block;
  animation: fadeIn 0.3s ease-in;
} */

.btn-news-show-all {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: #f1f5f9;
  color: var(--primary-color);
  text-align: center;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: auto;
  border-radius: 4px;
}

.btn-news-show-all:hover {
  background: #e2e8f0;
}

.news-content a {
  color: var(--accent-color);
  text-decoration: underline;
}

.news-content a:hover {
  text-decoration: none;
}

/* Sticky Header Scroll Effect */
.sticky-wrapper {
  transition: transform 0.3s ease;
}

/* When scrolled, hide the top row (logo + search) */
@media (min-width: 769px) {
  .sticky-wrapper.is-scrolled .nav-top-row {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease;
  }
}


/* Optional: Adjust shadow or border when scrolled */
.sticky-wrapper.is-scrolled .navbar {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Search Dropdown Styles */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 300px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  /* JS toggles this */
  margin-top: 5px;
}

.search-result-item {
  border-bottom: 1px solid #f1f5f9;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item a {
  display: block;
  padding: 12px 16px;
  color: #334155;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.search-result-item a:hover {
  background-color: #f8fafc;
  color: var(--primary-color);
  padding-left: 20px;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-style: italic;
  font-size: 0.9rem;
}

/* Copy Button Styles */
.copy-btn {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-left: 1rem;
}

.copy-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.contact-form-embedded .btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 68, 129, 0.2);
}

/* --- Free Data Section Styles --- */
.free-data-section {
  background: linear-gradient(135deg, #0077be 0%, #005a8f 100%);
  padding: 3rem 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
}

.free-data-section h2 {
  text-align: center;
  color: white;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.data-card {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  /* Changed from flex-start to center for compact look */
  gap: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
  position: relative;
  padding-right: 2.5rem;
}

.data-card::after {
  content: "→";
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  font-size: 1.5rem;
  font-weight: bold;
  color: #004481;
  opacity: 0;
  transition: all 0.3s ease;
}

.data-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  border-left-color: #004481;
  background: linear-gradient(90deg, white 0%, #f0f9ff 100%);
}

.data-card:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.data-card:active .data-card-icon {
  animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2) rotate(5deg);
  }

  100% {
    transform: scale(1);
  }
}

.data-card-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.data-card-content {
  flex: 1;
}

.data-card-title {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  display: block;
}

.data-card:hover .data-card-title {
  color: var(--accent-color);
}

.data-card-desc {
  color: var(--text-color);
  font-size: 0.85rem;
  line-height: 1.3;
  margin: 0;
}

/* Responsive: Mobile */
@media (max-width: 768px) {
  .data-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .free-data-section {
    padding: 2rem 1rem;
  }

  .free-data-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .data-card {
    padding: 1.25rem;
  }

  .data-card-icon {
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }
}

.copy-btn:active {
  transform: translateY(0);
}

/* Tile Animation - Analiza Glebowa */
#tile-analiza {
  position: relative;
  overflow: hidden;
  background-image: url('images/AnalizaGrunt.png');
  background-size: cover;
  background-position: center;
  transition: transform 0.2s;
}

#tile-analiza .service-bg,
#tile-analiza .icon {
  display: none;
  /* Hide default background and icon if desired, or adjust as needed */
}

#tile-analiza .service-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  /* High opacity for readability */
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  border-top: 2px solid var(--accent-gold);
}

#tile-analiza:hover .service-content {
  transform: translateY(0);
}

/* Ensure title and text styling in the slide-up content */
#tile-analiza .service-content h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

#tile-analiza .service-content p {
  font-size: 0.9rem;
  margin-bottom: 0;
}


/* Tile Animation - Zakup Map */
#tile-zakup {
  position: relative;
  overflow: hidden;
  /* background-image removed from here as it should be on ::before for blur effect */
  background-color: #2c3e50;
  /* Fallback */
  transition: transform 0.2s;
}

#tile-zakup::before {
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('images/kupMapy.jpg');
}

#tile-zakup .service-bg,
#tile-zakup .icon {
  display: none;
}

#tile-zakup .service-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  border-top: 2px solid var(--accent-green);
}

#tile-zakup:hover .service-content {
  transform: translateY(0);
}

#tile-zakup .service-content h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

#tile-zakup .service-content p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* --- Top Content Layout (Flexbox 3:3:2) --- */
.top-content-container {
  display: flex;
  gap: 1rem;
  width: 100%;
  align-items: flex-start;
}

.top-col-news {
  flex: 3;
  min-width: 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.top-col-monitor {
  flex: 3;
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: center;
  overflow: hidden;
}

.top-col-service {
  flex: 2;
  min-width: 0;
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  height: fit-content;
}

.top-content-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Responsive: Mobile Stack */
@media (max-width: 960px) {
  .top-content-container {
    flex-direction: column;
    gap: 2rem;
  }

  .top-col-news,
  .top-col-monitor,
  .top-col-service {
    flex: auto;
    width: 100%;
    height: auto !important;
    /* Override JS height */
  }

  .top-col-monitor {
    height: 300px !important;
    /* Fixed height for image on mobile */
  }
}

/* High Contrast Adjustments */
html.high-contrast .top-col-news,
html.high-contrast .top-col-service,
html.high-contrast .news-item {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

html.high-contrast .news-main-title,
html.high-contrast .news-title,
html.high-contrast strong {
  color: #ff0 !important;
}

html.high-contrast .news-content p,
html.high-contrast .btn-expand-subtle svg {
  fill: #fff !important;
  color: #fff !important;
}

html.high-contrast .static-info-window {
  background: #000 !important;
}

/* News Title Darker Color */
.news-title {
  color: #0f172a;
  /* Slate-900 */
  font-weight: 700;
}

/* Update for Analysis Page Description Box */
.analysis-info-box {
  background: #eff6ff;
  border-left: 4px solid #004481;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: justify;
  box-shadow: none;
}

.analysis-info-box i {
  color: #004481;
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.analysis-info-box p {
  padding: 0;
  margin: 0;
}

/* --- Standardized Blue Action Button --- */
.btn-action-blue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #004481;
  color: white;
  border: 2px solid #004481;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 68, 129, 0.3);
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
}

.btn-action-blue:hover {
  background-color: white;
  color: #004481;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 68, 129, 0.4);
}

.btn-action-blue:active {
  transform: translateY(0);
}

.btn-action-blue i {
  transition: transform 0.3s ease;
}

.btn-action-blue:hover i {
  transform: translateX(4px);
}

@keyframes pulse-blue {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 68, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 68, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 68, 129, 0);
  }
}



/* Resource Card Action Buttons */
.btn-action-blue {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #004481;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-action-blue:hover {
  background-color: #003366;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 68, 129, 0.3);
}

.btn-action-blue:active {
  transform: translateY(0);
}

.btn-action-blue-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: #004481;
  border: 2px solid #004481;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  white-space: nowrap;
  cursor: pointer;
}

.btn-action-blue-outline:hover {
  background-color: #004481;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 68, 129, 0.4);
}

.btn-action-blue-outline:active {
  transform: translateY(0);
}

/* ============================
   RESPONSIVE FOOTER LAYOUT
   ============================ */

/* Tablet: Stack logo on top, 3 columns below */
@media (max-width: 992px) {
  .footer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer-logo-section {
    text-align: center;
  }

  .footer-logo-section img {
    margin: 0 auto !important;
    max-width: 200px;
  }
}

/* Mobile: Single column layout */
@media (max-width: 768px) {
  .footer-columns-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer .container {
    padding: 0 1rem !important;
  }

  .footer-main-grid {
    padding: 2rem 0 !important;
  }
}


/* Layout Overrides for Index Page */
.top-content-grid {
  grid-template-columns: 4fr 4fr 2fr !important;
}

/* Feature tile height adjusted by flex/grid */

/* --- Visual Lifting --- */

/* Scroll Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Button Micro-interactions */
.btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

/* Specific Feature Tile Link Interaction */
.feature-tile-link:hover {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Menu Link Animation */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* High Contrast for Sharing Pages */
html.high-contrast .data-card,
html.high-contrast .data-card-large,
html.high-contrast .result-card,
html.high-contrast .result-header,
html.high-contrast .result-icon,
html.high-contrast .logo-text span,
html.high-contrast .btn-action-blue {
  background: #000000 !important;
  background-image: none !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .data-card:hover {
  background: #000000 !important;
  transform: none !important;
}

html.high-contrast .data-card-icon,
html.high-contrast .data-card-title,
html.high-contrast .data-card-desc {
  filter: none !important;
  color: #ffff00 !important;
  text-decoration: none !important;
}

html.high-contrast a {
  color: #ffff00 !important;
}

/* High Contrast for Analysis Page */
html.high-contrast .analysis-info-box {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

html.high-contrast .analysis-info-box i,
html.high-contrast .analysis-info-box p {
  color: #ffff00 !important;
}

html.high-contrast .resource-card-tile {
  border: 2px solid #ffff00 !important;
  background: #000 !important;
}

html.high-contrast .tile-overlay {
  background: #000 !important;
  opacity: 1 !important;
  display: flex !important;
  border-top: 2px solid #ffff00 !important;
}

html.high-contrast .tile-overlay i,
html.high-contrast .tile-overlay span {
  color: #ffff00 !important;
}

/* High Contrast for Knowledge Base (wiedza.html) */
html.high-contrast .kb-sidebar {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .kb-sidebar-header {
  background: #000000 !important;
  color: #ffff00 !important;
  border-bottom: 2px solid #ffff00 !important;
}

html.high-contrast .kb-link {
  color: #ffffff !important;
}

html.high-contrast .kb-link:hover,
html.high-contrast .kb-link.active {
  background: #000000 !important;
  color: #ffff00 !important;
  border-left-color: #ffff00 !important;
}

html.high-contrast .kb-content-wrapper {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .article-title {
  color: #ffff00 !important;
  border-bottom-color: #ffff00 !important;
}

html.high-contrast .article-body,
html.high-contrast .article-body p,
html.high-contrast .article-body li {
  color: #ffffff !important;
}

html.high-contrast .article-link-btn {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

html.high-contrast .btn-expand {
  color: #ffff00 !important;
}

/* High Contrast for Maps Compositions (kompozycje.html) */
html.high-contrast .resource-card {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .resource-thumb {
  background: #000000 !important;
  border-bottom: 2px solid #ffff00 !important;
}

html.high-contrast .resource-title a {
  color: #ffff00 !important;
}

html.high-contrast .resource-desc {
  color: #ffffff !important;
}

html.high-contrast .wms-section {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .wms-section h2 {
  color: #ffff00 !important;
}

html.high-contrast .wms-section p {
  color: #ffffff !important;
}

/* Target WMS cards by their structure or attributes */
html.high-contrast .wms-section div[onmouseover] {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .wms-section code {
  background: #333333 !important;
  color: #ffff00 !important;
  border: 1px solid #ffff00 !important;
}

html.high-contrast .copy-btn {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

/* High Contrast Override for Global Sections */
html.high-contrast .section {
  background-color: #000000 !important;
}

/* Fix for footer inline borders */
html.high-contrast .footer div[style*="border-top"] {
  border-top-color: #ffff00 !important;
}

/* High Contrast Global Body Fix */
html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Force Font Scaling */
html.font-medium {
  font-size: 110% !important;
}

html.font-large {
  font-size: 125% !important;
}

/* Search Box positioning fix */
.search-box {
  position: relative !important;
}


/* --- New Visual Effects (Propozycje Ulepszen) --- */

/* Glassmorphism Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Navbar override when glass effect is active */
.navbar.glass-effect {
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Gradient Button - Blue */
.btn-gradient-blue {
  background: linear-gradient(135deg, #004481 0%, #3b82f6 100%);
  color: white !important;
  border: none;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-gradient-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.btn-gradient-blue::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s;
  z-index: -1;
}

.btn-gradient-blue:hover::after {
  opacity: 1;
}


/* --- Ken Burns Animation (Zyjace Banery) --- */
@keyframes kenBurns {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* Apply Ken Burns to ALL slides so animation doesn't restart */
.carousel-slide::before {
  animation: kenBurns 40s ease-in-out infinite;
  transform-origin: center center;
}


/* --- Cinematic Cross-fade Override --- */
.carousel-slide {
  transform: none !important;
  transition: opacity 1.5s ease-in-out !important;
}

/* Removed transform: none to allow Ken Burns animation on ::before pseudo-element */



html.high-contrast .kb-link:hover,
html.high-contrast .kb-link.active {
  background: #000000 !important;
  color: #ffff00 !important;
  border-left-color: #ffff00 !important;
}

html.high-contrast .kb-content-wrapper {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .article-title {
  color: #ffff00 !important;
  border-bottom-color: #ffff00 !important;
}

html.high-contrast .article-body,
html.high-contrast .article-body p,
html.high-contrast .article-body li {
  color: #ffffff !important;
}

html.high-contrast .article-link-btn {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

html.high-contrast .btn-expand {
  color: #ffff00 !important;
}

/* High Contrast for Maps Compositions (kompozycje.html) */
html.high-contrast .resource-card {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .resource-thumb {
  background: #000000 !important;
  border-bottom: 2px solid #ffff00 !important;
}

html.high-contrast .resource-title a {
  color: #ffff00 !important;
}

html.high-contrast .resource-desc {
  color: #ffffff !important;
}

html.high-contrast .wms-section {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}

html.high-contrast .wms-section h2 {
  color: #ffff00 !important;
}

html.high-contrast .wms-section p {
  color: #ffffff !important;
}

/* Target WMS cards by their structure or attributes */
html.high-contrast .wms-section div[onmouseover] {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .wms-section code {
  background: #333333 !important;
  color: #ffff00 !important;
  border: 1px solid #ffff00 !important;
}

html.high-contrast .copy-btn {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

/* High Contrast Override for Global Sections */
html.high-contrast .section {
  background-color: #000000 !important;
}

/* Fix for footer inline borders */
html.high-contrast .footer div[style*="border-top"] {
  border-top-color: #ffff00 !important;
}

/* High Contrast Global Body Fix */
html.high-contrast body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Force Font Scaling */
html.font-medium {
  font-size: 110% !important;
}

html.font-large {
  font-size: 125% !important;
}

/* Search Box positioning fix */
.search-box {
  position: relative !important;
}


/* --- New Visual Effects (Propozycje Ulepszen) --- */

/* Glassmorphism Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

/* Navbar override when glass effect is active */
.navbar.glass-effect {
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Gradient Button - Blue */
.btn-gradient-blue {
  background: linear-gradient(135deg, #004481 0%, #3b82f6 100%);
  color: white !important;
  border: none;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-gradient-blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

.btn-gradient-blue::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.2s;
  z-index: -1;
}

.btn-gradient-blue:hover::after {
  opacity: 1;
}


/* --- Ken Burns Animation (Zyjace Banery) --- */
@keyframes kenBurns {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* Apply Ken Burns to ALL slides so animation doesn't restart */
.carousel-slide::before {
  animation: kenBurns 40s ease-in-out infinite;
  transform-origin: center center;
}


/* --- Cinematic Cross-fade Override --- */
.carousel-slide {
  transform: none !important;
  transition: opacity 1.5s ease-in-out !important;
}

/* Removed transform: none to allow Ken Burns animation on ::before pseudo-element */


/* --- Accessibility & Mobile Safeguards --- */
@media (prefers-reduced-motion: reduce) {}

/* Ensure Carousel doesn't overflow on mobile */
@media (max-width: 768px) {
  .hero-carousel {
    border-radius: 0 0 24px 24px;
    /* Invert radius only at bottom for mobile usually looks better, or keep top */
    border-radius: 20px 20px 0 0;
    /* Keep consistent with desktop but smaller */
  }
}

/* Critical Fix: Contain Ken Burns zoom within carousel */
.hero-carousel {
  overflow: hidden !important;
}

.carousel-slide {
  overflow: hidden !important;
}

/* CRITICAL FIX: Allow Ken Burns even with reduced-motion preference */
@media (prefers-reduced-motion: reduce) {

  /* Override: Ken Burns remains active (subtle, non-jarring animation) */
  /* Apply Ken Burns to ALL slides so animation doesn't restart */
  .carousel-slide::before {
    animation: kenBurns 40s ease-in-out infinite;
    transform-origin: center center;
  }
}

/* ============================================
   MODERN UI ENHANCEMENTS - PHASE 1
   ============================================ */

/* 1. Scroll Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #004481, #0066cc, #3b82f6);
  z-index: 10001;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(0, 68, 129, 0.5);
}

/* 2. Button Micro-interactions */
.btn,
.btn-primary,
.btn-gradient-blue,
.btn-submit {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover,
.btn-primary:hover,
.btn-gradient-blue:hover,
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 68, 129, 0.25);
}

.btn:active,
.btn-primary:active,
.btn-gradient-blue:active,
.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(0, 68, 129, 0.15);
}

/* 3. Feature Tile Lift Effect */
.feature-tile {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s ease;
}

.feature-tile:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* 4. Icon Animations */
.btn i,
.nav-links a i {
  transition: transform 0.3s ease;
  display: inline-block;
}

.btn:hover i {
  transform: scale(1.15);
}

.nav-links a:hover i.fa-home {
  transform: scale(1.2);
}

/* 5. Improved Scroll Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* NUCLEAR FIX: Force visibility on mobile/tablet to assume JS/Observer failure fallback */
@media (max-width: 991px) {
  .fade-in-section {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
}

.fade-in-section.visible,
.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility: Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {

  .btn,
  .btn:hover,
  .feature-tile,
  .feature-tile:hover,
  .fade-in-section,
  .nav-links a i,
  .btn i {
    transition: none !important;
    transform: none !important;
    animation: none !important;
  }

  .scroll-progress {
    transition: width 0s;
  }
}

/* ============================================
   FLOATING FAB - ACCESSIBILITY CONTROLS
   ============================================ */

.accessibility-fab {
  position: fixed;
  right: 20px;
  top: 120px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* Main FAB Trigger Button */
.fab-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #004481 0%, #0066cc 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 68, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fab-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0, 68, 129, 0.5);
}

.fab-trigger:active {
  transform: scale(0.95);
}

.fab-trigger i {
  transition: transform 0.3s ease;
}

.fab-trigger.active i {
  transform: rotate(90deg);
}

/* FAB Menu Items */
.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-menu button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  border: 2px solid #004481;
  color: #004481;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fab-menu button:hover {
  transform: scale(1.15);
  background: #004481;
  color: white;
  box-shadow: 0 6px 16px rgba(0, 68, 129, 0.3);
}

.fab-menu button:active {
  transform: scale(0.95);
}

/* Tooltips */
.fab-menu button::before {
  content: attr(data-tooltip);
  position: absolute;
  right: 60px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  font-family: var(--font-main);
}

.fab-menu button:hover::before {
  opacity: 1;
  visibility: visible;
  right: 65px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .accessibility-fab {
    right: 16px;
    top: auto;
    bottom: 20px;
  }

  .fab-trigger {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .fab-menu button {
    width: 44px;
    height: 44px;
    font-size: 14px;
  }
}

/* Hide old accessibility toolbar */
.accessibility-toolbar {
  display: none !important;
}


.high-contrast .download-button-card {
  background: #000000 !important;
  border: 3px solid #ffffff !important;
  box-shadow: none !important;
}

.high-contrast .download-button-card .download-icon {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
}

.high-contrast .download-button-card h3,
.high-contrast .download-button-card p {
  color: #ffffff !important;
}

.high-contrast .download-button-card .download-btn {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
  box-shadow: none !important;
}

.high-contrast .download-button-card .download-btn:hover {
  background: #000000 !important;
  color: #ffffff !important;
}


/* High Contrast Styles for Download Buttons - Matching platne page style */
html.high-contrast .download-button-card {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .download-button-card .download-icon {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .download-button-card h3,
html.high-contrast .download-button-card p {
  color: #ffff00 !important;
}

html.high-contrast .download-button-card .download-btn {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
  box-shadow: none !important;
}

html.high-contrast .download-button-card .download-btn:hover {
  background: #000000 !important;
  color: #ffff00 !important;
}

/* === Form Protection (Anti-Bot) === */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;

}

/* --- Mobile Menu Critical Fixes --- */
@media (max-width: 768px) {

  /* Prevent header from collapsing completely on mobile */
  .sticky-wrapper.is-scrolled .nav-top-row {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    padding: inherit !important;
    margin: inherit !important;
  }

  /* --- Multi-row Mobile Header Layout --- */
  .nav-top-row {
    flex-wrap: wrap !important;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }

  /* Row 1: Logo & Title (Full Width) */
  .logo {
    flex: 0 0 100%;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
  }

  .logo-text {
    display: flex !important;
    /* Restore visibility */
    flex-direction: column;
    white-space: normal;
  }

  .logo-text span:first-child {
    font-size: 0.85rem !important;
    line-height: 1.2;
  }

  .logo-text span:last-child {
    font-size: 0.7rem !important;
    line-height: 1.2;
    opacity: 0.8;
  }

  .logo-img {
    height: 36px;
    /* Slightly smaller to fit better */
  }

  /* Row 2: Search & Hamburger */
  .nav-actions {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    /* Important for flex container */
  }

  .search-box {
    flex: 0 1 auto;
    /* Don't grow indefinitely */
    width: calc(100% - 60px);
    /* Leave space for hamburger */
    max-width: none;
    margin-right: 0.5rem;
    background: #f8fafc;
  }

  .search-input {
    width: 100%;
    /* Ensure input takes available space */
  }

  .hamburger {
    flex: 0 0 44px;
    /* Fixed width */
    display: block !important;
    z-index: 2000;
    margin-left: auto;
    /* Push to far right */
    padding: 0.6rem;
    background-color: #f1f5f9;
    /* Light background for visibility */
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    min-width: 44px;
    /* Minimum touch target size */
    min-height: 44px;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* --- Mobile Menu Link Visibility Fix --- */
  .nav-links {
    display: none;
    /* Hidden by default */
    flex-direction: column;
    width: 100%;
    background: white;
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    z-index: 1000;
  }

  .nav-links.active {
    display: flex !important;
    /* Force visible when active */
  }

  .nav-links li {
    width: 100%;
    display: block;
    /* Ensure list items are blocks */
    border-bottom: 1px solid #f1f5f9;
    margin: 0;
  }

  .nav-links li a {
    display: block !important;
    /* Force link visibility */
    padding: 1rem;
    color: #334155 !important;
    /* Force dark text color */
    font-weight: 500;
    font-size: 1rem;
    text-decoration: none;
    background: transparent;
  }

  .nav-links li a:hover {
    background-color: #f1f5f9;
    color: var(--primary-color) !important;
  }

  /* Dropdown styling fix for mobile */
  .dropdown-content {
    position: static;
    /* Stack naturally on mobile */
    box-shadow: none;
    padding-left: 1rem;
    /* Indent submenu */
    background: #f8fafc;
    width: 100%;
    display: block !important;
    /* Always show submenu items on mobile simplified view */
  }

  .hamburger span {
    background-color: #004481 !important;
    /* High contrast dark blue */
    display: block;
    width: 24px;
    height: 3px;
    margin: 2px 0;
    border-radius: 2px;
  }
}

/* ============================================================
   NOWE KARTY WIADOMOSCI (.news-entry) z obrazkiem + scroll
   ============================================================ */

/* Wrapper wewnętrzny kontenera wiadomości */
.news-inner-wrapper {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  height: 100%;
}

/* Nagłówek przyklejony na górze */
.news-main-title {
  flex-shrink: 0;
}

/* Lista przewijalna */
#news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 460px;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

#news-list::-webkit-scrollbar {
  width: 5px;
}

#news-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#news-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.news-entry {
  border-bottom: 1px solid #e2e8f0;
}

.news-entry:last-child {
  border-bottom: none;
}

.news-entry-link {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.85rem 0.25rem;
  text-decoration: none;
  color: inherit;
}

.news-entry-thumb {
  flex-shrink: 0;
}

.news-entry-img {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.news-entry-img--placeholder {
  width: 90px;
  height: 70px;
  background: #e2e8f0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.5rem;
}

.news-entry-body {
  flex: 1;
  min-width: 0;
}

.news-entry-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

.news-entry-link:hover .news-entry-title {
  color: #004481;
}

.news-entry-text {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 0.35rem;
}

.news-entry-text--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link 'Czytaj więcej →' odsyłający do strony */
.news-more-link {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #004481;
  text-decoration: none;
  transition: color 0.2s;
}

.news-more-link:hover {
  color: #0069cb;
}

/* Przycisk rozwijający pełną treść */
.news-toggle {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #004481;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}

.news-toggle:hover {
  color: #0069cb;
}

/* Pełna treść – domyślnie ukryta */
.news-entry-full {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin-top: 0.2rem;
}

.news-entry-full p {
  margin: 0;
}

.news-entry-full a {
  color: #004481;
}

/* Wysoki kontrast */
html.high-contrast .news-entry {
  border-bottom-color: #fff !important;
}

html.high-contrast .news-entry-link:hover {
  background: #111 !important;
}

html.high-contrast .news-entry-title {
  color: #ff0 !important;
}

html.high-contrast .news-entry-skrot {
  color: #fff !important;
}

html.high-contrast .news-more-link {
  color: #ff0 !important;
}

/* Responsive — telefon */
@media (max-width: 600px) {

  /* Ukryj obrazki w wiadomościach na telefonie */
  .news-entry-thumb {
    display: none;
  }

  #news-list {
    max-height: none;
    /* na mobile nie ograniczaj wysokości — scroll strony */
  }
}