/*
 * opsonize.ai shared responsive layer. Every page links this before its own
 * <style>, so page styles still win at equal specificity. Layout only: no
 * colours, no copy. Breakpoints: 768px (phones and small tablets), 480px
 * (phones, 360-414px first).
 */

/* 1. Base: nothing may force a horizontal scroll, and phones never rescale text. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
video,
canvas,
iframe,
embed,
object,
svg {
    max-width: 100%;
}

img,
video {
    height: auto;
}

body {
    overflow-wrap: break-word;
}

a[href^="mailto:"],
a[href^="tel:"] {
    overflow-wrap: anywhere;
}

pre,
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll > table {
    min-width: 100%;
}

/* 2. Touch: link rows get 44px targets; form fields stay 16px so iOS never zooms on focus. */
.tap-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

@media (max-width: 768px) {
    input,
    select,
    textarea {
        font-size: max(16px, 1em);
    }

    button,
    input[type="submit"],
    select {
        min-height: 44px;
    }
}

/* 3. Document pages (legal, privacy, contact): full-bleed reading column on phones. */
@media (max-width: 640px) {
    body.doc {
        padding: 0;
    }

    .doc .container {
        max-width: none;
        min-height: 100vh;
        padding: 24px 18px 48px;
        border-radius: 0;
        box-shadow: none;
    }

    .doc h1 {
        font-size: 1.75rem;
        line-height: 1.25;
    }

    .doc h2 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .doc h3 {
        font-size: 1.1rem;
    }

    .doc ul,
    .doc ol {
        margin-left: 0;
        padding-left: 1.25rem;
    }

    .doc .entity-block,
    .doc .panel {
        padding: 12px 14px;
    }

    .doc .tap-links {
        display: flex;
        flex-wrap: wrap;
        column-gap: 18px;
        row-gap: 0;
    }

    .doc .tap-links a {
        margin-right: 0;
    }
}

/* 4. Exam pages (FMGE, MRCP, NEET PG / INI-CET share one template; USMLE has its own). */
.exam .logo {
    min-height: 44px;
}

.exam .header .cta-button,
.exam .nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .exam .header {
        padding: 0.5rem 0;
    }

    .exam .nav {
        gap: 12px;
    }

    .exam .logo {
        min-width: 0;
    }

    .exam .logo img {
        width: 32px;
        height: 32px;
    }

    .exam .logo-text {
        font-size: 1.2rem;
    }

    .exam .header .cta-button,
    .exam .nav-cta {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .exam .hero {
        padding: 2.5rem 0;
    }

    .exam .hero h1 {
        font-size: 2.1rem;
    }

    .exam .hero h2 {
        font-size: 1.5rem;
    }

    .exam :is(.hero, .cta, .early-access) p {
        font-size: 1.05rem;
    }

    .exam :is(.fmge-info, .mrcp-parts, .exam-cards) {
        gap: 1.25rem;
        margin: 2rem 0;
    }

    .exam :is(.info-card, .part-card, .exam-card) {
        padding: 1.5rem 1.25rem;
    }

    .exam .exam-pattern {
        margin: 2rem 0;
        padding: 2.5rem 1rem;
    }

    .exam :is(.features, .cta, .early-access) {
        padding: 2.5rem 0;
    }

    .exam :is(.exam-pattern, .features, .cta, .early-access) h2 {
        font-size: 1.75rem;
        line-height: 1.25;
        margin-bottom: 1.25rem;
    }

    .exam :is(.pattern-grid, .features-grid) {
        gap: 0.75rem;
    }

    .exam :is(.pattern-item, .feature) {
        padding: 1rem 0.5rem;
    }

    .exam .feature-icon {
        font-size: 2.25rem;
        margin-bottom: 0.5rem;
    }

    .exam .cta-button {
        min-height: 44px;
    }

    /* USMLE: keep the fixed bar to one row instead of stacking it. */
    .exam-usmle .nav-content {
        flex-direction: row;
        gap: 12px;
        padding: 10px 0;
    }

    .exam-usmle .logo img {
        height: 32px;
    }

    .exam-usmle .logo-text {
        font-size: 20px;
    }

    .exam-usmle .hero {
        padding: 96px 0 48px;
    }

    .exam-usmle .section {
        padding: 48px 0;
    }

    .exam-usmle .section-header {
        margin-bottom: 32px;
    }

    .exam-usmle .section-title {
        font-size: 1.75rem;
    }

    .exam-usmle .section-subtitle {
        font-size: 1.05rem;
    }

    .exam-usmle .hero .hero-subtitle {
        font-size: 1.15rem;
        margin-bottom: 20px;
    }

    .exam-usmle .hero-description {
        margin-bottom: 28px;
    }

    .exam-usmle .cta-button {
        padding: 14px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .exam .hero h1,
    .exam-usmle .hero-text h1 {
        font-size: 1.85rem;
    }

    .exam .logo-text,
    .exam-usmle .logo-text {
        font-size: 1.05rem;
    }

    .exam-usmle .logo {
        gap: 8px;
    }
}
