/* assets/css/style.css - Valttikodit Custom CSS */

:root {
    /* Skandinaavinen väripaletti */
    --bg-color: #fdfbfb;
    --text-color: #1a1a1a;
    --text-muted: #6b7280;
    --primary: #121212;
    --primary-hover: #333333;
    --accent: #e5e7eb;
    --border: #e5e7eb;
    --card-bg: #ffffff;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;

    --radius: 0.5rem;
    --container-width: 1200px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    min-width: 44px;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    background-color: rgba(253, 251, 251, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    z-index: 50;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background-color: var(--accent);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5e5;
    /* Korvaa oikealla kuvalla tuotannossa tyyliin: background-image: url('assets/img/hero.jpg'); */
    background-size: cover;
    background-position: center;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    background-color: #fafafa;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-8 {
    margin-top: 2rem;
}

.py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.d-none {
    display: none !important;
}

/* Rich text injected components (CMS) */
[data-project="description"] iframe,
[data-cms] iframe,
.project-layout iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100vw !important; /* Fallback */
    aspect-ratio: 1 / 1 !important;
    margin: 2rem 0 !important;
    float: none !important;
    clear: both !important;
    border-radius: var(--radius) !important;
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
}

@media (min-width: 768px) {
    [data-project="description"] iframe,
    [data-cms] iframe,
    .project-layout iframe {
        height: 450px !important;
        aspect-ratio: auto !important;
    }
}

/* Grid Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.card-img {
    width: 100%;
    height: 240px;
    background-color: var(--accent);
    position: relative;
    background-size: cover;
    background-position: center;
}

@supports (aspect-ratio: 4/3) {
    .card-img {
        height: auto;
        aspect-ratio: 4/3;
    }
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.card-badge.sold {
    background: #000;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        z-index: 999;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    }
    /* Only applied when JS toggles it */
    .nav-links.active {
        transform: translateY(0);
        display: flex !important;
    }

    .hero-bg::after {
        background: transparent;
    }
}

/* Mobile Navigation Hamburger */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Mobile Icon Animation states */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
}

/* Unified Responsive Grids (replaces hardcoded HTML inline styles) */
.grid-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}
.project-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}
.grid-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Form layout for Ota Yhteyttä */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

/* Project Page Hero */
.project-hero {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background-color: #f3f4f6;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 2000px rgba(0,0,0,0.15);
}

/* Mobile Grid Overrides */
@media (max-width: 992px) {
    .grid-split, .project-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .grid-gallery {
        grid-template-columns: 1fr;
    }
    .grid-form {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* Spacing and Padding Overrides for Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem !important;
    }
    .py-16 {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }
    /* Sticky fixes */
    .sticky-card {
        position: static !important;
        margin-top: 2rem;
    }
    
    .project-hero {
        height: auto;
        min-height: 250px;
        aspect-ratio: 4/3;
        background-size: contain;
        background-repeat: no-repeat;
        box-shadow: inset 0 0 0 2000px rgba(0,0,0,0.05);
    }
}

/* Kohdesivun taulukot */
.details-section {
    background-color: #f7f5f0;
    padding: 4rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}

.details-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.details-group {
    background-color: #f7f5f0;
    margin-bottom: 2rem;
}

.details-group-title {
    display: flex;
    align-items: center;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    cursor: pointer;
    color: var(--text-color);
}

.details-group-title::after {
    content: '▼';
    font-size: 0.75rem;
    margin-left: 0.5rem;
    color: var(--text-muted);
}

.details-table {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.details-row {
    display: flex;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.details-row:last-child {
    border-bottom: none;
}

.details-term {
    flex: 0 0 30%;
    font-weight: 500;
    font-size: 0.875rem;
    padding-right: 1.5rem;
    min-width: 250px;
}

.details-desc {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Sijainti */
.location-section {
    padding: 6rem 0;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.map-wrapper {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    background: #e5e5e5;
    border: 1px solid var(--border);
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .details-row {
        flex-direction: column;
        padding: 1rem;
    }

    .details-term {
        margin-bottom: 0.5rem;
        min-width: 100%;
    }

    .location-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}