/* base rules */
img {
	max-width: 100%;
	height: auto;
}

.BZar img {
   max-width: 100%;
   margin: auto !important;
}

.scrolable-div {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table {
	max-width: 100%;
}

/* compact mobile bar (only shown on phones) */
#mnav {
	display: none;
}

/* mobile-only banner (hidden on desktop) */
.mobile-only {
	display: none;
}

/* ============ tablets & smaller laptops ============ */
@media only screen and (max-width: 1200px) {
    .nav.sticky {
        display: none;
    }

    /* keep the banner visible and fully stacked above the content.
       the hidden .top-wave div (height:555px + negative margins) is a
       desktop-only spacing trick; kill it here so it can't collapse the header */
    #header {
        margin-bottom: 0;
        padding-top: 0;
        z-index: auto;
        line-height: 0;
    }

    #header a {
        line-height: normal;
        font-size: 0;
    }

    #header img {
        visibility: visible;
        display: block;
    }

    #header .top-wave {
        display: none;
    }

    #buttonContainer {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    #col .button {
        flex: 0 1 23%;
        box-sizing: border-box;
        margin: 3px;
    }

    #main {
        margin-top: 10px;
    }

    #content .BZar {
        padding: 20px 6%;
    }

    #keyspeechbox {
        padding: 2% 6% !important;
    }

    #footer {
        padding-top: 90px;
    }
}

/* ============ small tablets / large phones ============ */
@media only screen and (max-width: 768px) {
    /* overflow-x: clip avoids the RTL "can't scroll down" trap on mobile */
    html {
        overflow-x: clip;
    }

    /* replace the big banner with a compact bar + dropdown menu */
    #header {
        display: none;
    }

    #mnav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 1000000;
        height: 58px;
        box-sizing: border-box;
        background: var(--navy-800);
        border-bottom: 2px solid var(--gold);
        box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
        padding: 0 12px;
    }

    /* keep the page content clear of the fixed mobile bar */
    #wrapper {
        padding-top: 58px;
    }

    #mnav .mnav-logo {
        display: inline-flex;
        align-items: center;
    }

    #mnav .mnav-logo img {
        display: block;
        height: 40px;
        width: auto;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    }

    /* persistent mobile banner shown above the content on every section */
    .mobile-only {
        display: block;
        width: 100%;
        margin: 0 0 12px;
        line-height: 0;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    }

    .mobile-only img {
        display: block;
        width: 100%;
        height: auto;
    }

    #mnav-btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        background: var(--gold);
        color: var(--navy-900);
        border: none;
        border-radius: 20px;
        font-family: "IRANSansFaNum", Tahoma, sans-serif;
        font-size: 14px;
        font-weight: bold;
        padding: 7px 15px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    #mnav-btn .mnav-icon {
        display: inline-flex;
        flex-direction: column;
        justify-content: space-between;
        width: 18px;
        height: 13px;
    }

    #mnav-btn .mnav-icon span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--navy-900);
        border-radius: 1px;
    }

    #col {
        display: none;
    }

    /* dropdown menu that opens over the page at the current scroll position */
    #col.open {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        position: fixed;
        top: 58px;
        right: 0;
        left: 0;
        z-index: 999999;
        box-sizing: border-box;
        padding: 10px;
        background: var(--navy-800);
        border-bottom: 2px solid var(--gold);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55);
        max-height: calc(100vh - 58px);
        overflow-y: auto;
        animation: mnavDrop 0.18s ease-out;
    }

    @keyframes mnavDrop {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* dropdown items: two compact columns so the menu stays short */
    #col .button {
        flex: 0 1 46%;
        padding: 12px 4px;
        font-size: 13px;
        border-radius: 3px;
        text-align: center;
    }

    #col.open .button {
        margin: 4px 0;
    }

    #main {
        margin-top: 0;
    }

    #content .BZar {
        Padding: 15px 10px;
    }

    #keyspeechbox {
        padding: 2% !important;
    }

    .sponsorBar {
        font-size: 15px;
        padding: 10px;
    }

    .grid .person {
        width: 100%;
        margin: 5px auto;
    }

    /* stack speaker cards */
    .presenter .pic {
        position: static;
        display: block;
        margin: 15px auto;
    }

    .presenter .pic:nth-child(2) {
        top: auto;
    }

    .presenter .caption {
        margin: 0 15px 20px;
        text-align: center;
    }

    .panelists {
        width: 100%;
    }

    .panelists .detail {
        font-size: 13px;
        line-height: 26px;
    }

    /* panel cards */
    .panel-card .panel-title {
        font-size: 15px;
    }

    .panel-card .panel-members {
        gap: 14px 12px;
        padding: 18px 10px;
    }

    .panelist {
        width: 140px;
    }

    .panel-card .panel-body {
        padding: 14px 16px 20px;
    }

    .panel-card .panel-projects {
        padding: 2px 12px 12px;
    }

    .panelist .panelist-avatar,
    .panelist .panelist-monogram {
        width: 76px;
        height: 76px;
        font-size: 28px;
        line-height: 72px;
    }

    #intronav {
        width: 100%;
    }

    /* album year-switcher buttons (inline width:19% -> 2 per row) */
    #content .button.rounded {
        width: 45% !important;
        box-sizing: border-box;
        margin: 3px;
        padding: 9px 6px;
        font-size: 12px;
    }

    #footer {
        padding-top: 60px;
        margin-top: 0;
    }

    table td {
        height: auto;
    }

    /* intro sponsor logos (cellspacing=50 => too wide) */
    .BZar table {
        border-spacing: 10px;
    }

    /* executive team: equal boxes, no wrapped names on phones */
    table.partners {
        width: 100% !important;
    }

    table.partners td {
        font-size: 12px;
        padding: 5px 2px;
    }
}

/* ============ phones ============ */
@media only screen and (max-width: 480px) {
    #col .button {
        flex: 0 1 46%;
        margin: 4px 0;
        padding: 12px 4px;
        font-size: 13px;
    }

    #main {
        margin-top: 5px;
    }

    #header img {
        max-width: 100%;
    }

    #content .BZar,
    #keyspeechbox {
        Padding: 12px 10px;
    }

    #content h4 {
        font-size: 15px;
        line-height: 28px;
    }

    #content p {
        font-size: 13px;
    }

    .sponsorBar {
        font-size: 14px;
        padding: 8px;
    }

    .grid .person img {
        float: none;
        display: block;
        margin: 10px auto;
        width: 130px;
    }

    .grid .person .caption {
        float: none;
        width: 100%;
        margin: 0;
        padding: 0 10px 12px;
        text-align: center;
    }

    .conf-articles table p {
        font-size: 12px;
    }

    .conf-articles table td {
        font-size: 12px;
        padding: 4px;
    }

    .fancybox-buttons {
        margin: 3px;
    }

    .fancybox-buttons img {
        height: 56px;
        width: 56px;
    }

    #content .button.rounded {
        width: 98% !important;
        font-size: 13px;
    }

    /* intro sponsor logos (cellspacing=50 => too wide) */
    .BZar table {
        border-spacing: 10px;
    }

    #footerNote {
        font-size: 13px;
    }
}
@media only screen and (max-width: 360px) {
    .fancybox-buttons img {
        height: 46px;
        width: 46px;
    }

    #col .button {
        font-size: 12px;
        padding: 9px 3px;
    }
}