.account-page {
  max-width: 1040px;
}

.account-profile-card,
.account-preferences {
  border-radius: 14px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.account-img {
  display: block;
  margin: 0;
  object-fit: cover;
}

.avatar-picker {
  position: relative;
  display: block;
  flex: 0 0 125px;
  width: 125px;
  height: 125px;
  overflow: hidden;
  border: 3px solid var(--bg-panel);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-primary), var(--shadow-lg);
  cursor: pointer;
}

.avatar-picker:focus-within {
  outline: 3px solid var(--accent-primary);
  outline-offset: 4px;
}

.avatar-picker-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(0, 0, 0, .68);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.avatar-picker:hover .avatar-picker-overlay,
.avatar-picker:focus-within .avatar-picker-overlay {
  opacity: 1;
}

.avatar-picker-overlay svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
}

.account-eyebrow {
  margin: 0 0 .3rem;
  color: var(--accent-primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.account-heading {
  margin-bottom: .25rem;
}

.avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.avatar-upload-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text-secondary);
  font-size: .9rem;
}

.avatar-upload-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 14%, transparent);
  border-radius: 50%;
  font-weight: 800;
}

.preferences-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.preference-title {
  margin-bottom: .8rem;
  font-family: var(--font-sans);
  font-size: .85rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.selection-card {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .65rem;
  padding: .8rem .7rem;
  color: var(--text-primary);
  text-align: left;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
}

a.selection-card:hover,
a.selection-card:focus,
button.selection-card:hover,
button.selection-card:focus {
  color: var(--text-primary);
  text-decoration: none;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  outline: none;
}

.selection-card:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 35%, transparent);
}

.selection-card.is-selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-sm);
}

.selection-card:disabled {
  cursor: wait;
  opacity: .7;
}

.selection-card-icon,
.theme-swatch {
  display: inline-flex;
  flex: 0 0 2rem;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  border-radius: 8px;
}

.theme-swatch {
  border: 1px solid var(--border-strong);
}

.swatch-dark { background: linear-gradient(135deg, #111827 50%, #3b82f6 50%); }
.swatch-light { background: linear-gradient(135deg, #ffffff 50%, #dbeafe 50%); }
.swatch-sepia { background: linear-gradient(135deg, #fff3e8 50%, #f56a00 50%); }

.selection-card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.selection-card-content strong {
  overflow: hidden;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-card-content small {
  margin-top: .18rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-indicator {
  position: absolute;
  top: -.42rem;
  right: -.42rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  background: var(--accent-primary);
  border: 2px solid var(--bg-panel);
  border-radius: 50%;
}

.preference-status {
  min-height: 1.3rem;
  color: var(--text-secondary);
  font-size: .85rem;
}

@media (max-width: 767.98px) {
  .content-section { padding: 28px 20px; }
  .account-identity { align-items: flex-start; }
  .selection-grid { grid-template-columns: 1fr; }
}
/* ========================================= */
/* 1. MASTER THEME VARIABLES                 */
/* ========================================= */

:root {
  /* Typography */
  --font-serif: 'Merriweather', serif;
  --font-sans: 'Open Sans', 'Merriweather Sans', sans-serif;
  --transition-speed: 300ms;

  /* Default Theme: (Dark) */
  --bg-base: #121214;
  /* Deepest background */
  --bg-panel: #1e1e24;
  /* Elevated surface (Cards, Sections) */
  --bg-hover: #2a2a35;
  /* Interactive elements */
  --bg-glass: rgba(18, 18, 20, 0.85);

  --text-primary: #f8f9fa;
  /* High contrast text (Headings, data) */
  --text-secondary: #adb5bd;
  /* Muted text (Labels, descriptions) */
  --text-tertiary: #7f8488;
  /* Muted text (Labels, descriptions) */

  --border-subtle: #2d2d36;
  /* Dividers, table borders */
  --border-strong: #495057;
  /* Inputs, active states */

  --accent-primary: #428bca;
  /* Links, Primary Buttons */
  --accent-hover: #3071a9;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
}



/* Theme Override: LIGHT MODE (Crisp & Clinical) */
body.theme-light {
  --bg-base: #f4f5f7;
  --bg-panel: #ffffff;
  --bg-hover: #e9ecef;
  --bg-glass: rgba(244, 245, 247, 0.85);

  --text-primary: #212529;
  --text-secondary: #6c757d;

  --border-subtle: #dee2e6;
  --border-strong: #ced4da;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
}

/* Theme Override: Sepia (Warm & Historical) */
body.theme-sepia {
  /* Backgrounds mapped from the new soft support and tinted colors */
  --bg-base: #f7f4f2;
  --bg-panel: #fff3e8;
  --bg-hover: #ffe0c7;
  --bg-glass: rgba(255, 243, 232, 0.85);
  /* #fff3e8 at 85% opacity */

  /* Text mapped from the deepest primary warm browns for high contrast */
  --text-primary: #210c00;
  --text-secondary: #7c3500;

  /* Borders mapped from the new subtle and default border colors */
  --border-subtle: #ffe0c7;
  --border-strong: #ff9c54;

  /* Accents mapped from the new primary accent and strong hover states */
  --accent-primary: #f56a00;
  --accent-hover: #b94f00;

  /* Shadows tinted with the new --text-primary RGB (33, 12, 0) */
  --shadow-sm: 0 2px 4px rgba(33, 12, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(33, 12, 0, 0.1);
}

/* ========================================= */
/* 2. BASE STYLES & TYPOGRAPHY               */
/* ========================================= */

body {
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  /* UI gets Sans by default */
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

body::-webkit-scrollbar {
  width: 0.5rem;
}

body::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

body::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-header,
.article-title,
.card-title {
  color: var(--text-primary);
  font-family: var(--font-serif);
  font-weight: 800;
}

main {
  margin-left: 70px;
  /* padding: 1rem; */
}

.content-section,
.infobox,
.card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-speed) ease;
}

.content-section {
  padding: 40px 30px;
  margin-bottom: 20px;
}

.list-group-item {
  color: var(--text-secondary);
  background-color: var(--bg-panel);
  border-color: var(--border-subtle);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.jumbotron,
.archive-container {
  background-color: var(--bg-panel);
}

.alert-light {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  border-color: var(--border-subtle);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: 0px !important;
}

h1 {
  font-weight: 800;
}

.bg-steel {
  background-color: #314757;
}

.royal-purple {
  background-color: #7851a9;
}

.dark-blue {
  background-color: #5156a9;
}

.gold {
  background: linear-gradient(to bottom, #cfc09f 27%, #ffecb3 40%, #a67f2f 78%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
  position: relative;
  margin: 0;
}

.gold::after {
  background: none;
  content: attr(data-heading) / "";
  left: 0;
  top: 0;
  z-index: -1;
  position: absolute;
  text-shadow:
    -1px 0 1px #c6bb9f,
    0 1px 1px #c6bb9f,
    5px 5px 10px rgba(0, 0, 0, 0.4),
    -5px -5px 10px rgba(0, 0, 0, 0.4);
}

.gold::marker {
  content: "❤";
  color: #ff0000;
  -webkit-text-fill-color: transparent;
  font-size: 1.2em;
  margin-right: 0.5em;
}

.content-block {
  padding: 4rem 2rem;
}


/* ------------------------ */
/* --------NAV BAR--------- */
/* ------------------------ */

.menu-dropdown .icon svg {
  fill: currentColor;
  height: 2em;
  width: auto;
  transition: fill var(--transition-speed) ease;
}

.menu-dropdown li:hover .icon svg {
  fill: var(--accent-hover);
}

.navbar {
  color: #cbd5db;
  height: 3.5rem;
}

.site-header .navbar-nav .nav-link {
  color: #cbd5db;
  font-family: 'Merriweather', serif;
  font-weight: 800;
  font-size: 1em;
}

.site-header .navbar-nav .nav-link:hover {
  color: #ffffff;
}

.site-header .navbar-nav .nav-link.focus {
  color: #ffffff;
}

.form-control {
  color: var(--text-primary);
  background-color: var(--bg-base);
  border: 1px solid var(--border-strong);
}

.form-control:focus {
  color: var(--text-primary);
  background-color: var(--bg-base);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 .2rem rgba(66, 139, 202, .25);
}

.infobox {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  /* Differentiates it slightly from the panel */
  position: relative;
  padding: .75rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-strong);
  border-radius: .25rem;
  line-height: 1.75;
}

.article-title {
  color: var(--text-primary);
  font-weight: 800;
  text-align: center;
}

.underline {
  position: relative;
}

.underline span {
  pointer-events: none;
}

.underline canvas {
  pointer-events: auto;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--text-primary);
  /*z-index: -1;*/
  user-select: none;
  -moz-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -o-user-select: none;
  cursor: pointer;
}

a.article-title:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

.article-content {
  white-space: pre-line;
  padding: 30px 30px 0px 0px;
}

.article-img {
  object-fit: cover;
  max-height: 65px;
  max-width: 65px;
  margin-right: 16px;
}

.article-metadata {
  padding-bottom: 1px;
  margin-bottom: 4px;
}

/*
  .article-metadata a:hover {
    color: #333;
    text-decoration: none;
  }
  */

.article-svg {
  width: 25px;
  height: 25px;
  vertical-align: middle;
}

.profilmeny .profil-bio ul li {
  flex: revert;
  width: 100%;
  padding: 0 10px;
  text-align: left;
  list-style-type: square;
}

.account-img {
  height: 125px;
  width: 125px;
  margin-right: 20px;
  margin-bottom: 16px;
}

.account-heading {
  font-size: 2rem;
}

.card-img-top {
  filter: contrast(80%);
  height: 14rem;
  object-fit: cover;
  object-position: 50% 20%;
  transition: all 0.5s cubic-bezier(.43, .41, .22, .91);
}

.card:hover .card-img-top {
  filter: contrast(100%);
}

.card {
  background-color: rgb(0, 0, 0, 0.4);
  border-radius: 0.25rem;
  box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .5);
  width: 15rem;
}

.card:hover {
  border-radius: 0.25rem;
  box-shadow: 0 30px 40px -16px rgba(0, 0, 0, .5);
}

.card-body {
  padding: 0rem;
}

.card-title {
  margin-bottom: .5rem;
  font-weight: 800;
  font-size: .8em;
  color: var(--text-primary);
}

.card-title a {
  display: block;
  padding: 1rem;
}

.card a {
  color: var(--text-primary);
}

.card-title a:hover {
  text-decoration: underline;
}

.card-text {
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 400;
  font-size: .8rem;
}

.card-hidden-content {
  display: none;
}

.card-body:hover>.card-hidden-content {
  display: block;
}

.zoom-in {
  cursor: zoom-in;
}

.themed-input {
  background-color: var(--bg-base) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-strong) !important;
  transition: all var(--transition-speed) ease-in-out;

}

.themed-input::placeholder {
  color: var(--text-tertiary) !important;
}

.themed-input:focus {
  background-color: var(--bg-panel) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 0.25rem var(--bg-hover) !important;
}

.themed-label {
  color: var(--text-secondary);
}

.ai-choice-card {
  cursor: pointer;
  background-color: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  border-radius: 0.375rem;
  transition: all var(--transition-speed) ease-in-out;
  opacity: 0.65;
  padding: 1em;
}

.ai-choice-card:hover:not(.locked-card) {
  border-color: var(--border-strong);
  background-color: var(--bg-hover);
  opacity: 0.9;
}

.ai-choice-card.active-choice {
  border-color: var(--accent-primary);
  background-color: var(--bg-hover);
  opacity: 1;
  box-shadow: var(--shadow-sm);
}

/* Card Typography & Badges */
.ai-choice-card .ai-title {
  color: var(--text-primary);
  transition: color var(--transition-speed) ease-in-out;
}

.active-choice .ai-title {
  color: var(--accent-primary);
}

.ai-choice-card .ai-desc {
  color: var(--text-secondary);
}

.ai-choice-card .ai-badge {
  background-color: var(--bg-base);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.25em 0.6em;
  border-radius: 0.25rem;
  font-size: 0.75em;
  font-weight: 700;
  transition: all var(--transition-speed) ease-in-out;
}

.active-choice .ai-badge {
  background-color: var(--accent-primary);
  color: var(--bg-panel);
  border-color: var(--accent-primary);
}

.locked-card {
  cursor: not-allowed;
  opacity: 0.4;
  background-color: var(--bg-base);
  filter: grayscale(100%);
}

.locked-text {
  color: var(--accent-hover);
}

.gaudygoldframe {
  border: 20px solid transparent;
  padding: 0px;
  object-fit: cover;
  border-image: url(images/uglyframe.jpg) 50 round;
  box-shadow: 0 5px 7px -5px rgba(0, 0, 0, 5);
  margin-top: 13px;
}

.btn {
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
  color: white;
}

.modal-content {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
}

.table {
  color: var(--text-secondary);
}

.table thead th {
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-strong);
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table td,
.table th {
  border-top: 1px solid var(--border-subtle);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.03);
  /* Works in both light/dark */
}

.table-hover tbody tr:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}


/*  Når tabellen ekspanderes i mobilvisning */

td.child {
  background-color: var(--bg-hover);
  background-image: repeating-linear-gradient(0deg, var(--bg-hover), var(--bg-hover) 2px, var(--bg-panel) 2px, var(--bg-panel) 4px);
  border: 1px solid var(--border-subtle);
  padding: 10px 10px;
  list-style: none;
}

td.child>ul>li {
  list-style: none;
  font-size: .8rem;
}

td.child>ul>li>a>img {
  margin: 0rem !important;
}

td.child>ul {
  margin-bottom: 0rem;
}


/* END DATATABLES */


.page-item.active .page-link {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff !important;
}

.page-item.disabled .page-link {
  background-color: var(--bg-base);
  border-color: var(--border-subtle);
  color: var(--text-secondary) !important;
}

.page-link:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary) !important;
  border-color: var(--border-strong);
}

.page-link {
  position: relative;
  display: block;
  padding: .5rem .75rem;
  margin-left: -1px;
  line-height: 1.25;
  color: var(--accent-primary);
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-speed) ease;
}

.list-group-item-darker {
  color: var(--text-secondary);
  background-color: var(--bg-hover);
}

.list-group-item-darker:active {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.list-group-item-darker:hover {
  z-index: 1;
  color: var(--text-primary);
  text-decoration: none;
  background-color: var(--border-subtle);
}

.archive-picture {
  border-radius: 3px;
  max-width: 1100px;
}

.archive-entry {
  width: max-content;
  margin: 0 auto;
}

.archive-description {
  display: inline-block;
  width: 100%;
}

.fill-height {
  min-height: calc(100vh - 2rem);
}

.galleryimage {
  max-width: 12vw;
}

.index-svg-icons {
  fill: var(--text-primary);
  height: 1.2em;
  vertical-align: bottom;
  margin-right: 0.1em;
  transition: all 0.2s ease-in-out;
  margin-left: 0.8em;
}



hr {
  border-top: 1px dotted var(--border-strong);
  margin-right: 14rem;
  margin-left: 1rem;
}

/* ========================= */
/* -------- MOBILE  -------- */
/* ========================= */

@media (max-width: 768px) {

  main {
    margin-left: 0px;
  }

  .content-block {
    padding: 2rem 15px;
  }

  .archive-entry {
    width: 100%;
  }

  hr {
    margin-right: 1rem;
  }

  .galleryimage {
    max-width: 45%;
    margin-bottom: 10px;
  }

  .infobox,
  .article-content,
  .card-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .primary-nav>.hamburger {
    display: none !important;
  }

  .mobile-bottom-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: var(--bg-glass);
    /* Dynamic Blur Background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    z-index: 9999;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    /* Dynamic Text */
    text-decoration: none;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 700;
    width: 100%;
    height: 100%;
    transition: color 0.2s ease;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:active {
    color: var(--accent-primary);
    /* Highlights the icon when tapped */
    text-decoration: none;
  }

  .bottom-nav-item svg {
    height: 24px;
    width: 24px;
    margin-bottom: 4px;
    fill: currentColor;
  }

  main {
    padding-bottom: 90px !important;
  }

  /* Hide the vertical sidebar  */
  .primary-nav {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 10000;
    height: 100vh;
    width: 250px;
  }

  /* When the 'Mer' button is tapped (adds openNav to HTML), slide it in! */
  html.openNav .primary-nav {
    transform: translateX(0);
  }

  /* Add a dark shadow over the site when the menu is open */
  html.openNav body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    z-index: 9999;
    pointer-events: auto;
  }

}