:root {
  --color-primary: hsl(241, 73%, 50%);;
  --color-primary-bg: hsl(from var(--color-primary) h s 40%);

  --color-text: hsl(from var(--color-primary) h s 5%);
  --color-h2:  hsl(from var(--color-primary) h calc(s * 1.50) 65%);
  --color-h3:  hsl(from var(--color-primary) h calc(s * 1.50) 65%);

  --label-text: #ffffff;
  --label-background: #0476af;
  --label-opacity: 0.5;

  --menu-text: #ffffff;
  --menu-background: #2320cf;
  --menu-opacity: 0.8;
  --menu-divider-color: #ffffff;

  --primary-block-text: #cfcfcf;
  --primary-block-h3: #ffffff;
  --primary-block-background: var(--color-primary-bg);

  font-size: 18px;
}

body {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  container-type: inline-size;
}

header {
  width: 100%;
  height: 500px;
  min-height: 500px;
  position: relative;
}

header figure {
  margin: 0;
}

header img {
  height: 100%;
  max-height: 500px;
  width: 100%;
  object-fit: cover;
}

nav {
  width: 100%;
  padding-block: 0.25rem;
  position: fixed;
  top: 0px;
  margin: 0;
  padding: 0;

  font-size: 1.5rem;
  line-height: 1.8rem;

  background-color: var(--menu-background);

  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;

  z-index: 1000;

  transition: font-size 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
}

nav.scrolled {
  background-color: rgba(
    from var(--menu-background) r g b / var(--menu-opacity)
  );
  font-size: 1.3rem;
  line-height: 1.2rem;
}

nav a {
  color: #9f9f9f;
  text-decoration: none;
  position: relative;
  padding-block: 1rem;
}

nav a:not(:last-child)::before {
  content: "/";
  position: absolute;
  right: -1.25rem;
  top: 50%;
  transform: translateY(-50%);
  height: 50%;
  color: var(--menu-divider-color);
  font-weight: bold;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.60em;
  width: 0;
  height: 3px;
  background-color: var(--menu-divider-color);
  transition: width 0.3s ease, left 0.3s ease;
}

nav a:hover,
nav:not(:hover) a.current {
  color: #ffffff;
}

nav a:hover::after,
nav:not(:hover) a.current::after {
  width: 100%;
}

header h1 {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 0.5rem;
  color: var(--label-text);
  background-color: rgba(
    from var(--label-background) r g b / var(--label-opacity)
  );
  padding: 1rem;
  text-align: center;
}

header h1 span {
  font-size: .8em;
}

main {
  margin-block: 2rem;
  display: flex;
  gap: 2rem;
  flex-direction: column;
  text-align: center;
}

main p, main ul {
  text-align: left;
}

main h2 {
  color: var(--color-h2);
  margin-block: 0;
  padding: 0;
}

main h3 {
  color: var(--color-h3);
}

.pad2 {
  padding-block: 2rem;
}

main > * {
  display: grid;
  width: 80rem;
  max-width: calc(100% - 6rem);
  margin-inline: auto;

}

main .container:nth-of-type(odd) {
  /* background-color: #f0f0f0; */
}

main .container:nth-of-type(even) {
  position: relative;
  background-color: hsl(from var(--color-primary) h s 90%);
}

main .container:nth-of-type(even)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100cqw;
  margin-left: -50vw;
  height: 100%;
  background-color: inherit;
  z-index: -1;
}

main .primary {
  background-color: var(--primary-block-background);
  color: var(--primary-block-text);

  clip-path: polygon(
    2rem 0,
    100% 0,
    100% calc(100% - 2rem),
    calc(100% - 2rem) 100%,
    0 100%,
    0 2rem
  );

  font-size: 1.1rem;
  line-height: 1.5rem;
  padding: 1rem;

  display: flex;
  flex-direction: column;
  gap: 1rem;
}

main .primary h3 {
  color: var(--primary-block-h3);
  margin: 0;
  padding: 0;
}


main .two-cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

main .two-cols.nowrap {
  flex-wrap: nowrap;
}

main .two-cols > * {
  max-width: calc(50% - 3rem);
  margin-inline: 1.5rem;
}

main .image-gallery {
  display: flex;
  /* flex-wrap: no-wrap; */
}

main .image-gallery > figure {
  max-width: calc(50% - 3rem);
  /* max-height: 334px; */
  /* margin-inline: 1.5rem;; */
}

main figure {
  position: relative;
  display: flex;
  flex-direction: column;
}

main .image-gallery figure img:not(.asis) {
  width: 100%;
  /* height: 100%; */
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

main.page-neurons figure img {
  aspect-ratio: unset;
}

main figure figcaption {
  font-size: 0.8rem;
  color: #555;
  margin-top: 5px;
  margin: 0;
  padding: .5rem 0 0 0;
}

main figure .image-container {
  position: relative;
}

main figure .img-attrib {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0 0.5em 0.5em 0;
  padding: 0.25em;
  color: white;
  background-color: rgba(0, 0, 0, 0.2);
  font-size: 0.7rem;
  text-align: right;
}

main figure .img-attrib a {
  color: white;
  text-decoration: none;
}
main figure .img-attrib a:hover {
    text-decoration: underline;
  }

.bio, .image-text {
  display: flex;
}

.image-text {
  flex-wrap: nowrap;
}

.bio figure img,
.image-text figure img {
  aspect-ratio: unset;
  height: unset;
}

.bio h3 span,
.image-text h3 span {
  display:block;
  font-weight: normal;
  font-size: .75em;
}

/* Stylizacja listy definicji */
dl {
  margin: 0 auto;
  padding: 0;
  width: 80%;
  max-width: 800px;
  background-color: var(--primary-block-background);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Stylizacja terminów definicji */
dt {
  background-color: var(--color-primary);
  color: var(--label-text);
  padding: 1rem;
  font-weight: bold;
  border-bottom: 1px solid var(--color-primary-bg);
}

/* Stylizacja opisów definicji */
dd {
  background-color: #efefef;
  color: var(--color-text);
  padding: 1rem 1rem 1rem 2rem;
  margin: 0;
  border-bottom: 1px solid var(--color-primary-bg);
}

/* Ostatni element bez dolnej granicy */
dd:last-of-type {
  border-bottom: none;
}

main.page-ciekawostki section.primary {
  width: 80%;
  max-width: 800px;
}

/* Styl dla sekcji z siatką (grid) */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  align-items: start;
  margin-top: 1.5rem;
}

/* Styl dla pojedynczego elementu w grid */
.equipment,
.disease {
  background-color: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.3s ease-in-out;
}

.equipment:hover,
.disease:hover {
  transform: scale(1.05);
}

/* Styl dla obrazów */
.equipment img,
.disease img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

/* Tekst pod obrazkami */
.equipment p,
.disease p {
  font-size: 1rem;
  line-height: 1.4;
  color: #333;
}

/* Responsywność */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

footer {
  background-color: #23272a;
  color: #ffffff;
  text-align: center;
  padding: 1rem 0;
  margin-top: 2rem;
  font-size: 1rem;
}

/* Styl dla tekstu w stopce */
footer p {
  margin: 0;
  font-weight: 400;
}

/* h1,
h2 {
  color: #2320cf;
}
.container {
  width: 80%;
  margin: auto;
  background-color: #0476af;
  padding: 20px;
  border-radius: 10px;
  margin-block: 1rem;
}
.image-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
} */
/* .image-container img {
  width: 300px;
  height: auto;
  border-radius: 10px;
  animation: spin 2s infinite linear alternate;
} */
/* .image-container img:hover {
  animation: none i;
} */
/* @keyframes spin {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(180deg);
  }
}
.highlighted-text {
  font-size: 1.2em;
  font-weight: bold;
  color: black;
} */
