/* ======================================================================
   LEPIBASE – DETAIL DRUHU
   Verejný profil druhu
   ====================================================================== */

.species-detail {
  padding-block:
    var(--lp-space-6)
    var(--lp-space-20);
}

.species-detail__breadcrumbs {
  margin-bottom: var(--lp-space-5);
}


/* ======================================================================
   HERO
   ====================================================================== */

.species-detail-hero {
  display: grid;
  grid-template-columns:
    minmax(0, 1.15fr)
    minmax(24rem, 0.85fr);
  grid-template-areas:
    "gallery identity"
    "thumbnails thumbnails"
    "cta cta";
  align-items: stretch;
  gap: 0 clamp(2rem, 4vw, 5rem);

  padding-bottom: var(--lp-space-10);
  border-bottom: var(--lp-border);
}

/* Hero bez cover fotografie */

.species-detail-hero--without-cover {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "identity"
    "thumbnails"
    "cta";
}

.species-detail-hero--without-cover .species-detail-hero__identity {
  width: 100%;
  max-width: 42rem;
  height: auto;
}

.species-detail-hero--without-cover .species-detail-stats {
  margin-top: var(--lp-space-8);
  padding-top: 0;
}

.species-hero__intro {
  max-width: 38rem;
  margin: var(--lp-space-4) 0 0;

  color: var(--lp-color-text);
  font-size: 1.0625rem;
  line-height: 1.65;
}
/* Galéria */

.species-gallery {
  grid-area: gallery;
  min-width: 0;
}

.species-gallery__cover {
  position: relative;

  display: grid;
  overflow: hidden;
aspect-ratio: 3 / 2;

  border: var(--lp-border);
  border-radius: var(--lp-radius-panel);

  background: var(--lp-color-surface-soft);
}

.species-gallery__cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.species-gallery__placeholder {
  height: 100%;
}

.species-gallery__credit {
  margin: 0.35rem var(--lp-space-2) 0;

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.4;
  text-align: right;
}

.species-gallery__thumbnails {
  grid-area: thumbnails;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--lp-space-3);

  margin-top: var(--lp-space-8);
  padding-top: var(--lp-space-6);
  border-top: var(--lp-border);
}

.species-gallery-thumb {
  position: relative;

  min-width: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;

  border: var(--lp-border);
  border-radius: var(--lp-radius-media);

  background: var(--lp-color-surface-soft);
}

.species-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.species-gallery-thumb__placeholder {
  display: grid;
  width: 100%;
  height: 100%;

  place-items: center;

  color: var(--lp-color-line-strong);
  font-family: var(--lp-font-display);
  font-size: 1.5rem;
}

.species-gallery-thumb__label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;

  padding:
    var(--lp-space-4)
    var(--lp-space-2)
    var(--lp-space-2);

  overflow: hidden;

  background:
    linear-gradient(
      to top,
      rgb(18 49 74 / 0.8),
      transparent
    );

  color: #fff;

  font-size: var(--lp-type-label-size);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.species-gallery__thumbnails--reference .species-gallery-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 0.3rem;
}

.species-gallery__thumbnails--reference
.species-gallery-thumb__label {
  right: auto;
  bottom: 0.5rem;
  left: 0.5rem;

  display: flex;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;

  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: rgb(20 16 19 / 78%);

  font-size: 1rem;
  line-height: 1;
}
/* Identita druhu */

.species-detail-hero__identity {
  grid-area: identity;
  display: flex;
  min-width: 0;
  height: 100%;

  flex-direction: column;
  align-items: stretch;
  padding-top: var(--lp-space-2);
}

.species-detail-hero__heading {
  display: grid;
  justify-items: start;
}

.species-detail-hero__latin {
  max-width: 14ch;
  margin: 0;

  font-size: clamp(2.75rem, 4.15vw, 4.1rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.species-detail-hero__author {
  display: block;
  margin-top: var(--lp-space-2);

  color: var(--lp-color-subtle);

  font-family: var(--lp-font-ui);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.species-detail-hero__slovak {
  margin-top: var(--lp-space-4);

  color: var(--lp-color-link);

  font-family: var(--lp-font-ui);
  font-size: clamp(1.25rem, 1.7vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
}

.species-detail-hero__description {
  max-width: 34rem;
  margin-top: var(--lp-space-5);

  color: var(--lp-color-text-secondary);

  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.55;
}

.species-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lp-space-2);

  margin-top: var(--lp-space-5);
}

.species-detail-badge {
  display: inline-flex;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;

  align-items: center;

  border: var(--lp-border);
  border-radius: var(--lp-radius-pill);

  background: var(--lp-color-surface-v1);
  color: var(--lp-color-text-muted);

  font-size: var(--lp-type-small-size);
  font-weight: 700;
}

.species-detail-badge.is-protected {
  border-color: #b7c6b1;
  background: var(--lp-color-moss-soft);
  color: var(--lp-color-moss);
}

.species-detail-badge.is-red-list,
.species-detail-badge.is-eu {
  border-color: #e7c592;
  background: var(--lp-color-ochre-soft);
  color: var(--lp-color-warning);
}


/* Údaje z pozorovaní Lepibase */

.species-detail-stats {
  margin-top: auto;
  padding-top: var(--lp-space-8);
}
.species-detail-stats__grid {
  display: grid;
  margin: 0;

  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-block: var(--lp-border);
}

.species-detail-stats__title {
  margin: 0 0 var(--lp-space-3);

  color: var(--lp-color-text-secondary);
  font-family: var(--lp-font-ui);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
}

.species-detail-stat {
  display: grid;
  min-width: 0;
  min-height: 5.4rem;
  padding: var(--lp-space-4) var(--lp-space-3);

  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: center;
  gap: var(--lp-space-3);
}

.species-detail-stat:nth-child(even) {
  border-left: var(--lp-border);
}

.species-detail-stat:nth-child(n + 3) {
  border-top: var(--lp-border);
}

.species-detail-stat__icon {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  color: var(--lp-color-identity);
}

.species-detail-stat__icon svg {
  width: 1.65rem;
  height: 1.65rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.species-detail-stats__grid dt,
.species-detail-stats__grid dd {
  margin: 0;
}

.species-detail-stats__grid dd {
  color: var(--lp-color-text-primary);

  font-family: var(--lp-font-display);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 650;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.species-detail-stats__grid dt {
  margin-top: var(--lp-space-1);

  color: var(--lp-color-text-muted);

  font-size: var(--lp-type-small-size);
  line-height: 1.3;
}

.species-detail-stats__grid {
  display: grid;
  margin: 0;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  border-block: var(--lp-border);
}


/* Nahlásenie pozorovania */


/* =========================================================
   Nahlásenie pozorovania
   ========================================================= */

.species-observation-cta {
  display: flex;
  margin-top: var(--lp-space-6);
  padding-top: var(--lp-space-5);

  align-items: center;
  justify-content: space-between;
  gap: var(--lp-space-6);

  border-top: var(--lp-border);
}

.species-observation-cta__copy {
  min-width: 0;
}

.species-observation-cta__title {
  margin: 0;

  color: var(--lp-color-identity);
  font-family: var(--lp-font-ui);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}

.species-observation-cta__text {
  max-width: 34rem;
  margin: 0.25rem 0 0;

  color: var(--lp-color-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.species-observation-cta__button {
  flex: 0 0 auto;
  min-width: 11.5rem;
}

.species-observation-cta__pending {
  flex: 0 0 auto;

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-small-size);
  font-weight: 600;
  line-height: 1.4;
}

/* ======================================================================
   SPOLOČNÉ SEKCIE
   ====================================================================== */

.species-detail-section {
  padding-block: var(--lp-space-12);
}

.species-detail-section + .species-detail-section {
  border-top: var(--lp-border);
}

.species-detail-section__header {
  margin-bottom: var(--lp-space-8);
}

.species-detail-section__title {
  margin-top: var(--lp-space-2);
}

.species-detail-subtitle {
  margin: 0 0 var(--lp-space-5);

  color: var(--lp-color-text-primary);

  font-family: var(--lp-font-display);
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.25;
}

/* ======================================================================
   ZÁKLADNÉ ÚDAJE
   ====================================================================== */

.species-basic__layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.35fr)
    minmax(20rem, 0.85fr);

  gap: var(--lp-space-6);
}

.species-basic__subtitle {
  margin: 0 0 var(--lp-space-4);

  color: var(--lp-color-text-primary);

  font-family: var(--lp-font-display);
  font-size: var(--lp-type-title-size);
  font-weight: 650;
  line-height: var(--lp-type-title-line);
}


/* Fenológia podľa literatúry */

.species-literature-phenology {
  min-width: 0;
}

.species-literature-phenology__table {
  border-block: var(--lp-border);
}

.species-literature-phenology__row {
  display: grid;
  grid-template-columns:
    minmax(6.5rem, 1.25fr)
    repeat(12, minmax(1.5rem, 1fr));

  min-height: 2.35rem;

  align-items: center;
}

.species-literature-phenology__row + .species-literature-phenology__row {
  border-top: 1px solid
    color-mix(
      in srgb,
      var(--lp-color-line) 72%,
      transparent
    );
}
.species-literature-phenology__row--header {
  min-height: 1.8rem;

  color: var(--lp-color-subtle);

  font-size: var(--lp-type-label-size);
  font-weight: 700;
  text-align: center;
}

.species-literature-phenology__stage {
  padding-right: var(--lp-space-3);

  color: var(--lp-color-text-primary);

  font-family: var(--lp-font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}

.species-literature-phenology__month {
  position: relative;

  display: block;
  height: 100%;

  border-left: 1px solid
    color-mix(
      in srgb,
      var(--lp-color-line) 58%,
      transparent
    );
}

.species-literature-phenology__month::after {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;

  height: 2px;

  background: transparent;

  content: "";
  transform: translateY(-50%);
}

.species-literature-phenology__month.is-active::after {
  background: #63725e;
}

.species-literature-phenology__month.is-active::before {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;

  width: 0.45rem;
  height: 0.45rem;

  border-radius: 50%;

  background: #63725e;

  content: "";
  transform: translate(-50%, -50%);
}

.species-literature-phenology__row:nth-child(3)
  .species-literature-phenology__month.is-active::after,
.species-literature-phenology__row:nth-child(3)
  .species-literature-phenology__month.is-active::before {
  background: #ce7e22;
}

.species-literature-phenology__row:nth-child(4)
  .species-literature-phenology__month.is-active::after,
.species-literature-phenology__row:nth-child(4)
  .species-literature-phenology__month.is-active::before {
  background: #63725e;
}

.species-literature-phenology__row:nth-child(5)
  .species-literature-phenology__month.is-active::after,
.species-literature-phenology__row:nth-child(5)
  .species-literature-phenology__month.is-active::before {
  background: #d5a817;
}

.species-literature-phenology__note {
  margin-top: var(--lp-space-2);
}


/* Ďalšie údaje */

.species-basic-facts {
  min-width: 0;
  padding-left: var(--lp-space-6);

  border-left: var(--lp-border);
}

.species-basic-facts__list {
  margin: 0;

  border-block: var(--lp-border);
}

.species-basic-facts__item {
  display: grid;
  min-height: 4.45rem;
  padding-block: var(--lp-space-3);

  grid-template-columns:
    minmax(7.5rem, 0.7fr)
    minmax(0, 1.3fr);

  align-items: start;
  gap: var(--lp-space-4);
}

.species-basic-facts__item + .species-basic-facts__item {
  border-top: var(--lp-border);
}

.species-basic-facts__item dt {
  color: var(--lp-color-text-primary);

  font-size: 0.8125rem;
  font-weight: 750;
  line-height: 1.4;
}

.species-basic-facts__item dd {
  display: flex;
  margin: 0;

  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--lp-space-3);

  color: var(--lp-color-text-muted);

  font-size: var(--lp-type-small-size);
  line-height: var(--lp-type-small-line);
}

.species-basic-facts__value {
  display: inline-flex;

  align-items: baseline;
  gap: var(--lp-space-1);

  color: var(--lp-color-text);
  font-weight: 600;
}

.species-basic__sources-link {
  display: flex;
  width: fit-content;
  margin-top: var(--lp-space-4);
  margin-left: auto;

  align-items: center;
  gap: var(--lp-space-2);

  font-size: var(--lp-type-small-size);
}

/* =========================================================
   Identifikácia
========================================================= */

.species-identification__layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(13rem, 18rem);
  align-items: start;
  gap: var(--lp-space-8);
}

.species-identification__main,
.species-similar {
  min-width: 0;
}

.species-identification__main {
  display: grid;
  grid-template-columns:
    minmax(20rem, 28rem)
    auto;
  justify-content: start;
  align-items: start;
  column-gap: var(--lp-space-4);
}

.species-identification__main
> .species-detail-subtitle {
  grid-column: 1;
  margin: 0 0 var(--lp-space-4);
}

.species-identification__text {
  grid-column: 1;

  max-width: 42ch;

  color: var(--lp-color-text);
  font-size: var(--lp-type-body-size);
  line-height: 1.7;
}


/* =========================================================
   Určovacie fotografie
========================================================= */

.species-identification__photos {
  grid-column: 2;
  grid-row: 1 / span 2;

  min-width: 0;
}

.species-identification__photos-title {
  margin: 0 0 var(--lp-space-4);
}

.species-identification__gallery {
  display: grid;
  align-content: start;
  justify-content: start;
  gap: var(--lp-space-3);

  margin: 0;
  padding: 0;
}

.species-identification-photo__credit {
  margin-top: var(--lp-space-2);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.4;
}

.species-identification__gallery[data-count="1"] {
  grid-template-columns: 12rem;
}

.species-identification__gallery[data-count="2"],
.species-identification__gallery[data-count="3"] {
  grid-template-columns: repeat(2, 9rem);
}

.species-identification-photo {
  min-width: 0;
  margin: 0;
}

.species-identification-photo__image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;

  border-radius: var(--lp-radius-card);
  cursor: zoom-in;
}

.species-identification__gallery[data-count="3"]
.species-identification-photo:last-child {
  grid-column: 1;
}


/* =========================================================
   Podobné druhy
========================================================= */

.species-similar {
  padding-left: var(--lp-space-6);
  border-left: 1px solid var(--lp-color-line);
}

.species-similar
> .species-detail-subtitle {
  margin: 0 0 var(--lp-space-4);
}

.species-similar__list {
  display: grid;
  gap: 0;

  margin: 0;
  padding: 0;

  list-style: none;
}

.species-similar__item {
  position: relative;

  margin: 0;
  padding: 0;

  border-bottom: 1px solid var(--lp-color-line);
}

.species-similar__link {
  position: relative;

  display: grid;
  gap: 0.15rem;

  padding: var(--lp-space-2) 0 var(--lp-space-4);

  color: inherit;
  text-decoration: none;
}

.species-similar__latin,
.species-similar__latin em {
  color: var(--lp-color-link);
}

.species-similar__latin {
  font-size: var(--lp-type-body-size);
  line-height: 1.35;
}

.species-similar__slovak {
  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.35;
}

.species-similar__link:hover
.species-similar__latin,
.species-similar__link:hover
.species-similar__latin em,
.species-similar__link:focus-visible
.species-similar__latin,
.species-similar__link:focus-visible
.species-similar__latin em {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}


/* =========================================================
   Náhľad podobného druhu
========================================================= */

.species-similar__preview {
  position: absolute;
  z-index: 10;
  top: calc(100% + var(--lp-space-2));
  right: 0;

  display: none;
  width: 14rem;
  padding: var(--lp-space-2);

  border: 1px solid var(--lp-color-line);
  border-radius: var(--lp-radius-card);

  background: var(--lp-color-surface-v1);
  box-shadow: var(--lp-shadow-card);
}

.species-similar__preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;

  border-radius: calc(
    var(--lp-radius-card) - var(--lp-space-1)
  );
}

.species-similar__link:hover
.species-similar__preview,
.species-similar__link:focus-visible
.species-similar__preview {
  display: block;
}


/* =========================================================
   Iba podobné druhy
========================================================= */

.species-identification__layout.is-only-similar {
  grid-template-columns: minmax(13rem, 20rem);
}

.species-identification__layout.is-only-similar
.species-similar {
  padding-left: 0;
  border-left: 0;
}


/* =========================================================
   Tablet
========================================================= */

@media (max-width: 1000px) {
  .species-identification__main {
    grid-template-columns: 1fr;
    row-gap: var(--lp-space-5);
  }

.species-identification__photos {
  grid-column: 1;
  grid-row: auto;
}
}


/* =========================================================
   Mobil
========================================================= */

@media (max-width: 700px) {
  .species-identification__layout,
  .species-identification__layout.is-only-similar {
    grid-template-columns: 1fr;
    gap: var(--lp-space-6);
  }

  .species-similar {
    padding-top: var(--lp-space-5);
    padding-left: 0;

    border-top: 1px solid var(--lp-color-line);
    border-left: 0;
  }

  .species-identification__gallery[data-count="1"] {
    grid-template-columns: 12rem;
  }

  .species-identification__gallery[data-count="2"],
  .species-identification__gallery[data-count="3"] {
    grid-template-columns: repeat(2, 9rem);
  }

  .species-similar__preview {
    display: none !important;
  }
}
/* ======================================================================
   BIOLÓGIA
   ====================================================================== */

.species-biology__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--lp-space-8);

  margin-top: var(--lp-space-6);
  padding-top: var(--lp-space-6);

  border-top: 1px solid var(--lp-color-line);
}

.species-biology__facts > section {
  min-width: 0;
  padding: var(--lp-space-5);
}

.species-biology__facts > section + section {
  border-left: var(--lp-border);
}

.species-biology__facts h3 {
  margin: 0 0 var(--lp-space-3);

  color: var(--lp-color-identity);

  font-family: var(--lp-font-display);
  font-size: 1.2rem;
}

.species-biology__detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--lp-space-10);

  margin-top: var(--lp-space-8);
  padding-top: var(--lp-space-6);

  border-top: 1px solid var(--lp-color-line);
}

.species-biology__detail
> section {
  min-width: 0;
}

.species-biology__detail
> section
> .species-detail-subtitle {
  margin: 0 0 var(--lp-space-4);
}

.species-host-plants {
  display: grid;
  gap: var(--lp-space-6);
}

.species-host-plants__group + .species-host-plants__group {
  padding-top: var(--lp-space-5);
  border-top: var(--lp-border);
}

.species-host-plants__group h4 {
  margin: 0 0 var(--lp-space-3);

  color: var(--lp-color-text-muted);

  font-family: var(--lp-font-ui);
  font-size: var(--lp-type-small-size);
  font-weight: 750;
}

.species-host-plants__group ul {
  display: grid;
  margin: 0;
  padding: 0;

  list-style: none;
  gap: var(--lp-space-2);
}

.species-host-plants__group li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--lp-space-2);

  color: var(--lp-color-text-primary);
}

.species-host-plants__group li::before {
  width: 0.4rem;
  height: 0.4rem;

  border-radius: 50%;

  background: var(--lp-color-moss);

  content: "";
}

.species-host-plants__group li span {
  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-small-size);
}


.species-biology-stage {
  min-width: 0;
  padding: 0;
}


.species-biology-stage h3 {
  margin: 0 0 var(--lp-space-3);

  color: var(--lp-color-identity);
  font-size: var(--lp-type-h4-size);
  line-height: 1.25;
}

.species-biology-stage__text {
  max-width: 34ch;

  color: var(--lp-color-text);
  font-size: var(--lp-type-body-size);
  line-height: 1.55;
}

/* ======================================================================
   VÝSKYT
   ====================================================================== */

.species-distribution__grid {
  display: grid;
  grid-template-columns: 1fr;

  gap: var(--lp-space-8);
}

.species-distribution__grid > section {
  min-width: 0;
}

.species-distribution__map {
  order: 1;
}

.species-distribution__phenology {
  order: 2;
}

.species-distribution__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--lp-space-4);
}

.species-distribution-map-layout {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(0, 3fr);
  gap: var(--lp-space-6);
  align-items: stretch;
}

.species-distribution-map-meta {
  min-width: 0;
}

.species-distribution-map-meta .species-distribution-map__summary {
  display: grid;
  gap: var(--lp-space-4);
  margin-top: 0;
}

.species-distribution-map-meta .species-distribution__legend.is-kfme {
  grid-template-columns: 1fr;
}
.species-distribution__scheme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;

  border: 1px solid var(--lp-color-line);
  border-radius: var(--lp-radius-control);
}

.species-distribution__scheme-toggle[hidden] {
  display: none;
}

.species-distribution__scheme-toggle button {
  min-width: 4.25rem;
  padding: 0.4rem 0.75rem;

  border: 0;
  background: transparent;
  color: var(--lp-color-text-muted);

  font: inherit;
  font-size: var(--lp-type-label-size);
  font-weight: 700;

  cursor: pointer;
}

.species-distribution__scheme-toggle button + button {
  border-left: 1px solid var(--lp-color-line);
}

.species-distribution__scheme-toggle button[aria-pressed="true"] {
  background: var(--lp-color-identity);
  color: var(--lp-color-surface-v1);
}

.species-map-placeholder {
  display: grid;
  min-height: 25rem;
  padding: var(--lp-space-8);

  border: var(--lp-border);
  border-radius: var(--lp-radius-panel);

  place-items: center;

  background: var(--lp-color-surface-soft);
  color: var(--lp-color-text-muted);

  text-align: center;
}

.species-record-chart {
  display: grid;
  min-height: 25rem;

  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: var(--lp-space-2);
}

.species-record-chart__month {
  display: grid;
  height: 100%;

  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--lp-space-2);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  font-weight: 700;
  text-align: center;
}

.species-record-chart__bar-wrap {
  display: flex;
  height: 100%;

  align-items: flex-end;

  border-bottom: var(--lp-border);
  background:
    linear-gradient(
      to top,
      var(--lp-color-surface-soft),
      transparent
    );
}

.species-record-chart__bar {
  display: block;
  width: 100%;
  min-height: 0;

  background: var(--lp-color-identity);
}


/* ======================================================================
   LITERATÚRA
   ====================================================================== */

.species-literature {
  padding-bottom: var(--lp-space-4);
}


/* ======================================================================
   RESPONZIVITA
   ====================================================================== */

@media (max-width: 70rem) {
  .species-detail-hero {
    grid-template-columns:
      minmax(0, 1.05fr)
      minmax(21rem, 0.95fr);

    gap: var(--lp-space-8);
  }

  .species-basic__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-basic-fact:nth-child(3) {
    border-left: 0;
  }

  .species-basic-fact:nth-child(n + 3) {
    border-top: var(--lp-border);
  }
}


@media (max-width: 54rem) {
  .species-detail-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "gallery"
      "identity"
      "thumbnails"
      "cta";
    gap: 0;
  }

  .species-detail-hero__identity {
    max-width: 42rem;
    margin-top: var(--lp-space-8);
    padding-top: 0;
  }

.species-detail-stats {
  margin-top: auto;
  padding-top: var(--lp-space-10);
}

  .species-gallery__thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .species-identification__grid,
  .species-biology__detail,
  .species-distribution__grid {
    grid-template-columns: 1fr;
  }

  .species-biology__facts {
    grid-template-columns: 1fr;
  }

  .species-biology__facts > section + section {
    border-top: var(--lp-border);
    border-left: 0;
  }

  .species-map-placeholder,
  .species-record-chart {
    min-height: 20rem;
  }
  .species-basic__layout {
  grid-template-columns: 1fr;
}

.species-basic-facts {
  padding-top: var(--lp-space-6);
  padding-left: 0;

  border-top: var(--lp-border);
  border-left: 0;
}
}


@media (max-width: 40rem) {
  .species-detail {
    padding-block:
      var(--lp-space-5)
      var(--lp-space-12);
  }

  .species-detail-hero__latin {
    font-size: clamp(2.5rem, 12vw, 3.4rem);
  }

  .species-gallery__cover {
    aspect-ratio: 4 / 3;
  }

  .species-gallery__thumbnails {
    display: grid;
    grid-auto-columns: minmax(8rem, 11rem);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .species-detail-stats__grid {
    grid-template-columns: 1fr;
  }

  .species-detail-stat:nth-child(even) {
    border-left: 0;
  }

  .species-detail-stat + .species-detail-stat {
    border-top: var(--lp-border);
  }


  .species-record-chart {
    overflow-x: auto;
    grid-template-columns: repeat(12, minmax(2.25rem, 1fr));
  }

.species-literature-phenology {
  overflow-x: auto;
}

.species-literature-phenology__table {
  min-width: 42rem;
}

.species-basic-facts__item {
  grid-template-columns: 1fr;
  gap: var(--lp-space-2);
}
.species-observation-cta {
  align-items: stretch;
  gap: var(--lp-space-4);
}

.species-observation-cta__button {
  width: 100%;
}
}



@media (max-width: 1000px) {
  .species-biology__facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-biology-stage:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--lp-color-line);
  }

  .species-biology-stage:nth-child(4) {
    border-top: 1px solid var(--lp-color-line);
  }
}

@media (max-width: 700px) {
  .species-biology__facts {
    grid-template-columns: 1fr;
  }

  .species-biology-stage + .species-biology-stage {
    border-top: 1px solid var(--lp-color-line);
    border-left: 0;
  }
}

.species-habitats__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lp-space-2) var(--lp-space-4);

  margin: 0;
  padding: 0;

  list-style: none;
}

.species-habitats__list li {
  margin: 0;
  padding: 0;

  color: var(--lp-color-text);
  font-size: var(--lp-type-body-size);
  line-height: 1.5;
}

.species-habitats__list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .6rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.species-habitats__item {
    color: var(--lp-color-primary);
    font-weight: 600;
}

.species-habitats__item:not(:last-child)::after {
    content: " ·";
    color: var(--lp-color-text-muted);
}


.species-habitats__name {
  display: inline-block;

  padding: 0.12rem 0.55rem;

  border: 1px solid var(--lp-color-line);
  border-radius: 999px;

  background: var(--lp-color-surface-soft);
  color: var(--lp-color-text-primary);

  font-weight: 600;
}

/* =========================================================
   Verejná mapa výskytu
========================================================= */

.species-distribution-map {
  position: relative;

  width: 100%;
  min-height: 25rem;
  overflow: hidden;

  border: 1px solid var(--lp-color-line);
  border-radius: var(--lp-radius-card);

  background: var(--lp-color-surface-soft);
}

.species-distribution-map__message {
  display: grid;
  place-items: center;

  min-height: 25rem;
  margin: 0;
  padding: var(--lp-space-6);

  color: var(--lp-color-text-muted);
  text-align: center;
  line-height: 1.6;
}

.species-distribution-map__status {
  margin-top: var(--lp-space-3);
}

.species-distribution-map__privacy-note {
  max-width: 65ch;
  margin-top: var(--lp-space-3);
}

.species-distribution__legend {
  margin-top: var(--lp-space-3);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.4;
}

.species-distribution-popup {
  display: grid;
  gap: 0.25rem;

  min-width: 10rem;
}

.species-distribution-popup strong {
  color: var(--lp-color-text-primary);
}

.species-distribution-popup span {
  color: var(--lp-color-text-muted);
}

.species-distribution-map .leaflet-control-layers,
.species-distribution-map .leaflet-bar {
  border: 0;
  box-shadow: var(--lp-shadow-card);
}

@media (max-width: 700px) {
  .species-distribution-map,
  .species-distribution-map__message {
    min-height: 20rem;
  }
}

/* =========================================================
   Verejná mapa výskytu
========================================================= */

.species-distribution-map {
  position: relative;

  width: 100%;
height: 30rem;
min-height: 30rem;
  overflow: hidden;

  border: 1px solid var(--lp-color-line);
  border-radius: var(--lp-radius-card);

  background: #eef7fa;
}


/* =========================================================
   Stavové správy mapy
========================================================= */

.species-distribution-map__message {
  display: grid;
  place-items: center;

  min-height: 20rem;
  margin: 0;
  padding: var(--lp-space-6);

  color: var(--lp-color-text-muted);
  text-align: center;
  line-height: 1.6;
}

.species-distribution-map__status {
  margin-top: var(--lp-space-3);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.4;
}

.species-distribution-map__privacy-note {
  max-width: 65ch;
  margin-top: var(--lp-space-3);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.5;
}


/* =========================================================
   Legenda
========================================================= */

.species-distribution__legend {
  max-width: 65ch;
  margin-top: var(--lp-space-3);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.5;
}


/* =========================================================
   Leaflet – kontajner a ovládanie
========================================================= */

.species-distribution-map .leaflet-container {
  width: 100%;
  height: 100%;

  font-family: inherit;
}

.species-distribution-map .leaflet-bar {
  overflow: hidden;

  border: 0;
  border-radius: var(--lp-radius-control);
  box-shadow: var(--lp-shadow-card);
}

.species-distribution-map .leaflet-bar a {
  color: var(--lp-color-text-primary);
  background: var(--lp-color-surface-v1);
}

.species-distribution-map .leaflet-bar a:hover,
.species-distribution-map .leaflet-bar a:focus-visible {
  background: #f4f8fa;
}

.species-distribution-map .leaflet-control-attribution {
  padding: 0.15rem 0.35rem;

  color: var(--lp-color-text-muted);
  background: rgba(255, 255, 255, 0.82);

  font-size: 0.65rem;
}


/* =========================================================
   Popup bunky
========================================================= */

.species-distribution-popup {
  display: grid;
  gap: 0.35rem;

  min-width: 11rem;
}

.species-distribution-popup strong {
  color: var(--lp-color-text-primary);
  font-size: var(--lp-type-body-size);
  line-height: 1.35;
}

.species-distribution-popup span {
  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.35;
}

.species-distribution-map .leaflet-popup-content-wrapper {
  border-radius: var(--lp-radius-control);

  background: var(--lp-color-surface-v1);
  box-shadow: var(--lp-shadow-card);
}

.species-distribution-map .leaflet-popup-content {
  margin: var(--lp-space-4);
}

.species-distribution-map .leaflet-popup-tip {
  background: var(--lp-color-surface-v1);
}


/* =========================================================
   Responzivita
========================================================= */

@media (max-width: 1000px) {
  .species-distribution-map {
    height: 22rem;
    min-height: 22rem;
  }

  .species-distribution-map__message {
    min-height: 22rem;
  }
}

@media (max-width: 700px) {
  .species-distribution-map {
    height: 18rem;
    min-height: 18rem;

    border-radius: var(--lp-radius-control);
  }

  .species-distribution-map__message {
    min-height: 18rem;
    padding: var(--lp-space-5);
  }

  .species-distribution-map__status,
  .species-distribution-map__privacy-note,
  .species-distribution__legend {
    font-size: var(--lp-type-label-size);
  }
}

/* =========================================================
   Fenológia zo záznamov
   Rovnaký systém ako fenológia podľa literatúry,
   doplnený o počet pozorovaných jedincov.
========================================================= */

.species-record-phenology__table {
  border-block: var(--lp-border);
}

.species-record-phenology__row {
  --record-phenology-color: #63725e;

  display: grid;
  grid-template-columns:
    minmax(6.5rem, 1.25fr)
    repeat(12, minmax(1.5rem, 1fr));

  min-height: 3rem;

  align-items: center;
}

.species-record-phenology__row
+ .species-record-phenology__row {
  border-top: 1px solid
    color-mix(
      in srgb,
      var(--lp-color-line) 72%,
      transparent
    );
}


/* Farby štádií */

.species-record-phenology__row--imago {
  --record-phenology-color: #63725e;
}

.species-record-phenology__row--larva {
  --record-phenology-color: #ce7e22;
}

.species-record-phenology__row--pupa {
  --record-phenology-color: #63725e;
}

.species-record-phenology__row--egg {
  --record-phenology-color: #d5a817;
}


/* Hlavička mesiacov */

.species-record-phenology__row--header {
  min-height: 2.25rem;

  color: var(--lp-color-subtle);

  font-size: var(--lp-type-label-size);
  font-weight: 700;
  text-align: center;
}


/* Názov štádia */

.species-record-phenology__stage {
  padding-right: var(--lp-space-3);

  color: var(--lp-color-text-primary);

  font-family: var(--lp-font-ui);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}


/* Mesačná bunka */

.species-record-phenology__month {
  position: relative;

  display: block;
  height: 100%;

  border-left: 1px solid
    color-mix(
      in srgb,
      var(--lp-color-line) 58%,
      transparent
    );
}


/* Fenologická čiara */

.species-record-phenology__month::after {
  position: absolute;

  top: 62%;
  right: 0;
  left: 0;

  height: 2px;

  background: transparent;

  content: "";
  transform: translateY(-50%);
}

.species-record-phenology__month.is-active::after {
  background: var(--record-phenology-color);
}


/* Bod aktívneho mesiaca */

.species-record-phenology__month.is-active::before {
  position: absolute;
  z-index: 1;

  top: 62%;
  left: 50%;

  width: 0.45rem;
  height: 0.45rem;

  border-radius: 50%;

  background: var(--record-phenology-color);

  content: "";
  transform: translate(-50%, -50%);
}


/* Počet nad bodom */

.species-record-phenology__count {
  position: absolute;
  z-index: 2;

  top: 0.16rem;
  left: 50%;

  color: var(--lp-color-text-muted);

  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;

  white-space: nowrap;

  transform: translateX(-50%);
}


/* Poznámka */

.species-record-phenology__note {
  margin-top: var(--lp-space-2);
}


/* Mobil */

@media (max-width: 40rem) {
  .species-distribution__phenology {
    overflow-x: auto;
  }

  .species-record-phenology__table {
    min-width: 42rem;
  }
  .species-observation-cta {
  border-top: 0;
}
}

/* =========================================================
   Zarovnanie fenológie s mapou
========================================================= */

.species-distribution__phenology {
  display: flex;
  min-width: 0;

  flex-direction: column;
  align-items: stretch;
}

.species-record-phenology__table {
  width: 100%;
  margin-top: var(--lp-space-6);

}

.species-record-phenology__note {
  margin-top: var(--lp-space-3);
}

.species-distribution-map__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;

  margin-top: var(--lp-space-3);

  color: var(--lp-color-text-muted);
  font-size: var(--lp-type-label-size);
  line-height: 1.5;
}

.species-distribution-map__status,
.species-distribution__legend {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.species-distribution__legend:not(:empty)::before {
  margin-right: 0.35rem;
  content: "·";
}

.species-distribution-map .leaflet-tile-pane {
  filter:
    saturate(0.45)
    brightness(1.06)
    contrast(0.92);
}

/* Jemné deliace čiary — fenológia podľa literatúry */

.species-literature-phenology__row
+ .species-literature-phenology__row {
  border-top: 1px solid rgb(50 31 46 / 0.10);
}

.species-literature-phenology__month {
  border-left: 1px solid rgb(50 31 46 / 0.08);
}


/* Jemné deliace čiary — fenológia z pozorovaní */

.species-record-phenology__row
+ .species-record-phenology__row {
  border-top: 1px solid rgb(50 31 46 / 0.10);
}

.species-record-phenology__month {
  border-left: 1px solid rgb(50 31 46 / 0.08);
}

.leaflet-utmGrid-pane svg,
.leaflet-utmOccupied-pane svg {
    max-width: none;
    max-height: none;
}

/* KFME atlasová vetva verejnej mapy */

.species-distribution-map.is-kfme,
.species-distribution-map.is-kfme .leaflet-container {
  background: #f3f5f3;
}

.leaflet-kfmeCountry-pane svg,
.leaflet-kfmeGrid-pane svg,
.leaflet-kfmeSymbol-pane svg,
.leaflet-kfmeOutline-pane svg {
  max-width: none;
  max-height: none;
}

.species-distribution__legend.is-kfme {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.75rem;
  width: 100%;
}

.species-distribution__legend.is-kfme::before {
  content: none;
}

.species-distribution__legend-item {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.35rem;
}


.species-distribution__legend-symbol {
  width: 1.28rem;
  height: 1.28rem;
  flex: 0 0 1.28rem;
  overflow: visible;
}
@media (max-width: 700px) {
  .species-distribution__legend.is-kfme {
    grid-template-columns: 1fr;
  }
}