/* Grundläggande stilar och variabler */
:root {
  --primary-color: #a93b01;
  --orange-color-1: #ffb662;
  --orange-color-2: #ffac4b;
  --orange-color-3: #f2c48f;
  --light-background: #fff0df;
  --text-color: #4a3f3a;
  --white: #ffffff;
  --black: #000000;

  /* Förbättrade font-stacks med Safari-fallbacks */
  --heading-font: "Londrina Solid", "Impact", "Arial Black", "Helvetica",
    sans-serif;
  --body-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, sans-serif;
}

/* Extra säkerhet för Safari */
@supports (font-display: swap) {
  h1,
  h2,
  h3,
  h4 {
    font-family: var(--heading-font);
    font-display: swap;
  }

  body {
    font-family: var(--body-font);
    font-display: swap;
  }
}

/* Prestanda-optimeringar */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  transform: translateZ(0);
  backface-visibility: hidden;
}

body {
  font-family: var(--body-font);
  background-color: var(--light-background);
  color: var(--text-color);
  line-height: 1.7;
  font-size: 1.1rem;
}

.container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 2rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--heading-font);
  color: var(--primary-color);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.content-section h2,
.dark-section h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.dark-section h2 {
  color: var(--white);
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.7));
}

p {
  margin-bottom: 1.5rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

.logo-fixed {
  height: 100px;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
}

/* Hero-sektion */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
    url(images/hero-image.webp) no-repeat center center/cover;
  min-height: 85vh;
  color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background-attachment: scroll;
}

.hero-content h1 {
  font-size: 4rem;
  color: var(--white);
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
}

.hero-content h2 {
  font-size: 2.5rem;
  color: var(--white);
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
}

/* Nedräknare */
.timer-container {
  display: grid;
  grid-template-columns: repeat(7, auto);
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.25rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}

.divider {
  grid-row: 1/3;
  width: 8px;
  height: 2px;
  background-color: var(--orange-color-1);
  margin-bottom: 24px;
  margin-top: auto;
}

.timer-label {
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  text-align: center;
  grid-row: 1;
  margin: 0;
  letter-spacing: 1px;
  filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.6));
}

.timer-group {
  display: flex;
  gap: 8px;
  grid-row: 2;
}

.timer-cell {
  height: 45px;
  width: 35px;
  display: flex;
  flex-direction: column;
  position: relative;
  font-weight: 700;
  box-shadow: rgba(0, 0, 0, 0.35) 0 5px 15px;
}

.timer-cell p {
  position: absolute;
  font-size: 1.5em;
  color: var(--black);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.top,
.bottom {
  height: 50%;
  width: 100%;
  border-radius: 4px;
}

.top {
  background-color: var(--orange-color-1);
}

.bottom {
  background-color: var(--orange-color-2);
}

/* Allmänna sektioner */
.content-section {
  padding: 5rem 0;
}

#about {
  text-align: center;
}

#about p {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

#about h3 {
  margin-top: 2rem;
  font-size: 1.5rem;
}

/* Recept */
#recipes {
  background-color: var(--white);
}

#recipes h2 {
  margin-bottom: 1.5rem;
}

.card-container {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.recipe-subtitle {
  text-align: center;
  margin-bottom: 3rem;
  font-weight: 700;
  color: #565656;
}

.card {
  max-width: 300px;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card a {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  padding: 0;
}

.card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.card:hover img {
  transform: scale(1.02);
}

.card h3 {
  font-size: 1.75rem;
  color: var(--black);
  margin: 0.5rem 0;
  transition: color 0.3s ease;
}

.card:hover h3 {
  color: var(--primary-color);
}

.card p {
  margin-bottom: 0;
  transition: color 0.3s ease;
}

/* Historia */
#history .two-column {
  display: flex;
  align-items: center;
  gap: 4rem;
  justify-content: center;
}

#history .column-text {
  min-width: 300px;
  max-width: 700px;
}

#history .column-image img {
  height: auto;
  max-height: 450px;
  object-fit: contain;
}

#history .column-text h2 {
  text-align: left;
}

/* Kuriosa */
.dark-section {
  background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.5)),
    url(images/background-image.webp) no-repeat center center/cover;
  color: var(--white);
  padding: 4rem 0;
  background-attachment: scroll;
}

.hr-lines {
  position: relative;
  max-width: 500px;
  margin: 0 auto 4rem;
  text-align: center;
}

.hr-lines:before,
.hr-lines:after {
  content: " ";
  display: block;
  height: 2px;
  width: 130px;
  position: absolute;
  top: 50%;
  background: var(--white);
}

.hr-lines:before {
  left: 0;
}

.hr-lines:after {
  right: 0;
}

.dark-section h3 {
  color: var(--orange-color-3);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-container {
  display: flex;
  text-align: center;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.icon-item {
  max-width: 300px;
  padding: 20px;
  border-radius: 8px;
}

.icon-item img {
  max-width: 60px;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

/* === REN KARUSELL STYLING === */
#producers {
  background-color: var(--white);
}

#producers .container {
  padding: 0;
}

#producers h2 {
  padding: 0 2rem;
  margin-bottom: 4rem;
}

.carousel-container {
  max-width: 100%;
  margin: 0 auto;
}

.carousel-swiper {
  width: 100%;
  padding: 40px 60px;
}

/* Förhindra oönskad focus-scroll till karusellen */
.carousel-swiper .swiper-wrapper {
  pointer-events: none;
}

.carousel-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  pointer-events: auto;
}

.carousel-swiper .swiper-slide a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  outline: none;
}

.carousel-swiper .swiper-slide a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.carousel-swiper .swiper-slide a:hover {
  transform: scale(1.1);
}

.carousel-swiper .swiper-slide img {
  max-width: 80%;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.carousel-swiper .swiper-slide a:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* Navigation under karusellen */
.carousel-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
}

.nav-btn {
  color: var(--primary-color);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 10px;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-feature-settings: "liga" off;
  font-feature-settings: "liga" off;
}

.nav-btn:hover {
  transform: scale(1.1);
}

.pagination-dots {
  display: flex;
  gap: 12px;
  align-items: center;
}

.pagination-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-dot.active {
  background-color: var(--primary-color);
  transform: scale(1.3);
}

.pagination-dot:hover {
  background-color: var(--primary-color);
  transform: scale(1.1);
}

/* FAQ */
.faq-item {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
  text-align: center;
}

.faq-item:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1.4rem;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background: var(--white);
  color: var(--black);
  text-align: left;
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 100px;
  row-gap: 50px;
}

footer .left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-img-container {
  height: 90px;
}

.footer-img-container img {
  height: inherit;
}

.footer-text h3 {
  margin: 0;
  font-size: 1.5rem;
}

.footer-text p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-color);
}

footer .right {
  display: flex;
  gap: 20px;
  align-items: center;
  font-family: var(--heading-font);
  text-decoration: underline;
  text-decoration-color: var(--primary-color);
  font-size: 1.2rem;
  text-underline-offset: 5px;
}

/* Scroll to top knapp */
#scrollToTopBtn {
  position: fixed;
  bottom: 110px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--primary-color);
  color: #fff;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  font-size: 18px;
  width: 50px;
  height: 50px;
  line-height: 18px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease,
    background-color 0.3s ease;
}

#scrollToTopBtn.show {
  opacity: 1;
  visibility: visible;
}

#scrollToTopBtn:hover {
  background-color: #7c2a00;
}

/* === RESPONSIVITET === */
@media (max-width: 992px) {
  #history .two-column {
    text-align: center;
  }

  #history .column-image {
    display: none;
  }

  #history .column-text,
  #history .column-text h2 {
    text-align: center;
  }

  .carousel-swiper {
    padding: 30px 40px;
  }

  .carousel-swiper .swiper-slide {
    height: 160px;
  }

  .carousel-swiper .swiper-slide img {
    max-height: 100px;
  }

  .nav-btn {
    font-size: 26px;
  }
}

@media (max-width: 768px) {
  .content-section h2,
  .dark-section h2 {
    font-size: 1.85rem;
  }

  .hero-content h1 {
    font-size: 2.75rem;
  }

  .hero-content h2 {
    font-size: 1.75rem;
  }

  .logo-fixed {
    height: 60px;
    top: 10px;
    left: 10px;
  }

  .timer-cell {
    height: 35px;
    width: 27px;
    box-shadow: rgba(0, 0, 0, 0.25) 0 3px 10px;
  }

  .timer-cell p {
    font-size: 1.25rem;
  }

  .timer-label {
    font-size: 0.65rem;
  }

  .divider {
    margin-bottom: 13px;
    width: 8px;
  }

  .timer-container {
    column-gap: 0.25rem;
  }

  .hr-lines {
    max-width: 300px;
  }

  .hr-lines:before,
  .hr-lines:after {
    width: 80px;
  }

  .recipe-subtitle {
    margin-top: -1rem;
    margin-bottom: 2rem;
  }

  /* Mobil karusell */
  .carousel-swiper {
    padding: 20px 30px;
  }

  .carousel-swiper .swiper-slide {
    height: 140px;
  }

  .carousel-swiper .swiper-slide img {
    max-height: 80px;
    /* ALLTID färg på mobil */
    filter: none !important;
    opacity: 1 !important;
  }

  .carousel-navigation {
    gap: 20px;
    margin-top: 10px;
  }

  .nav-btn {
    font-size: 24px;
  }

  .pagination-dot {
    width: 12px;
    height: 12px;
  }

  /* Minska komplexitet på mobil */
  .hero {
    background-attachment: scroll;
  }

  .dark-section {
    background-attachment: scroll;
  }
}

@media (max-width: 480px) {
  .carousel-swiper {
    padding: 15px 20px;
  }

  .carousel-swiper .swiper-slide {
    height: 120px;
  }

  .carousel-swiper .swiper-slide img {
    max-height: 60px;
  }

  .nav-btn {
    font-size: 20px;
  }

  .pagination-dot {
    width: 10px;
    height: 10px;
  }
}

/* Reduce motion för användare som föredrar det */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  #scrollToTopBtn {
    transition: opacity 0.1s ease !important;
  }
}
