/*
Theme Name: Niiinis Recepttema
Theme URI: https://niiinis.se
Author: Jesper Ekerling
Author URI: https://niiinis.se
Description: Ett modernt WordPress-tema för receptsajter med anpassningsbara färger, typsnitt och responsiv layout med sidoannonser.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: niiinis-recipe
Tags: blog, food-and-drink, custom-colors, custom-header, custom-menu, featured-images, flexible-header, responsive-layout, threaded-comments, translation-ready
*/

/* Reset och grundläggande styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color, #333);
    background-color: var(--background-color, #f5f5f5);
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font, Georgia, 'Times New Roman', serif);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

/* General link styles - outside content area */
a {
    color: var(--link-color, #6e3838);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color, #005177);
    text-decoration: underline;
}

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

/* Header med bild */
.site-header {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Logo overlay */
.site-logo {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    max-width: 250px;
    width: 80%;
    transition: opacity 0.3s ease;
    display: block;
}

.site-logo:hover {
    opacity: 0.9;
}

.site-logo img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.65)) 
            drop-shadow(-1px -1px 2px rgba(0, 0, 0, 0.5)) 
            drop-shadow(0 0 6px rgba(0, 0, 0, 0.5));
}

/* Desktop: Logo to the left */
@media (min-width: 768px) {
    .site-logo {
        left: 10%;
        top: 50%;
        transform: translateY(-50%);
        max-width: 23%;
    }
    
    .site-logo img {
        filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8)) 
                drop-shadow(-1px -1px 2px rgba(0, 0, 0, 0.6))
                drop-shadow(0 0 6px rgba(0, 0, 0, 0.5));
    }
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.header-image:hover {
    opacity: 0.9;
}

.header-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Desktop header-bild */
.header-image-desktop {
    display: none;
}

/* Mobil header-bild */
.header-image-mobile {
    display: block;
}

/* Layout container */
.site-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    position: relative;
}

/* ==================== STICKY TOP NAVIGATION ==================== */
.sticky-top-nav {
    position: relative;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color-main, #ddd);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.sticky-top-nav.hidden {
    transform: translateY(-100%);
}

.sticky-nav-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Row 1 - Hamburger, Logo, Menu, Search, Social Icons */
.sticky-nav-row-1 {
    background: var(--sticky-nav-row1-bg, #735146);
}

.sticky-nav-row-1 .sticky-nav-container {
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
    gap: 15px;
    min-height: 60px;
}

/* Hamburger Menu Toggle */
.hamburger-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    flex-shrink: 0;
}

.hamburger-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.site-title {
    font-family: var(--sticky-nav-title-font);
    font-size: var(--sticky-nav-title-size);
    font-weight: 600;
    flex-shrink: 0;
}

.site-title a {
    color: var(--site-title-color, #8B0000);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-title a:hover {
    color: var(--site-title-hover-color, #A00000);
}

/* Main Navigation Menu (visible items) */
.main-nav-wrapper {
    flex: 0 1 auto;
    overflow: hidden;
    min-width: 0;
}

.main-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    white-space: nowrap;
}

.main-nav-menu > li {
    margin: 0;
    padding: 0;
    position: relative;
}

.main-nav-menu > li > a {
    display: block;
    padding: 20px 18px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.main-nav-menu > li > a:hover {
    background: rgba(0,0,0,0.15);
}

/* Desktop submenu */
.main-nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--content-bg, #fff);
    border: 1px solid var(--border-color-main, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.main-nav-menu .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.main-nav-menu .sub-menu li {
    margin: 0;
    padding: 0;
}

.main-nav-menu .sub-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.main-nav-menu .sub-menu a:hover {
    background: rgba(0,0,0,0.05);
}

/* Search Form */
.sticky-search-form {
    flex: 1;
    display: flex;
    max-width: 350px;
}

.sticky-search-form form {
    display: flex;
    margin: 0;
    width: 100%;
}

.sticky-search-form label {
    flex: 1;
    margin: 0;
    display: flex;
}

.sticky-search-form .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.sticky-search-form input[type="search"],
.sticky-search-form .search-field {
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 8px 0 0 8px;
    background: rgba(255,255,255,0.95);
    color: #333;
    font-size: 14px;
    flex: 1;
    height: 42px;
    box-sizing: border-box;
}

.sticky-search-form input[type="search"]::placeholder,
.sticky-search-form .search-field::placeholder {
    color: #999;
}

.sticky-search-form button,
.sticky-search-form .search-submit {
    padding: 0;
    background: #c00 !important;
    color: #fff !important;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    font-weight: 600;
    transition: background 0.2s ease;
    min-width: 60px;
    width: 60px;
    height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sticky-search-form button *:not(svg),
.sticky-search-form .search-submit *:not(svg) {
    display: none !important;
}

.sticky-search-form button:hover,
.sticky-search-form .search-submit:hover {
    opacity: 0.9;
}

.sticky-search-form button svg,
.sticky-search-form .search-submit svg {
    display: block;
    margin: 0 auto;
}

/* Social Icons */
.social-icons {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
}

.social-icons a {
    color: var(--social-icons-color, rgba(255,255,255,0.8));
    transition: color 0.2s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.social-icons a:hover {
    color: var(--social-icons-hover-color, rgba(255,255,255,1));
}

.social-icons svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}

/* Hamburger Menu (Slide-in from left) */
.hamburger-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--content-bg, #fff);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 9998;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.hamburger-menu.active {
    left: 0;
}

.hamburger-menu-content {
    padding: 80px 20px 20px;
}

/* Social Icons in Hamburger Menu */
.hamburger-social-icons {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 30px 10px 20px;
    margin-top: 20px;
}

.hamburger-social-icons a {
    color: var(--text-color);
    transition: color 0.2s ease;
}

.hamburger-social-icons a:hover {
    color: var(--link-color, #0066cc);
}

.hamburger-social-icons svg {
    width: 26px;
    height: 26px;
}

.hamburger-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hamburger-nav li {
    margin: 0;
    padding: 0;
}

.hamburger-nav > li > a {
    display: block;
    padding: 15px 10px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color-main, #ddd);
    transition: background 0.2s ease;
    position: relative;
}

.hamburger-nav > li > a:hover {
    background: rgba(0,0,0,0.05);
}

/* Hamburger menu submenu styles */
.hamburger-nav .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hamburger-nav .submenu-arrow {
    font-size: 24px;
    transition: transform 0.3s ease;
    display: inline-block;
    margin-left: 10px;
}

.hamburger-nav .menu-item-has-children.submenu-open > a .submenu-arrow {
    transform: rotate(90deg);
}

.hamburger-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.03);
}

.hamburger-nav .menu-item-has-children.submenu-open > .sub-menu {
    max-height: 1000px;
}

.hamburger-nav .sub-menu li a {
    display: block;
    padding: 12px 10px 12px 30px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color-main, #ddd);
    transition: background 0.2s ease;
}

.hamburger-nav .sub-menu li a:hover {
    background: rgba(0,0,0,0.05);
}

body.menu-open {
    overflow: hidden;
}

body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9997;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--content-bg, #fff);
    border-top: 1px solid var(--border-color-main, #ddd);
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color, #333);
    text-decoration: none;
    padding: 4px 12px;
    transition: color 0.2s ease;
    background: transparent !important;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.mobile-bottom-nav-item:hover,
.mobile-bottom-nav-item:focus {
    color: var(--primary-color, #c00);
}

.mobile-bottom-nav-item svg {
    margin-bottom: 2px;
}

.mobile-bottom-nav-item .sun-icon,
.mobile-bottom-nav-item .moon-icon {
    transition: all 0.3s ease;
}

.mobile-bottom-nav-item .moon-icon {
    display: none;
}

html[data-theme="dark"] .mobile-bottom-nav-item .sun-icon {
    display: none;
}

html[data-theme="dark"] .mobile-bottom-nav-item .moon-icon {
    display: block;
}

.mobile-bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
}

/* Mobile Search Overlay */
.mobile-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 99999;
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-search-overlay.active {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

.mobile-search-content {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.mobile-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 10px;
}

.mobile-search-form {
    display: flex;
    width: 100%;
}

.mobile-search-form input[type="search"],
.mobile-search-form .search-field {
    flex: 1;
    padding: 16px 20px;
    border: none;
    border-radius: 8px 0 0 8px;
    background: #fff;
    color: #333;
    font-size: 16px;
}

.mobile-search-form button,
.mobile-search-form .search-submit {
    padding: 16px 24px;
    background: var(--search-button-bg, #c00);
    color: var(--search-button-text, #fff);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive helpers */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .mobile-bottom-nav {
        display: flex;
    }
}

/* Responsive adjustments */
@media (max-width: 1150px) {
    .main-nav-wrapper {
        display: none;
    }
    
    .sticky-search-form {
        max-width: 300px;
    }
}

@media (max-width: 900px) {
    .social-icons {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .sticky-search-form {
        display: none !important;
    }
    
    .sticky-nav-row-1 .sticky-nav-container {
        gap: 10px;
        padding: 0 15px;
        min-height: 56px;
        justify-content: space-between;
    }
    
    .site-title {
        font-size: 16px;
    }
    
    body {
        padding-bottom: 70px;
    }
}



/* Dark mode support for sticky nav */
html[data-theme="dark"] .sticky-top-nav {
    background: var(--content-bg, #2d2d2d);
    border-bottom-color: #444;
}

html[data-theme="dark"] .sticky-nav-row-1 {
    border-bottom-color: #444;
}

html[data-theme="dark"] .site-title a {
    color: var(--site-title-color-dark, #ff6b6b);
}

html[data-theme="dark"] .site-title a:hover {
    color: var(--site-title-hover-color-dark, #ff8787);
}

html[data-theme="dark"] .social-icons a {
    color: rgba(255,255,255,0.9) !important;
}

.html[data-theme="dark"] .social-icons a:hover {
    color: rgba(255,255,255,1) !important;
}

html[data-theme="dark"] .main-nav-menu > li > a {
    color: rgba(255,255,255,0.9);
}

html[data-theme="dark"] .main-nav-menu > li > a:hover {
    background: rgba(255,255,255,0.1);
}

html[data-theme="dark"] .sticky-search-form input[type="search"],
html[data-theme="dark"] .sticky-search-form .search-field {
    background: var(--background-color, #1a1a1a);
    color: var(--text-color, #e0e0e0);
    border-color: #444;
}

html[data-theme="dark"] .sticky-search-form button,
html[data-theme="dark"] .sticky-search-form .search-submit {
    background: #c00 !important;
    color: #fff !important;
}

html[data-theme="dark"] .hamburger-menu-toggle {
    background: transparent !important;
}

html[data-theme="dark"] .hamburger-menu-toggle span {
    background: rgba(255,255,255,0.9);
}

html[data-theme="dark"] .hamburger-menu {
    background: var(--content-bg, #2d2d2d);
}

html[data-theme="dark"] .hamburger-nav > li > a {
    color: var(--text-color, #e0e0e0);
    border-bottom-color: #444;
}

html[data-theme="dark"] .hamburger-nav > li > a:hover {
    background: rgba(255,255,255,0.05);
}

html[data-theme="dark"] .hamburger-nav .sub-menu {
    background: rgba(0,0,0,0.2);
}

html[data-theme="dark"] .mobile-bottom-nav {
    background: var(--content-bg, #2d2d2d);
    border-top-color: #444;
}

html[data-theme="dark"] .mobile-bottom-nav-item {
    color: var(--text-color, #e0e0e0);
    background: transparent !important;
}

html[data-theme="dark"] .mobile-bottom-nav-item svg {
    color: rgba(255,255,255,0.9);
}

html[data-theme="dark"] .mobile-bottom-nav-item span {
    color: rgba(255,255,255,0.9);
}

html[data-theme="dark"] .mobile-bottom-nav-item:hover,
html[data-theme="dark"] .mobile-bottom-nav-item:focus {
    color: var(--primary-color, #ff6b6b);
    background: transparent !important;
}

html[data-theme="dark"] .mobile-bottom-nav-item:hover svg,
html[data-theme="dark"] .mobile-bottom-nav-item:focus svg,
html[data-theme="dark"] .mobile-bottom-nav-item:hover span,
html[data-theme="dark"] .mobile-bottom-nav-item:focus span {
    color: var(--primary-color, #ff6b6b);
}

html[data-theme="dark"] .mobile-nav .sub-menu li a {
    color: var(--text-color, #e0e0e0);
    border-bottom-color: #444;
}

html[data-theme="dark"] .mobile-nav .sub-menu li a:hover {
    background: rgba(255,255,255,0.05);
}

html[data-theme="dark"] .mobile-menu-toggle span {
    background: rgba(255,255,255,0.9);
}

/* ==================== END STICKY TOP NAVIGATION ==================== */

/* Dark mode toggle in navigation */
.nav-dark-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    color: rgba(255,255,255,0.9) !important;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.2);
    margin-right: 15px;
    padding-right: 15px;
    flex-shrink: 0;
}

.nav-dark-mode-toggle:hover {
    color: rgba(255,255,255,1) !important;
    background: transparent !important;
}

.nav-dark-mode-toggle svg {
    color: rgba(255,255,255,0.9) !important;
}

.nav-dark-mode-toggle .mode-text {
    color: rgba(255,255,255,0.9) !important;
}

html[data-theme="dark"] .nav-dark-mode-toggle {
    background: transparent !important;
    color: rgba(255,255,255,0.9) !important;
}

html[data-theme="dark"] .nav-dark-mode-toggle:hover {
    background: transparent !important;
    color: rgba(255,255,255,1) !important;
}

html[data-theme="dark"] .nav-dark-mode-toggle svg {
    color: rgba(255,255,255,0.9) !important;
}

html[data-theme="dark"] .nav-dark-mode-toggle .mode-text {
    color: rgba(255,255,255,0.9) !important;
}

.nav-dark-mode-toggle svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-dark-mode-toggle .mode-text {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.nav-dark-mode-toggle .sun-icon,
.nav-dark-mode-toggle .moon-icon {
    transition: all 0.3s ease;
}

.nav-dark-mode-toggle .moon-icon {
    display: none;
}

html[data-theme="dark"] .nav-dark-mode-toggle .sun-icon {
    display: none;
}

html[data-theme="dark"] .nav-dark-mode-toggle .moon-icon {
    display: block;
}

/* Hide text on smaller screens */
@media (max-width: 1300px) {
    .nav-dark-mode-toggle .mode-text {
        display: none;
    }
    .nav-dark-mode-toggle {
        padding: 8px;
    }
}

/* Dark mode toggle button (old fixed position - hide on desktop) */
.dark-mode-toggle {
    display: none;
}


.site-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    gap: 20px;
}

/* Huvudinnehåll */
.site-main {
    width: 100%;
    max-width: 1050px;
    background: var(--content-bg, #fff);
    padding: 30px;
    border: var(--content-border, 1px solid #ddd);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Sidospalter */
.sidebar-column {
    width: 300px;
    flex-shrink: 0;
    display: none;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    transition: top 0.3s ease;
}

.sidebar-column.left {
    order: -1;
}

.sidebar-column.right {
    order: 1;
}

.column-placeholder {
    width: 300px;
    height: 600px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #999;
}

/* Post/Article styling */
.post {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 2px solid #eee;
}

.post:last-child {
    border-bottom: none;
}

.entry-header {
    margin-bottom: 20px;
}

.entry-title {
    margin-bottom: 10px;
}

.entry-title a {
    color: #333;
    text-decoration: none;
}

.entry-title a:hover {
    color: #0066cc;
}

.entry-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.entry-meta a {
    color: #666;
}

.entry-meta a:hover {
    color: #0066cc;
}

.post-thumbnail {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
}

.entry-content {
    margin-bottom: 20px;
}

/* Links inside content area */
.site-main a,
.site-main .entry-content a,
.entry-content a,
article a {
    color: var(--content-link-color, #a60e0e);
}

.site-main a:hover,
.site-main .entry-content a:hover,
.entry-content a:hover,
article a:hover {
    color: var(--content-link-hover-color, #7a0a0a);
}

.entry-content p {
    margin-bottom: 1em;
}

.entry-content ul,
.entry-content ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

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

/* Recipe-specifik styling */
.recipe-meta {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #0066cc;
}

.recipe-meta-item {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.recipe-meta-item strong {
    color: #333;
}

.recipe-ingredients,
.recipe-instructions {
    margin: 30px 0;
}

.recipe-ingredients h3,
.recipe-instructions h3 {
    border-bottom: 2px solid #0066cc;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Navigation */
.navigation {
    padding: 30px 0;
    clear: both;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-links a {
    padding: 10px 20px;
    background: #0066cc;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
}

.nav-links a:hover {
    background: #004499;
    text-decoration: none;
}

/* Comments */
.comments-area {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.comment-list {
    list-style: none;
    margin: 0;
}

.comment {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Footer */
.site-footer {
    background: var(--sticky-nav-row1-bg, #735146);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.site-footer a {
    color: #fff;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-text {
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer-text p {
    margin: 0.5em 0;
}

.footer-navigation {
    margin-top: 20px;
}

.footer-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-navigation li {
    display: inline;
}

/* Responsiv design */

/* Desktop (1650px+): Visa båda sidoannonserna */
@media (min-width: 1650px) {
    .header-image-desktop {
        display: block;
    }
    
    .header-image-mobile {
        display: none;
    }
    
    .sidebar-column.left,
    .sidebar-column.right {
        display: block;
    }
}

/* Medium desktop (1370px - 1649px): Visa en sidoannons */
@media (min-width: 1370px) and (max-width: 1649px) {
    .header-image-desktop {
        display: block;
    }
    
    .header-image-mobile {
        display: none;
    }
    
    .sidebar-column.right {
        display: block;
    }
}

/* Desktop (768px+) */
@media (min-width: 768px) {
    .header-image-desktop {
        display: block;
    }
    
    .header-image-mobile {
        display: none;
    }
}

/* Entry footer styling */
.entry-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.entry-meta-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.entry-meta-footer .posted-on {
    font-style: italic;
}

.entry-meta-footer .comments-link a {
    color: var(--link-color, #0073aa);
    text-decoration: none;
    font-weight: 500;
}

.entry-meta-footer .comments-link a:hover {
    color: var(--link-hover-color, #005177);
    text-decoration: underline;
}

/* Tablet och mindre */
@media (max-width: 767px) {
    .site-main {
        padding: 20px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .nav-links {
        flex-direction: column;
    }
}

/* Comments Section Styling */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color, #ddd);
}

.comments-title {
    margin-bottom: 2rem;
    font-size: 1.75rem;
    color: var(--text-color, #333);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.comment-list .comment {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--content-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment-list .children {
    list-style: none;
    margin-left: 2rem;
    margin-top: 1rem;
}

.comment-author {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.comment-author .avatar {
    border-radius: 50%;
    float: left;
    margin-right: 1rem;
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--meta-color, #666);
    margin-bottom: 1rem;
}

.comment-metadata a {
    color: var(--meta-color, #666);
    text-decoration: none;
}

.comment-metadata a:hover {
    color: var(--link-color, #0073aa);
}

.comment-content {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.reply {
    margin-top: 1rem;
}

.reply a {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: var(--link-color, #0073aa);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

.reply a:hover {
    background: var(--link-hover-color, #005177);
}

.no-comments {
    font-style: italic;
    color: var(--meta-color, #666);
    padding: 1rem;
    text-align: center;
}

/* Comment Form */
.comment-respond {
    margin-top: 2rem;
}

.comment-reply-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-form-comment label,
.comment-form-author label,
.comment-form-email label,
.comment-form-url label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--input-bg, #fff);
    color: var(--text-color, #333);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.comment-form-comment textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form-comment textarea:focus,
.comment-form-author input:focus,
.comment-form-email input:focus,
.comment-form-url input:focus {
    outline: none;
    border-color: var(--link-color, #0073aa);
}

.form-submit {
    margin-top: 1rem;
}

.form-submit input[type="submit"] {
    padding: 0.75rem 2rem;
    background: var(--link-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-submit input[type="submit"]:hover {
    background: var(--link-hover-color, #005177);
}

/* Mobil */
@media (max-width: 480px) {
    .site-wrapper {
        padding: 10px;
    }
    
    .site-main {
        padding: 15px;
    }
    
    .comment-list .children {
        margin-left: 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* WordPress Admin Bar Fixes */
body.admin-bar .dark-mode-toggle {
    top: calc(20px + 32px); /* Admin bar height is 32px on desktop */
}

body.admin-bar .sidebar-column {
    top: calc(20px + 32px); /* Adjust sticky position for admin bar */
    max-height: calc(100vh - 32px - 40px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .dark-mode-toggle {
        top: calc(15px + 46px); /* Admin bar height is 46px on mobile */
    }
    
    body.admin-bar .sidebar-column {
        top: calc(20px + 46px);
        max-height: calc(100vh - 46px - 40px);
    }
}

/* Fix for admin bar hiding elements */
body.admin-bar .site-header,
body.admin-bar .sidebar-column,
body.admin-bar .footer-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure sidebars are visible when logged in */
body.logged-in .sidebar-column {
    display: none; /* Default hidden */
}

@media (min-width: 1650px) {
    body.logged-in .sidebar-column.left,
    body.logged-in .sidebar-column.right {
        display: block !important;
    }
}

@media (min-width: 1370px) and (max-width: 1649px) {
    body.logged-in .sidebar-column.right {
        display: block !important;
    }
}

/* Widget Styling */
.widget_block {
    margin-bottom: 1rem;
}

.wp-block-group {
    margin-bottom: 2rem;
    padding: var(--block-group-padding, 20px);
    background-color: var(--block-group-bg, #ffffff);
    border: var(--block-group-border-width, 1px) solid var(--block-group-border-color, #dddddd);
    box-shadow: var(--block-group-shadow, 0 2px 8px rgba(0,0,0,0.1));
    border-radius: 8px;
}

/* Dark mode wp-block-group colors */
html[data-theme="dark"] .wp-block-group {
    background-color: var(--block-group-bg-dark, #2d2d2d);
    border-color: var(--block-group-border-color-dark, #444444);
    border-width: var(--block-group-border-width-dark, 1px);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .wp-block-group {
        background-color: var(--block-group-bg-dark, #2d2d2d);
        border-color: var(--block-group-border-color-dark, #444444);
        border-width: var(--block-group-border-width-dark, 1px);
    }
}

/* Sidebar h2 heading size (desktop only) */
@media (min-width: 1370px) {
    .sidebar-column h2 {
        font-size: var(--sidebar-h2-size, 20px);
    }
}

.wp-block-latest-posts.wp-block-latest-posts__list li {
    clear: both;
    overflow-wrap: break-word;
    line-height: 1.4rem;
    margin-bottom: 0.6rem;
    font-size: 90%;
}

/* Search Widget Styling */
.wp-block-search,
.search-form {
    position: relative;
    display: flex;
    align-items: stretch;
}

/* Hide search widget title */
.wp-block-search__label,
.widget_search h2,
.widget_block h2:has(+ .wp-block-search) {
    display: none !important;
}

/* Search input */
.wp-block-search__input,
.search-form .search-field {
    background-color: var(--search-bg, #ffffff);
    color: var(--search-button-bg, #66b3ff);
    border: 1px solid var(--border-color-main, #dddddd);
    border-radius: var(--search-input-radius, 8px) 0 0 var(--search-input-radius, 8px);
    padding: 10px 15px;
    width: 100%;
    flex: 1;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    border-right: none;
}

.wp-block-search__input:focus,
.search-form .search-field:focus {
    outline: none;
    border-color: var(--search-button-bg, #66b3ff);
    box-shadow: 0 0 0 2px rgba(102, 179, 255, 0.2);
}

/* Search button */
.wp-block-search__button,
.search-form .search-submit {
    background-color: #c00 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 0 var(--search-button-radius, 8px) var(--search-button-radius, 8px) 0;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0;
    min-width: 55px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0;
}

.wp-block-search__button:hover,
.search-form .search-submit:hover {
    opacity: 0.85;
}

/* Replace button text with SVG search icon */
.wp-block-search__button::before,
.search-form .search-submit::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg role="img" width="26" height="26" viewBox="0 0 24 24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M17.121 15l5.598 5.597a.5.5 0 010 .707l-1.415 1.415a.5.5 0 01-.707 0L15 17.12 17.121 15z"></path><path fill="white" fill-rule="evenodd" d="M10.5 19a8.5 8.5 0 100-17 8.5 8.5 0 000 17zm0-2.75a5.75 5.75 0 100-11.5 5.75 5.75 0 000 11.5z" clip-rule="evenodd"></path></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Dark mode search colors - keep icon color */
html[data-theme="dark"] .wp-block-search__button::before,
html[data-theme="dark"] .search-form .search-submit::before {
    background-image: url('data:image/svg+xml;utf8,<svg role="img" width="26" height="26" viewBox="0 0 24 24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M17.121 15l5.598 5.597a.5.5 0 010 .707l-1.415 1.415a.5.5 0 01-.707 0L15 17.12 17.121 15z"></path><path fill="white" fill-rule="evenodd" d="M10.5 19a8.5 8.5 0 100-17 8.5 8.5 0 000 17zm0-2.75a5.75 5.75 0 100-11.5 5.75 5.75 0 000 11.5z" clip-rule="evenodd"></path></svg>');
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .wp-block-search__button::before,
    :root:not([data-theme]) .search-form .search-submit::before {
        background-image: url('data:image/svg+xml;utf8,<svg role="img" width="26" height="26" viewBox="0 0 24 24" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M17.121 15l5.598 5.597a.5.5 0 010 .707l-1.415 1.415a.5.5 0 01-.707 0L15 17.12 17.121 15z"></path><path fill="white" fill-rule="evenodd" d="M10.5 19a8.5 8.5 0 100-17 8.5 8.5 0 000 17zm0-2.75a5.75 5.75 0 100-11.5 5.75 5.75 0 000 11.5z" clip-rule="evenodd"></path></svg>');
    }
}

/* Button inside layout - override to joined style */
.wp-block-search__inside .wp-block-search__button {
    margin-left: 0;
}

/* Responsive search */
@media (max-width: 768px) {
    .wp-block-search__input,
    .search-form .search-field {
        font-size: 0.95rem;
        padding: 8px 12px;
    }
    
    .wp-block-search__button,
    .search-form .search-submit {
        min-width: 50px;
        padding: 8px 15px;
    }
}

/* Search Results Page Styling */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color-main, #ddd);
}

.page-title {
    font-size: 2rem;
    color: var(--text-color, #333);
}

.page-title span {
    color: var(--link-color, #0073aa);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.search-result-item {
    background: var(--content-bg, #fff);
    border: 1px solid var(--border-color-main, #ddd);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.search-result-thumbnail {
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f5f5f5;
}

.search-result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-thumbnail img {
    transform: scale(1.05);
}

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

.search-result-content .entry-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.search-result-content .entry-title a {
    color: var(--text-color, #333);
    text-decoration: none;
}

.search-result-content .entry-title a:hover {
    color: var(--link-color, #0073aa);
}

.search-result-content .entry-summary {
    font-size: 0.9rem;
    color: var(--meta-color, #666);
    margin-bottom: 1rem;
    flex: 1;
}

.search-result-content .read-more {
    color: var(--link-color, #0073aa);
    text-decoration: none;
    font-weight: 600;
    align-self: flex-start;
}

.search-result-content .read-more:hover {
    color: var(--link-hover-color, #005177);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results .page-content {
    margin-top: 2rem;
}

/* Search loading state */
.search-loading-main {
    padding: 3rem 1rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--meta-color, #666);
}

/* Tablet */
@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

/* Sticky Post Header */
.sticky-post-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: var(--content-bg, #fff);
    border-bottom: 2px solid var(--border-color-main, #ddd);
    padding: 1rem 2rem;
    margin-left: -30px;
    margin-right: -30px;
    margin-bottom: 20px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    transition: all 0.3s ease;
}

/* Hide original entry header on single posts since we have sticky header */
.single .entry-header {
    display: none;
}

/* Sticky Post Info - for home/archive pages in left sidebar */
.sticky-post-info {
    background: var(--block-group-bg, #fff);
    border: var(--block-group-border-width, 1px) solid var(--block-group-border-color, #dddddd);
    box-shadow: var(--block-group-shadow, 0 2px 8px rgba(0,0,0,0.1));
    border-radius: 8px;
    padding: var(--block-group-padding, 20px);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.sticky-post-info-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.sticky-post-info-title {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
    color: var(--text-color, #333);
}

.sticky-post-info-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

.sticky-post-info-comment-link {
    display: inline-block;
    background: #c00;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sticky-post-info-comment-link:hover {
    background: #a00;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #fff;
}

/* Dark mode sticky post info */
html[data-theme="dark"] .sticky-post-info {
    background-color: var(--content-bg, #1a1a1a);
    border-right-color: var(--block-group-border-color-dark, #444444);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .sticky-post-info {
        background-color: var(--content-bg, #1a1a1a);
        border-right-color: var(--block-group-border-color-dark, #444444);
    }
}

/* Hide on mobile and tablet - only show on desktop with left sidebar */
@media (max-width: 1649px) {
    .sticky-post-info {
        display: none;
    }
}

.sticky-post-header .sticky-title {
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.3;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: font-size 0.3s ease;
}

.sticky-post-header.scrolled .sticky-title {
    font-size: 1.2rem;
}

.sticky-post-header .sticky-comment-link {
    background: #c00;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sticky-post-header .sticky-comment-link:hover {
    background: #a00;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #fff;
}

/* Dark mode sticky header */
html[data-theme="dark"] .sticky-post-header {
    background: var(--content-bg, #1a1a1a);
    border-bottom-color: #444;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .sticky-post-header {
        background: var(--content-bg, #1a1a1a);
        border-bottom-color: #444;
    }
}

/* Admin bar adjustment */
body.admin-bar .sticky-post-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .sticky-post-header {
        top: 46px;
    }
}

/* Mobile sticky header */
@media (max-width: 768px) {
    .sticky-post-header {
        padding: 0.75rem 1rem;
        margin-left: -20px;
        margin-right: -20px;
        gap: 1rem;
    }
    
    .sticky-post-header .sticky-title {
        font-size: 1.2rem;
    }
    
    .sticky-post-header.scrolled .sticky-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .sticky-post-header,
    .sticky-home-header {
        margin-left: -15px;
        margin-right: -15px;
    }
}

@media (max-width: 480px) {
    .sticky-post-header {
        margin-left: -15px;
        margin-right: -15px;
    }
}