/*
Theme Name: Blossom Responsive
Theme URI: https://kortadikter.se
Description: Mobile-responsive child theme for Blossom
Author: Anna
Template: blossom
Version: 1.0
*/

@import url("../blossom/style.css");

/* ============================================
   RESPONSIVE ENHANCEMENTS FOR KORTADIKTER.SE
   ============================================ */

/* Base improvements for all screens */
* {
    box-sizing: border-box;
}

body {
    font-size: 100%; /* Better base for responsive scaling */
}

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

/* Make container flexible */
#wrapper,
#topmenu,
#header,
#bottom {
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#menudiv {
    max-width: 860px;
    width: 95%;
}

/* ============================================
   TABLET: 768px - 1024px
   ============================================ */
@media screen and (max-width: 1024px) {
    #wrapper,
    #topmenu,
    #header,
    #bottom {
        width: 95%;
        max-width: 768px;
    }
    
    #picture {
        max-width: 100%;
        height: auto;
    }
}

/* ============================================
   MOBILE: < 768px
   ============================================ */
@media screen and (max-width: 767px) {
    body {
        font-size: 100%;
        text-align: left;
    }
    
    /* Container adjustments */
    #wrapper,
    #topmenu,
    #header,
    #bottom,
    #menudiv {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Header adjustments */
    #header {
        height: auto;
        text-align: center;
    }
    
    #headerimg {
        margin: 10px auto;
        text-align: center;
    }
    
    #headerimg img {
        max-width: 90%;
        height: auto;
    }
    
    #headerimg h1,
    #headerimg a {
        font-size: 24px;
    }
    
    .description {
        font-size: 1.1em;
        padding-left: 10px;
        text-align: center;
        width: 100%;
    }
    
    /* Top menu/ad section */
    #topmenu {
        height: auto;
        margin: 10px auto;
        background-size: cover;
    }
    
    #topright {
        width: 100%;
        height: auto;
        float: none;
        clear: both;
        margin: 0;
        padding: 10px;
    }
    
    #topright table {
        width: 100% !important;
        max-width: 100%;
    }
    
    #topright td {
        width: 100% !important;
        height: auto !important;
        text-align: center !important;
    }
    
    /* Search box */
    #search {
        width: 100%;
        padding: 10px;
        clear: both;
        float: none;
    }
    
    #search .searchbox {
        width: 60%;
        max-width: 200px;
    }
    
    #search input.find {
        width: auto;
        min-width: 60px;
    }
    
    /* Navigation menu - stack vertically */
    #absnav {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    #nav {
        margin: 0;
    }
    
    #nav li {
        float: none;
        display: block;
        width: 100%;
        border-bottom: 1px solid #da8d9d;
    }
    
    #nav li a {
        display: block;
        padding: 12px 15px;
        font-size: 16px;
        min-height: 44px; /* Touch-friendly target */
    }
    
    #nav ul {
        position: static;
        width: 100%;
        display: none; /* Hide submenus by default on mobile */
    }
    
    #nav li:hover ul,
    #nav li.active ul {
        display: block;
    }
    
    #nav li ul li {
        padding-left: 20px;
        background: #fff8f5;
    }
    
    #nav li ul li a {
        padding: 10px 15px;
    }
    
    /* Content layout - single column */
    div#container {
        float: none;
        margin: 0;
        width: 100%;
    }
    
    div#content {
        margin: 0;
        padding: 15px;
    }
    
    /* Hide or relocate the decorative picture on mobile */
    #picture {
        display: none; /* Can be changed to display: block; if wanted */
        width: 100%;
        height: auto;
        background-size: cover;
        min-height: 200px;
    }
    
    /* Sidebar - full width below content */
    .mainsidebar {
        float: none;
        width: 100%;
        padding: 15px;
        background: none;
        clear: both;
    }
    
    #sidebar,
    #sidebar2 {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
        padding: 0;
    }
    
    .mainsidebar #sidebar ul li li,
    .mainsidebar #sidebar2 ul li li {
        width: 100%;
    }
    
    /* Tabbed module */
    #tabbedmodule {
        float: none;
        width: 100%;
        padding: 15px;
    }
    
    /* Typography adjustments */
    .mainsidebar {
        font-size: 1.1em;
    }
    
    #sidebar ul li div,
    #sidebar2 ul li div,
    #sidebar h2,
    #sidebar2 h2 {
        font-size: 1.3em;
    }
    
    /* Content typography */
    #content {
        font-size: 1.1em;
        line-height: 1.6em;
    }
    
    .post,
    .page {
        margin-bottom: 30px;
    }
    
    .post h2,
    .page h2 {
        font-size: 1.4em;
        line-height: 1.3em;
        word-wrap: break-word;
    }
    
    .entry {
        line-height: 1.7em;
        word-wrap: break-word;
    }
    
    /* Touch-friendly links */
    a {
        min-height: 44px;
        display: inline-block;
        line-height: 44px;
        vertical-align: middle;
    }
    
    /* Prevent text from being too small */
    p, li, .feedback {
        font-size: 1em;
        line-height: 1.6em;
    }
    
    /* Footer */
    #bottom {
        width: 100%;
        height: auto;
        min-height: 28px;
        background-size: cover;
    }
    
    /* Comments section */
    .commentlist {
        padding-left: 0;
    }
    
    .commentlist li {
        padding: 10px;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    textarea {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* Prevents auto-zoom on iOS */
        padding: 10px;
    }
    
    input[type="submit"],
    button {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* ============================================
   SMALL MOBILE: < 480px
   ============================================ */
@media screen and (max-width: 480px) {
    #headerimg h1,
    #headerimg a {
        font-size: 20px;
    }
    
    .description {
        font-size: 1em;
    }
    
    #search .searchbox {
        width: 55%;
    }
    
    #content {
        padding: 10px;
    }
    
    .post h2,
    .page h2 {
        font-size: 1.2em;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mobile-hide {
    display: block;
}

@media screen and (max-width: 767px) {
    .mobile-hide {
        display: none;
    }
}

.mobile-only {
    display: none;
}

@media screen and (max-width: 767px) {
    .mobile-only {
        display: block;
    }
}

/* ============================================
   MOBILE MENU FIX - Higher specificity override
   Added 2026-10-27
   ============================================ */
@media screen and (max-width: 767px) {
    /* Force horizontal menu to stack vertically */
    #absnav {
        position: static !important;
        width: 100% !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        z-index: 100 !important;
    }
    
    #menudiv {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 10px !important;
    }
    
    #nav {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    #nav li {
        float: none !important;
        display: block !important;
        width: 100% !important;
        position: static !important;
        border-bottom: 1px solid #da8d9d;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #nav li a {
        display: block !important;
        padding: 12px 15px !important;
        font-size: 16px !important;
        line-height: 1.4 !important;
        text-decoration: none !important;
        min-height: 44px !important;
        margin: 0 !important;
    }
    
    #nav li a:hover {
        background: #fff0e8;
    }
    
    /* Hide dropdown submenus on mobile by default */
    #nav ul {
        position: static !important;
        display: none !important;
        width: 100% !important;
    }
    
    /* Show submenus on hover/touch */
    #nav li:hover > ul,
    #nav li:focus-within > ul {
        display: block !important;
    }
    
    #nav li ul li {
        padding-left: 20px !important;
        background: #fff8f5 !important;
        border: none !important;
        border-bottom: 1px solid #eed !important;
    }
}
