﻿/* ============================================
   AD WEBSITE - RESPONSIVE STYLES
   Tablet (iPad) and Mobile breakpoints
   ============================================ */

/* ============================================
   FIX: Telerik Drawer z-index for mobile filters
   Must be higher than header (z-index: 1000-1001)
   ============================================ */

.k-drawer,
.k-drawer-container .k-drawer,
.k-drawer-wrapper
{
    z-index: 10001 !important;
}

/* Specific fix for mobile tag drawer on VacancySearch and ArticleSearch */
.mobile-tag-drawer,
.mobile-tag-drawer.k-drawer
{
    z-index: 10001 !important;
}

.mobile-tag-drawer .k-drawer-wrapper,
.mobile-tag-drawer .k-drawer-content
{
    z-index: 10001 !important;
}

/* When drawer is expanded, lower header z-index */
body:has(.k-drawer-expanded) .ad-header.ad-bg,
body:has(.k-drawer-expanded) .ad-header .ad-navigation
{
    z-index: 1 !important;
}

/* Fallback for browsers without :has() support - use JavaScript class */
body.drawer-open .ad-header.ad-bg,
body.drawer-open .ad-header .ad-navigation
{
    z-index: 1 !important;
}

/* ============================================
   LARGE SCREENS (below 1200px)
   ============================================ */

@media (max-width: 1199.98px)
{
    .ad-container
    {
        max-width: 100%;
    }
}

/* ============================================
   TABLET/IPAD STYLES (768px - 1024px)
   iPad Portrait: 768px
   iPad Landscape: 1024px
   Border-radius: 6px
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px)
{
    .ad-content
    {
        padding-left: 1rem;
        padding-right: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .ad-container
    {
        padding: 0 12px;
    }

    .ad-header.ad-bg
    {
        border-radius: 8px;
        padding: 10px 15px 2px 15px !important;
    }

    .ad-footer.ad-bg
    {
        border-radius: 8px;
        padding: 12px 15px 8px 15px;
    }

    .ad-header-socialmedia,
    .ad-footer-socialmedia
    {
        font-size: 1.25rem;
    }

    /* Article images - tablet sizing */
    .article-body .article-image,
    .article-intro .article-image
    {
        max-width: 45%;
        border-radius: 6px;
    }

    .article-body .article-image.center,
    .article-intro .article-image.center
    {
        max-width: 80%;
        border-radius: 6px;
    }

    .article-body .article-image.left,
    .article-intro .article-image.left
    {
        margin: 8px 15px 8px 0;
        border-radius: 6px;
    }

    .article-body .article-image.right,
    .article-intro .article-image.right
    {
        margin: 8px 0 8px 15px;
        border-radius: 6px;
    }

    .article-body .article-image img,
    .article-intro .article-image img
    {
        max-width: 350px;
        border-radius: 6px;
    }

    .article-body .article-image.center img,
    .article-intro .article-image.center img
    {
        max-width: 100%;
        border-radius: 6px;
    }

    .article-body .article-image .image-caption,
    .article-intro .article-image .image-caption
    {
        border-radius: 0 0 6px 6px;
        font-size: 0.85rem;
    }
}

/* ============================================
   TABLET STYLES (below 992px) - General tablet
   ============================================ */

@media (max-width: 991.98px)
{
    .ad-container
    {
        padding: 0 10px;
    }

    .ad-header.ad-bg
    {
        border-radius: 8px;
        padding: 10px 12px 2px 12px !important;
    }

    .ad-footer.ad-bg
    {
        border-radius: 8px;
        padding: 12px 15px 8px 15px;
    }

    /* Article images - tablet border-radius */
    .article-body .article-image,
    .article-intro .article-image,
    .article-body .article-image.center,
    .article-intro .article-image.center,
    .article-body .article-image.left,
    .article-intro .article-image.left,
    .article-body .article-image.right,
    .article-intro .article-image.right
    {
        border-radius: 6px;
    }

    .article-body .article-image img,
    .article-intro .article-image img,
    .article-body .article-image.center img,
    .article-intro .article-image.center img
    {
        border-radius: 6px;
    }

    .article-body .article-image .image-caption,
    .article-intro .article-image .image-caption
    {
        border-radius: 0 0 6px 6px;
    }
}

/* ============================================
   MOBILE STYLES (below 768px)
   Border-radius: 0 (full-bleed images)
   ============================================ */

@media (max-width: 767.98px)
{
    .ad-container
    {
        padding: 0 5px;
    }

    .ad-content
    {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* Header mobile - higher z-index to be above main content */
    .ad-header.ad-bg
    {
        border-radius: 8px;
        padding: 8px 8px 0 8px !important;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: visible;
        position: relative;
        z-index: 1000;
    }

    /* Fix row overflow issues but allow dropdown overflow */
    .ad-header.row
    {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        overflow: visible;
    }

    /* Header columns - minimal padding, allow overflow */
    .ad-header > .ad-col
    {
        padding-left: 5px;
        padding-right: 5px;
        overflow: visible;
    }

    /* Navigation inside header - higher z-index */
    .ad-header .ad-navigation
    {
        margin-left: -8px;
        margin-right: -8px;
        padding: 8px 0 0 0;
        width: calc(100% + 16px);
        overflow: visible;
        position: relative;
        z-index: 1001;
    }

    .ad-header .ad-navigation > .ad-col
    {
        padding-left: 0;
        padding-right: 0;
        overflow: visible;
    }

    .ad-language-selector
    {
        margin-left: auto;
    }

    .ad-header-socialmedia, .ad-footer-socialmedia
    {
        font-size: 1.0rem;
        float: right;
    }

    /* Main content - MUST be lower z-index than header dropdown */
    .ad-main
    {
        position: relative;
        z-index: 1;
    }

    /* Footer mobile - compact layout */
    .ad-footer.ad-bg
    {
        border-radius: 8px;
        padding: 10px 8px 8px 8px;
        position: relative;
        z-index: 1;
    }

    /* Fix footer row overflow */
    .ad-footer.row
    {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .ad-footer .ad-col
    {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Footer inner rows - compact on mobile */
    .ad-footer .ad-row
    {
        margin-left: 0;
        margin-right: 0;
    }

    .ad-footer .ad-row .ad-col
    {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Stack footer columns on mobile */
    .ad-footer .ad-row .ad-col.col-6,
    .ad-footer .ad-row .ad-col.col-3
    {
        flex: 0 0 auto;
        width: auto;
    }

    /* Footer first row - horizontal compact layout */
    .ad-footer .ad-row:first-child
    {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 8px;
    }

    .ad-footer .ad-row:first-child .ad-col
    {
        flex: 0 0 auto;
        width: auto;
        max-width: 100%;
        margin-bottom: 0;
    }

    /* Footer menu column - takes more space */
    .ad-footer .ad-row:first-child .ad-col:first-child
    {
        flex: 1 1 100%;
        text-align: center;
        margin-bottom: 8px;
    }

    /* Social and advertisement columns */
    .ad-footer .ad-row:first-child .ad-col:nth-child(2),
    .ad-footer .ad-row:first-child .ad-col:nth-child(3)
    {
        flex: 0 0 auto;
    }

    /* Copyright row */
    .ad-footer .ad-row:last-child
    {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* ============================================
       MOBILE: Article images full-width, NO text wrap
       ============================================ */

    /* Force .article-image containers inside article content to full width block */
    .article-body .article-image,
    .article-body .article-image.left,
    .article-body .article-image.right,
    .article-body .article-image.center,
    .article-intro .article-image,
    .article-intro .article-image.left,
    .article-intro .article-image.right,
    .article-intro .article-image.center
    {
        display: block !important;
        float: none !important;
        clear: both !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 16px 0 !important;
        padding: 0 !important;
        text-align: center !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    /* Force images inside .article-image to full width */
    .article-body .article-image img,
    .article-intro .article-image img
    {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        display: block !important;
    }

    /* Override images with inline style attributes */
    .article-body .article-image img[style],
    .article-intro .article-image img[style]
    {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        float: none !important;
        display: block !important;
        border-radius: 0 !important;
    }

    /* Image captions inside article content */
    .article-body .article-image .image-caption,
    .article-intro .article-image .image-caption
    {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin-top: 0;
        background: #f8f9fa;
        text-align: center;
        border-radius: 0;
    }

    /* Paragraphs should NOT wrap around images on mobile */
    .article-body p,
    .article-intro p
    {
        float: none !important;
    }

    /* Line breaks normal on mobile */
    .article-body br,
    .article-intro br
    {
        display: block;
        line-height: 1.5em;
    }
}

/* ============================================
   SMALL MOBILE STYLES (below 576px)
   ============================================ */

@media (max-width: 575.98px)
{
    .ad-container
    {
        padding: 0 3px;
    }

    .ad-header.ad-bg
    {
        border-radius: 6px;
        padding: 6px 5px 0 5px !important;
        overflow: visible;
    }

    /* Header columns - tighter */
    .ad-header > .ad-col
    {
        padding-left: 3px;
        padding-right: 3px;
        overflow: visible;
    }

    /* Navigation - extend to edges */
    .ad-header .ad-navigation
    {
        margin-left: -5px;
        margin-right: -5px;
        padding: 6px 0 0 0;
        width: calc(100% + 10px);
        overflow: visible;
    }

    .ad-footer.ad-bg
    {
        border-radius: 6px;
        margin-bottom: 5px;
        padding: 8px 5px 6px 5px;
    }

    .ad-footer .ad-col
    {
        padding-left: 3px;
        padding-right: 3px;
    }

    /* Even more compact footer layout */
    .ad-footer .ad-row:first-child
    {
        gap: 6px;
    }

    .ad-footer .ad-row:first-child .ad-col:first-child
    {
        margin-bottom: 6px;
    }

    .ad-footer .ad-row:last-child
    {
        margin-top: 6px;
        padding-top: 6px;
    }
}

/* ============================================
   BROWSER WARNING STYLES
   ============================================ */

#browser-warning-overlay
{
    animation: fadeIn 0.3s ease-in-out;
}

#browser-warning-overlay > div
{
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn
{
    from
    {
        opacity: 0;
    }

    to
    {
        opacity: 1;
    }
}

@keyframes slideIn
{
    from
    {
        opacity: 0;
        transform: translateY(-20px);
    }

    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

#browser-warning-overlay a:hover > div
{
    background-color: #f5f5f5;
    border-color: #cc3333;
}
