/* Reset some default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
  
/* Set global font and sizing baseline */
html {
    font-size: calc(16px + (23 - 16) * (100vw - 400px) / (2500 - 320));
    position: relative;
}
  
body {
    font-family: 'Barlow', sans-serif;
    color: #222;
    background-color: #e92039;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    height: 100%;
}  

/* --- Header och navigering --- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  min-height: 110px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10;
  background: linear-gradient(to bottom,
    rgba(233, 32, 57, 1) 0%,
    rgba(233, 32, 57, 1) 30%,
    rgba(233, 32, 57, 0) 100%);
  }

.site-header.solid {
  background: #e92039; /* Samma färg, men helt solid */
  min-height: 80px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  transition: background-color 0.3s ease;
}

.site-header.solid .logo img {
  height: 80px; /* eller den storlek du vill ha */
  padding-bottom: 0.3rem;
}

.site-header.menu-open {
  padding-bottom: 200px; /* justera efter hur mycket utrymme menyn behöver */
  transition: padding-bottom 0.3s ease;
}

/* Header-left och header-widget får fast bredd men minimal */
.header-left,
.header-widget {
  flex: 0 0 80px; /* mindre bredd */
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1.75rem;
  left: 2rem;
}

/* Logon får absolut position för exakt centering */
.logo {
  position: absolute;
  left: 50%;
  top: 50%; /* Lägg till för vertikal centrering */
  transform: translate(-50%, -50%); /* centrera både horisontellt och vertikalt */
  padding-top: 0.8rem; /* ta bort padding, kan orsaka förskjutning */
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: auto;
  z-index: 1001;
}

.logo img {
  height: 110px; /* matcha höjden på .logo */
  width: auto;
}

/* Menyn flexar och skjuts helt till höger */
.hidden {
  display: none;
}

#menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: #e92039;
  display: flex;
  flex-direction: column ;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

#menu.hidden {
  display: none !important;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 10px 0;
}

#hamburger {
  color: rgb(230, 230, 230);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1100; /* högre än menyns 1000 */
  font-size: 2.2rem;
  background: none;
  border: none;
  cursor: pointer;
}

nav a {
  text-decoration: none;
  color: #f7f7f7;
  font-weight: 600;
  padding: 0.3rem 0; /* tidigare kanske större */
  line-height: 1.2;   /* gör texten tätare vertikalt */
  font-size: 0.85rem; /* kan också minska font-storlek lite om det hjälper */
  transition: color 0.2s ease;
}

nav a:hover {
  color: #ffd900;
  border-bottom: 2px solid #ffd900;  /* Samma färg som texten, men kan skiljas */
}

/* Header widget kan positioneras absolut i hörnet om du vill */

/* Hero Header */
.start-header {
    background: url('images/cta-icon.png') no-repeat center center/cover;
    padding: 6rem 2rem 2rem 2rem;
    position: relative;
    height: 98vh;
}

.about-header {
    background: url('images/about-header.png');
    padding: 6rem 2rem 2rem 2rem;
    position: relative;
    height: 50vh;
    background-position: center center;
    background-position-y: 20%;
    background-repeat: no-repeat;

}

.hero-header {
    color: white;
    padding: 10rem 1rem 1rem 1rem;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    align-items: center;
    text-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.25);
    font-weight: bold;
    line-height: 1.3;
    letter-spacing: normal;
    font-size: 2.7rem;
}

.hero-header .logo img {
    width: 100px;
    height: auto;
}

.hero-header h1 {
    font-size: 2.7rem;
    color: white;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
    font-weight: bold;
    line-height: 1.3;
}

.hero-text p {
    font-family: 'Barlow', sans-serif;
    font-size: 1.25rem;
    line-height: 1.6;
    font-weight: 400;
    text-align: center;
    color: #ffffff;
    margin: 0.5rem 0;
    padding: 0 1.5rem;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
    letter-spacing: normal;
}  

  /* Hide main navigation */
  .site-header .main-nav {
    display: none;
  }
  
  /* When menu is opened */
  .site-header .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    width: 200px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }

/* Mobile styles - cleaned and specific */
@media (max-width: 768px) {
  /* Hamburger button */
  #hamburger,
  .menu-toggle {
    display: block;
  }
    
  /* Logo adjustments */
  .logo img {
    height: 70px;
  }
  
  /* Hero section responsive text */
  .hero-header h1 {
    font-size: 2rem;
  }
  
  .hero-text p {
    font-size: 1rem;
  }
}

/* Logo padding for slightly larger screens */
@media (max-width: 900px) {
  .logo img {
    padding-top: 1rem;
  }
}

/* Call-to-Action Banner */
.cta-banner {
    background: url('images/cta-icon.png') center center no-repeat;
    background-size: cover;
    color: white;
    text-align: center;
    padding: 60px 20px;
}

.cta-banner h2 {
    font-size: 2.5rem;
}

.cta-banner p {
    font-size: 1.2rem;
}

#dibs-checkout-container {
    width: 50%;   /* max-bredd */
    max-height: 600px; /* max-höjd */
    margin: 1rem auto;
}

.btn-donate {
    margin-top: 50px;
    background-color: #ffe96f;
    color: #ab0020;
    padding: 15px 30px;
    font-size: 1.2rem;
    text-decoration: none;
    border-radius: 60px;
}

.btn-donate:hover {
    background-color: #FFD700;
}

/* Icons Section */
.icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 icons per row on larger screens */
    gap: 2rem; 
    margin: 2rem auto 4rem auto;
    padding: 20px;
    background-color: #e92039;
    text-align: center;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
}

.icon-item img {
    width: 60px;
    height: 60px;
    border-radius: 3%;
    margin-bottom: 10px;
    border: none;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.icon-item img:hover {
    transform: scale(1.1);
}

.icon-item h2 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 10px;
    line-height: 1.4;
}

.icon-item p {
    color: white;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    margin-bottom: 3rem;
    padding: 0 5px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .icons {
        grid-template-columns: repeat(2, 1fr); /* 2 items per row on smaller screens */
    }

    .icon-item img {
        width: 50px; /* Adjust icon size for mobile */
        height: 50px;
    }

    .icon-item h2 {
        font-size: 1.25rem;
    }

    .icon-item p {
        font-size: 1rem;
    }

    .content h1 {
        font-size: 1.5rem;
    }

    .content h2 {
        font-size: 1rem;
    }

    .content h3 {
        font-size: 0.95rem;
    }

    .content p {
        font-size: 0.95rem;
    }
}

/* Content Section */
.content {
    padding: 3rem 2rem 2rem 2rem; /* Ökad top-padding för bättre luft */
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: left;
    max-width: 55rem;
    border-radius: 1.5rem;
    margin: 8vh auto;
}

.content h1 {
    font-size: 1.7rem;
    font-weight: bold;
}

.content h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.content h3 {
    font-size: 1rem;
    font-weight: bold;
}

.content h1,
.content h2,
.content h3 {
    line-height: 1.3;
}

.content h1,
.content h2,
.content h3,
.content p,
.content ol,
.contact-form,
.content ul {
    margin: 0 auto 20px;
    max-width: 40rem;
    text-align: left;
}

.content p {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.content ol,
.content ul {
    list-style-position: outside;
    padding-left: 1rem;
}

hr.spaced {
    max-width: 55rem;
    margin: 0 auto 20px;
    max-width: 40rem;
    text-align: left;
}

hr.spaced-top {
  max-width: 55rem;
    margin: 0 auto 20px;
    max-width: 40rem;
    text-align: left;
}

.contact-form {
  border-radius: 1rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
}

.contact-form .input-button-wrapper {
  display: flex;
  gap: 0.5rem; /* lite mellanrum mellan input och knapp */
  align-items: center; /* vertikal centrering */
}

.contact-form input[type="email"] {
  flex: 1; /* tar så mycket plats som möjligt */
  min-width: 0; /* för att flexboxen ska funka bra */
}

.contact-form input[type="submit"] {
  flex-shrink: 0; /* knappen krymper inte */
}

/* Dash list (custom bullets) */
.dash-list {
    list-style: none;
    padding-left: 1rem;
    margin: 0 auto 20px;
    max-width: 40rem;
    text-align: left;
}

.dash-list li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.dash-list li::before {
    content: "-";
    position: absolute;
    left: 0;
}

/* Icon above footer */
.fixed-bottom-icon {
    position: relative;
    margin-top: 0.8rem;
    bottom: 0px;           /* Justerar avståndet från botten av sidan */
    left: 50%;              /* Centrerar ikonen horisontellt */
    transform: translateX(-50%); /* Finjusterar för att verkligen centrera ikonen */
    z-index: 10;            /* Gör så att ikonen syns ovanpå footer */
    width: 80px;                   /* Sätt en maxstorlek för ikonen */
    height: auto;
}

.fixed-bottom-icon img {
    width: 100%;            /* Justera storleken på ikonen efter behov */
    height: auto;
    border-radius: 8px;     /* Ger ikonen rundade hörn */
}

/* Footer */
footer {
    background-color: #d60029;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    z-index: 5;
}

/* Stilar för header-ikonen */
.header-icon {
    position: fixed;        /* Fixera ikonen på skärmen */
    bottom: 60px;           /* 60px från botten så att den ligger strax ovanför footer */
    left: 50%;              /* Centrera ikonen horisontellt */
    transform: translateX(-50%); /* Justera för exakt centrering */
    z-index: 10;            /* Se till att ikonen ligger ovanpå andra element */
}

/* Error Message Styles */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff3333;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%);
    }
}

/* Button Loading State */
.btn-donate:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-donate:disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
