/* ============================================================
   KRAŃCE MAPY — Custom CSS (poza Tailwind)
   Wersja: 0.1.0-mvp
   ============================================================ */

/* ----- BASE (gdyby Tailwind CDN się nie załadował) ----- */
body {
  margin: 0;
  font-family: 'Literata', Georgia, serif;
  background: #12121d;
  color: #e3e0f1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

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

/* ----- FILM GRAIN OVERLAY ----- */
.km-film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ----- CARTOUCHE BORDER ----- */
.km-cartouche-border {
  border: 1px solid #c97e3f;
}

/* ----- HERO — layout + background ----- */
.km-hero {
  /* Explicit layout — fallback niezależny od Tailwind CDN */
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 6rem;    /* pt-24 */
  padding-bottom: 3rem; /* pb-12 */
  padding-left: 20px;   /* px-margin-mobile */
  padding-right: 20px;

  /* Background */
  background-image:
    linear-gradient(to bottom, rgba(18,18,29,0.7), rgba(18,18,29,0.9)),
    url('../img/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #12121d;
}

@media (min-width: 768px) {
  .km-hero {
    padding-left: 64px;  /* px-margin-desktop */
    padding-right: 64px;
  }
}

@media (max-width: 768px) {
  .km-hero {
    background-attachment: scroll;
  }
}

/* ----- HERO BUTTONS — column na mobile, row na desktop ----- */
.km-hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}
@media (min-width: 640px) {
  .km-hero-buttons {
    flex-direction: row;
  }
}

/* ----- MAP PREVIEW (Leaflet jako tło) ----- */
#km-map-preview-leaflet {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* ----- CUSTOM SCROLLBAR (side panel mapy) ----- */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #12121d; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #6b5337;
  border-radius: 3px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #c97e3f; }

/* ----- NO SCROLLBAR (utility, np. filter pills mapy) ----- */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* ----- FADE-IN ANIMACJA ----- */
.km-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.km-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- LEAFLET DARK MODE OVERRIDE ----- */
.leaflet-container {
  background: #12121d !important;
  font-family: 'Literata', Georgia, serif;
}
.leaflet-popup-content-wrapper {
  background: #1f1e2a;
  color: #e3e0f1;
  border: 1px solid #c97e3f;
  border-radius: 0;
}
.leaflet-popup-tip { background: #c97e3f; }
.leaflet-control-attribution {
  background: rgba(18, 18, 29, 0.8) !important;
  color: #8b6f47 !important;
}
.leaflet-control-attribution a { color: #c97e3f !important; }

/* Pinezki Leaflet — custom divIcon */
.km-leaflet-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c97e3f;
  border: 2px solid #c97e3f;
  box-shadow: 0 0 12px rgba(201, 126, 63, 0.7);
  transition: transform 0.3s ease;
  cursor: pointer;
}
.km-leaflet-pin:hover {
  transform: scale(1.5);
}
.km-leaflet-pin--biegun-niedostepnosci  { background: #c97e3f; border-color: #c97e3f; box-shadow: 0 0 12px rgba(201,126,63,0.7); }
.km-leaflet-pin--glebia-pionowa         { background: #4f8da6; border-color: #4f8da6; box-shadow: 0 0 12px rgba(79,141,166,0.7); }
.km-leaflet-pin--polityczna             { background: #d4b896; border-color: #d4b896; box-shadow: 0 0 12px rgba(212,184,150,0.7); }
.km-leaflet-pin--izolacja-oceaniczna    { background: #5fb3a3; border-color: #5fb3a3; box-shadow: 0 0 12px rgba(95,179,163,0.7); }
.km-leaflet-pin--czasowa                { background: #b3a05f; border-color: #b3a05f; box-shadow: 0 0 12px rgba(179,160,95,0.7); }

/* ----- DROP CAP (single odcinek) ----- */
.km-dropcap::first-letter,
.km-content p:first-of-type::first-letter {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-size: 5rem;
  line-height: 0.85;
  float: left;
  margin: 0.5rem 0.75rem 0 0;
  color: #c97e3f;
  font-weight: 700;
}

/* ----- LINE CLAMP UTILITIES ----- */
.line-clamp-3,
.line-clamp-4 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 { -webkit-line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; }

/* ----- CONTENT — typografia treści ----- */
.km-content { line-height: 1.8; }
.km-content p { margin-bottom: 1.5rem; }
.km-content h2 {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-size: 1.75rem;
  color: #ca7f40;
  margin: 2.5rem 0 1.25rem;
  letter-spacing: 0.02em;
}
.km-content h3 {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-size: 1.375rem;
  color: #e3c193;
  margin: 2rem 0 1rem;
}
.km-content a {
  color: #c97e3f;
  border-bottom: 1px solid rgba(201, 126, 63, 0.3);
  transition: border-color 0.3s ease;
}
.km-content a:hover { border-color: #c97e3f; }
.km-content blockquote {
  border-left: 3px solid #c97e3f;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #d4b896;
}
.km-content ul, .km-content ol { margin: 1rem 0 1.5rem 1.5rem; }
.km-content li { margin-bottom: 0.5rem; }

/* ----- HIDDEN (utility) ----- */
.km-hidden { display: none !important; }

/* ----- ADMIN BAR FIX ----- */
.admin-bar header.fixed {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar header.fixed {
    top: 46px;
  }
}

/* ----- RESPONSIVE TYPOGRAPHY ADJUST ----- */
@media (max-width: 640px) {
  .km-content { font-size: 16px; }
  .km-dropcap::first-letter,
  .km-content p:first-of-type::first-letter {
    font-size: 3.5rem;
  }
}
