/* =========================================
   INFOSIDER – STYRET
========================================= */

.board-section {
  --board-btn: #3d0000;
  --board-btn-hover: #520808;
  --board-radius: 24px;
  --board-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;

  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 8px;
  box-sizing: border-box;
  font-family: var(--board-font);
  -webkit-font-smoothing: antialiased;
}

.board-section *,
.board-section *::before,
.board-section *::after {
  box-sizing: border-box;
}

/* Valgfri overskrift */
.board-intro { text-align: center; margin: 0 auto 40px; max-width: 640px; }
.board-intro h2 { margin: 0 0 10px; font-family: var(--board-font); font-weight: 600; letter-spacing: -0.02em; }
.board-intro p { margin: 0 0 10px; color: #6e6e73; font-size: 17px; line-height: 1.5; }

.board-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

/* =========================================
   KORT
========================================= */

.board-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--board-radius);
  background: #111;
  isolation: isolate;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1), box-shadow 0.5s cubic-bezier(.2, .8, .2, 1);
}

.board-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 20px 48px rgba(0, 0, 0, 0.16);
}

/* =========================================
   BILDE
========================================= */

.board-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #111;
}

.board-photo img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover;
  object-position: var(--x, 50%) var(--y, 35%);
  transform: scale(var(--z, 1));
  transform-origin: var(--x, 50%) var(--y, 35%);
  transition: transform 0.8s cubic-bezier(.2, .8, .2, 1), filter 0.5s ease;
}

.board-card:hover .board-photo img {
  transform: scale(calc(var(--z, 1) * 1.04));
}

/* Myk toning bak teksten */
.board-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.25) 62%,
    rgba(0, 0, 0, 0.72) 85%,
    rgba(0, 0, 0, 0.88) 100%
  );
  pointer-events: none;
}

/* =========================================
   TEKST
========================================= */

.board-card-content {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 22px 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 0.4s ease;
}

.board-section .board-name {
  margin: 0 0 4px !important;
  color: #fff !important;
  font-family: var(--board-font) !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.022em !important;
  text-transform: none !important;
}

.board-section .board-role {
  margin: 0 0 16px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  font-family: var(--board-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.005em !important;
}

/* =========================================
   LES MER
========================================= */

.board-section .board-details {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-section .board-button {
  order: 2;
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start;
  gap: 10px !important;
  width: auto !important;
  margin: 0 !important;
  padding: 7px 8px 7px 16px !important;
  list-style: none !important;

  background: var(--board-btn) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);

  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-family: var(--board-font) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
  text-decoration: none !important;

  cursor: pointer !important;
  user-select: none;
  transition: background-color 0.25s ease, transform 0.25s ease !important;
}

.board-section .board-button::-webkit-details-marker { display: none; }
.board-section .board-button::marker { content: ""; }

.board-section .board-button:hover {
  background: var(--board-btn-hover) !important;
}

.board-section .board-button:active {
  transform: scale(0.97);
}

.board-section .board-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Pluss-ikon som blir til kryss */
.board-section .board-button::after {
  content: "";
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) center / 10px 1.5px no-repeat,
    linear-gradient(#fff, #fff) center / 1.5px 10px no-repeat,
    rgba(255, 255, 255, 0.14);
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
}

.board-section .board-details[open] .board-button::after {
  transform: rotate(45deg);
}

.board-section .board-button .tekst-lukk { display: none; }
.board-section .board-details[open] .board-button .tekst-apne { display: none; }
.board-section .board-details[open] .board-button .tekst-lukk { display: inline; }

/* =========================================
   BIOGRAFI – glasspanel over bildet
========================================= */

.board-card:has(.board-details[open]) .board-card-content {
  top: 0;
  padding-top: 28px;
  background: rgba(24, 6, 6, 0.62);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
}

.board-card:has(.board-details[open]) .board-photo img {
  transform: scale(calc(var(--z, 1) * 1.08));
}

.board-card:has(.board-details[open]) .board-details {
  flex: 1;
}

.board-section .board-details[open] .board-button {
  margin-top: auto !important;
}

.board-bio {
  order: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 0 18px;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  animation: board-inn 0.45s cubic-bezier(.2, .8, .2, 1);
}

.board-bio p { margin: 0 0 12px; color: inherit !important; font-size: inherit; line-height: inherit; }
.board-bio p:last-child { margin-bottom: 0; }

@keyframes board-inn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Når biografien er åpen, flyttes navnet opp til toppen av panelet */
.board-card:has(.board-details[open]) .board-card-content {
  justify-content: flex-start;
}

/* =========================================
   NETTBRETT
========================================= */

@media (max-width: 900px) {
  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .board-section .board-name { font-size: 20px !important; }
}

/* =========================================
   MOBIL
========================================= */

@media (max-width: 560px) {
  .board-section { padding: 16px 4px; }
  .board-grid { grid-template-columns: 1fr; gap: 18px; }
  .board-card { aspect-ratio: 4 / 5; }
  .board-card-content { padding: 22px 20px 20px; }
  .board-section .board-name { font-size: 22px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .board-card,
  .board-photo img,
  .board-bio { transition: none !important; animation: none !important; }
}
