@import url('https://fonts.googleapis.com/css2?family=Mali:wght@400;600;700&display=swap');

:root {
    /* TGT Color Palette - Updated */
    --primary-color: #4997CB; /* tmavě modrá */
    --secondary-color: #54595F; /* Dark Grey - kept for text/ui */
    --text-color: #7A7A7A; /* Grey */
    
    /* Brand Colors */
    --brand-purple: #83579F; /* fialová */
    --brand-pink: #CA579C; /* fialovorůžová */
    --brand-dark-red: #D84545; /* tmavě červená */
    --brand-red: #F6454F; /* červená */
    --brand-wine: #CC3366; /* vínová */
    --brand-dark-beige: #DCB68F; /* tmavé hnědá */
    --brand-beige: #ECDFCD; /* pozadí hnědá */
    --brand-gold: #D29945; /* zlata */
    --brand-light-blue: #94D0F2; /* světle modrá */
    --brand-emerald: #5CBB9E; /* smaragdová */
    --brand-light-emerald: #27B2B9; /* světle smaragdová */
    --brand-green: #4DA167; /* zelená pro zeleninu */

    --white: #ffffff;
    --gray: #f5f5f5; /* flat neutral - admin pages only, see .bg-light */
    --spacing: 2rem;
    --border-radius: 20px;
}

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

body {
    font-family: 'Mali', cursive, sans-serif; /* Updated Font */
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* Consistent type scale across all pages (heroes may override inline). */
h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    line-height: 1.25;
}

h3 {
    font-size: 1.35rem;
    line-height: 1.3;
}

h4 {
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }
}

/* Consistent custom-styled selects (Mali font + custom chevron, no native look). */
select.form-control,
.variant-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    max-width: 420px;
    padding: 12px 40px 12px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2383579F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

select.form-control:focus,
.variant-select:focus {
    border-color: var(--brand-purple);
    outline: none;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem; /* consistent button text size regardless of surrounding context */
    line-height: 1.2;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap; /* Prevents text from wrapping to second line */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Navbar */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    font-weight: 500;
    color: var(--text-color);
    transition: color 0.3s;
}

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

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 30px; /* Slightly wider */
    height: 4px; /* Slightly thicker */
    margin: 6px auto;
    border-radius: 4px; /* Rounded edges */
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: #333333; /* Hardcoded dark color */
}

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

/* Hero buttons (legacy .hero/.hero h1/.hero p rules removed; pages use .hero-split). */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    margin-bottom: 3rem;
    color: #666;
}

/* Admin pages only (flat grey backdrop). Do NOT use for marketing section
   alternation - that zebra is white (default) <-> .bg-paper. */
.bg-light {
    background-color: var(--gray);
}

/* Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Enforce 3 columns to prevent single items from stretching */
    gap: 2rem;
}

/* Mobile responsive grid */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* 4-column variant grid (product buy box) */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* O mně / about section grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.card {
    position: relative;
    background: var(--white);
    padding: 2rem 1.5rem; /* Slightly reduced horizontal padding */
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    min-height: 3.4rem; /* Keeps titles aligned even if one is slightly longer */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card:hover {
    transform: translateY(-5px);
}

.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.gallery-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 1.5rem;
}

.gallery-thumb {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background-color: #eee;
}

.gallery-item h3 {
    margin: 1rem 0;
    font-size: 1.1rem;
}

/* Footer - Soil Theme */
.footer {
    background: linear-gradient(180deg, #5C3D2E 0%, #4A3122 30%, #3B2518 60%, #2E1B10 100%);
    color: #3B2518;
    padding: 0 0 2rem;
    position: relative;
    overflow: hidden;
}

/* Dirt texture overlay */
.footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle 2px at 15% 25%, rgba(0,0,0,0.15) 50%, transparent 50%),
        radial-gradient(circle 3px at 45% 15%, rgba(0,0,0,0.1) 50%, transparent 50%),
        radial-gradient(circle 1.5px at 70% 40%, rgba(0,0,0,0.12) 50%, transparent 50%),
        radial-gradient(circle 2px at 25% 60%, rgba(0,0,0,0.1) 50%, transparent 50%),
        radial-gradient(circle 2.5px at 80% 70%, rgba(0,0,0,0.08) 50%, transparent 50%),
        radial-gradient(circle 1px at 55% 85%, rgba(0,0,0,0.12) 50%, transparent 50%),
        radial-gradient(circle 3px at 10% 80%, rgba(139,90,43,0.2) 50%, transparent 50%),
        radial-gradient(circle 2px at 90% 30%, rgba(139,90,43,0.15) 50%, transparent 50%),
        radial-gradient(circle 2px at 35% 45%, rgba(139,90,43,0.1) 50%, transparent 50%),
        radial-gradient(circle 1.5px at 60% 55%, rgba(0,0,0,0.1) 50%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

.footer h4 {
    margin-bottom: 1rem;
    color: #5C3D2E;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer p {
    color: #4A3122;
    line-height: 1.6;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #3B2518;
    text-decoration: underline;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--brand-emerald);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    border-top: 2px dashed rgba(139,90,43,0.4);
    padding-top: 2rem;
    color: #5C3D2E;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* =========================================
   MOBILE OPTIMIZATION (Max-width 768px)
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Better Typography sizing */
    html {
        font-size: 14px; /* Base font size smaller */
    }
    
    h1 {
        font-size: 2.2rem !important; /* Override inline styles */
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    h2.section-title {
        font-size: 1.8rem;
    }

    /* 2. Layout Adjustments */
    .container {
        padding: 0 1.2rem; /* More space for content, less margins */
    }

    .section {
        padding: 3rem 0; /* Less vertical space between sections */
    }

    /* 3. Hero Section Fixes */
    .hero-grid {
        display: flex;
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-buttons {
        justify-content: center !important; /* Center buttons on mobile */
        flex-direction: column; /* Stack buttons */
        gap: 1rem;
    }

    .hero-buttons .btn {
        width: 100%; /* Full width buttons are easier to tap */
        text-align: center;
    }

    /* 4. Navigation & Touch Targets */
    .nav-links {
        display: none; /* Hidden by default */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        padding: 0;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        border-top: 2px solid var(--primary-color);
        gap: 0; /* Reset flex gap from desktop styles */
    }

    .nav-links.nav-active {
        display: flex; /* Show when active */
    }
    
    .hamburger {
        display: block !important; /* Force show */
        z-index: 1001; /* Ensure on top */
        padding: 10px; /* Touchable area */
    }

    .nav-links li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid #eee; /* Divider */
    }
    
    .nav-links a {
        display: block;
        padding: 15px 20px; /* Larger touch area, less margin */
        font-size: 1.1rem;
    }

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

    /* 5. Cards & Grid */
    .grid-3, .grid-2, .grid-4 {
        grid-template-columns: 1fr; /* Force single column */
        gap: 1.5rem;
    }

    /* Fix for very small screens (iPhone SE etc) */
    .card {
        padding: 1.5rem;
    }
}

/* Guides Section */
.guide-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.guide-thumb {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    color: var(--white);
}

.guide-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.guide-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Comics Section */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.comic-item {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    cursor: pointer;
}

.comic-item:hover {
    transform: scale(1.02);
}

.comic-thumb {
    height: 250px; /* Taller for comics */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.comic-item h3 {
    padding: 1rem;
    text-align: center;
    color: var(--secondary-color);
}

/* Book Cover Images */
.book-cover-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 2px solid #333;
    margin-bottom: 1rem;
    box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.book-cover-img:hover {
    transform: scale(1.05);
}

