/* === GRUNNLEGGENDE STILER OG BODY === */
body {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  font-family: Arial, Helvetica, sans-serif;
  background-attachment: fixed;
  height: 400vh;
  color: #ffffff;
  transition: all 0.5s ease-in-out;
  margin: 0;
  padding: 0;
}

/* === ELEMENTER FOR BAKGRUNNSBYTTE === */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.75s ease-in-out;
}

.bg-image.visible {
    opacity: 1;
}

.background-trigger {
    height: 20px;
}

/* === NAVIGASJONSMENY === */
nav {
	width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    position: fixed;
    text-align: center;
    top: 0;
    left: 0;
    z-index: 1000;
}

nav ul {
    align-items: center;
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav li {
    font-size: 30px;
    padding: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    display: inline-block;
    position: relative;
}

nav a.main-link {
  font-size: 40px;
}

nav a.link {
  font-size: 50px;
}

nav a::after {
  content: '';
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: 0;
  left: 0;
  margin-bottom: -10px; 
  background-color: #ffffff;
  transform-origin: bottom center;
  transition: transform 0.25s ease-out;
}

nav a:hover::after {
  transform: scaleX(1);
  margin-bottom: -10px; 
  transform-origin: bottom center;
}

/* === .cover SEKSJONER (OMSLAG FOR HOVEDINNHOLD) === */
.cover {
  background-color: rgba(0, 0, 0, 0.5);
  height: auto;
  margin-top: 30vh;
  margin-bottom: 100vh;
  padding: 20px;
  border-radius: 30px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  width: 99%;
}

.cover.projects-cover,
.cover.contact-cover {
    display: block !important;
    grid-template-columns: none;
}

/* === "OM MEG" SEKSJON === */
.about {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 10px;
}

.about > p {
    flex-grow: 1;
    overflow-y: auto;
}

.social-info {
    background-color: rgba(0, 0, 0, 0.5);
    margin: 10px 0 0 0;
    padding: 10px;
    border-radius: 20px;
}

.visual img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 30px;
    object-fit: cover;
}

.social-clickable:hover {
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
}

/* === PROSJEKTKORT === */
.card-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr; /* For 4 kolonner */
    gap: 10px;
}

.card {
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-default-info {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.card-details {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease-in-out 0.3s, max-height 0.3s ease-in-out;
}

.card:hover .card-default-info {
    opacity: 0;
}

.card:hover .card-details {
    opacity: 1;
    max-height: 900px;
}

/* === KNAPPER === */
button {
    background: none;
    color: inherit;
    border: none;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    position: relative;
    font: inherit;
	cursor: pointer;
	outline: inherit;
    font-size: 20px;
    /* bottom: 0px; -- Fjernet, kan forårsake problemer */
}

/* Understrek-effekt for knapper og lenker som ser ut som knapper */
button::after,
a.custom-button::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #ffffff;
    transform-origin: bottom center;
    transition: transform 0.25s ease-out;
}
button::after {
    /* padding-bottom: -10px; -- UGYLDIG CSS. Bør være margin-bottom eller justert bottom/padding. */
    margin-bottom: -10px; /* Beholdt din intensjon, men dette vil flytte streken for langt ned. */
}
a.custom-button::after { /* For lenker du vil style som knapper med understrek */
    margin-bottom: -10px; /* FORSIKTIG: Dette flytter streken ned. */
}

button:hover::after,
a.custom-button:hover::after {
    transform: scaleX(1);
    transform-origin: bottom center;
}
button:hover::after {
    /* padding-bottom: -10px; -- UGYLDIG CSS. */
    margin-bottom: -10px; /* Som over. */
}
a.custom-button:hover::after {
    margin-bottom: -10px; /* FORSIKTIG: Dette flytter streken ned. */
}

/* For a-tagger som skal se ut som knapper (som i prosjektkortene dine) */
a.custom-button {
    display: inline-block;
    position: relative;
    padding: 8px 15px; /* Eksempel-padding, juster etter behov */
    color: white;
    text-decoration: none;
    font-size: 20px; /* Fra din inline-style i HTML */
}


/* === KONTAKTSKJEMA === */
.contact-cover h2 {
    text-align: center;
    margin-bottom: 20px;
}

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background: transparent;
    color: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* === FOOTER === */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}
footer p {
    margin: 5px 0;
    font-size: 0.9rem;
}
footer .bi-heart-fill {
    color: red;
    position: relative;
    top: 2px;
}

/* === MEDIA QUERIES === */
@media (max-width: 992px) {
  body {
    height: 500vh;
  }
  .cover {
    grid-template-columns: 1fr;
    height: auto;
    margin-top: 25vh;
    padding-left: 15px;
    padding-right: 15px;
    width: auto;
  }
  .cover .about h1 {
    font-size: 2rem;
  }
  .cover .about p {
    font-size: 0.95rem;
  }
  .cover .visual {
    margin-top: 30px;
  }
  .card-container {
    grid-template-columns: 1fr;
  }
  nav ul { /* Endret fra bare 'ul' */
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 768px) {
  /* body { height: 500vh; } -- Arves fra 992px */
  .cover {
    margin-top: 25vh;
    padding-left: 10px;
    padding-right: 10px;
  }
  .cover .about h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  .cover .about p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .cover .about .social-clickable {
    font-size: 2.5rem !important;
    margin-left: 10px !important;
  }
   .cover .about .social-clickable:first-of-type {
        margin-left: 0 !important;
    }
  /* .card-container { grid-template-columns: 1fr; } -- Arves fra 992px */
}