/* Vaeltajakartta - Main Stylesheet */

:root {
    /* Social bar */
    --social-bar-height: 45px;
    --social-bar-height-mobile: 36px;

    /* Logo */
    --logo-height: 60px;
    --logo-height-mobile: 70px;
    --logo-height-scrolled: 40px;
    --logo-height-mobile-scrolled: 45px;

    /* Header padding */
    --header-padding-y: 20px;
    --header-padding-x: 40px;
    --header-padding-y-mobile: 20px;
    --header-padding-x-mobile: 20px;
    --header-padding-y-scrolled: 10px;
    --header-padding-y-mobile-scrolled: 10px;

    /* Mobile menu button */
    --menu-toggle-height: 36px;

    /* Gap in mobile header */
    --header-gap-mobile: 15px;
    --header-gap-mobile-scrolled: 10px;

    /* Calculated values - Desktop */
    /* header-wrapper top = social-bar-height */
    /* header height = padding-y * 2 + logo-height = 20 + 60 + 20 = 100px */
    /* total fixed height = social-bar + header = 45 + 100 = 145px */
    --header-height: calc(var(--header-padding-y) * 2 + var(--logo-height));
    --total-fixed-height: calc(var(--social-bar-height) + var(--header-height));

    /* Calculated values - Desktop scrolled */
    --header-height-scrolled: calc(var(--header-padding-y-scrolled) * 2 + var(--logo-height-scrolled));

    /* Calculated values - Mobile */
    /* header height = padding-y * 2 + logo + gap + button = 20 + 70 + 15 + 36 + 20 = 161px */
    --header-height-mobile: calc(var(--header-padding-y-mobile) * 2 + var(--logo-height-mobile) + var(--header-gap-mobile) + var(--menu-toggle-height));
    --total-fixed-height-mobile: calc(var(--social-bar-height-mobile) + var(--header-height-mobile));

    /* Calculated values - Mobile scrolled */
    /* header height = 10 + 45 + 10 + 36 + 10 = 111px */
    --header-height-mobile-scrolled: calc(var(--header-padding-y-mobile-scrolled) * 2 + var(--logo-height-mobile-scrolled) + var(--header-gap-mobile-scrolled) + var(--menu-toggle-height));
    --total-fixed-height-mobile-scrolled: var(--header-height-mobile-scrolled);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Top social bar */
.social-bar {
    background-color: #002e4e;
    height: var(--social-bar-height);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
    gap: 15px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.social-bar.hidden {
    transform: translateY(-100%);
}

.social-bar a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.social-bar a svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.social-bar a:hover {
    opacity: 0.8;
}

/* Header wrapper for sticky behavior */
.header-wrapper {
    position: fixed;
    top: var(--social-bar-height);
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: top 0.3s ease;
}

.header-wrapper.scrolled {
    top: 0;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--header-padding-y) var(--header-padding-x);
    background: white;
    transition: padding 0.3s ease;
}

.header-wrapper.scrolled header {
    padding: var(--header-padding-y-scrolled) var(--header-padding-x);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--logo-height);
    transition: height 0.3s ease;
}

.logo a {
    display: block;
    height: 100%;
    line-height: 0;
}

.logo img {
    height: 100%;
    width: auto;
    display: block;
}

.header-wrapper.scrolled .logo {
    height: var(--logo-height-scrolled);
}

/* Desktop Navigation */
nav {
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav a:hover {
    color: #002e4e;
}

nav a.active {
    color: #002e4e;
    font-weight: bold;
}

/* Mobile menu button */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #333;
    height: var(--menu-toggle-height);
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    line-height: var(--menu-toggle-height);
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    background: white;
    border-top: 1px solid #eee;
    position: fixed;
    top: var(--total-fixed-height);
    left: 0;
    right: 0;
    z-index: 999;
    transition: top 0.3s ease;
}

.mobile-nav.scrolled {
    top: var(--header-height-scrolled);
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #999;
    border-bottom: 1px solid #eee;
}

.mobile-nav a:hover {
    color: #002e4e;
}

.mobile-nav a.active {
    color: #002e4e;
    font-weight: bold;
}

/* Spacer to prevent content from going under fixed header */
.header-spacer {
    height: var(--total-fixed-height);
    transition: height 0.3s ease;
}

/* Main content */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
    color: #333;
}

.intro-text {
    margin-bottom: 40px;
}

.intro-text p {
    margin-bottom: 20px;
    text-align: justify;
}

.intro-text strong {
    color: #333;
}

/* App screenshots */
.app-screenshots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.app-screenshots img {
    max-width: 150px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Elämykset section */
.elamykset {
    text-align: center;
    margin: 50px 0;
}

.elamykset h2 {
    color: #0066cc;
    text-decoration: underline;
    font-size: 18px;
    margin-bottom: 30px;
}

.elamykset ul {
    list-style: none;
}

.elamykset li {
    margin: 15px 0;
}

.elamykset a {
    color: #333;
    text-decoration: none;
}

.elamykset a:hover {
    text-decoration: underline;
}

/* Download section */
.download-section {
    text-align: center;
    margin: 50px 0;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.download-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #333;
}

.qr-code {
    width: 100px;
    height: 100px;
    margin: 15px auto;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}

.store-badge {
    display: inline-block;
    margin: 20px 0;
}

.store-badge img {
    height: 50px;
}

.google-play-btn, .itunes-btn {
    display: inline-block;
    background: #000;
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    text-decoration: none;
    margin: 10px 0;
}

.google-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 200px;
    margin: 10px auto;
}

.google-play-btn .play-icon {
    width: 24px;
    height: 24px;
}

.google-play-btn .text {
    text-align: left;
}

.google-play-btn .text small {
    font-size: 10px;
    display: block;
}

.google-play-btn .text span {
    font-size: 18px;
    font-weight: bold;
}

.itunes-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 200px;
    margin: 10px auto;
}

.itunes-btn .apple-icon {
    width: 24px;
    height: 24px;
}

.itunes-btn .text {
    text-align: left;
}

.itunes-btn .text small {
    font-size: 10px;
    display: block;
}

.itunes-btn .text span {
    font-size: 18px;
    font-weight: bold;
}

/* Footer */
footer {
    background: #002e4e;
    color: white;
    padding: 40px 20px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

/* Facebook Likebox */
#facebook-likebox {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    min-width: 250px;
    max-width: 340px;
}

#facebook-likebox iframe {
    border: none;
    overflow: hidden;
}

.footer-info h4 {
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-info p {
    font-size: 14px;
    margin: 5px 0;
    color: #ccc;
}

.footer-info a {
    color: #ccc;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    background: white;
    color: #999;
    font-size: 12px;
}

.footer-bottom a {
    color: #999;
    text-decoration: none;
    margin: 0 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .social-bar {
        justify-content: center;
        height: var(--social-bar-height-mobile);
    }

    .header-wrapper {
        top: var(--social-bar-height-mobile);
    }

    header {
        flex-direction: column;
        padding: var(--header-padding-y-mobile) var(--header-padding-x-mobile);
        gap: var(--header-gap-mobile);
    }

    .header-wrapper.scrolled header {
        padding: var(--header-padding-y-mobile-scrolled) var(--header-padding-x-mobile);
        gap: var(--header-gap-mobile-scrolled);
    }

    nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        top: var(--total-fixed-height-mobile);
    }

    .mobile-nav.active {
        display: block;
    }

    .mobile-nav.scrolled {
        top: var(--total-fixed-height-mobile-scrolled);
    }

    .logo {
        height: var(--logo-height-mobile);
    }

    .header-wrapper.scrolled .logo {
        height: var(--logo-height-mobile-scrolled);
    }

    .header-spacer {
        height: var(--total-fixed-height-mobile);
    }

    main {
        padding: 20px 15px;
    }

    h1 {
        font-size: 20px;
    }

    .app-screenshots {
        flex-direction: column;
        align-items: center;
    }

    .app-screenshots img {
        max-width: 250px;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
    }

    #facebook-likebox {
        order: 2;
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
    }

    #facebook-likebox iframe {
        width: 100%;
        max-width: 340px;
    }

    .footer-info {
        order: 1;
    }
}
