:root {
  --header: #3A4E56;
  --bakgrund: #F5F7F6;
  --text: #1F1F1F; 
  --länk: #EBC07A;
  --box: #E6EBEA;
  --rubrik: #FFFFFF;
}

html {
  margin: 0 auto;
  font-family: "javanese-text", sans-serif;
  font-weight: 400;
  font-size: 1vw;
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  transition: 0.15s;
}

header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1vh 2vw;
  background-color: var(--header);
  box-shadow: 0 4px 6px var(--text);
  max-height: 8vh;
}

h1 {
  font-size: clamp(12pt, 1.8rem, 90pt);
  color: var(--rubrik);
}

header h1 {
  text-shadow: 2px 4px 0px var(--text);
}

.nav-links {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  list-style: none;
}

.nav-links a {
  align-items: center;
  text-decoration: none;
  color: var(--rubrik);
  font-size: clamp(10pt, 1.5rem, 90pt);
  margin: 0 1vw;
  padding: 0 1vw; 
  border-radius: 40px;
}

.nav-links a:hover {
  background-color: #2B383E;
  border-radius: 20px;
  transition: linear;
  transition-duration: 0.4s;
}

main {
  background-color: var(--bakgrund);
  min-height: 90vh;
}

main h2 {
  display: flex;
  justify-content: center;
  margin: 0;
  color: var(--header);
  font-size: clamp(10pt, 2rem, 70pt);
}

main p {
  font-size: clamp(8pt, 1.1rem, 50pt);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.center {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(33vw, 1fr));
  grid-auto-rows: 1fr;
  gap: 2vw;
  padding: 2vw 0 13vh 0;
  margin: 0 1vw;
}

.center1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(33vw, 1fr));
  grid-auto-rows: 1fr;
  gap: 2vw;
  padding: 2vh 0 13vh 0;
  justify-items: center;
}

.container {
  justify-items: center;
  padding: 2vw;
  min-height: fit-content;
  background-color: var(--box);
  color: var(--text);
  border-radius: 20px;
  box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.6);
  max-width: 60vw;
  cursor: pointer;
  outline-offset: 2px;
  outline: none;
  transition: box-shadow 0.3s ease;
}

.container:hover,
.container:focus {
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.container a {
  color: var(--länk);
  text-decoration: none;
  margin: 0;
  font-size: clamp(5pt, 1.1rem, 20pt);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.center img {
  max-width: 20vw;
  max-height: 20vh;
  border-radius: 20px;
}

footer {
  background-color: var(--header);
  position: fixed;
  bottom: 0;
  width: 100vw;
  padding: 0.5vw;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

footer a {
  text-decoration: none;
  color: var(--rubrik);
  font-size: clamp(5pt, 1.5rem, 20pt);
}

#toggleMode {
  background-color: var(--box);
  padding: 0.5vw;
  border: none;
  border-radius: 1vh;
  font-size: clamp(5pt, 0.8rem, 20pt);
}

.dark-mode main {
  background-color: rgb(45, 47, 49);
}

.dark-mode header {
  background-color: rgb(30, 32, 35);
}

.dark-mode footer {
  background-color: rgb(30, 32, 35);
}

.dark-mode .container {
  background-color: rgb(42, 43, 45);
}

.dark-mode .container p {
  color: var(--box);
}

.dark-mode h2 {
  color: var(--länk);
}

.dark-mode .nav-links a:hover {
  background-color: rgb(45, 47, 49);
}

.dark-mode #toggleMode {
  background-color: rgb(45, 47, 49);
  color: var(--box);
}

h3 {
  margin: 0;
  font-size: clamp(5pt, 1rem, 20pt);
  color: var(--länk);
  text-decoration: none;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.Paolo {
  width: 100%;
  max-height: 60vh;
}

@media (max-width: 699px) {
  .center {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90vw, 1fr));
    grid-auto-rows: 1fr;
    gap: 2vw;
    justify-items: center;
  }

  .center1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90vw, 1fr));
    grid-auto-rows: 1fr;
    gap: 2vw;
    justify-items: center;
  }
  .container{
    width: 80vw;
  }
  .container img {
    max-width: 40vw;
    max-height: 10vh;
  }
  
  .container p {
    display:none;
  }
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255 255 255 / 0.8);
  backdrop-filter: blur(9px) saturate(1.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 80vw;
  max-width: 480px;
  max-height: 40vh;
  overflow-y: auto;
  background: var(--bakgrund);
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.15);
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  padding: 2rem 2.5rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  outline: none;
}
.popup img{
  display: none;
}
.popup.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.popup h2 {
  font-weight: 700;
  font-size: 3rem;
  margin: 0 0 1rem 0;
  color: var(--header);
}
.popup .content {
  flex-grow: 1;
  color: var(--text);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1.5;
}
.popup .close-btn {
  align-self: flex-end;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--header);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s ease;
  user-select: none;
}
.popup .close-btn:hover,
.popup .close-btn:focus {
  color: #ef4444;
  outline: none;
}

@media (min-width: 700px) {
  .container p,
  .container img {
    display: block !important;
  }
  .container {
    cursor: default;
  }
  .popup,
  .overlay {
    display: none !important;
  }
}
