/* ------------------------------------------------------------------------ */
/* IMPORTANT; Custom overrides from the default oat.min.css 				*/
/*  - Comments are NOT removed from this  									*/
/* ------------------------------------------------------------------------ */

/* Default/Light Theme Variables */
:root {  
  --background: light-dark(#F4EEEB, #383838); /* rgb(255 255 255); Alt. F3F0EB,  */
  --text-color: light-dark(#000000, #f0f0f0);
  --primary: #D38337;  /* Primary buttons  (Blue: #00a8f6) (Green: #00A866) (Orange: #ed9856)*/    
//  --primary-foreground: #FF9742; /* Text color on primary buttons */
//  --secondary: #10b981;
  --card: rgb(240 240 240); /* Card background */
//  --border: light-dark(#00d4d8, #0052ff); /* ALL borders (buttons, cards etc */
  --shadow-none: 0 0px 0px 0 rgb(0 0 0 / .1);
  --link-internal: light-dark(#B56027, #ffB886); /* primary  (light => Red: C42B2B, Green: 008e55, 3A844A)*/
  --link-external: light-dark(#5883D8, #83A2DB);
  --image-border: light-dark(#444444, #666666);
  
  --gradient-light-blue: #94cbf5;
  --gradient-light-purple: #b578eb;
  --gradient-light-orange: #ff9169 80%;
  --gradient-blue: #64abe5;
  --gradient-purple: #9558cb;
  --gradient-multi-1: #0a84ff 0%;
  --gradient-multi-2: #b833e1 40%;
  --gradient-multi-3: #ff7139 80%;
}

/* Custom Dark Theme Overrides */
[data-theme="dark"] {
  --primary: #ffB886; /* (Purple: #ff46e5); */
//  --primary-foreground: #FF9742; /* Text color on primary buttons */
//  --secondary: #10b981;
  --card: rgb(90 90 90); /* Card background */
  --oat-bg: #333333;
}
/* ------------------------ */
/* Misc Overrides 			*/
/* ------------------------ */

[data-topnav] { /* Light AND Dark mode (default) */
  --border: light-dark(var(--light-border), var(--dark-border));
  --light-border: #DEDCDB;
  --dark-border: #222222;      
  background-color: light-dark(#FFFFFF, #2b2b2b); 
//background-color: light-dark(#F9F6F2, #28282a); 
  box-shadow: var(--shadow-large);  
} 

[data-theme="dark"] [data-topnav] {
	box-shadow: var(--shadow-large);
}
aside[data-sidebar] { 
  --border: light-dark(var(--light-border), var(--dark-border));
  --light-border:  #DEDCDB;
  --dark-border:  #222222;    
  border-inline-end: none; /* Remove border */
  background-color: var(--background); /* light-dark(#ffffff, #383838);    */
  box-shadow: none;  /* NOT light-dark aware i oat   */
  /* margin-left: 20px; => sidebar hidden on mobile  */
  /* padding: 5px 15px; */
}
aside[data-theme="dark"] [data-sidebar]  { 
  box-shadow: none;  /* NOT light-dark aware i oat */
}
 
a:hover {
  text-decoration: underline;  
  font-weight: bold; 
}
/* .main */
a {  
  font-weight: bold; /* 100: thin, 400: Normal, 700:Bold => men ikke alle fonter støtter dette !*/
  text-decoration: none;
}

/* .main */
i {
	color: light-dark(#995555, #bbbbbb)
}
b {
	color: light-dark(#111111, #f5e6c8)	
}

.sub-list li {
  list-style-type: none;  /* Hollow circle for sub-items */
  color: var(--muted-foreground);
}
.sub-list li::before {
  content: "-";              /* Custom bullet character */
  /* color: #ef4444;  */           /* Bullet color (red) */
  margin-right: 6px; 
  font-weight: bold;
}
.accordion-list {
	color: light-dark(#111111, #f5e6c8)
}

/* Different color for external vs internal links */
a:not(.button) { color: var(--link-internal); }
 a[href^="http"]:not([href*="codexmemex.com"]):not(.no-icon),
 a[href^="//"]:not([href*="codexmemex.com"]):not(.no-icon) {
  color: var(--link-external);
}
/* External-link symbol indicator
a[href^="http"]:not([href*="codexmemex.com"]):not(.no-icon)::after,
  a[href^="//"]:not([href*="codexmemex.com"]):not(.no-icon)::after {
  content: '\2197'; 
  display: inline-block;
  margin-left: 5px;
  font-size: 0.9em;
}
*/


.very-large-header {	
  font-size: var(--text-1)
}
.large-header {	
  font-size: 1.3rem;
}


g-1 {
  /* background: linear-gradient(90deg, #ff00cc, #3333ff); */
   background: light-dark(linear-gradient(105deg, var(--gradient-multi-1), var(--gradient-multi-2), var(--gradient-multi-3)), 
   						 linear-gradient(105deg, var(--gradient-light-purple), var(--gradient-light-orange), var(--gradient-blue))  );
  /* background: light-dark(linear-gradient(to right, var(--gradient-multi-1), var(--gradient-multi-2) ), */
/* 						 linear-gradient(to right, var(--gradient-blue), var(--gradient-purple))  ); */
  
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* font-weight: bold; */
}
	
.gradient { /* Example use: <h1 class="title"><span class="gradient">Why</span> Codex Memex ?</h1>   */  
  background: light-dark(linear-gradient(105deg, var(--gradient-multi-1), var(--gradient-multi-2), var(--gradient-multi-3)),
						 linear-gradient(to right, var(--gradient-blue), var(--gradient-purple))  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.image-box-shadow {
  box-shadow: 10px 10px 20px rgba(30, 30, 30, 0.5);   
  border-radius: 8px; /* => rounded corners (not with screenshots) */
}
[data-theme="dark"] .image-box-shadow {
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.9);
  border-radius: 8px; /* => rounded corners (not with screenshots) */
}
.image-box-shadow-small {
  box-shadow: 4px 4px 10px rgba(30, 30, 30, 0.5);   
  border-radius: 4px; /* => rounded corners (not with screenshots) */
}
[data-theme="dark"] .image-box-shadow-small {
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.9);
  border-radius: 4px; /* => rounded corners (not with screenshots) */
}

.zoom-thumb {
	border: 1px solid var(--image-border); /* Hvis border-radius, MÅ det være solid her */
	border-radius: 8px; /* => rounded corners (not with screenshots) */
}
.no-radius {
	border-radius: 0px; /* => rounded corners (not with screenshots) */
}
body.home {
  section {
    margin-bottom: var(--space-12);
  }

  nav[data-topnav] {
    .favicon {
      display: inline-block;
    }
    .logo {
      display: none;
    }
  }
}
body:not(.home) {
  nav[data-topnav] {
    .favicon {
      display: none;
    }
    .logo {
      display: inline-block;
    }
  }
}


/* ------------------------------------------ */
/* Zoom animation on the dialog image */
.zoom-img {
  transform: scale(0.8);
  opacity: 0;
  transition: transform 2.3s ease, opacity 2.3s ease; /* Does not work due to opening Dialog */
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.4);
  border-radius: 8px; /* => rounded corners (not with screenshots) */
  border: 1px solid var(--image-border);; /* Hvis border-radius, MÅ det være solid her */
}

/* Animate in when dialog opens */
dialog[open] .zoom-img {
  transform: scale(1);
  opacity: 1;
}
dialog {  
  color: var(--oat-color, CanvasText);
  background-color: var(--oat-bg, Canvas);
}
/* Make the Oat dialog fill (nearly) the entire window */
dialog#zoom-dialog,
dialog#zoom-dialog:modal {
  width: 90vw;        /* 95% of viewport width - changed to 90 */
  height: 90vh;       /* 95% of viewport height */
  max-width: 90vw;    /* override Oat's smaller max-width  */
  max-height: 90vh;   /* override Oat's smaller max-height */
  margin: auto;       /* center it */
  padding: 0;         /* remove default padding so image fills space */
}

/* Fade-in animation works with this - but not very pretty anyway, so removed
dialog#zoom-dialog[open] {
  animation: zoom-in 0.8s ease forwards;
}
@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
*/

dialog#zoom-dialog figure {
  margin: 20px;             /* NEW — removes browser default left margin */
  display: flex;
  flex-direction: column;
  align-items: center;   /* NEW — center children horizontally */
  max-width: 100%;
  max-height: 100%;
}

dialog#zoom-dialog img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;   /* preserves aspect ratio */
}

dialog#zoom-dialog figcaption {
  text-align: center;    /* NEW — center the caption text */
  padding: 1rem;
  /* color: #fff; */
}

/* Backdrop dimming */
dialog#zoom-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

/* Caption text styling */
dialog#zoom-dialog figcaption {
  /* color: #fff; */
  text-align: center;
  padding: 1rem;
}

/* Close button */
dialog#zoom-dialog button {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

/* ------------------------------------------ */
.carousel {
    position: relative;
    max-width: 800px;
    margin: 2rem auto;
    overflow: hidden;
	border-radius: 8px; /* => rounded corners (not with screenshots) */
  }

  .carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
  }

  .carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
  }

  .carousel-slide figure {
    margin: 0;
  }

  .carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 4px;
    z-index: 10;
  }

  .carousel-btn.prev { left: 0px; }
  .carousel-btn.next { right: 0px; }
  .carousel-btn:hover { background: rgba(0, 0, 0, 0.8); }

  .carousel-dots {
    text-align: center;
    margin-top: 0.5rem;
  }

  .carousel-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: #bbb;
    border-radius: 50%;
    cursor: pointer;
  }

  .carousel-dot.active { background: #333; }

/* ------------------------------------------ */
nav[data-topnav] {
  font-size: var(--text-7);

  button[data-sidebar-toggle] {
    margin-left: calc(-1.1*var(--space-4));
    left: 0;
    height: 100%;
    border: 0;
    margin-right: 10px;
    padding: 6px 10px;
    line-height: 1;
    color: var(--foreground);
    transition: background-color var(--transition-fast), transform var(--transition-fast);

    &:hover {
      background-color: var(--accent);
    }

    &:active {
      transform: translateY(1px);
    }

    svg {
      opacity: 0.8;
    }
  }
  
  a, button { /* Both <a href and <button */
    color: var(--muted-foreground);
  }
  .button { /* class="button" */
	color:  light-dark(white, black); 
  }

  img {
    height: 24px;
  }

  .branding {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .favicon {
    line-height: 1;
  }

  .hstack {
    gap: var(--space-6);
  }
}

.footer {
  margin: var(--space-6) 0;
}

.intro {
  margin-bottom: var(--space-12);
  .logo img {
    max-height: 60px;
  }
  .title {
    margin-bottom: var(--space-2);
  }
  .slogan {
    margin: 0 0 var(--space-10) 0;
    font-weight: normal;
  }
}

.features-2 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: var(--space-12);  
}
.features-3 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--space-4);  
  padding: 0px;
}
.card-tight {
	padding:var(--space-3);
}

.main-sidebar {
  .logo {
    border-bottom: none;
    padding-bottom: var(--space-4);
    img {
      max-height: 40px;
    }
  }
  nav sup {
    color: var(--muted-foreground);
    font-size: var(--text-8);
    margin-left: var(--space-1);
  }
  footer button {
    width: 100%;
  }
}


/* Swap theme icons */
html[data-theme="dark"] .icon-dark {
  display: none;
}
html:not([data-theme="dark"]) .icon-light {
  display: none;
}

@layer components {
  .container {
    max-width: 900px;
  }
}

.section-permalink {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--text-7);
  color: var(--muted-foreground);
}

.section-permalink:hover {
  color: var(--foreground);
}

pre {
  position: relative;

  code {
    display: block;
  }

  menu.actions {
    opacity: 0;
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    transition: opacity 150ms ease-in-out;
  }

  &:hover menu.actions {
    opacity: 1;
  }

  menu.actions button {
    background: rgba(0, 0, 0, .4);
    color: #bbb;
    border: 1px solid #bbb;
    padding: 2px var(--space-3);
    margin-left: 5px;
    &:hover {
      background-color: rgba(0, 0, 0);
    }
  }

  [contenteditable] {
    outline: none;
  }
}



/* ------------------------------------------------------------------------ */
/*	KEN BURNS image animation

	USE: 
	<div class="ken-burns-container">
		<img src="img/v01/screenshot-notes-1.webp" alt="Sample Image" class="ken-burns-image">
	</div>
*/
.ken-burns-container {
  width: 600px;         /* Adjust to your needs */
  height: 400px;        /* Adjust to your needs */
  overflow: hidden;     /* Hides the image as it expands */
  position: relative;
}
.ken-burns-image {
  width: 100%;
  height: 100%;
  object-fit: cover;    /* Ensures image fills container without distortion */
  /* animation: kenburns 10s ease-in-out infinite alternate; */
  animation: kenburns 10s ease-in-out;
}
@keyframes kenburns {
  0% {
    /* Zoom in slightly and pan toward the top-right */
    transform: scale(1.2) translate(-5%, -5%);
  }
  100% {    
	transform: scale(1) translate(0, 0);
  }
}
/* ------------------------------------------------------------------------ */







/* ------------------------------------------------------------------------ */
/* SVG MASK FOR PHOTOS (TEST)
------------------------------------------------------------------------ */
 .hero {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 1. The image layer */
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;

  /* Apply the SVG mask */
/*  -webkit-mask-image: url(#spotlight-mask);  /* url("img/mask.svg#spotlight"); */ 
/*  mask-image: url(#spotlight-mask);  /* url("img/mask.svg#spotlight"); */

/*
 -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='black' d='M140 30 C 175 45, 195 90, 180 135 C 165 180, 110 200, 70 180 C 30 160, 10 100, 35 60 C 60 20, 105 15, 140 30 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='black' d='M140 30 C 175 45, 195 90, 180 135 C 165 180, 110 200, 70 180 C 30 160, 10 100, 35 60 C 60 20, 105 15, 140 30 Z'/%3E%3C/svg%3E");
*/
  
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='black' d='M100 0 C 145 0, 175 15, 190 50, 200 100, 190 150, 175 185, 145 200, 100 200, 55 200, 25 185, 10 150, 0 100, 10 50, 25 15, 55 0, 100 0 Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='black' d='M100 0 C 145 0, 175 15, 190 50, 200 100, 190 150, 175 185, 145 200, 100 200, 55 200, 25 185, 10 150, 0 100, 10 50, 25 15, 55 0, 100 0 Z'/%3E%3C/svg%3E");
  

  /* Dette eksempelet fungerer, men ikke lokale filer - må enten ha localhost for testing, eller laste opp svg til min egen server (etterhvert) */
//mask-image: url("https://assets.codepen.io/1101822/circles-mask-whole.svg");  /* url("img/mask.svg#spotlight"); */

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* 2. The dimming overlay */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: transparent // rgba(0, 0, 0, 0.65);
  z-index: 2;
}

/* 3. The text layer */
.hero__content {
  position: relative;
  z-index: 3;
  max-width: 600px;
  padding: 2rem;
}

.hero__content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero__content p {
  font-size: 1.25rem;
  line-height: 1.6;
}

.basic-shadow {
	/* font-size: 30px; */
	/* font-family: Arial, sans-serif; */
	/* Horizontal: 2px, Vertical: 2px, Blur: 0, Color: Gray */
	text-shadow: 2px 2px 0px gray;
}

.soft-shadow {
	font-size: 30px;
	font-family: Arial, sans-serif;
	/* Horizontal: 3px, Vertical: 3px, Blur: 5px, Color: semi-transparent black */
	text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
}





/* ------------------------------------------------------------------------ */
/* MOBILE */
/* ------------------------------------------------------------------------ */
/* Show sidebar-border only on mobile */
@media (max-width: 768px) {
  aside[data-sidebar] {
    border-inline-end: 1px solid var(--border);
    box-shadow: var(--shadow-small);
  }
}

@media (max-width: 768px) {
  .features {
    grid-template-columns: 1fr;
  }
  nav[data-topnav] .hstack {
    display: none;
  }
}
@media (max-width: 450px) {
  menu.actions button {
    &.btn-edit {
      display: none;
    }
  }
}
