/* Responsive Design for Rakushka.org */
/* Mobile-first approach with progressive enhancement */

/* Base responsive adjustments */
/* Only apply box-sizing on mobile to prevent desktop layout issues */
@media screen and (max-width: 1024px) {
    * {
        box-sizing: border-box;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: rgba(80, 72, 56, 0.9) !important;
    border: 2px solid #fff !important;
    border-radius: 5px;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    width: 44px;
    height: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(80, 72, 56, 1);
}

.mobile-menu-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mobile-menu-toggle.active {
    background: rgba(80, 72, 56, 1);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #fff;
    margin: 4px auto;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

/* Tablet (769px - 1024px) - Minor adjustments only */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    #wrapper {
        width: 95%;
        max-width: 969px;
        margin: 10px auto 0;
    }

    #search {
        width: 95%;
        margin: 0 auto;
    }

    /* Improve logo/header area for tablet - use solid background */
    #logo {
        width: 100%;
        height: auto;
        padding: 30px 15px 25px;
        background-image: none !important;
        background-color: #f8f5f0;
    }

    #logo h1 {
        margin: 0 !important;
    }

    #logo h1 a {
        font-size: 30px;
        text-align: center;
        display: block;
        color: #504838;
        text-shadow: 1px 1px #ccc;
        letter-spacing: 2px;
    }

    #logo p {
        text-align: center;
        color: #504838;
        margin-top: 5px;
    }

    #menu {
        width: 100%;
        padding: 0 2.5%;
        position: relative;
    }

    #content .posts .post-1 {
        width: 45%;
        margin-right: 2%;
        height: auto;
        min-height: 138px;
    }

    #content .posts .post-2 {
        width: 48%;
    }
}

/* Mobile landscape and small tablets (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    #wrapper {
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #search {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 10px 15px;
        background: #ffffff;
    }

    #search p {
        font-size: 11px !important;
        margin-top: 5px;
        float: none;
        text-align: center;
    }

    #main-contacts {
        font-size: 11px;
        line-height: 1.4;
        float: none;
        text-align: center;
        margin-top: 5px;
    }

    #logo {
        width: 100%;
        height: auto;
        min-height: auto;
        padding: 25px 15px 20px;
        background-image: none !important;
        background-color: #f8f5f0;
    }

    #logo h1 {
        margin: 0 !important;
    }

    #logo h1 a {
        font-size: 28px;
        display: block;
        text-align: center;
        color: #504838;
        text-shadow: 1px 1px #ccc;
        letter-spacing: 2px;
    }

    #logo p {
        font-size: 12px;
        text-align: center;
        color: #504838;
        text-transform: uppercase;
        margin-top: 5px;
    }

    /* Mobile Navigation */
    #menu {
        width: 100%;
        height: auto;
        min-height: 50px;
        padding: 5px 15px;
        position: relative;
        overflow: visible;
    }

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

    #menu ul {
        display: none;
        width: 100%;
        margin: 0;
        padding: 50px 0 20px 0;
        background-color: #a99b79 !important;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 999;
        min-height: 100vh;
    }

    #menu ul.show {
        display: block !important;
    }

    #menu ul li {
        display: block !important;
        width: 100%;
        list-style: none !important;
        margin: 0;
        padding: 0;
    }

    #menu ul li a {
        display: block !important;
        float: none !important;
        width: 100%;
        margin: 0 !important;
        padding: 15px 20px !important;
        text-align: left !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-decoration: none !important;
        color: #fff !important;
        background-color: transparent !important;
    }

    #menu ul li a:hover,
    #menu ul li a:focus {
        background-color: rgba(0, 0, 0, 0.1) !important;
        text-decoration: none !important;
    }

    #content {
        padding: 15px;
    }

    #content .posts {
        padding: 0 10px;
    }

    #content .posts .title {
        margin: 0 -10px 16px;
        padding: 10px;
    }

    #content .posts .title p {
        width: 100%;
        font-size: 16px;
    }

    #content .posts .post-1,
    #content .posts .post-2 {
        width: 100%;
        float: none;
        margin-right: 0;
        margin-bottom: 15px;
        height: auto;
    }

    #content .posts .post-1 img {
        max-width: 100%;
        height: auto;
    }

    #content .blog_post {
        padding: 10px 5px;
    }

    #content .blog_post .post_heading h2 {
        font-size: 18px;
    }

    #content .blog_post_view .post_heading h2 {
        font-size: 20px;
    }

    #page .photo {
        max-width: 100%;
        height: auto;
    }

    #page .photo-left,
    #page .photo-right {
        float: none;
        display: block;
        margin: 0 auto 10px;
    }

    #page table {
        font-size: 11px;
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    input[type="text"],
    select,
    textarea {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    #content form p label {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }

    #content form p {
        display: block;
    }

    #footer {
        width: 100%;
        padding: 10px;
        height: auto;
        text-align: center;
    }

    #footer span {
        float: none;
        display: block;
        padding: 10px 0;
    }

    #footer img {
        float: none;
        display: block;
        margin: 10px auto;
    }
}

/* Mobile portrait (max-width: 480px) */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }

    #logo {
        min-height: auto;
        padding: 20px 10px 18px;
        background-image: none !important;
    }

    #logo h1 a {
        font-size: 24px;
        letter-spacing: 1px;
    }

    #logo p {
        font-size: 11px;
    }

    #search p {
        font-size: 10px !important;
    }

    #main-contacts {
        font-size: 11px;
    }

    #content {
        padding: 10px;
    }

    #content .posts {
        padding: 0 5px;
    }

    #content .posts .title {
        margin: 0 -5px 10px;
        padding: 8px 5px;
    }

    #content .posts .title p {
        font-size: 14px;
    }

    #content .blog_post .post_heading h2 {
        font-size: 16px;
    }

    #content .blog_post_view .post_heading h2 {
        font-size: 18px;
    }

    .post_heading h1 {
        font-size: 20px;
        line-height: 22px;
    }

    #content .pagination span,
    #content .pagination span a {
        font-size: 14px;
        padding-right: 3px;
    }

    input[type="submit"],
    input[type="button"] {
        padding: 8px 20px;
        font-size: 14px;
    }
}

/* Small mobile devices (max-width: 320px) */
@media screen and (max-width: 320px) {
    #logo {
        min-height: auto;
        padding: 18px 10px 15px;
        background-image: none !important;
    }

    #logo h1 a {
        font-size: 22px;
    }

    #menu ul li a {
        font-size: 13px;
        padding: 10px 12px;
    }

    #content .posts .title p {
        font-size: 13px;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #logo {
        min-height: auto;
        padding: 20px 15px 15px;
        background-image: none !important;
    }

    #menu ul {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* Print styles */
@media print {
    #menu,
    #footer,
    #search,
    .mobile-menu-toggle {
        display: none !important;
    }

    #wrapper {
        width: 100%;
        box-shadow: none;
    }

    body {
        background: white;
    }

    a {
        text-decoration: underline;
    }
}
