/* Mobile Responsive Styles */

/* Default styles for larger screens */
.burger-menu {
    display: none;
}

/* Media query for tablets and smaller devices */
@media screen and (max-width: 1024px) {
    video {
        display: none; 
    }

    .content p {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 12pt;
    }

    /* Adjust container margin */
    .container {
        margin-left: 240px;
    }
    
    /* Reduce sidebar width */
    .sidebar {
        width: 240px;
        padding: 20px 15px;
    }
    
    /* Adjust main content */
    main {
        margin: 20px auto;
        max-width: 700px;
    }
    
    /* Adjust event layout */
    .date {
        width: 80px;
    }
    
    .dateInner {
        width: 80px;
    }
    
    .eventContent {
        margin-left: 80px;
        width: calc(100% - 80px);
    }
    
    .description, .additional-info, .eventCode {
        width: calc(100% - 120px);
    }
    
    /* Adjust year header */
    .yearheaderright {
        font-size: 100pt;
        line-height: 120px;
    }
    
    /* Adjust country header */
    .countryheaderright {
        font-size: 40pt;
    }
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
    /* Burger menu button */
    .burger-menu {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1100;
        width: 40px;
        height: 40px;
        background-color: #111;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        border: none;
        cursor: pointer;
        padding: 8px;
    }
    
    .burger-menu span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: white;
        margin: 5px 0;
        transition: transform 0.3s, opacity 0.3s;
    }
    
    /* Burger menu animation for open state */
    .burger-menu.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .burger-menu.open span:nth-child(2) {
        opacity: 0;
    }
    
    .burger-menu.open span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 85%;
        max-width: 300px;
        z-index: 1100; /* Higher z-index to ensure it appears above other content */
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        transform: translateX(0);
    }
    
    /* Adjust container for full width */
    .container {
        margin-left: 0;
    }
    
    /* Adjust main content */
    main {
        width: 100%;
        padding: 10px;
        margin-top: 60px;
        max-width: 100%;
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1050;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    /* Adjust menu items for touch */
    .menu li {
        min-height: 44px;
        line-height: 44px;
    }
    
    .menu li a {
        padding: 0 10px;
    }
    
    .level-1 li a {
        font-size: 14pt;
        line-height: 44px;
    }
    
    .level-2 li a {
        font-size: 12pt;
        line-height: 40px;
    }
    
    .toggle-icon {
        width: 44px;
        height: 44px;
        line-height: 44px;
    }
    
    /* Adjust inline menu items */
    .inline li {
        min-width: 40px;
        min-height: 30px;
        line-height: 30px;
        margin: 2px;
    }
    
    .inline li a {
        padding: 5px;
        line-height: 30px;
    }
    
    /* Adjust background image */
    .europe-background img {
        height: 100vh;
        width: auto;
        object-fit: cover;
    }
    
    /* Adjust content headers */
    .content h1 {
        font-size: 20pt;
        padding: 15px 0;
        z-index: 1000;
    }
    
    /* Adjust year header */
    .yearheader {
        margin-bottom: 15px;
        border: 3px solid #333;
    }
    
    .yearheaderleft {
        width: 70%;
    }
    
    .yearheaderright {
        width: 29%;
        font-size: 60pt;
        line-height: 80px;
        letter-spacing: -5px;
    }
    
    /* Adjust country header */
    .countryheader {
        margin-bottom: 15px;
        border: 3px solid #333;
    }
    
    .countryheaderleft {
        width: 30%;
    }
    
    .countryheaderleft img {
        height: 120px;
    }
    
    .countryheaderright {
        width: 69%;
        font-size: 30pt;
        line-height: 60px;
    }
    
    /* Adjust month menu */
    .monthmenu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .monthmenu li a {
        padding: 8px 9px;
        font-size: 10pt;
    }
    
    /* Adjust event layout */
    .event {
        padding: 8px;
        margin-bottom: 20px;
    }
    
    .date {
        width: 70px;
    }
    
    .dateInner {
        width: 70px;
    }
    
    .dateDay {
        font-size: 12pt;
    }
    
    .dateYear {
        font-size: 18pt;
    }
    
    .eventContent {
        margin-left: 70px;
        width: calc(100% - 70px);
        min-height: 80px;
        padding-left: 8px;
    }
    
    .description {
        width: calc(100% - 80px);
        font-size: 12pt;
        line-height: 15pt;
        margin: 3px 0;
    }
    
    .additional-info {
        width: calc(100% - 80px);
        font-size: 10pt;
        margin: 10px 0 3px 0;
    }
    
    .eventCode {
        width: calc(100% - 80px);
        font-size: 11pt;
        margin-bottom: 10px;
    }
    
    .flags {
        width: 70px;
    }
    
    .flag {
        width: 20px;
        height: 15px;
        margin-left: 2px;
    }
    
    .flag img {
        width: 20px;
        height: 15px;
    }
    
    /* Adjust pagination */
    .paginationmenu {
        width: 100%;
        height: 36px;
        border-radius: 5px 5px 0 0;
    }
    
    .previouspage a, .nextpage a {
        line-height: 36px;
        font-size: 10pt;
        padding: 0 8px;
    }
    
    .pageselector {
        width: 60%;
        left: 20%;
        height: 36px;
        line-height: 36px;
        font-size: 10pt;
    }
    
    /* Adjust forms */
    .formBox {
        padding: 8px;
    }
    
    .formBoxSmall {
        width: 100%;
        padding: 20px;
    }
    
    .formBox input {
        width: 100%;
        padding: 8px;
        font-size: 11pt !important;
    }
    
    .formBox textarea {
        height: 200px;
        padding: 8px;
    }
    
    .formBox button {
        font-size: 12pt !important;
        padding: 8px;
    }
}

/* Media query for very small devices */
@media screen and (max-width: 480px) {
    main {
        padding: 8px;
    }
    
    .sidebar {
        width: 85%;
        padding: 15px 10px;
    }
    
    /* Further reduce font sizes */
    .level-1 li a {
        font-size: 13pt;
    }
    
    .level-2 li a {
        font-size: 11pt;
    }
    
    .level-3 li a {
        font-size: 9pt;
    }
    
    /* Adjust content headers */
    .content h1 {
        font-size: 18pt;
        padding: 12px 0;
    }
    
    /* Adjust year header */
    .yearheader {
        margin-bottom: 12px;
        border: 2px solid #333;
    }
    
    .yearheaderright {
        font-size: 40pt;
        line-height: 60px;
        letter-spacing: -3px;
    }
    
    /* Adjust country header */
    .countryheader {
        margin-bottom: 12px;
        border: 2px solid #333;
    }
    
    .countryheaderleft img {
        height: 100px;
    }
    
    .countryheaderright {
        font-size: 24pt;
        line-height: 50px;
    }
    
    /* Adjust event layout */
    .event {
        padding: 6px;
        margin-bottom: 15px;
    }
    
    .date {
        width: 60px;
    }
    
    .dateInner {
        width: 60px;
    }
    
    .dateDay {
        font-size: 10pt;
    }
    
    .dateYear {
        font-size: 16pt;
    }
    
    .eventContent {
        margin-left: 60px;
        width: calc(100% - 60px);
        min-height: 70px;
        padding-left: 6px;
    }
    
    .description {
        width: calc(100% - 70px);
        font-size: 11pt;
        line-height: 14pt;
    }
    
    .additional-info {
        width: calc(100% - 70px);
        font-size: 9pt;
    }
    
    .eventCode {
        width: calc(100% - 70px);
        font-size: 10pt;
    }
    
    .flags {
        width: 60px;
    }
    
    /* Adjust pagination */
    .paginationmenu {
        height: 32px;
    }
    
    .previouspage a, .nextpage a {
        line-height: 32px;
        font-size: 9pt;
        padding: 0 6px;
    }
    
    .pageselector {
        height: 32px;
        line-height: 32px;
        font-size: 9pt;
    }
    
    /* Adjust forms */
    .formBox {
        padding: 6px;
    }
    
    .formBoxSmall {
        padding: 15px;
    }
    
    .formBox input {
        padding: 6px;
        font-size: 10pt !important;
    }
    
    .formBox textarea {
        height: 150px;
        padding: 6px;
    }
    
    .formBox button {
        font-size: 11pt !important;
        padding: 6px;
    }
}

/* Timeline responsive styles */
@media screen and (max-width: 1024px) {
    .timeline {
        width: 100%;
        max-width: 700px;
        padding: 10px 15px;
    }
}

@media screen and (max-width: 768px) {
    .timeline {
        width: 100%;
        padding: 8px 12px;
        margin-bottom: 20px;
    }
    
    .decade {
        margin: 15px 0;
    }
    
    .decade h2 {
        font-size: 1.1em;
        padding: 2px 6px;
    }
    
    .decade .events {
        margin: 5px 0 5px 20px;
    }
    
    .decade .events li {
        margin-bottom: 5px;
        font-size: 11pt;
    }
}

@media screen and (max-width: 480px) {
    .timeline {
        padding: 6px 10px;
        margin-bottom: 15px;
        border-left: 2px solid #CCC;
    }
    
    .decade {
        margin: 12px 0;
    }
    
    .decade h2 {
        font-size: 1em;
        padding: 2px 5px;
        border-left: 3px solid #666;
    }
    
    .decade .events {
        margin: 5px 0 5px 15px;
    }
    
    .decade .events li {
        margin-bottom: 4px;
        font-size: 10pt;
        line-height: 1.3;
    }
}

/* Shop responsive styles */
@media screen and (max-width: 1024px) {
    .content details .product-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .content .featured-product {
        padding: 25px;
    }
    
    .content .featured-product h3 {
        font-size: 16pt;
    }
    
    .content .featured-product .price {
        font-size: 1.8em;
    }
    
    .content .featured-product button {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}

@media screen and (max-width: 768px) {
    .content details {
        padding: 8px;
        margin-top: 15px;
    }
    
    .content details summary {
        font-size: 1.1em;
        padding: 8px 12px;
    }
    
    .content details .product-cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
        padding: 12px 0;
    }
    
    .content .subscriptions {
        flex-direction: column;
        gap: 15px;
    }
    
    .content .subscription-card {
        padding: 15px;
    }
    
    .content .subscription-card h3 {
        font-size: 1.3em;
    }
    
    .content .subscription-card .price {
        font-size: 1.5em;
    }
    
    .content .subscription-card ul {
        margin: 8px 0 15px 15px;
    }
    
    .content .subscription-card button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .content .featured-product {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .content .featured-product h3 {
        font-size: 15pt;
        margin-bottom: 15px;
    }
    
    .content .featured-product .price {
        font-size: 1.6em;
        margin-bottom: 15px;
    }
    
    .content .featured-product button {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .content .product-card {
        padding: 12px;
    }
    
    .content .product-card h4 {
        font-size: 1.1em;
    }
    
    .content .product-card .price {
        font-size: 1.1em;
    }
    
    .content .product-card button {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media screen and (max-width: 480px) {
    .content details {
        padding: 6px;
        margin-top: 12px;
    }
    
    .content details summary {
        font-size: 1em;
        padding: 6px 10px;
    }
    
    .content details .product-cards {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
        padding: 10px 0;
    }
    
    .content .subscription-card {
        padding: 12px;
    }
    
    .content .subscription-card h3 {
        font-size: 1.2em;
    }
    
    .content .subscription-card .price {
        font-size: 1.4em;
    }
    
    .content .subscription-card ul {
        margin: 6px 0 12px 12px;
    }
    
    .content .subscription-card ul li {
        font-size: 0.8em;
        margin-bottom: 4px;
    }
    
    .content .subscription-card button {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .content .featured-product {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .content .featured-product h3 {
        font-size: 14pt;
        margin-bottom: 12px;
    }
    
    .content .featured-product .price {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    .content .featured-product button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .content .product-card {
        padding: 10px;
    }
    
    .content .product-card h4 {
        font-size: 1em;
    }
    
    .content .product-card .price {
        font-size: 1em;
    }
    
    .content .product-card button {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    .shop-success-message {
        font-size: 14pt;
    }
}

/* Cart and Checkout responsive styles */
@media screen and (max-width: 1024px) {
    .cart-section .empty, .checkout-section .empty, .paypal-message {
        font-size: 18pt;
    }
    
    .cart-section a, .checkout-section a, .paypal-message a {
        font-size: 14pt;
    }
    
    .content .cart-section .cart-table th,
    .content .cart-section .cart-table td {
        padding: 8px;
    }
    
    .content .cart-section .cart-summary .cta-button {
        padding: 8px 16px;
    }
    
    .content .checkout-section form h2 {
        font-size: 1.4em;
    }
    
    .content .checkout-section form .cta-button {
        font-size: 1.1em;
    }
}

@media screen and (max-width: 768px) {
    .cart-section .empty, .checkout-section .empty, .paypal-message {
        font-size: 16pt;
    }
    
    .cart-section a, .checkout-section a, .paypal-message a {
        font-size: 13pt;
    }
    
    /* Adjust cart table for mobile */
    .content .cart-section .cart-table {
        display: block;
        width: 100%;
    }
    
    .content .cart-section .cart-table thead {
        display: none; /* Hide table headers on mobile */
    }
    
    .content .cart-section .cart-table tbody,
    .content .cart-section .cart-table tr,
    .content .cart-section .cart-table td {
        display: block;
        width: 100%;
        text-align: left;
    }
    
    .content .cart-section .cart-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        padding: 8px;
        background-color: #f9f9f9;
    }
    
    .content .cart-section .cart-table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    .content .cart-section .cart-table td:before {
        position: absolute;
        left: 10px;
        top: 10px;
        content: attr(data-label);
        font-weight: bold;
    }
    
    .content .cart-section .cart-table td:last-child {
        border-bottom: none;
    }
    
    .content .cart-section .cart-summary {
        text-align: center;
    }
    
    .content .cart-section .cart-summary .cta-button {
        padding: 8px 15px;
        font-size: 0.9em;
        display: block;
        margin: 10px auto;
        width: 80%;
    }
    
    .content .checkout-section form h2 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }
    
    .content .checkout-section form .cta-button {
        font-size: 1em;
        padding: 8px;
    }
}

@media screen and (max-width: 480px) {
    .cart-section .empty, .checkout-section .empty, .paypal-message {
        font-size: 14pt;
    }
    
    .cart-section a, .checkout-section a, .paypal-message a {
        font-size: 12pt;
    }
    
    .content .cart-section .cart-table tr {
        margin-bottom: 12px;
        padding: 6px;
    }
    
    .content .cart-section .cart-table td {
        padding: 6px 6px 6px 45%;
        font-size: 0.9em;
    }
    
    .content .cart-section .cart-table td:before {
        left: 6px;
        top: 6px;
        font-size: 0.9em;
    }
    
    .content .cart-section .cart-summary .cta-button {
        padding: 6px 12px;
        font-size: 0.85em;
        width: 100%;
    }
    
    .content .checkout-section form h2 {
        font-size: 1.2em;
        margin-bottom: 10px;
    }
    
    .content .checkout-section form .cta-button {
        font-size: 0.9em;
        padding: 6px;
    }
}

/* Landing page responsive styles */
@media screen and (max-width: 1024px) {
    /* Hero section */
    .hero-overlay {
        width: 80%;
        left: 10%;
        right: 10%;
    }
    
    .hero-overlay h1 {
        width: 100%;
        font-size: 24pt;
    }
    
    .cta-subscribe {
        width: 80%;
        margin: 0 auto;
    }
    
    /* Alphabet navigation */
    .alphabet-navigation {
        margin: 15px 0;
        padding-bottom: 15px;
    }
    
    .alphabet-navigation .letter {
        width: 40px;
        height: 40px;
        line-height: 40px;
        margin: 4px;
        font-size: 0.95em;
    }
    
    .bibliography-entry {
        margin-bottom: 20px;
        padding: 12px;
    }
    
    .bibliography-entry .author {
        font-size: 1.05em;
    }
    
    .bibliography-entry .publication-info {
        font-size: 0.9em;
    }
}

@media screen and (max-width: 768px) {
    /* Hero section */
    .hero {
        height: 50vh;
    }
    
    .collage {
        grid-template-columns: repeat(2, 1fr); /* Only 2 images per row on mobile */
    }
    
    .hero-overlay {
        width: 90%;
        left: 5%;
        right: 5%;
        text-align: center;
    }
    
    .hero-overlay h1 {
        width: 100%;
        font-size: 20pt;
        padding: 10px;
    }
    
    .cta-button {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .cta-subscribe {
        width: 90%;
        padding: 10px;
        margin: 0 auto;
    }
    
    /* Pagination - ensure it's properly centered */
    .paginationmenu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0 auto;
        border-radius: 5px 5px 0 0;
    }
    
    .pageselector {
        width: 60%;
        left: 20%;
        right: 20%;
        text-align: center;
    }
    
    /* Alphabet navigation */
    .alphabet-navigation {
        margin: 12px 0;
        padding-bottom: 12px;
    }
    
    .alphabet-navigation .letter {
        width: 36px;
        height: 36px;
        line-height: 36px;
        margin: 3px;
        font-size: 0.9em;
    }
    
    .bibliography-entry {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    .bibliography-entry .author {
        font-size: 1em;
        margin-bottom: 6px;
    }
    
    .bibliography-entry .title {
        margin-bottom: 6px;
        font-size: 0.95em;
    }
    
    .bibliography-entry .publication-info {
        font-size: 0.85em;
    }
    
    /* Pagination styles - consistent with other pagination */
    .pagenumber, .pageelipsis {
        margin: 0 3px;
        padding: 4px 8px;
        font-size: 0.9em;
    }
    
    /* Locked overlay */
    .locked-overlay {
        height: 180px;
    }
    
    .shop-button {
        padding: 8px 16px;
        font-size: 0.95em;
    }
}

@media screen and (max-width: 480px) {
    /* Hero section */
    .hero {
        height: 40vh;
    }
    
    .collage {
        grid-template-columns: repeat(2, 1fr); /* Maintain 2 images per row on very small devices */
    }
    
    .hero-overlay {
        width: 95%;
        left: 2.5%;
        right: 2.5%;
    }
    
    .hero-overlay h1 {
        font-size: 18pt;
        padding: 8px;
        margin-bottom: 15px;
    }
    
    .cta-button {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .cta-subscribe {
        width: 95%;
        padding: 8px;
    }
    
    .cta-subscribe h2 {
        font-size: 16pt;
    }
    
    /* Alphabet navigation */
    .alphabet-navigation {
        margin: 10px 0;
        padding-bottom: 10px;
    }
    
    .alphabet-navigation .letter {
        width: 30px;
        height: 30px;
        line-height: 30px;
        margin: 2px;
        font-size: 0.85em;
    }
    
    .bibliography-entry {
        margin-bottom: 12px;
        padding: 8px;
    }
    
    .bibliography-entry .author {
        font-size: 0.95em;
        margin-bottom: 5px;
    }
    
    .bibliography-entry .title {
        margin-bottom: 5px;
        font-size: 0.9em;
    }
    
    .bibliography-entry .publication-info {
        font-size: 0.8em;
        line-height: 1.3;
    }
    
    /* Pagination styles */
    .pagenumber, .pageelipsis {
        margin: 0 2px;
        padding: 3px 6px;
        font-size: 0.85em;
    }
    
    /* Locked overlay */
    .locked-overlay {
        height: 150px;
    }
    
    .shop-button {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

/* Lists responsive styles */
@media screen and (max-width: 1024px) {
    /* Alphabet navigation - similar to bibliography */
    .list-entries .alphabet-navigation {
        margin: 15px 0;
        padding-bottom: 15px;
    }
    
    .list-entries .alphabet-navigation .letter {
        width: 40px;
        height: 40px;
        line-height: 40px;
        margin: 4px;
        font-size: 0.95em;
    }
    
    .list-entry {
        margin-bottom: 18px;
        padding: 8px 0;
    }
    
    .list-entry .name {
        font-size: 1.05em;
        min-width: 180px;
    }
    
    .list-entry .country {
        min-width: 130px;
    }
    
    .list-entry .description {
        margin-top: 8px;
        font-size: 0.95em;
    }
}

@media screen and (max-width: 768px) {
    .list-entries .alphabet-navigation {
        margin: 12px 0;
        padding-bottom: 12px;
    }
    
    .list-entries .alphabet-navigation .letter {
        width: 36px;
        height: 36px;
        line-height: 36px;
        margin: 3px;
        font-size: 0.9em;
    }
    
    .list-entry {
        margin-bottom: 15px;
        padding: 8px 0;
    }
    
    .list-entry .name {
        font-size: 1em;
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .list-entry .country {
        position: relative;
        right: auto;
        text-align: left;
        min-width: 100%;
        margin-bottom: 8px;
    }
    
    .list-entry .description {
        margin-top: 5px;
        font-size: 0.9em;
    }
}

@media screen and (max-width: 480px) {
    .list-entries .alphabet-navigation {
        margin: 10px 0;
        padding-bottom: 10px;
    }
    
    .list-entries .alphabet-navigation .letter {
        width: 30px;
        height: 30px;
        line-height: 30px;
        margin: 2px;
        font-size: 0.85em;
    }
    
    .list-entry {
        margin-bottom: 12px;
        padding: 6px 0;
    }
    
    .list-entry .name {
        font-size: 0.95em;
        margin-bottom: 6px;
    }
    
    .list-entry .country {
        margin-bottom: 6px;
    }
    
    .list-entry .country img {
        width: 20px;
        height: 14px;
        margin-right: 6px;
    }
    
    .list-entry .country span {
        font-size: 0.85em;
    }
    
    .list-entry .description {
        margin-top: 4px;
        font-size: 0.85em;
        line-height: 1.3;
    }
}