/* Mobile-specific styles for ODAN FM */

/* Base typography for better readability on mobile */
html {
    font-size: 16px;
}

/* Responsive typography */
@media (max-width: 640px) {
    h1 {
        font-size: 1.75rem !important;
        line-height: 2.25rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 2rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        line-height: 1.75rem !important;
    }

    p,
    li,
    a,
    span,
    div {
        font-size: 1rem !important;
        line-height: 1.5 !important;
    }
}

/* Image optimizations */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure images don't exceed their container */
.content img,
.news-image,
.gallery-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Improve touch targets for mobile */
a,
button,
[role="button"],
.btn,
.nav-link {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Form elements */
input,
textarea,
select,
button {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

/* Prevent horizontal scrolling */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Improve button touch targets */
.btn,
button,
[type="button"],
[type="submit"] {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.375rem;
}

/* Card optimizations for mobile */
.card,
.news-card,
.event-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Prevent long words from breaking layout */
p,
h1,
h2,
h3,
h4,
h5,
h6,
a,
li,
td,
th,
label,
input,
textarea,
select,
button {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Optimize tables for mobile */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Improve list readability */
ul,
ol {
    padding-left: 1.5rem;
}

/* Better spacing for mobile */
section,
article,
header,
footer,
div[class*="container"] {
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Optimize iframe embeds */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}

.embed-responsive::before {
    display: block;
    content: "";
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Optimize images for high DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* High DPI optimizations */
    img {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0) scale(1, 1);
        transform: translateZ(0) scale(1, 1);
    }
}

/* Disable animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
