/* Mobile responsiveness fixes for conference pages */

/* =================================================================
   CONFERENCE TITLE - Slightly bigger, no bold
   ================================================================= */
.conf-grid_head h1 {
    font-size: 2.2rem !important;
    font-weight: normal !important;
    line-height: 1.3 !important;
}

@media (max-width: 767px) {
    .conf-grid_head h1 {
        font-size: 1.8rem !important;
    }
}

/* =================================================================
   CONFERENCE NAVIGATION MENU - Horizontal menu with hamburger on mobile
   ================================================================= */
.conf-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    border-bottom: 2px solid #005580;
    margin: -1rem -1.5rem 2rem -1.5rem;
    padding: 0 1.5rem;
}

.conf-nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    margin-left: auto;
}

.conf-nav__hamburger span {
    width: 25px;
    height: 3px;
    background: #005580;
    transition: all 0.3s ease;
}

.conf-nav__hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.conf-nav__hamburger.active span:nth-child(2) {
    opacity: 0;
}

.conf-nav__hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.conf-nav__menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0;
    flex-wrap: wrap;
}

.conf-nav__menu li {
    margin: 0;
}

.conf-nav__menu li a {
    display: block;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: #212529;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.conf-nav__menu li a:hover {
    color: #005580;
    background: #f0f8ff;
    border-bottom-color: #005580;
}

.conf-nav__menu li a.active {
    color: #005580;
    border-bottom-color: #005580;
    font-weight: 600;
}

/* Mobile menu */
@media (max-width: 991px) {
    .conf-nav {
        display: flex;
        align-items: center;
    }

    .conf-nav__hamburger {
        display: flex;
    }

    .conf-nav__menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 2rem 0;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .conf-nav__menu.active {
        left: 0;
    }

    .conf-nav__menu li {
        width: 100%;
    }

    .conf-nav__menu li a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #eee;
        border-left: 3px solid transparent;
    }

    .conf-nav__menu li a:hover,
    .conf-nav__menu li a.active {
        border-left-color: #005580;
        border-bottom-color: #eee;
    }
}

/* Menu overlay on mobile */
.conf-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.conf-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =================================================================
   TIMER STYLES - Countdown timer in header
   ================================================================= */
/* 3 Separate Sections with Green Icons */
.conf-grid__info {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    align-items: stretch !important;
    margin: 1.5rem 0 !important;
    padding: 1.5rem !important;
    background: white !important;
    border-radius: 12px !important;
}

.conf-grid__info-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: #f8f9fa !important;
    padding: 1rem 1.25rem !important;
    margin: 0 !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    flex: 1 1 auto !important;
    min-width: 200px !important;
}

/* Larger green icons */
.conf-grid__info-item svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    color: #28a745 !important;
    flex-shrink: 0 !important;
}

.conf-grid__info-item .conf-by-icon {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

.conf-grid__info-item .conf-by-icon small,
.conf-grid__info-item .conf-by-icon p,
.conf-grid__info-item .conf-by-icon address,
.conf-grid__info-item .conf-by-icon span {
    display: inline !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #555 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: normal !important;
    font-style: normal !important;
}

.conf-grid__info-item .conf-by-icon small {
    display: none !important;
}

/* No separators needed - each item has its own border */
.conf-grid__info-item:not(.conf-grid__info-item--timer)::after {
    display: none !important;
}

/* Timer - full width below, no border box */
.conf-grid__info-item--timer {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 0.5rem !important;
    padding-top: 1rem !important;
    padding-bottom: 0 !important;
    border: none !important;
    background: transparent !important;
    border-top: 1px solid #e9ecef !important;
}

/* Timer keeps transparent background */
.conf-grid__info-item.conf-grid__info-item--timer {
    background: transparent !important;
}

.conf-grid__info-item--timer::after {
    display: none !important;
}

.conf-grid__info-item--timer .conf-by-icon small {
    display: inline !important;
    font-size: 12px !important;
    color: #666 !important;
    margin-right: 0.5rem !important;
}

/* Mobile */
@media (max-width: 767px) {
    .conf-grid__info {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: flex-start !important;
    }

    .conf-grid__info-item:not(.conf-grid__info-item--timer)::after {
        display: none !important;
    }
}

.timer-wrapper {
    margin-top: 0.5rem;
}

#timer {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.25rem;
}

.digit-box {
    display: flex;
    gap: 2px;
    background: transparent;
    border-radius: 6px;
    padding: 8px 10px;
    min-width: 50px;
    justify-content: center;
}

.digit-box span {
    color: #005580 !important;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.digit-box-text {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.divider {
    font-size: 24px;
    font-weight: bold;
    color: #005580;
    margin: 0 0.25rem;
    line-height: 1;
}

/* Mobile responsive timer */
@media (max-width: 767px) {
    .digit-box {
        padding: 6px 8px;
        min-width: 40px;
    }

    .digit-box span {
        font-size: 20px;
    }

    .divider {
        font-size: 20px;
        margin: 0 0.15rem;
    }

    .digit-box-text {
        font-size: 9px;
    }
}

/* =================================================================
   MENU STYLES - Sticky navigation menu
   ================================================================= */
.conf-grid_aside__menu {
    list-style: none;
    padding: 0;
    margin: 0;
    position: sticky;
    top: 20px;
}

.conf-grid_aside__menu li {
    margin-bottom: 8px;
}

.conf-grid_aside__menu li a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #212529;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.conf-grid_aside__menu li a:hover {
    background-color: #f0f8ff;
    border-left-color: #005580;
    color: #005580;
    padding-left: 20px;
}

.conf-grid_aside__menu li a.active {
    background-color: #f0f8ff;
    border-left-color: #005580;
    color: #005580;
    font-weight: 600;
}

.conf-grid_aside__menu__accented a {
    font-weight: 600;
}

/* CRITICAL: Fix CSS Grid layout for mobile */
@media (max-width: 991px) {
    .conf-grid {
        display: block !important;
        grid-template-columns: none !important;
    }

    .conf-grid_main {
        display: block !important;
        grid-template-columns: none !important;
    }

    /* Hide desktop hero, show mobile hero */
    .conf-grid_main__hero {
        display: none !important;
    }

    .conf-grid_main__hero_mobile {
        display: block !important;
    }

    .conf-grid_aside {
        display: none !important;
    }
}

/* Program tables - make them more compact on mobile */
@media (max-width: 767px) {
    /* Force override inline styles on time column */
    table.program-table tbody tr td[style*="width: 13.25ch"] {
        width: 11ch !important;
        min-width: 11ch !important;
        max-width: 11ch !important;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.25rem !important;
    }

    /* Reduce first column width on mobile */
    table.program-table tbody tr td:first-child {
        width: 11ch !important;
        min-width: 11ch !important;
        max-width: 11ch !important;
        font-size: 0.85rem !important;
        padding: 0.5rem 0.25rem !important;
    }

    /* Make second column text smaller and adjust padding */
    table.program-table tbody tr td:last-child {
        font-size: 0.9rem !important;
        padding: 0.5rem 0.25rem !important;
    }

    /* Make table header smaller on mobile */
    table.program-table thead tr th {
        font-size: 1.25rem !important;
        padding: 0.75rem 0.5rem !important;
    }

    /* Smaller font for session titles */
    table.program-table tbody tr td:last-child > div > div > span {
        font-size: 0.95rem !important;
    }

    /* Smaller font for presenter info */
    table.program-table tbody tr td:last-child > div > div > div {
        font-size: 0.8rem !important;
    }

    /* Ensure table doesn't overflow */
    table.program-table {
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
    }
}

/* Extra small screens */
@media (max-width: 575px) {
    /* Even more compact on very small screens */
    table.program-table tbody tr td[style*="width: 13.25ch"] {
        width: 9ch !important;
        min-width: 9ch !important;
        max-width: 9ch !important;
        font-size: 0.75rem !important;
        padding: 0.4rem 0.2rem !important;
    }

    table.program-table tbody tr td:first-child {
        width: 9ch !important;
        min-width: 9ch !important;
        max-width: 9ch !important;
        font-size: 0.75rem !important;
        padding: 0.4rem 0.2rem !important;
    }

    table.program-table tbody tr td:last-child {
        font-size: 0.85rem !important;
        padding: 0.4rem 0.3rem !important;
    }

    table.program-table thead tr th {
        font-size: 1.1rem !important;
        padding: 0.6rem 0.4rem !important;
    }
}

/* Ensure all images in conference content are responsive */
.conf-grid_main__body img,
.conf-grid_main__hero img,
.conf-grid_main__hero_mobile img,
.conf-grid-main__hero__scroller img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

/* Make sure long URLs or emails break properly */
.conf-grid_main__body a,
.conf-grid_main__body address {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix any fixed-width content from CKEditor */
.conf-grid_main__body table {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
}

.conf-grid_main__body table td,
.conf-grid_main__body table th {
    min-width: 50px;
}

/* Fix container width on mobile */
@media (max-width: 767px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* CRITICAL: Fix all CKEditor content in sections - ULTRA AGGRESSIVE */
@media (max-width: 767px) {
    /* Force all paragraphs, divs, and spans to be responsive */
    .conf-grid_main__body section p,
    .conf-grid_main__body section div,
    .conf-grid_main__body section span,
    .conf-grid_main__body section h1,
    .conf-grid_main__body section h2,
    .conf-grid_main__body section h3,
    .conf-grid_main__body section h4,
    .conf-grid_main__body section strong,
    .conf-grid_main__body section em {
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        font-size: inherit !important;
    }

    /* Remove all inline widths from CKEditor elements */
    .conf-grid_main__body section *[style*="width"] {
        width: auto !important;
        max-width: 100% !important;
    }

    /* Force all images to be responsive */
    .conf-grid_main__body section img {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Fix all tables in sections */
    .conf-grid_main__body section table {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
    }

    .conf-grid_main__body section table td,
    .conf-grid_main__body section table th {
        font-size: 0.9rem !important;
        padding: 0.5rem !important;
        word-wrap: break-word !important;
    }

    /* Fix lists */
    .conf-grid_main__body section ul,
    .conf-grid_main__body section ol {
        padding-left: 1.5rem !important;
        max-width: 100% !important;
    }

    .conf-grid_main__body section li {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Fix specific sections */
    .conf-grid_main__body section#informacje,
    .conf-grid_main__body section#program,
    .conf-grid_main__body section#pakiety,
    .conf-grid_main__body section#rejestracja,
    .conf-grid_main__body section#koordynatorzy,
    .conf-grid_main__body section#prelegenci,
    .conf-grid_main__body section#partnerzy,
    .conf-grid_main__body section#kontakt {
        max-width: 100% !important;
        overflow-x: hidden !important;
        word-wrap: break-word !important;
    }

    /* Force override any fixed positioning or absolute positioning */
    .conf-grid_main__body section * {
        position: relative !important;
        left: auto !important;
        right: auto !important;
    }

    /* Fix addresses and contact info */
    .conf-grid_main__body section address {
        font-size: 0.9rem !important;
        line-height: 1.5 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Fix links that might be too long */
    .conf-grid_main__body section a {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }

    /* Fix iframes (maps, videos) */
    .conf-grid_main__body section iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Fix any floated elements */
    .conf-grid_main__body section *[style*="float"] {
        float: none !important;
    }

    /* Fix headings */
    .conf-grid_main__body section h2,
    .conf-grid_main__body section h3 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
    }
}

/* =================================================================
   FIX: Jednolite rozmiary zdjęć prelegentów/koordynatorów
   Problem: Zdjęcia mają różne wymiary (194x237 do 1000x1420)
   Rozwiązanie: object-fit: cover wymusza jednolite wymiary
   ================================================================= */

/* Prelegenci (speakers grid) */
.conf-speakers-grid figure.our-author-wrapper img {
    width: 100% !important;
    height: 280px !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
}

/* Koordynatorzy (coordinators grid) */
.conf-coordinators-grid .conf-person-wrapper img {
    width: 200px !important;
    height: 200px !important;
    object-fit: cover !important;
    object-position: center top !important;
    border-radius: 8px !important;
    display: block !important;
}

/* Mobile responsiveness */
@media (max-width: 767px) {
    .conf-speakers-grid figure.our-author-wrapper img {
        height: 240px !important;
    }
    
    .conf-coordinators-grid .conf-person-wrapper img {
        width: 150px !important;
        height: 150px !important;
    }
}
