/* CSS Variables */
:root {
    --primary-red: #ff1919;
    --primary-dark: #cc0000;
    --accent-red: #ff4444;
    --accent-hover: #ff0000;
    --dark-gray: #191919;
    --light-gray: #666666;
    --background-dark: #191919;
    --background-light: #f5f5f5;
    --white: #ffffff;
    --border-dark: #333333;
    
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    
    --transition: all 0.3s ease;
}



/* Top Bar */
.top-bar {
    background-color: #ff1919;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-size: 16px;
}
.top-bar a {
    color: black;
    text-decoration: none;
    margin-left: 8px;
}

.top-bar i {
    color: black; /* ensure the phone icon in the top-bar is black */
}

.puhelin {
    width: 18px;
    height: auto;
    margin-right: 8px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--background-dark);
    color: var(--white);
    line-height: 1.6;
    font-size: var(--font-size-base);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* About section visual styles (keeps all text intact) */
.about-section { padding: 40px 0; }
.about-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
/* Make the photo container circular and give the container the shadow so the shadow follows the circle */
.about-photo {
    width: 260px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    display: block;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}
.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.about-content .section-title { margin-bottom: 12px; }
.about-par { color: rgba(255,255,255,0.95); font-size: 1rem; line-height: 1.7; margin-bottom: 12px; }
.about-sub { color: var(--primary-red); margin-top: 12px; margin-bottom: 8px; }

@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-photo img { max-height: 320px; }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary-red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--accent-red);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-outline:hover {
    background: var(--primary-red);
    color: var(--white);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
}

/* Header */
.header {
    background: var(--background-dark);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-dark);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-red);
    text-decoration: none;
}

.nav {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary-red);
}

.phone-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    background: var(--primary-red);
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.phone-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-red);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), 
                url('kuvat/puukasa-pilkottu-puu.webp') center/cover;
    min-height: 70vh;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
    position: relative;
}

.hero-content h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: var(--font-size-xl);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hero-cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Hero buttons used on service landing pages and subpages */
.hero-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Services Overview */
.services-overview {
    padding: 80px 0;
    background: var(--background-dark);
}

.section-title {
    text-align: center;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 48px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.service-card {
    background: var(--border-dark);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-dark);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.service-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.service-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 16px;
}

.service-card p {
    color: var(--white);
    margin-bottom: 24px;
}

.service-list {
    list-style: none;
    margin-bottom: 24px;
}

.service-list li {
    padding: 8px 0;
    color: var(--light-gray);
    font-size: var(--font-size-sm);
}

.service-list li::before {
    content: "✓";
    color: var(--primary-red);
    font-weight: bold;
    margin-right: 8px;
}

/* Why Choose Us */
.why-choose {
    padding: 80px 0;
    background: var(--border-dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.feature-item {
    text-align: center;
    padding: 24px;
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--white);
    font-size: 1.5rem;
}

.feature-item h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 12px;
}

.feature-item p {
    color: var(--white);
    font-size: var(--font-size-sm);
}

/* Image Section */
.image-section {
    padding: 60px 0;
    background: var(--background-dark);
}

.centered-image {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(255, 25, 25, 0.2);
}

.centered-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Portfolio Section */
.portfolio {
    padding: 80px 0;
    background: var(--background-dark);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.portfolio-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.portfolio-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.portfolio-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.portfolio-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    padding: 24px 16px 16px;
}

.portfolio-caption h4 {
    font-size: var(--font-size-lg);
    margin-bottom: 4px;
}

.portfolio-caption p {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

/* Equipment Gallery */
.equipment-gallery {
    padding: 80px 0;
    background: var(--border-dark);
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.equipment-item {
    text-align: center;
    background: var(--background-dark);
    padding: 24px;
    border-radius: 12px;
    transition: var(--transition);
    border: 1px solid var(--border-dark);
}

.equipment-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.equipment-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

.equipment-item h4 {
    color: var(--primary-red);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

/* Testimonials */
.testimonials {
    padding: 80px 0;
    background: var(--background-dark);
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.testimonial-item {
    background: var(--background-beige);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.testimonial-item::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-green);
    position: absolute;
    top: -10px;
    left: 20px;
    opacity: 0.3;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 24px;
    color: var(--light-gray);
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-green);
}

/* Quote Form */
.quote-section {
    padding: 80px 0;
    background: var(--primary-red);
    color: var(--white);
}

.quote-section .section-title {
    color: var(--white);
}

.quote-form {
    max-width: 600px;
    margin: 48px auto 0;
    background: var(--border-dark);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--white);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: var(--font-size-base);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* Elegant checkbox grid for services */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--border-dark);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--white);
}

.checkbox-item:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 25, 25, 0.2);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
    display: block;
    text-align: center;
    line-height: 1;
}

/* Footer */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--white);
}

.footer-section p,
.footer-section a {
    color: #cccccc;
    text-decoration: none;
    line-height: 1.8;
}

.footer-section a:hover {
    color: var(--primary-red);
}

.contact-info {
    list-style: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #cccccc;
}

.contact-info i {
    width: 20px;
    color: var(--accent-orange);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 30px;
    text-align: center;
    color: #888;
    font-size: var(--font-size-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        padding: 12px 0;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-content h1 {
        font-size: var(--font-size-3xl);
    }
    
    .hero-content p {
        font-size: var(--font-size-lg);
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta .btn {
        min-width: 200px;
    }

    .hero-buttons {
        flex-direction: column;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons .btn {
        width: 100%;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .service-grid,
    .features-grid,
    .portfolio-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .quote-form {
        margin: 32px 16px 0;
        padding: 24px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    /* Mobile navigation open state */
    .nav.mobile-active {
        display: flex !important;
        position: absolute;
        top: 64px; /* below header */
        left: 16px;
        right: 16px;
        background: rgba(16,16,16,0.98);
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: 8px;
        z-index: 1001;
        box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    }

    .nav.mobile-active a {
        display: block;
        padding: 8px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.03);
    }

    /* Make about photo scale down and center on narrow screens */
    .about-photo { width: 100%; max-width: 260px; margin: 0 auto; }
}

/* Extra small phones tweaks */
@media (max-width: 420px) {
    body { font-size: 0.95rem; }
    .mobile-menu-toggle span { width: 22px; }
    .nav.mobile-active { left: 8px; right: 8px; top: 60px; }
}

@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: var(--font-size-2xl);
    }
    
    .service-card,
    .quote-form {
        padding: 24px;
    }
    
    .btn-lg {
        padding: 14px 24px;
        font-size: var(--font-size-base);
    }
    
    .centered-image {
        border-radius: 8px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
