/* =====================================================================
   mobile.css — styles used ONLY by mobile.html (phones, tablets, iPads)
   Loaded after style.css, so anything here overrides the shared styles.
   ===================================================================== */

html.m-page body { -webkit-text-size-adjust: 100%; }

/* ---------------------------------------------------------------------
   1. CONTENT ORDER (one column on every phone / tablet / iPad size)
        1  name block
        2  tab bar + About Me  →  Professional Summary  →  Qatar Media Corporation
        3  My Projects
        4  Certificates (with links, personal info, buttons)
        5  Current Tech Stack
   --------------------------------------------------------------------- */
html.m-page .app-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 880px !important;
    height: auto !important;
    margin: 0 auto !important;
}
/* let the blocks inside the side columns take part in the page order */
html.m-page aside.col-left,
html.m-page aside.col-right { display: contents !important; }

html.m-page .left-block-profile   { order: 1; }
html.m-page main.col-center       { order: 2; }
html.m-page .right-block-projects { order: 3; }
html.m-page .left-block-more      { order: 4; }
html.m-page .right-block-stack    { order: 5; }

html.m-page .left-block,
html.m-page .right-block,
html.m-page main.col-center {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    opacity: 1 !important;
    transform: none !important;
}
html.m-page main.col-center { height: auto !important; overflow: visible !important; padding: 0 !important; }
html.m-page .col-right { margin-left: 0 !important; }

/* ---------------------------------------------------------------------
   2. LARGE TABLETS / iPads IN LANDSCAPE (wider than 1100px)
      Re-use the small-screen rules from style.css so the single-column
      layout looks the same there too.
   --------------------------------------------------------------------- */
@media (min-width: 1101px) {

    /* ---- copied from style.css @media (max-width: 1100px) ---- */

    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 14px 12px 28px;
        display: block;
    }

    .app-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 880px;
        height: auto;
        margin: 0 auto;
        gap: 14px;
    }

    .col-left,
    .col-center,
    .col-right {
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        opacity: 1 !important;
        transform: none !important;
    }

    .col-left { order: 1; }
    .col-center { order: 2; padding-left: 0; padding-right: 0; }
    .col-right { order: 3; }

    .progress-rail {
        position: sticky;
        top: 0;
        z-index: 120;
    }

    .main-nav {
        position: sticky;
        top: 0;
        background: rgba(7, 8, 12, 0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: 10px 4px 12px;
        margin-bottom: 16px;
    }

    .main-nav ul {
        gap: 14px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 2px 4px;
        justify-content: flex-start;
    }

    .main-nav ul::-webkit-scrollbar {
        display: none;
    }

    .main-nav li {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.84rem;
    }

    .pro-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 100%;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid-layout {
        grid-template-columns: 1fr;
    }

    .responsibilities-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Timeline → stacked single column */
    .timeline-alt {
        padding: 8px 0 20px;
    }

    .timeline-line {
        left: 16px;
        transform: none;
    }

    .t-card,
    .t-card.left,
    .t-card.right {
        float: none;
        width: calc(100% - 40px);
        margin: 0 0 18px 40px;
        text-align: left;
    }

    .t-card::before,
    .t-card::after {
        display: none;
    }

    .timeline-row-1digitals,
    .timeline-row-elegansys,
    .timeline-row-imarah,
    .timeline-row-petro,
    .timeline-row-alfazin {
        margin-top: 0;
    }

    .t-card.qmc-card .qmc-popup,
    .qmc-popup,
    .one-digitals-popup,
    .elegansys-popup,
    .imarah-popup,
    .petro-popup,
    .alfazin-popup,
    .t-popup {
        display: none !important;
    }

    .t-row {
        margin-bottom: 0;
    }

    .t-row::after {
        display: none;
    }

    html {
        overflow-x: hidden;
    }

    .switch {
        position: static;
        transform: none;
        margin: 12px auto 0;
        display: block;
    }

    .avatar-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* ---- copied from style.css @media (max-width: 1100px) ---- */

    #about .hero-spotlight .pro-stats { grid-template-columns: repeat(2, 1fr) !important; }
    #about .hero-spotlight .pro-stat:nth-child(3) { border-left: 0 !important; }
    #about .hero-spotlight .pro-stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, 0.08) !important; }

    /* ---- copied from style.css @media (max-width: 1100px) ---- */

    .main-nav ul { display: flex !important; overflow-x: auto; }
    .main-nav li { flex: 1 0 auto !important; padding-left: 12px !important; padding-right: 12px !important; }

    /* ---- copied from style.css @media (min-width: 769px) and (max-width: 1100px) ---- */

    .col-left .profile-header {
        display: grid !important;
        grid-template-columns: 84px minmax(0, 1fr) !important;
        grid-template-areas:
            "photo name"
            "photo role"
            "status status" !important;
        column-gap: 16px !important;
        row-gap: 2px !important;
        align-items: center !important;
        justify-items: start !important;
        text-align: left !important;
        padding: 4px 0 18px 0 !important;
        margin: 0 0 6px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .col-left .profile-header .avatar-container {
        grid-area: photo;
        width: 84px !important;
        height: 84px !important;
        margin: 0 !important;
        align-self: center;
    }
    .col-left .profile-header .avatar-container img {
        width: 84px !important;
        height: 84px !important;
        border-radius: 20px !important;
        object-fit: cover;
        object-position: center top;
    }
    .col-left .profile-header .name-row {
        grid-area: name;
        align-self: end;
        width: 100%;
        margin: 0 !important;
        padding-right: 44px;                        /* room for the theme button */
        box-sizing: border-box;
        justify-content: flex-start !important;
        text-align: left !important;
    }
    .col-left .profile-header .name-row h1 {
        font-size: clamp(1.25rem, 5.6vw, 1.55rem) !important;
        line-height: 1.15 !important;
        text-align: left !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .col-left .profile-header .handle {
        grid-area: role;
        align-self: start;
        margin: 2px 0 0 !important;
        min-height: 1.4em;                         /* no jump while the role text types */
        font-size: 0.9rem !important;
        text-align: left !important;
        white-space: nowrap;
        overflow: hidden;
        max-width: 100%;
        padding-right: 44px;
        box-sizing: border-box;
    }
    .col-left .profile-header .live-status {
        grid-area: status;
        justify-self: stretch !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 8px;
        width: 100% !important;
        max-width: none !important;
        margin: 16px 0 0 !important;
        padding: 9px 14px !important;
        border-radius: 12px !important;
        font-size: 0.82rem !important;
        text-align: center;
    }
    /* theme button: top-right on phones so it never overlaps the photo */
    .col-left .profile-header > .switch.theme-switch {
        left: auto !important;
        right: 0 !important;
        top: 0 !important;
    }
    body.theme-soft .col-left .profile-header { border-bottom-color: rgba(15, 23, 42, 0.08); }

    /* ---- copied from style.css @media (min-width: 769px) and (max-width: 1100px) ---- */

    /* a little larger on tablets */
    .col-left .profile-header { grid-template-columns: 104px minmax(0, 1fr) !important; column-gap: 20px !important; }
    .col-left .profile-header .avatar-container,
    .col-left .profile-header .avatar-container img { width: 104px !important; height: 104px !important; border-radius: 22px !important; }
    .col-left .profile-header .name-row h1 { font-size: 1.8rem !important; }
    .col-left .profile-header .handle { font-size: 1.05rem !important; }
    .col-left .profile-header .live-status { font-size: 0.95rem !important; padding: 11px 16px !important; }

    /* ---- copied from style.css @media (min-width: 769px) and (max-width: 1100px) ---- */

    .col-left .profile-header .avatar-container,
    .col-left .profile-header .avatar-container img { border-radius: 18px !important; }        /* was 22px */

    /* ---- copied from style.css @media (max-width: 1100px), (hover: none) and (pointer: coarse) ---- */

    #particle-field { display: none !important; }
    .site-ambient,
    .site-ambient::before,
    .site-ambient::after,
    .ambient-orb,
    .ambient-grid,
    .ambient-vignette {
        animation: none !important;
        transition: none !important;
    }
    .ambient-orb { translate: none !important; }
}

/* tab bar on wide tablets: normal readable size */
@media (min-width: 1101px) {
    html.m-page .main-nav li { font-size: 0.95rem !important; }
    html.m-page body { height: auto !important; overflow-y: auto !important; }
}

/* ---------------------------------------------------------------------
   3. STATS BAR: 2 × 2 on phones, one row of 4 on tablets / iPads
   --------------------------------------------------------------------- */
@media (max-width: 600px) {
    html.m-page #about .hero-spotlight .pro-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    html.m-page #about .hero-spotlight .pro-stat:nth-child(3) { border-left: 0 !important; }
    html.m-page #about .hero-spotlight .pro-stat:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, 0.08) !important; }
    html.m-page body.theme-soft #about .hero-spotlight .pro-stat:nth-child(n+3) { border-top-color: rgba(15, 23, 42, 0.08) !important; }
}
@media (min-width: 601px) {
    html.m-page #about .hero-spotlight .pro-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    html.m-page #about .hero-spotlight .pro-stat:nth-child(3) { border-left: 1px solid rgba(255, 255, 255, 0.08) !important; }
    html.m-page #about .hero-spotlight .pro-stat:nth-child(n+3) { border-top: 0 !important; }
    html.m-page body.theme-soft #about .hero-spotlight .pro-stat:nth-child(3) { border-left-color: rgba(15, 23, 42, 0.08) !important; }
}

/* ---------------------------------------------------------------------
   4. MY PROJECTS: icon · title/description · View button on the right
   --------------------------------------------------------------------- */
html.m-page .project-list .project-card {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
}
html.m-page .project-list .project-card .p-thumb { flex: 0 0 auto !important; }
html.m-page .project-list .project-card .p-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
}
html.m-page .project-list .project-card .btn-view,
html.m-page .project-list .project-card a.btn-view {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 0 0 auto !important;
    align-self: center !important;
    white-space: nowrap;
}
html.m-page .project-list .project-card .btn-view,
html.m-page .project-list .project-card a.btn-view {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    min-height: 0 !important;
    line-height: 1 !important;
    padding: 0 16px !important;
}

/* ---------------------------------------------------------------------
   5. Day / night theme button: 7% smaller on the mobile page (36px → 33.5px)
   --------------------------------------------------------------------- */
html.m-page .profile-header > .switch.theme-switch { width: 33.5px !important; height: 33.5px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 15.8px !important; }
/* theme button: a further 5% smaller (33.5px → 31.8px) */
html.m-page .profile-header > .switch.theme-switch { width: 31.8px !important; height: 31.8px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 15px !important; }
/* theme button: another 5% smaller (31.8px → 30.2px) */
html.m-page .profile-header > .switch.theme-switch { width: 30.2px !important; height: 30.2px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 14.3px !important; }
/* theme button: 10% smaller again (30.2px → 27.2px) */
html.m-page .profile-header > .switch.theme-switch { width: 27.2px !important; height: 27.2px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 12.9px !important; }
/* keep it easy to tap: invisible touch area extends 9px beyond the small button */
html.m-page .profile-header > .switch.theme-switch::after { content: ""; position: absolute; inset: -9px; }
/* theme button: 20% smaller again (27.2px → 21.8px) */
html.m-page .profile-header > .switch.theme-switch { width: 21.8px !important; height: 21.8px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 10.3px !important; }
html.m-page .profile-header > .switch.theme-switch::after { inset: -12px; }
/* theme button: 20% smaller again (21.8px → 17.4px) */
html.m-page .profile-header > .switch.theme-switch { width: 17.4px !important; height: 17.4px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 8.2px !important; }
html.m-page .profile-header > .switch.theme-switch::after { inset: -14px; }
/* theme button: 20% smaller again (17.4px → 13.9px) */
html.m-page .profile-header > .switch.theme-switch { width: 13.9px !important; height: 13.9px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 6.6px !important; }
html.m-page .profile-header > .switch.theme-switch::after { inset: -16px; }
/* theme button: +40% (13.9px → 19.5px) on every phone / tablet / iPad size */
html.m-page .profile-header > .switch.theme-switch { width: 19.5px !important; height: 19.5px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 9.2px !important; }
html.m-page .profile-header > .switch.theme-switch::after { inset: -13px; }
/* theme button: +10% (19.5px → 21.5px) */
html.m-page .profile-header > .switch.theme-switch { width: 21.5px !important; height: 21.5px !important; }
html.m-page .theme-switch .slider::before,
html.m-page .theme-switch input:checked + .slider::before,
html.m-page .theme-switch input:not(:checked) + .slider::before { font-size: 10.1px !important; }
