/*
Theme Name: Prepper
Description: Moderne WordPress tema til magasin om katastrofeberedskab og prepping. Optimeret til Gutenberg og mobile enheder.
Author: Mads Nordskov
Version: 1.1.1
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Funnel+Sans:wght@400;500;600;700&display=swap');

:root {
    --color-forest-shadow: #3E4A3B;
    --color-moss-green: #5D6956;
    --color-sage: #8A9677;
    --color-sand: #C4B896;
    --color-safety-orange: #FF6B35;
    --color-white: #ffffff;
    
    --font-mono: 'DM Mono', monospace;
    --font-sans: 'Funnel Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-forest-shadow);
    background-color: var(--color-white);
}

/* WordPress Core Alignment Classes */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin: 0 auto 1.5rem;
}

.alignwide {
    margin-left: -5vw;
    margin-right: -5vw;
    max-width: calc(100vw - 2rem);
    width: auto;
}

.alignfull {
    margin-left: calc(-100vw / 2 + 100% / 2);
    margin-right: calc(-100vw / 2 + 100% / 2);
    max-width: 100vw;
    width: auto;
}

/* WordPress Block Editor Styles */
.wp-block-group {
    margin-bottom: 2rem;
}

.wp-block-columns {
    margin-bottom: 2rem;
}

.wp-block-column {
    margin-bottom: 1rem;
}

.wp-block-image {
    margin-bottom: 1.5rem;
}

.wp-block-quote {
    border-left: 4px solid var(--color-safety-orange);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.wp-block-pullquote {
    border-top: 4px solid var(--color-safety-orange);
    border-bottom: 4px solid var(--color-safety-orange);
    padding: 2rem 0;
    text-align: center;
    margin: 2rem 0;
}

.wp-block-button__link {
    background-color: var(--color-safety-orange);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.wp-block-button__link:hover {
    background-color: #e55a2e;
    transform: translateY(-2px);
}

/* Header & Navigation */
.site-header {
    background-color: var(--color-forest-shadow);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(62, 74, 59, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.main-navigation a:hover {
    color: var(--color-safety-orange);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Main Content */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
}

.content-area {
    width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

h3 {
    font-size: 1.8rem;
}

h4 {
    font-size: 1.4rem;
}

.entry-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.entry-content {
    margin-bottom: 2rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

/* Post Meta */
.entry-meta {
    font-size: 0.9rem;
    color: var(--color-sage);
    margin-bottom: 1.5rem;
}

.entry-meta a {
    color: var(--color-safety-orange);
    text-decoration: none;
}

.entry-meta a:hover {
    text-decoration: underline;
}

/* Category Labels */
.post-categories {
    margin-bottom: 1rem;
}

.post-categories a {
    background-color: var(--color-safety-orange);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-moss-green) 0%, var(--color-forest-shadow) 100%);
    color: white;
    padding: 4rem 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.cta-button {
    background-color: var(--color-safety-orange);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    background-color: #e55a2e;
    transform: translateY(-2px);
}

.hero-image {
    background-color: var(--color-sage);
    border-radius: 12px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 500;
    color: var(--color-forest-shadow);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-subtitle {
    color: var(--color-moss-green);
    font-size: 1.1rem;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(62, 74, 59, 0.1);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(62, 74, 59, 0.15);
}

.news-card-image {
    height: 200px;
    background-color: var(--color-sage);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.news-card-content {
    padding: 1.5rem;
}

.news-card h3 {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.news-card h3 a {
    color: inherit;
    text-decoration: none;
}

.news-card h3 a:hover {
    color: var(--color-safety-orange);
}

.news-card p {
    color: var(--color-moss-green);
    margin-bottom: 1rem;
}

.news-card-meta {
    font-size: 0.9rem;
    color: var(--color-sage);
}

/* Single Post */
.single-post .entry-header {
    margin-bottom: 3rem;
}

.single-post .post-thumbnail {
    margin-bottom: 2rem;
}

.single-post .post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Archive Pages */
.archive-header {
    margin-bottom: 3rem;
    text-align: center;
}

.archive-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--color-moss-green);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
    gap: 1rem;
}

.page-numbers {
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    border: 2px solid var(--color-sage);
    border-radius: 6px;
    color: var(--color-forest-shadow);
    transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background-color: var(--color-safety-orange);
    border-color: var(--color-safety-orange);
    color: white;
}

/* Widgets & Sidebar */
.widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(62, 74, 59, 0.1);
}

.widget-title {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.widget li {
    margin-bottom: 0.5rem;
}

.widget a {
    color: var(--color-forest-shadow);
    text-decoration: none;
}

.widget a:hover {
    color: var(--color-safety-orange);
}

/* Footer */
.site-footer {
    background-color: var(--color-forest-shadow);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-widgets {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-widget h3 {
    margin-bottom: 1rem;
    color: var(--color-safety-orange);
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-widget a {
    color: var(--color-sand);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-widget a:hover {
    color: white;
}

.site-info {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-moss-green);
    margin-top: 2rem;
    color: var(--color-sage);
}

/* Mobile Menu Styles */
.mobile-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-forest-shadow);
    z-index: 999;
    padding-top: 80px;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.mobile-menu-container[style*="block"] {
    animation: slideInDown 0.3s ease forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-navigation {
    list-style: none;
    padding: 2rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-navigation li {
    border-bottom: 1px solid var(--color-moss-green);
}

.mobile-navigation a {
    display: block;
    padding: 1.5rem 0;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.mobile-navigation a:hover,
.mobile-navigation a:focus {
    color: var(--color-safety-orange);
    padding-left: 1rem;
    outline: 2px solid var(--color-safety-orange);
    outline-offset: 2px;
}

.mobile-menu-toggle {
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: var(--color-safety-orange);
}

.mobile-menu-toggle[aria-expanded="true"] {
    color: var(--color-safety-orange);
}

/* Header Scroll Effect */
.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(62, 74, 59, 0.2);
    backdrop-filter: blur(10px);
}

/* Loading State */
body:not(.loaded) {
    overflow: hidden;
}

body:not(.loaded) .site-main {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

body.loaded .site-main {
    opacity: 1;
    transform: translateY(0);
}

/* Single Post Layout with Sidebar */
.site-main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    display: grid !important;
    grid-template-columns: 2fr 1fr !important; /* Main content takes 2/3, sidebar takes 1/3 */
    gap: 2rem;
    min-width: 768px; /* Prevent grid collapse on narrower screens */
}

.site-main {
    width: 100%;
}

#secondary {
    width: 100%;
    background-color: var(--color-sand); /* Light background for visual distinction */
    border-left: 2px solid var(--color-moss-green); /* Subtle separator */
    padding: 1.5rem;
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-navigation ul {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .site-main {
        padding: 2rem 1rem;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .nav-container {
        position: relative;
    }
    
    .mobile-menu-container {
        padding-top: 70px;
    }
    
    .mobile-navigation {
        padding: 1rem;
    }
    
    .mobile-navigation a {
        font-size: 1.1rem;
        padding: 1.2rem 0;
    }

    .site-main-container {
        grid-template-columns: 1fr !important; /* Stack main and sidebar on mobile */
        min-width: 0; /* Allow full responsiveness */
    }

    #secondary {
        margin-top: 2rem;
        border-left: none; /* Remove separator on mobile */
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 1rem;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .entry-title {
        font-size: 2rem;
    }

    .mobile-menu-container {
        padding-top: 65px;
    }
    
    .mobile-navigation a {
        font-size: 1rem;
        padding: 1rem 0;
    }
}