/*
 * MAJAK-FOTO — mobile layer
 * =========================
 *
 * The compiled Tailwind bundle was generated for the desktop design and is not
 * regenerated here, so this file layers on top of it. Everything lives inside a media
 * query: on a wide screen not a single rule applies and the desktop rendering is
 * byte-for-byte what it was.
 *
 * What it is fixing, measured rather than guessed (see STATUS.md):
 *   - the homepage was 10 051px tall on an 812px screen — over twelve screens of scroll,
 *     because the section rhythm was inherited from the desktop;
 *   - 23 tappable elements on the pricing page were under the 44px a fingertip needs;
 *   - the sign-in page spent 575px, seventy percent of the first screen, on a decorative
 *     panel before the form appeared.
 *
 * Ordering note: the file is loaded after the bundle, so plain-specificity overrides
 * win. Where a utility class would otherwise fight back, the selector is made more
 * specific rather than reaching for !important.
 */

@media (max-width: 1023.98px) {
    /* ------------------------------------------------------------- rhythm */

    /* clamp(4rem, 8vw, 7.5rem) resolved to 64px top and bottom, so consecutive
       sections sat 128px apart. Halving it removes roughly a screen and a half from
       the homepage without making anything feel crowded. */
    .studio-section {
        padding-block: 2.75rem;
    }

    /* The display face keeps its presence but stops setting the page height on its
       own: clamp() bottomed out at 3.2rem, which is 51px on a 375px screen. */
    .studio-title {
        font-size: clamp(2.5rem, 11vw, 3.4rem);
        line-height: 1.06;
        letter-spacing: -0.045em;
    }

    /* -------------------------------------------------------- touch targets */

    /*
     * Links inside flowing text must stay inline — enlarging those would break the
     * line box — so this covers the standalone ones: list items, navigation, actions.
     * The padding is balanced by a negative margin so the layout does not shift.
     */
    .promo-bar a,
    .promo-bar button,
    footer a,
    [data-services-panel] a {
        padding-block: 0.6rem;
        margin-block: -0.6rem;
    }

    /* The hamburger was 40px square. */
    [data-mobile-trigger] {
        width: 2.75rem;
        height: 2.75rem;
    }

    /* ------------------------------------------------------ campaign bar */

    /* Three stacked lines used to run before the logo was even visible. */
    .promo-bar .studio-wrap {
        padding-block: 0.5rem;
        gap: 0.4rem 0.6rem;
    }

    .promo-bar p {
        flex-basis: 100%;
        margin: 0;
    }
}

@media (max-width: 639.98px) {
    /* --------------------------------------------------------- sign-in page */

    /*
     * The two-column card is a desktop composition: a tall ink panel beside the form.
     * Stacked on a phone the panel became a 575px preamble. Here it collapses to a
     * band that says whose site this is and gets out of the way.
     */
    [data-auth-aside] {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    [data-auth-aside] [data-auth-pitch] {
        display: none;
    }

    [data-auth-aside] [data-auth-note] {
        display: none;
    }

    /* ------------------------------------------------------------ pricing */

    /*
     * The package grid draws its separators with borders on each cell, which on one
     * column leaves a stack of full-width rules and no way to tell where a package
     * ends. Each package becomes a card instead.
     */
    [data-pricing-grid] {
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
        border: 0;
    }

    [data-pricing-grid] > article {
        border: 1px solid var(--color-line);
        border-radius: var(--radius-card);
        padding: 1.5rem 1.35rem;
    }

    /* The dark, recommended package keeps its own edge. */
    [data-pricing-grid] > article.bg-ink-900 {
        border-color: var(--color-ink-800);
    }

    /* Inside a card the generous desktop spacing reads as drift. */
    [data-pricing-grid] > article > h3 {
        margin-top: 1.1rem;
    }

    [data-pricing-grid] > article > p,
    [data-pricing-grid] > article > ul {
        margin-top: 1rem;
    }

    /* --------------------------------------------- room for the fixed bar */

    /*
     * The bottom bar floats over the page, so the last thing on every page was
     * partly behind it — in the package finder it covered a choice outright.
     */
    body {
        padding-bottom: 0;
    }
}

@media (max-width: 639.98px) {
    /* ---------------------------------------------------------- service list */

    /*
     * Each service was a 6:5 poster stacked above its text — around 500px per item,
     * so six services ran to three thousand. Most of that is a placeholder standing in
     * for a photograph the studio has not supplied yet, which is the least useful
     * thing on a phone. As a row with a square thumbnail the same content reads as a
     * list you can scan, and the poster keeps its role without setting the page height.
     */
    [data-service-card] {
        display: grid;
        grid-template-columns: 6.25rem 1fr;
        align-items: center;
        gap: 1rem;
        padding-block: 0.85rem;
        border-bottom: 1px solid var(--color-line);
    }

    [data-service-card] > div:first-child {
        aspect-ratio: 1;
        padding: 0.45rem;
    }

    /* Inside a thumbnail only the word survives; the label and caption are unreadable
       at this size and repeat what the heading already says. */
    [data-service-card] .service-poster {
        justify-content: center;
        padding: 0.4rem;
    }

    [data-service-card] .service-poster > span:first-child,
    [data-service-card] .service-poster > span:last-child {
        display: none;
    }

    [data-service-card] .service-poster > span:nth-child(2) {
        font-size: 1rem;
        line-height: 1.15;
        text-align: center;
    }

    /* The corner arrow duplicates the row's own affordance. */
    [data-service-card] > div:first-child > span[aria-hidden] {
        display: none;
    }

    [data-service-card] [data-service-text] {
        border-bottom: 0;
        padding: 0;
    }

    [data-service-card] [data-service-text] h3 {
        font-size: 1.1rem;
        line-height: 1.25;
    }

    [data-service-card] [data-service-text] p {
        margin-top: 0.3rem;
        font-size: 0.8rem;
        line-height: 1.45;
    }

    [data-service-card] [data-service-text] > span {
        margin-top: 0.4rem;
    }
}

@media (max-width: 1023.98px) {
    /* -------------------------------------------------- administration shell */

    /*
     * The sidebar is a desktop column. Stacked on a phone it ran 547px — the logo, six
     * navigation rows, a link back to the site and the account block — before any of
     * the actual screen appeared. Here it becomes a compact ink header: identity on one
     * line, the sections as a scrollable row of chips, the account beside them.
     */
    [data-admin-aside] {
        padding: 0.85rem 1rem 0.75rem;
    }

    [data-admin-nav] {
        margin-top: 0.75rem;
    }

    [data-admin-nav] ul {
        flex-direction: row;
        gap: 0.4rem;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 0.15rem;
    }

    [data-admin-nav] ul::-webkit-scrollbar {
        display: none;
    }

    [data-admin-nav] li > a,
    [data-admin-nav] li > span {
        white-space: nowrap;
        min-height: 2.75rem;
        display: flex;
        align-items: center;
    }

    /* The sections that do not exist yet are noise on a small screen. */
    [data-admin-nav] li > span {
        display: none;
    }

    /* Back to the site sits with the account rather than on its own line. */
    [data-admin-back] {
        display: none;
    }

    [data-admin-account] {
        margin-top: 0.75rem;
        padding-top: 0.65rem;
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.3rem 0.9rem;
    }

    [data-admin-account] > p:first-child {
        font-size: 0.8rem;
    }

    [data-admin-account] > div {
        margin-top: 0;
    }

    /* ------------------------------------------------------- client portal */

    /* Five destinations in a strip that scrolls: each needs a finger-sized target. */
    [data-portal-rail] a {
        min-height: 2.75rem;
    }
}

@media (max-width: 1279.98px) {
    /* ------------------------------------------------------- mobile menu */

    /*
     * The panel only exists below xl, so its whole layout lives here rather than as
     * utility classes on the markup.
     *
     * It used to be a single run of rows separated by hairlines, all the same weight,
     * with nothing to say where one group ended and the next began. Now the three jobs
     * it does are visibly separate: where to go, what the studio shoots, and the two
     * actions. Note what is NOT here — the padding/negative-margin pairing used
     * elsewhere for touch targets. In a vertical list it makes neighbours overlap by
     * the padding, so a tap near an edge opens the wrong page. These rows are tall
     * enough on their own.
     */
    /* The close button was 40px. */
    .mobile-nav-head button {
        min-width: 2.75rem;
        min-height: 2.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid var(--color-line);
    }

    .mobile-nav-body {
        display: flex;
        flex: 1;
        flex-direction: column;
        padding: 1.25rem 1.25rem 2rem;
    }

    .mobile-nav-school {
        margin-bottom: 1.5rem;
    }

    .mobile-nav-main {
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-main > li + li {
        border-top: 1px solid var(--color-line);
    }

    .mobile-nav-main a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        min-height: 3.5rem;
        font-size: 1.4rem;
        letter-spacing: -0.015em;
    }

    /* The arrow is a hint, not a headline. */
    .mobile-nav-main a > span {
        color: var(--color-fg-muted);
        font-size: 0.95rem;
    }

    .mobile-nav-label {
        margin: 2rem 0 0.75rem;
        color: var(--color-fg-muted);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }

    /*
     * Services are a reference list, not a destination in the same sense, so they read
     * as a quieter block: a tinted panel, two per row where the names are short enough.
     */
    .mobile-nav-services {
        display: grid;
        gap: 0.25rem;
        border-radius: var(--radius-card);
        background: var(--color-surface);
        border: 1px solid var(--color-line);
        padding: 0.35rem 0.75rem;
    }

    .mobile-nav-services > li + li {
        border-top: 1px solid var(--color-line);
    }

    .mobile-nav-services a {
        display: flex;
        align-items: center;
        min-height: 2.9rem;
        font-size: 0.95rem;
    }

    .mobile-nav-actions {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        margin-top: auto;
        padding-top: 2rem;
    }
}

@media (max-width: 1023.98px) {
    /* ------------------------------------------------------- chapter strip */

    /*
     * Sits directly under the sticky header — 68px of it on a phone, 88 from the small
     * breakpoint — so the two move as one bar.
     */
    .section-nav {
        display: block;
        position: sticky;
        top: 68px;
        z-index: 35;
        background: color-mix(in srgb, var(--color-canvas) 92%, transparent);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--color-line);
    }

    @supports not (backdrop-filter: blur(1px)) {
        .section-nav {
            background: var(--color-canvas);
        }
    }

    .section-nav-track {
        display: flex;
        gap: 0.4rem;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0.45rem 1.25rem;
    }

    .section-nav-track::-webkit-scrollbar {
        display: none;
    }

    .section-nav a {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        min-height: 2.25rem;
        padding: 0 0.85rem;
        border-radius: 9999px;
        border: 1px solid transparent;
        color: var(--color-fg-muted);
        font-size: 0.82rem;
        font-weight: 600;
        white-space: nowrap;
        transition: background-color .15s, color .15s, border-color .15s;
    }

    /* Where you are now. */
    .section-nav a[aria-current="true"] {
        background: var(--color-accent-soft);
        border-color: var(--color-brass-200);
        color: var(--color-accent);
    }

    /* ------------------------------------------------ chapters you can see */

    /*
     * Each section already carried a signpost — "01 / Co spolu zachytíme", "04 / Od
     * první zprávy" — set at 10.4px, which is the size of fine print. The wayfinding
     * existed and was simply invisible. Made legible, and given a rule above it, the
     * scroll stops being one undifferentiated field and reads as labelled chapters.
     */
    .studio-kicker {
        font-size: 0.78rem;
        letter-spacing: 0.14em;
    }

    .studio-section > .editorial-rule:first-child,
    .studio-section > div > .editorial-rule:first-child {
        margin-bottom: 0.35rem;
    }

    /* A hairline where one chapter ends and the next begins, for the sections that do
       not already announce themselves with their own background. */
    main > section.studio-section + section.studio-section:not([class*="bg-"]) {
        border-top: 1px solid var(--color-line);
    }

    /* Anchored jumps have to clear both sticky bars. */
    main > section[id] {
        scroll-margin-top: 7.5rem;
    }
}

@media (min-width: 640px) and (max-width: 1023.98px) {
    .section-nav {
        top: 88px;
    }
}
