/* ==========================================================================
   1. VARIABLER & GLOBAL RESET
   ========================================================================== */
:root {
    --primary-color: #0C480A;   /* Mörkgrön */
    --secondary-color: #A4B48A; /* Ljusgrön */
    --text-color: #333;
    --light-bg: #F9F7F0;        /* Varm beige/vit bakgrund */
    --dark-bg: var(--primary-color);
    --font-primary: 'Georgia', serif; 
    --font-secondary: 'Helvetica Neue', sans-serif; 
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; 
}

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

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* ==========================================================================
   2. ALLMÄN LAYOUT & TYPOGRAFI
   ========================================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4 {
    font-family: var(--font-primary);
    margin-bottom: 0.8em;
    color: var(--primary-color);
}

h1 { font-size: 2.5em; }
h2 { font-size: 2.2em; text-align: center; }
h3 { font-size: 1.8em; }
h4 { font-size: 1.3em; }

p { margin-bottom: 1em; }

section {
    padding: 60px 0;
    background-color: #fff;
}

.intro-text {
    font-size: 1.2em;
    max-width: 700px;
    margin: 20px auto 30px;
}

/* NYTT: För att lyfta fram text, t.ex. öppettider */
.highlight-text {
    font-weight: bold;
    color: var(--primary-color);
    background-color: var(--secondary-color);
    padding: 2px 5px;
    border-radius: 3px;
    white-space: nowrap; /* Förhindrar radbrytning */
}


/* ==========================================================================
   3. SIDHUVUD & NAVIGATION
   ========================================================================== */
header {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;     
    background-color: rgba(249, 247, 240, 0.95); 
    border-bottom: 1px solid rgba(12, 72, 10, 0.1); 
    padding: 10px 0; 
    transition: background-color 0.3s ease, padding 0.3s ease; 
}

header nav a {
    color: var(--primary-color);
}

body {
    padding-top: 100px; 
}
#logo-link {
    float: left;
    display: block;
}
#logo-link img {
    height: 80px; 
    display: block;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav ul { list-style: none; }
nav ul li { display: inline; margin-left: 20px; }

nav ul a {
    color: var(--primary-color); 
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

nav ul a:hover,
nav ul a.active-page {
    color: var(--secondary-color);
}

/* ==========================================================================
   4. STARTSIDA SPECIFIKT (Karusell, Produkter, Plats)
   ========================================================================== */

/* -- Sektion Bakgrunder -- */
.activity-carousel-section {
    background-color: var(--dark-bg); 
    padding: 60px 0 0;
}
.activity-carousel-section h2, 
.activity-carousel-section .intro-text { color: white; text-align: center; }

/* -- Karusell -- */
.carousel-wrapper {
    width: 100%; 
    overflow-x: scroll;
    padding-bottom: 40px;
    -ms-overflow-style: none;  /* IE och Edge */
    scrollbar-width: none;  /* Firefox */
}
.carousel-wrapper::-webkit-scrollbar { display: none; }

.activity-carousel {
    display: flex; 
    gap: 20px;
    padding: 0 5%;
    min-width: fit-content;
}

.carousel-item {
    display: block;
    min-width: 400px;
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}
.carousel-item:hover { transform: translateY(-5px); }

.carousel-item .content {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 30px 15px 15px; 
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 100%); 
    color: white;
}
.carousel-item h3 { color: white; margin-bottom: 0.2em; font-size: 1.5em; }
.carousel-item p { font-size: 0.9em; color: #eee; margin: 0; }

/* Karusell Bakgrunder */
.carousel-item.products-bg { background: url('img/varaprodukter.jpg') center center/cover; }
.carousel-item.tinyhouse-bg { background: url('img/utsikttinyhouse.jpg') center center/cover; }
.carousel-item.market-bg { background: url('img/bondemarknad.jpg') center center/cover; }
.carousel-item.samarbete-bg { background: url('img/klaralven.jpg') center center/cover; }
.carousel-item.consulting-bg { background: url('img/knotebo-12.jpg') center center/cover; }

/* -- Startsidans Produktteaser -- */
.products-section {
    background-color: var(--light-bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* -- Startsidans Filosofi-rutnät (3 kolumner) -- */
.philosophy-section {
    text-align: center;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.feature-item {
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #eee;
    border-top: 4px solid var(--secondary-color);
    border-radius: 5px;
    text-align: left;
}

/* -- Startsidans Plats / Karta -- */
.location-section {
    background-color: #fff;
    padding: 0; 
    position: relative;
}
.location-section .container {
    padding: 60px 0; 
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.map-responsive-container {
    width: 100%;        
    height: 30vh;       
    min-height: 300px; 
    position: relative;
    overflow: hidden;
    display: block;
}
.map-responsive-container iframe {
    width: 100%; height: 100%; border: 0; display: block;
}

/* ==========================================================================
   5. INNEHÅLLSSIDOR (Filosofi.html, etc.) - ÅTERSTÄLLD
   ========================================================================== */

/* --- NY STYLING FÖR HISTORIA SEKTIONEN (Dubbla Kolumner) --- */

/* 1. Delar texten i två kolumner (endast på större skärmar) */
.content-grid .history-columns {
    /* Använd CSS Columns för att dela textinnehållet */
    column-count: 2;
    column-gap: 40px; /* Mellanrum mellan kolumnerna */
    /* Säkerställer att h3 inte bryts över kolumnerna */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
}

/* 2. Säkerställer att bilden hamnar direkt under textkolumnerna */
#historia .content-grid {
    flex-direction: column; /* Stapla elementen vertikalt (text följt av bild) */
}

/* Säkerställer att textinnehållet behåller full bredd i rutnätet */
#historia .content-grid .text-content {
    max-width: 100%;
}

/* --- SLUT NY STYLING --- */


/* -- Hero Banner -- */
.page-hero {
    background-color: var(--primary-color);
    color: white;
    padding: 100px 0 80px;
    text-align: center;
}
.page-hero h1 { color: white; margin-bottom: 20px; }
.page-hero .intro-text { color: #f0f0f0; margin: 0 auto; text-align: center;}

/* Specifik bakgrund för Filosofi */
.philosophy-hero {
    background: linear-gradient(rgba(12, 72, 10, 0.8), rgba(12, 72, 10, 0.8)), url('img/knotebo-12.jpg');
    background-size: cover;
    background-position: center;
}

/* Specifik bakgrund för Hitta Oss (NY) */
.location-hero {
    background: linear-gradient(rgba(12, 72, 10, 0.8), rgba(12, 72, 10, 0.8)), url('img/Knotebogard.jpg');
    background-size: cover;
    background-position: center;
}
#karta.content-section {
    padding-top: 10px;
}
/* -- Layout: Text bredvid Bild (Sicksack) -- */
.content-section { padding: 80px 0; }
.content-section.light-bg { background-color: var(--light-bg); }

.content-grid {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-top: 40px;
}

.text-content { flex: 1; text-align: left; }
.image-placeholder { flex: 1; }

.image-placeholder img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: block;
}

/* Omvänd ordning (Bild till vänster, text till höger) */
.reverse-order { flex-direction: row-reverse; }

/* -- Innehållsknappar -- */
.center-cta { text-align: center; margin-top: 60px; }

/* ==========================================================================
   6. KNAPPAR (Buttons)
   ========================================================================== */
.button {
    display: inline-block;
    padding: 10px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin: 5px;
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
}
.button.large-button { padding: 15px 40px; font-size: 1.1em; }

.button.primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}
.button.primary:hover { background-color: #2D5C17; }

.button.secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.button.secondary:hover { background-color: var(--primary-color); color: white; }

/* ==========================================================================
   7. SIDFOT
   ========================================================================== */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
}
.social-icons {
    margin-top: 15px;
    margin-bottom: 5px;
}
.social-icons a {
    color: white; /* Iconen moeten wit zijn */
    font-size: 1.8em; /* Vergroot de iconen */
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s;
}
.social-icons a:hover {
    color: var(--secondary-color); /* Lichter groen bij hover */
}

/* ==========================================================================
   8. PRODUKTER.HTML (Produktkort & Horisontell Scroll)
   ========================================================================== */

/* --- Hero Banner Bakgrund --- */
.products-hero {
    background: linear-gradient(rgba(12, 72, 10, 0.7), rgba(12, 72, 10, 0.7)), url('img/varaprodukter.jpg');
    background-size: cover;
    background-position: center;
}

/* --- Säsongsfält --- */
.seasonal-bar {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 15px 0;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

/* --- Sökfält Styling --- */
.search-section {
    padding: 30px 0 10px;
    background-color: var(--light-bg);
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
}

#productSearch {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    font-size: 1.1em;
    font-family: var(--font-secondary);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#productSearch:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(12, 72, 10, 0.2);
}

/* --- Produktkategori Rubrik Justering --- */
.product-category-section h2 {
    margin-bottom: 0;
    text-align: left;
}


/* --- Produkt Horisontell Scroll Layout --- */
.product-carousel-wrapper {
    width: 100%;
    overflow-x: scroll; 
    padding: 20px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.product-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.product-carousel {
    display: flex;
    gap: 30px;
    padding: 0 10px;
    min-width: fit-content;
}

/* *** FIX: FAST STORLEK FÖR KORTEN *** */
.product-card {
    width: 280px; /* Strikt bredd, löser inkonsekvens */
    height: 450px;  /* Fast höjd */
    flex-shrink: 0; 
    
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.product-card.coming-soon {
    opacity: 0.7;
    border: 1px dashed var(--secondary-color);
}

.product-card.out-of-stock {
    opacity: 0.7;
    border: 1px dashed var(--secondary-color);
}
/* Bildhöjden gjord något mindre för att ge plats åt kortets fasta höjd */
.product-image-container {
    height: 180px; 
    overflow: hidden;
}
.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
}

/* NYTT: Tvingar beskrivningen till max 3 rader och trunkerar med punkter */
.product-info p:not(.product-tag, .product-price) {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
    line-height: 1.3em; /* Standard radhöjd */
    max-height: 3.9em; /* 3 rader * 1.3em */
}


.product-info h3 {
    margin-top: 0;
    margin-bottom: 5px;
}

.product-price {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.3em;
    margin: 5px 0 15px;
}

/* --- Produkt Taggar (Oförändrad) --- */
.product-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.product-tag.in-stock {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}
.product-tag.season {
    background-color: #5cb85c;
    color: white;
}
.product-tag.coming-soon {
    background-color: #2d5a99; /* Zacht blauw */
    color: white;
}
.product-tag.limited {
    background-color: #d17a22; /* Warme oranje-tint */
    color: white;
}
.product-tag.out-of-stock {
    background-color: #ccc;
    color: #666;
}

.product-card.out-of-stock img {
    filter: grayscale(60%);
    opacity: 0.7;
}

/* --- Produkt Knappar (Oförändrad) --- */
.small-button {
    margin-top: auto; 
    padding: 8px 15px;
    font-size: 0.9em;
}

.small-button.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* ==========================================================================
   9. BESTÄLLNINGSFORMULÄR
   ========================================================================== */

/* Input för antal inuti produktkort */
.quantity-input-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    margin-top: 15px;
    border-top: 1px dashed #eee;
}

.quantity-input-wrapper label {
    font-weight: bold;
    font-size: 0.9em;
    color: var(--text-color);
}

.quantity-input-wrapper input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
}

/* Rutnätslayout för kundinformation i slutet av sidan */
.order-form-grid {
    display: grid;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
    text-align: left;
}

.order-form-grid label {
    font-weight: bold;
    margin-bottom: 5px;
}

.order-form-grid input[type="text"],
.order-form-grid input[type="email"],
.order-form-grid input[type="tel"],
.order-form-grid textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box; /* Säkerställer att padding är inkluderad i bredden (box-sizing) */
}

.order-form-grid textarea {
    resize: vertical;
}

.form-disclaimer {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    margin-bottom: 20px;
}

.center-cta {
    text-align: center;
}

/* ==========================================================================
   10. MODAL / LIGHTBOX
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Mörk, transparent bakgrund */
    display: none; /* Döljs som standard */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Säkerställer att den ligger över allt annat innehåll */
    overflow-y: auto; 
}

/* Klassen som läggs till av JavaScript för att visa modalen */
.modal-overlay.active {
    display: flex; 
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9); /* Börjar något mindre */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Animering när modalen är aktiv */
.modal-overlay.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    line-height: 1;
    font-weight: 300;
}

/* Se till att produktnamnet ser klickbart ut */
.product-info h3 {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--secondary-color); /* Lätt understrykning */
}

/* ==========================================================================
   11. TINYHOUSE.HTML SPECIFIEK
   ========================================================================== */

/* --- Hero Banner Achtergrond --- */
.tinyhouse-hero {
    /* Gebruikt dezelfde afbeelding als de carousel-item (tinyhouse-bg in sectie 4) */
    background: linear-gradient(rgba(12, 72, 10, 0.7), rgba(12, 72, 10, 0.7)), url('img/utsikttinyhouse.jpg'); 
    background-size: cover;
    background-position: center;
}

/* --- "Kommande" (Komt eraan) Banner --- */
.coming-soon-banner {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 15px 0;
    text-align: center;
    font-weight: bold;
    font-size: 1.3em;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    border-radius: 4px;
    margin-top: 10px 
}

/* --- Voorzieningen Raster (Amenities Grid) --- */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    text-align: center;
}
.amenity-item {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.amenity-item h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}
/* ==========================================================================
   12. KONSULT.HTML SPECIFIEK
   ========================================================================== */

/* ... bestaande stijlen ... */

/* NIEUW: Opmaak voor de Chroom-6 Highlight Box */
.cr6-highlight-box {
    background-color: var(--light-bg); /* Lichte achtergrondkleur van de site (#F9F7F0) */
    border-left: 5px solid var(--primary-color); /* Donkergroene lijn aan de zijkant */
    padding: 20px;
    margin-top: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Lichte schaduw */
}

/* Zorg dat de paragraaf in de box geen onnodige onder-marge heeft */
.cr6-highlight-box p {
    margin-bottom: 0; 
}

/* ==========================================================================
   13. RESPONSIVITET (Mobil & Surfplatta)
   ========================================================================== */
@media (max-width: 900px) {
    .activity-carousel { padding: 0 20px; }
    
    /* Se till att innehållssidor staplas under varandra på surfplattor/små skärmar */
    .content-grid, 
    .content-grid.reverse-order {
        flex-direction: column;
        gap: 30px;
    }
    .image-placeholder { max-width: 600px; margin: 0 auto; }
}

@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }
    body {
        padding-top: 110px;
    }
    header .container {
        flex-direction: column;
        text-align: center;
    }
    #logo-link {
        float: none;
        margin-bottom: 10px;
    }
    #logo-link img {
        max-height: 35px;
        width: auto;
    }
    nav ul {
        padding: 0;
    }
    nav ul li {
        margin: 0 10px;
    }
    header nav a {
        font-size: 0.9em;
        padding: 1px 10px;
    }

    h1 {
        font-size: 2em; 
    }
    h2 {
        font-size: 1.3em;
    }
    h3 {
        font-size: 1.1em;
    }
    .intro-text {
        font-size: 1.0em;
    }
    /* Startsida: Rutnät till 1 kolumn */
    .feature-grid { grid-template-columns: 1fr; }

    /* Kartans höjd justeras */
    .map-responsive-container { height: 250px; }

    /* Stänger av kolumner på små skärmar för historia */
    .content-grid .history-columns {
        column-count: 1;
        column-gap: 0;
    }
}

@media (max-width: 600px) {
    /* Karusellobjekt anpassade för mobil */
    .carousel-item { min-width: 75vw; height: 250px; }
    .carousel-item .content { padding: 20px 15px 15px; }
}