/* Responsive CSS for Marin Wedding DJ Website */
/* Mobile-first approach with progressive enhancement */

/* ========================================
   CSS Reset & Base Styles
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    text-align: center !important;
    /* Center text globally */
    font-size: 18px !important;
    /* Adjusted to 18px */
    line-height: 1.6;
}

p,
td,
div,
span,
a,
li,
b,
strong {
    text-align: center !important;
    font-size: 18px !important;
    /* Adjusted to 18px */
}

/* Force ALL legacy font tags to match the size */
font {
    font-size: 18px !important;
}

/* Override all specific legacy sizes */
font[size] {
    font-size: 18px !important;
}

/* Specific overrides requested */
font[size="2"],
font[size="4"] {
    font-size: 18px !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-align: center !important;
    font-size: 24px !important;
    /* Headers slightly larger but centered */
}

/* ========================================
   Responsive Images
   ======================================== */
img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    /* Center all images */
}

/* ========================================
   Responsive Tables
   ======================================== */
table {
    width: 100% !important;
    border-collapse: collapse;
    margin-left: auto !important;
    margin-right: auto !important;
    /* Center tables */
}

/* Make nested tables responsive */
td,
th {
    padding: 5px;
}

/* ========================================
   Mobile Navigation
   ======================================== */
/* ========================================
   Mobile Navigation (Hamburger Menu)
   ======================================== */

/* Hide the legacy table navigation on mobile */
@media screen and (max-width: 768px) {
    table[bgcolor="#666666"] {
        display: none !important;
    }
}

/* Mobile Nav Header Styles */
.mobile-nav-header {
    display: none;
    /* Hidden on desktop */
}

@media screen and (max-width: 768px) {
    .mobile-nav-header {
        display: block;
        width: 100%;
        background-color: #666666;
        padding: 10px;
        position: relative;
        text-align: center;
        margin-bottom: 20px;
    }

    /* Hamburger Icon */
    .hamburger-icon {
        display: inline-block;
        cursor: pointer;
        padding: 5px;
        border: 1px solid #fff;
        border-radius: 4px;
    }

    .hamburger-icon span {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        -webkit-transition: all 0.3s ease-in-out;
        transition: all 0.3s ease-in-out;
        background-color: white;
    }

    /* Mobile Menu Items (Hidden by default) */
    .mobile-menu {
        display: none;
        background-color: #444;
        margin-top: 10px;
        border-radius: 4px;
    }

    .mobile-menu a {
        display: block;
        color: white;
        padding: 15px;
        text-decoration: none;
        border-bottom: 1px solid #555;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 16px;
        font-weight: bold;
    }

    .mobile-menu a:last-child {
        border-bottom: none;
    }

    .mobile-menu a:hover {
        background-color: #555;
    }
}

/* ========================================
   Content Area Responsiveness
   ======================================== */

/* Make all container tables full width on mobile */
@media screen and (max-width: 768px) {

    /* Force all tables to adapt to screen width */
    table {
        width: 100% !important;
        height: auto !important;
        /* Removed fixed layout to prevent squashed columns */
    }

    /* Ensure marquees don't cause overflow */
    marquee {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Ensure content doesn't overflow */
    td {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        /* Safer break than break-all */
        height: auto !important;
        /* Reset specific heights */
    }

    /* Font sizing for better mobile readability */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    font[size="2"],
    font[size="4"] {
        font-size: 14px !important;
    }

    font[size="6"] {
        font-size: 24px !important;
    }

    /* Adjust headings */
    h2 {
        font-size: 20px;
    }

    /* Make paragraphs more readable */
    p {
        padding: 0 10px;
        text-align: left !important;
    }

    /* Request: 18px for font sizes 2 and 4 on mobile */
    font[size="2"],
    font[size="4"] {
        font-size: 18px !important;
    }
}

/* ========================================
   Iframe Responsiveness (Contact Page)
   ======================================== */
@media screen and (max-width: 768px) {
    iframe {
        width: 100% !important;
        min-height: 800px;
    }
}

/* ========================================
   Images - Specific Fixes
   ======================================== */
@media screen and (max-width: 768px) {

    /* Banner image */
    img[src="banner.jpg"] {
        width: 100% !important;
        height: auto !important;
    }

    /* Large images - prevent overflow */
    img[style*="width: 1024px"],
    img[style*="width: 600px"] {
        width: 100% !important;
        height: auto !important;
    }
}

/* ========================================
   Text Alignment on Mobile
   ======================================== */
@media screen and (max-width: 768px) {

    div[align="center"],
    div[style*="text-align: center"],
    td[style*="text-align: center"],
    p[align="center"] {
        padding: 10px;
    }
}

/* ========================================
   Tablet Optimizations (768px - 1024px)
   ======================================== */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    table[width="53%"] {
        width: 80% !important;
    }

    table[width="67%"] {
        width: 90% !important;
    }
}

/* ========================================
   Small Mobile Phones (< 480px)
   ======================================== */
@media screen and (max-width: 480px) {

    /* Further reduce font sizes */
    body {
        font-size: 13px;
    }

    /* Make nav links even larger for easier tapping */
    table[bgcolor="#666666"] a {
        padding: 12px;
        font-size: 15px !important;
    }

    /* Phone number - make it prominent and tappable */
    a[href^="tel"],
    font:has(+ a[href^="tel"]) {
        font-size: 20px !important;
    }

    /* Reduce padding on small screens */
    td {
        padding: 3px;
    }
}

/* ========================================
   Print Styles (Bonus)
   ======================================== */
@media print {

    /* Hide navigation when printing */
    table[bgcolor="#666666"] {
        display: none;
    }

    /* Optimize for print */
    body {
        background: white !important;
    }

    a {
        color: black !important;
        text-decoration: underline;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */

/* Improve link visibility and touch targets */
a {
    text-decoration: underline;
    min-height: 44px;
    display: inline-block;
}

/* Focus states for keyboard navigation */
a:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* ========================================
   Prevent Horizontal Scrolling
   ======================================== */
body {
    overflow-x: hidden;
}

table {
    table-layout: auto;
}

/* Ensure body doesn't cause issues */
@media screen and (max-width: 768px) {
    body {
        width: 100% !important;
        margin: 0;
        padding: 0;
    }
}