:root {
    /* Kuvassa esitellyt värit */
    --solar-yellow: #FFC93C;     /* 60% - Solar Yellow */
    --forest-green: #228B22;     /* 30% - Forest Green */
    --sky-blue: #87CEEB;         /* 10% - Sky Blue */
    
    /* Lisävärit harmoniaa varten */
    --primary-dark: #0a2342;
    --primary: #2ca58d;
    --secondary: #84bc9c;
    --accent: #84bc9c;
    --light: #fffdf7;
}

/* Kuvassa esitellyt fontit: Fjalla One (Primary), Cabin (Secondary), Nunito Sans (Body) */
@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=Cabin:wght@300;400;500;600;700&family=Nunito+Sans:wght@300;400;500;600;700;800&display=swap');

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

body {
    min-height: 100vh;
    background: #f5f5f5;
    background-image: url('kuvat/koodikioski_valo.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Nunito Sans', sans-serif;  /* Body font */
    padding: 1rem;
    color: var(--primary-dark);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Hero-osio taustakuvalle */
.hero {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('kuvat/koodikioski_valo.webp') center/cover no-repeat;
    z-index: 0;
    pointer-events: none;
}

.bento-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: -40vh;
    position: relative;
    z-index: 2;
}

.bento-item {
    background: rgba(255, 201, 60, 0.9);  /* Solar Yellow tausta */
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(10, 35, 66, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    font-weight: 300;
    font-family: 'Nunito Sans', sans-serif;  /* Body font */
    color: var(--primary-dark);
}

.bento-item:hover {
    transform: none;
    background: rgba(34, 139, 34, 0.9);  /* Forest Green hover */
    color: var(--light);
}

.bento-item.social-media:hover {
    background: inherit;
    transform: none;
}

.bento-item.medium {
    background: rgba(34, 139, 34, 0.9);  /* Forest Green */
    color: var(--light);
}

.bento-item.medium h3,
.bento-item.medium ul,
.bento-item.medium li {
    color: var(--light);
}

.large {
    grid-column: span 2;
    grid-row: span 2;
    background: rgba(135, 206, 235, 0.9);  /* Sky Blue */
    color: var(--primary-dark);
}

.large h2 {
    font-size: 2.2rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-family: 'Fjalla One', sans-serif !important;  /* Primary font */
    font-weight: 400 !important;
}

.large p {
    font-size: 1.1rem;
    line-height: 1.6;
    font-family: 'Nunito Sans', sans-serif;  /* Body font */
}

.medium {
    grid-column: span 1;
    grid-row: span 2;
}

.small {
    grid-column: span 1;
    grid-row: span 1;
}

h2, h3 {
    margin-bottom: 1rem;
    font-family: 'Fjalla One', sans-serif !important;  /* Primary font otsikkoihin */
    font-weight: 400 !important;
    letter-spacing: -0.02em;
}

.large h2, .large h3 {
    color: var(--primary-dark);
}

p {
    font-family: 'Nunito Sans', sans-serif;  /* Body font */
    font-weight: 400;
    line-height: 1.6;
}

ul {
    list-style-position: inside;
    margin-left: 1rem;
    font-weight: 400;
    font-family: 'Cabin', sans-serif;  /* Secondary font listoihin */
}

li {
    font-family: 'Cabin', sans-serif;  /* Secondary font */
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--primary-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    background: var(--light);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
}

.social-links a:hover {
    background: var(--primary);
    color: var(--light);
}

.social-media {
    min-height: 10.66rem !important;
    height: 10.66rem !important;
    align-self: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    position: relative;
    overflow: hidden;
    max-width: 180px;
    grid-column: span 0.5;
}

.switch-container {
    display: flex;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.switch {
    display: block;
    position: relative;
    width: 70px;
    height: 70px;
    margin: 20px auto;
    border-radius: 50px;
    background: #e6e3da;
    background: linear-gradient(#e6e3da, #fff);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 
      inset 0 7px 0 #fdfdfd,
      0 2px 3px rgba(170, 160, 140,.3);
    cursor: pointer;
  }
  
  .switch:before {
    content: "";
    position: absolute;
    top: -10px; bottom: -10px;
    left: -5px; right: -5px;
    z-index: -1;
    background: #f2f1ed;
    border-radius: inherit;
    box-shadow:
      0 1px 1px rgba(174,163,145,0.2),
      0 3px 3px rgba(170, 160, 140, 0.4),
      inset 0 1px 0 rgba(255,255,255,0.8),
      0 0 5px rgba(170, 160, 140, 0.5);
  }
  
  .switch:after {
    content: "";
    position:absolute; 
    width: 60px;
    height: 70px;
    border-radius: 50%;
    z-index: -1;
    left: 18px;
    top: 10px;
    background: linear-gradient(160deg, rgba(170, 160, 140, 0.7), rgba(170, 160, 140, 0));
    filter: blur(1px);
  }
  
  #switch {
    clip: rect(0 0 0 0);
    position: absolute;
    visibility: hidden;
  }
  
  #switch:checked ~ .switch {
    background: linear-gradient(#f7f6f4, #fff);
    box-shadow:
      inset 0 -5px 0 #dbd3c8,
      0 6px 5px rgba(170, 160, 140, 0.75),
      3px 16px 5px rgba(170,160,140, 0.3);
    border-bottom: none;
  }
  
  #switch:checked ~ .switch:after {
    display: none;
  }

.carwash-box, .carwash-box.bento-item {
    background: url('kuvat/hapesula.webp') center/cover no-repeat !important;
    background-color: transparent !important;
    aspect-ratio: 1/1.2;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-clip: border-box;
    overflow: hidden;
}

.carwash-content {
    background: rgba(255,255,255,0.7);
    border-radius: 0;
    padding: 2rem 2rem 2rem 2rem;
    box-shadow: 0 2px 8px rgba(10, 35, 66, 0.10);
    backdrop-filter: blur(2px);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    font-family: 'Nunito Sans', sans-serif;
    color: var(--primary-dark) !important;
}

.carwash-toggle {
    display: none;
    font-size: 1rem;
    font-family: 'Cabin', sans-serif;
    font-weight: 500;
    background: var(--primary-dark);
    color: var(--light);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(40, 63, 59, 0.07);
    transition: background 0.2s;
}
.carwash-toggle:active {
    background: var(--primary);
}

/* Työpöytä: hoverilla näkyviin */
@media (hover: hover) and (pointer: fine) {
    .carwash-box:hover .carwash-content {
        opacity: 1;
        pointer-events: auto;
    }
    .carwash-toggle {
        display: none;
    }
}

/* Mobiili: napilla näkyviin */
@media (hover: none) and (pointer: coarse) {
    .carwash-content.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .carwash-toggle {
        display: block;
    }
}

.carwash-link {
    margin-top: 1.2rem;
    color: var(--forest-green) !important;  /* Forest Green linkille */
    background: none;
    padding: 0;
    border-radius: 0;
    text-decoration: underline;
    font-weight: 700;
    font-size: 1.3rem;
    font-family: 'Nunito Sans', sans-serif;
    box-shadow: none;
    transition: none;
}

.carwash-content h3, .pilgrimage-content h3 {
    color: var(--primary-dark) !important;
}

.carwash-content p, .pilgrimage-content p {
    color: var(--primary-dark) !important;
}

.carwash-content ul, .pilgrimage-content ul {
    color: var(--primary-dark) !important;
}

.carwash-content li, .pilgrimage-content li {
    color: var(--primary-dark) !important;
}

html, .inter-font {
    font-family: 'Nunito Sans', sans-serif;
}

button, 
input[type="button"],
input[type="submit"] {
    font-family: 'Cabin', sans-serif;
    font-weight: 500;
}

a {
    font-family: 'Nunito Sans', sans-serif;
}

.pilgrimage-box {
    background: url('kuvat/pyhiinvallukset.webp') center/cover no-repeat;
    aspect-ratio: 1/1.2;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-clip: border-box;
    background-color: transparent !important;
    overflow: hidden;
}

.pilgrimage-content {
    background: rgba(255,255,255,0.7);
    border-radius: 0;
    padding: 2rem 2rem 2rem 2rem;
    box-shadow: 0 2px 8px rgba(10, 35, 66, 0.10);
    backdrop-filter: blur(2px);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    font-family: 'Nunito Sans', sans-serif;
    color: var(--primary-dark);
    overflow-y: auto;
}

.pilgrimage-toggle {
    display: none;
    font-size: 1rem;
    font-family: 'Cabin', sans-serif;
    font-weight: 500;
    background: var(--primary-dark);
    color: var(--light);
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    margin-bottom: 1rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(40, 63, 59, 0.07);
    transition: background 0.2s;
}
.pilgrimage-toggle:active {
    background: var(--primary);
}

@media (hover: hover) and (pointer: fine) {
    .pilgrimage-box:hover .pilgrimage-content {
        opacity: 1;
        pointer-events: auto;
    }
    .pilgrimage-toggle {
        display: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    .pilgrimage-content.visible {
        opacity: 1;
        pointer-events: auto;
    }
    .pilgrimage-toggle {
        display: block;
    }
}

.pilgrimage-box.bento-item:hover {
    background: url('kuvat/pyhiinvallukset.webp') center/cover no-repeat !important;
    background-color: transparent !important;
}

.pilgrimage-content h3 {
    color: var(--primary-dark);
}

/* Mobiiliystävälliset tyylit */
@media screen and (max-width: 768px) {
    body {
        padding: 0.5rem;
        min-height: 100vh;
        background: #e9eff4;
        background-image: none;
        overflow-x: hidden;
    }

    .hero {
        width: 100vw;
        height: 60vh;
        min-height: 300px;
    }
    .hero-bg {
        height: 60vh;
        min-height: 300px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        background: url('kuvat/koodikioski_valo.webp') center/cover no-repeat;
        z-index: 0;
    }
    .bento-container {
        grid-template-columns: 1fr;
        margin-top: -25vh;
        gap: 1rem;
        padding-top: 1rem;
        position: relative;
        z-index: 2;
    }

    .bento-item {
        padding: 1rem;
    }

    .large {
        grid-column: span 1;
        grid-row: span 1;
    }

    .medium {
        grid-column: span 1;
        grid-row: span 1;
    }

    .small {
        grid-column: span 1;
        grid-row: span 1;
    }

    .large h2 {
        font-size: 1.5rem;
    }

    .large p {
        font-size: 1rem;
    }

    .carwash-box, .pilgrimage-box {
        min-height: 200px;
    }

    .carwash-content, .pilgrimage-content {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .carwash-content ul, .pilgrimage-content ul {
        padding-left: 1rem;
    }

    .carwash-content li, .pilgrimage-content li {
        margin-bottom: 0.5rem;
    }

    .social-media {
        max-width: 100%;
        min-height: 4rem !important;
    }

    .switch {
        width: 50px;
        height: 80px;
        margin: 50px auto;
    }

    /* Logo ja Instagram mobiilissa */
    .logo {
        left: 0.5rem !important;
        top: 0.5rem;
        max-width: 100px;
        max-height: 35px;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .instagram-link {
        right: 0.5rem !important;
        top: 0.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .instagram-link i {
        font-size: 1.2rem;
    }
}

/* Pienempi mobiili */
@media screen and (max-width: 480px) {
    body {
        background: #e9eff4;
        background-image: none;
    }

    .hero {
        width: 100vw;
        height: 40vh;
        min-height: 180px;
    }
    .hero-bg {
        height: 40vh;
        min-height: 180px;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        background: url('kuvat/koodikioski_valo.webp') center/cover no-repeat;
        z-index: 0;
    }
    .bento-container {
        margin-top: -15vh;
        padding-top: 0.5rem;
        position: relative;
        z-index: 2;
    }

    .large h2 {
        font-size: 1.3rem;
    }

    .carwash-content, .pilgrimage-content {
        font-size: 0.85rem;
    }

    /* Logo ja Instagram pienissä mobiileissa */
    .logo {
        max-width: 80px !important;
        max-height: 30px !important;
    }
    
    .logo img {
        max-height: 30px !important;
    }
    
    .instagram-link {
        width: 2rem !important;
        height: 2rem !important;
    }
    
    .instagram-link i {
        font-size: 1rem !important;
    }
}

/* Logo vasempaan yläkulmaan - tasattu bento-containerin vasempaan reunaan */
.logo {
    position: fixed;
    top: 1rem;
    left: calc(50% - 600px);  /* Keskitetty 1200px containerin vasempaan reunaan */
    z-index: 1000;
    max-width: 150px;
    max-height: 60px;
}

.logo img {
    width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.instagram-link {
    position: fixed;
    top: 1rem;
    right: calc(50% - 600px);  /* Keskitetty 1200px containerin oikeaan reunaan */
    z-index: 1000;
    background: var(--forest-green);  /* Forest Green perusväri */
    color: var(--light);
    text-decoration: none;
    padding: 0;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
    transition: background 0.3s ease;
}

.instagram-link i {
    font-size: 1.5rem;
}

.instagram-link:hover {
    background: var(--solar-yellow);  /* Solar Yellow hover-väri */
    color: var(--primary-dark);  /* Tumma teksti keltaisella taustalla paremman kontrastin vuoksi */
}

/* Responsiivisuus logolle ja Instagram-painikkeelle */
@media screen and (max-width: 1240px) {
    /* Kun näyttö on pienempi kuin container + marginaalit, palaa alkuperäisiin kulmiin */
    .logo {
        left: 1rem;
        max-width: 120px;
        max-height: 45px;
    }
    
    .instagram-link {
        right: 1rem;
    }
}