/* Custom responsive fixes for www.inanidigiada.it (Joomla / YOOtheme Pro) */

@media (max-width: 959px) {
    /* Prevent any horizontal scroll / overflow on mobile */
    html,
    body,
    .tm-page {
        overflow-x: clip !important;
        max-width: 100% !important;
    }

    /* Fix footer hours list hardcoded style="right: -140px;" overflowing off right edge */
    ul.uk-list.uk-position-relative[style*="right:"] {
        right: 0 !important;
        left: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
        padding-left: 0 !important;
    }

    ul.uk-list.uk-position-relative[style*="right:"] ul {
        list-style: none;
        padding-left: 0;
        margin-left: 0;
    }

    /* Fix homepage photo collage hardcoded style="left: -200px; top: -180px;" clipping & overlapping */
    div.uk-position-absolute[style*="left: -"],
    div.uk-position-absolute[style*="top: -"] {
        position: static !important;
        left: auto !important;
        top: auto !important;
        margin-top: 20px !important;
    }

    /* Compact oversized desktop vertical section paddings on mobile */
    .uk-section-xlarge {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    .uk-section-large {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    .uk-section {
        padding-top: 36px;
        padding-bottom: 36px;
    }

    /* Prevent large blank voids from scrollspy waiting on mobile */
    [uk-scrollspy-class],
    [uk-scrollspy] [uk-scrollspy-class] {
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Make mobile menu modal fully opaque & high-contrast */
    #tm-mobile.uk-modal-full,
    #tm-mobile .uk-modal-dialog {
        background-color: #ffffff !important;
        opacity: 1 !important;
    }

    #tm-mobile .uk-nav-primary > li > a {
        color: #222222 !important;
        font-size: 22px;
        line-height: 1.4;
        padding: 10px 0;
    }

    #tm-mobile .uk-nav-sub {
        padding-top: 4px;
        padding-bottom: 8px;
    }

    #tm-mobile .uk-nav-sub a {
        color: #4b5563 !important;
        font-size: 16px;
        padding: 6px 0;
    }

    #tm-mobile .uk-modal-close-full {
        background: transparent !important;
        color: #222222 !important;
    }

    /* Keep fixed-width tables (e.g. Calendar page width: 461px) and images inside viewport */
    table[style*="width:"] {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .tm-page img {
        max-width: 100%;
        height: auto;
    }

    /* Improve hero & section headline sizing on small screens */
    .uk-heading-2xlarge {
        font-size: 2.35rem !important;
        line-height: 1.15 !important;
    }

    .uk-heading-medium {
        font-size: 1.85rem !important;
        line-height: 1.2 !important;
    }
}
