/* ====== BASSTIL ====== */
body {
  background: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.8;
  overflow-y: auto;                  
  transition: background-color 1s ease;
}

/* ====== CONTAINER ====== */
#story-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
  position: relative;
}

/* ========================= */
/* BASSTIL FÖR ALLA BLOCK    */
/* ========================= */
.story-block {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  display: none;
}

.story-block.active {
  opacity: 1;
  pointer-events: auto;
  display: block;
}

/* ========================= */
/* TEXTBLOCK                 */
/* ========================= */
.story-block[id^="text"] {
  min-height: 100vh;              
  display: flex;
  flex-direction: column;
  justify-content: flex-start;    
  align-items: center;            
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: left;
}

.story-block[id^="text"] h1 {
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
}

.story-block[id^="text"] p {
  text-align: left;
  line-height: 1.6;
  font-size: 1.2rem;
  margin: 0 auto;
}

.story-block[id^="text"] p.centrerad-text {
  text-align: center !important;
}

/* ========================= */
/* BILDBLOCK                 */
/* ========================= */
.story-block[id^="img"] {
  position: absolute;             
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  max-width: 90%;
  text-align: center;
  min-height: auto;
  height: auto;
}

/* Bild i bildblock */
.story-block[id^="img"] img {
  max-width: 90% !important;      /* överstyr Bootstrap */
  height: auto !important;
  border: 5px solid #fff;
  box-shadow: 0 0 00px rgba(0,0,0,0.0);
  cursor: pointer;
  display: block !important;
  margin: 0 auto !important;
}

/* Bildblock med figcaption */
.story-block[id^="img"] figure {
  margin: 0 !important;           /* överstyr Bootstrap */
  text-align: center;
}

.story-block[id^="img"] figcaption {
  font-family: 'Questrial', sans-serif;
  font-size: 1.5rem;
  margin: 0.5rem 0 0 0 !important; /* överstyr Bootstrap */
  color: #292929;
  opacity: 0;
  animation: captionFadeIn 1.5s forwards;
  animation-delay: 0.5s;
}

@keyframes captionFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== TYPOGRAFI ====== */

/* Rubriker */
h1 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.8rem, 2vw + 1rem, 3rem); /* dynamisk storlek */
  margin-bottom: 1rem;
}

.h1-kapitel {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(2.5rem, 3vw + 1rem, 4rem); /* större, men också flytande */
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Brödtext */
p {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(1rem, 0.6rem + 1vw, 1.2rem); /* anpassar sig efter skärm */
  line-height: 1.6;
  margin: 0 auto;
  max-width: 600px; /* trevlig läsbredd på större skärmar */
}

/* Förordstext */
.p-forord {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(0.9rem, 0.5rem + 1vw, 1rem);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Bildtexter */
.story-block[id^="img"] figcaption {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(1rem, 0.8rem + 1vw, 1.5rem); /* flytande storlek */
  margin-top: 0.8rem;
  color: #292929;
  opacity: 0;
  animation: captionFadeIn 1.5s forwards;
  animation-delay: 0.5s;
  text-align: center;
}

/* Mobilanpassning för navbar */
@media (max-width: 767px) {
  .navmenu a {
    font-size: 1.1rem !important; /* större länktext */
  }

  .mobile-nav-toggle {
    font-size: 32px !important;   /* större hamburgermeny-ikon */
  }
}


/* ====== GÖMD LÄNK ====== */
.hidden-link {
  display: inline !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.hidden-link .bi {
  font-size: 3rem;
}

/* ====== KNAPP LOGIN ====== */
.btn-login {
  background-color: #c8e6c9 !important;
  border: none !important;
  color: #000 !important;
}

.btn-login:hover {
  background-color: #a5d6a7 !important;
  color: #000 !important;
}

/* ====== ÖVERGÅNGSEFFEKTER ====== */
.fade-in { animation: fadeIn 1s forwards; }
.fade-out { animation: fadeOut 1s forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

.slide-in-right { animation: slideInRight 0.8s forwards; }
.slide-out-left { animation: slideOutLeft 0.8s forwards; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutLeft { from { transform: translateX(0); opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }

.zoom-in { animation: zoomIn 0.8s forwards; }
.zoom-out { animation: zoomOut 0.8s forwards; }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes zoomOut { from { transform: scale(1); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }

.parallax-in { animation: parallaxIn 1s forwards; }
.parallax-out { animation: parallaxOut 1s forwards; }
@keyframes parallaxIn { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes parallaxOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }

.crossfade-in { animation: crossfadeIn 1.5s forwards; }
.crossfade-out { animation: crossfadeOut 1.5s forwards; }
@keyframes crossfadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes crossfadeOut { from { opacity: 1; } to { opacity: 0; } }

.word {
  opacity: 0;
  display: inline-block;
  animation: wordFadeIn 0.6s forwards;
  margin-right: 0.3em;
  white-space: pre;
}
@keyframes wordFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Neutralisera Bootstrap för länkar i story-block */
.story-block a,
.story-block a:visited,
.story-block a:hover,
.story-block a:active {
  color: #000 !important;
  text-decoration: none !important;
}

/* Transparent navbar */
.transparent-header {
  background: #4AC273 !important;
  box-shadow: none !important;
}

/* Textfärg i navbar */
.transparent-header .navmenu ul li a,
.transparent-header .sitename {
  color: #fff;
}

/* Hover-effekt */
.transparent-header .navmenu ul li a:hover,
.transparent-header .navmenu ul li a:focus {
  color: #ddd;
}

/* Dropdown bakgrund */
.transparent-header .navmenu ul li ul {
  background: rgba(0,0,0,0.8);
}
.transparent-header .navmenu ul li ul li a {
  color: #fff;
}
.transparent-header .navmenu ul li ul li a:hover {
  color: #4AC273;
}

/* ================================================== */
/* OVERRIDES EFTER KnightOne (main.css)               */
/* ================================================== */

/* Se till att story-container alltid börjar under navbaren */
#story-container {
  padding-top: 80px; /* matcha navbarens höjd */
}

/* Se till att p-taggar i story-block inte centreras av temat */
#story-container p {
  text-align: left;
}

/* Låt centrering fungera där du explicit vill */
#story-container p.centrerad-text {
  text-align: center !important;
}

/* Dropdown ska ligga över story-block */
header.header .navmenu .dropdown ul {
  z-index: 9999;
}

/* Tvinga logotypstorlek i navbar */
header.header .logo img {
  height: 80px !important;  /* ändra till 150px om du vill testa */
  width: auto !important;    /* behåll proportionerna */
  max-height: none !important; /* neutralisera KnightOne-begränsningen */
}

.navmenu a, .navmenu a:focus {
  color: rgba(0,0,0,0.7) !important; /* var(--nav-color) ersatt */
}

.navmenu>ul>li>a:before {
  background-color: #ffffff !important; /* var(--nav-hover-color) ersatt */
}

.navmenu .dropdown ul {
  background: #c8e6c9 !important; /* var(--nav-dropdown-background-color) ersatt */
}

.navmenu .dropdown ul a {
  color: #4C4C4C !important; /* var(--nav-dropdown-color) ersatt */
}

.navmenu .dropdown ul a:hover {
  color: #29692A !important; /* var(--nav-dropdown-hover-color) ersatt */
}

/* =========================================================
   MOBILVÄNLIG TYPOGRAFI & NAVMENU
   ========================================================= */

/* ====== RUBRIKER ====== */
h1 {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(1.8rem, 1.2rem + 1.5vw, 3rem); /* Skalar från mobil → desktop */
  margin-bottom: 1rem;
}

.h1-kapitel {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(2.2rem, 1.5rem + 2vw, 3.5rem); /* större för kapitelrubriker */
  font-weight: 700;
  margin-bottom: 1rem;
}

/* ====== BRÖDTEXT ====== */
p {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.3rem); /* skalar upp från mobil */
  line-height: 1.6;
}

.p-forord {
  font-size: clamp(0.9rem, 0.8rem + 0.3vw, 1.1rem); /* lite mindre & tightare */
  max-width: 600px;
  margin: 0 auto;
}

/* ====== FIGCAPTION (bildtexter) ====== */
.story-block[id^="img"] figcaption {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(1.2rem, 0.9rem + 0.5vw, 1.6rem); /* responsivt */
  margin: 0.5rem 0 0 0 !important;
  color: #292929;
  opacity: 0;
  animation: captionFadeIn 1.5s forwards;
  animation-delay: 0.5s;
}

/* ====== NAVMENU ====== */

/* Vanliga meny-länkar */
.navmenu a,
.navmenu a:focus {
  font-family: 'Exo 2', sans-serif;
  font-size: clamp(0.95rem, 0.8rem + 0.6vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Dropdown-länkar */
.navmenu .dropdown ul a {
  font-family: 'Questrial', sans-serif;
  font-size: clamp(0.9rem, 0.75rem + 0.5vw, 1rem);
  font-weight: 400;
}

/* Hamburgermenyns ikon */
.mobile-nav-toggle {
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.2rem);
}

/* =========================================================
   MOBILVÄNLIGA BILDER
   ========================================================= */

/* Standardbilder i story-block */
.story-block img {
  display: block;
  margin: 0 auto;
  height: auto;
  max-width: 90%; /* lite större på små skärmar än tidigare */
  transition: max-width 0.3s ease;
}

/* Extra justering för stående mobil → fyller nästan hela skärmen */
@media (max-width: 768px) {
  .story-block img {
    max-width: 95%;
  }
}

/* Större skärmar → behåll proportioner, men inte för stora */
@media (min-width: 1200px) {
  .story-block img {
    max-width: 75%;
  }
}

/* Bildblock med figcaption (säkerställ att allt centreras snyggt) */
.story-block[id^="img"] figure {
  margin: 0 auto !important;
  text-align: center;
  max-width: 100%;
}

/* =========================================================
   MOBILVÄNLIGA IKONER
   ========================================================= */

/* Grundinställning */
.bi {
  font-size: clamp(1.5rem, 2vw, 2.5rem); /* skalar mellan mobil och desktop */
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
}

/* Hover-effekt */
.bi:hover {
  transform: scale(1.1);
  color: #4AC273; /* samma gröna som i menyn */
}

/* Pilar i navigering mellan bilder */
.story-block .bi-arrow-left,
.story-block .bi-arrow-right {
  font-size: clamp(2rem, 3vw, 3.5rem); /* gör navigeringspilar lite större */
}

