/* Mobile-specific styles (up to 767px) */
@media screen and (max-width: 767px) {
    /* General layout */
    body {
        font-size: 16px;
    }
    
    .wide-content-container, 
    .content-container {
        width: 100%;
        padding: 0 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* Header and Navigation */
    .main-header {
        padding: 10px 15px;
        position: relative;
    }
    
    .logo {
        width: 40px;
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .main-nav {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 60px);
        background-color: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .mobile-menu-open .main-nav {
        left: 0;
    }
    
    .main-nav ul {
        flex-direction: column;
        padding: 20px;
    }
    
    .main-nav li {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .main-nav button {
        width: 100%;
        text-align: left;
        padding: 12px 15px;
        font-size: 1.1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        right: 15px;
        top: 15px;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 30px;
        height: 3px;
        margin: 6px auto;
        background-color: #2c3e50;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Hero section */
    .hero-section {
        height: 60vh;
    }
    
    .hero-content {
        width: 90%;
    }
    
    .main-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .cta-button {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    /* Books page */
    .timeline-view {
        padding: 20px 0;
    }
    
    .timeline-line {
        display: none; /* Hide the timeline line on mobile */
    }
    
    .timeline-books {
        padding: 0;
    }
    
    .timeline-book {
        margin-bottom: 40px;
        padding-left: 50px !important;
    }
    
    .timeline-book-content {
        width: 280px;
        height: 280px;
        margin: 0;
    }
    
    .timeline-book-content::after {
        display: none;
    }
    
    /* Hide the year on mobile view to make more room for the button */
    /* Force hide the year on mobile view with !important */
    .flip-card-back .timeline-book-year,
    .timeline-book-year,
    [class*="timeline-book-year"],
    .flip-card-back [class*="year"],
    .flip-card-back [class*="date"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .flip-card-back {
        padding: 20px;
    }
    
    .flip-card-back h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .flip-card-back p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    /* Book detail pages */
    .book-pages-container {
        width: 100%;
        padding: 10px;
    }
    
    .book-spread {
        flex-direction: column;
    }
    
    .book-page-single {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .book-page-image img {
        max-width: 100%;
    }
    
    .book-actions {
        margin-top: 20px;
    }
    
    .book-action-button {
        width: 100%;
        padding: 12px;
    }
    
    /* Noisy's Studio */
    .studio-container {
        padding: 15px;
    }
    
    .studio-intro {
        font-size: 0.9rem;
    }
    
    .canvas-tools {
        flex-direction: column;
    }
    
    #canvas-container {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 20px;
    }
    
    #scene-canvas {
        width: 100% !important;
        height: auto !important;
    }
    
    #sprite-panel {
        width: 100%;
        height: 200px;
        overflow-y: auto;
    }
    
    /* Footer */
    .main-footer {
        padding: 30px 15px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-logo, 
    .footer-links, 
    .footer-newsletter {
        width: 100%;
        margin-bottom: 25px;
        text-align: center;
    }
    
    .footer-links ul {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .newsletter-form button {
        width: 100%;
    }
}