/*
 * Shared styles for the eSIM education pages (What is an eSIM?, Compatibility).
 * Everything is scoped under .gs so it can't leak into the shared nav/footer.
 * Uses logical properties so the Arabic (RTL) locale mirrors correctly.
 */

.gs {
    --gs-ink: #111827;
    --gs-ink-2: #374151;
    --gs-body: #4b5563;
    --gs-muted: #6b7280;
    --gs-faint: #9ca3af;
    --gs-line: #e5e7eb;
    --gs-line-soft: rgba(17, 24, 39, 0.07);
    --gs-bg: #f9fafb;
    --gs-surface: #ffffff;
    --gs-tint: #eef2ff;
    --gs-tint-2: #e0e7ff;
    --gs-brand: #4f46e5;
    --gs-brand-hover: #4338ca;
    --gs-brand-ink: #3730a3;
    --gs-violet: #7c3aed;
    --gs-ok: #047857;
    --gs-ok-mark: #10b981;
    --gs-ok-bg: #ecfdf5;
    --gs-warn: #92400e;
    --gs-warn-bg: #fffbeb;
    --gs-warn-line: #fcd34d;
    --gs-no: #b91c1c;
    --gs-no-bg: #fef2f2;
    --gs-radius-sm: 0.625rem;
    --gs-radius: 1rem;
    --gs-radius-lg: 1.5rem;
    --gs-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
    --gs-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -6px rgba(16, 24, 40, 0.1);
    --gs-shadow-lg: 0 2px 4px rgba(30, 27, 75, 0.04), 0 28px 56px -16px rgba(30, 27, 75, 0.22);
    --gs-gutter: clamp(1rem, 4vw, 2rem);
    --gs-section: clamp(4rem, 9vw, 7rem);

    color: var(--gs-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.gs *,
.gs *::before,
.gs *::after {
    box-sizing: border-box;
}

.gs :focus-visible {
    outline: 2px solid var(--gs-brand);
    outline-offset: 3px;
    border-radius: 6px;
}

/* Zero-specificity reset so component link classes (.gs-link, .gs-btn…) always win. */
:where(.gs) a {
    color: inherit;
    text-decoration: none;
}

.gs [hidden] {
    display: none !important;
}

.gs-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Layout ---------- */

.gs-wrap {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: var(--gs-gutter);
}

.gs-wrap--narrow {
    max-width: 52rem;
}

.gs-section {
    padding-block: var(--gs-section);
}

.gs-section--white {
    background: var(--gs-surface);
}

.gs-section--tint {
    background: linear-gradient(180deg, var(--gs-bg) 0%, var(--gs-tint) 100%);
}

.gs-section-head {
    max-width: 44rem;
    margin-block-end: clamp(2.5rem, 5vw, 3.5rem);
}

.gs-section-head--center {
    margin-inline: auto;
    text-align: center;
}

/* ---------- Type ---------- */

.gs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gs-brand);
    letter-spacing: 0.01em;
}

.gs-eyebrow--pill {
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    border-radius: 999px;
    background: var(--gs-surface);
    box-shadow: inset 0 0 0 1px var(--gs-tint-2);
}

.gs-eyebrow__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: var(--gs-ok-mark);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.gs-h1 {
    margin: 1rem 0 0;
    font-size: clamp(2.5rem, 1.5rem + 3.8vw, 4.25rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--gs-ink);
    text-wrap: balance;
}

.gs-h2 {
    margin: 0.75rem 0 0;
    font-size: clamp(1.875rem, 1.35rem + 2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.028em;
    color: var(--gs-ink);
    text-wrap: balance;
}

.gs-h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--gs-ink);
}

.gs-lead {
    margin: 1.25rem 0 0;
    font-size: clamp(1.0625rem, 0.98rem + 0.4vw, 1.25rem);
    line-height: 1.6;
    color: var(--gs-body);
    text-wrap: pretty;
}

.gs-p {
    margin: 0.5rem 0 0;
    color: var(--gs-body);
    text-wrap: pretty;
}

.gs-small {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--gs-muted);
}

.gs-link {
    color: var(--gs-brand);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(79, 70, 229, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease;
}

.gs-link:hover {
    text-decoration-color: currentColor;
}

.gs-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    color: var(--gs-brand);
}

.gs-arrow-link svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.gs-arrow-link:hover svg {
    transform: translateX(3px);
}

[dir="rtl"] .gs-arrow-link svg,
[dir="rtl"] .gs-btn svg.gs-flip {
    transform: scaleX(-1);
}

[dir="rtl"] .gs-arrow-link:hover svg {
    transform: scaleX(-1) translateX(3px);
}

kbd.gs-kbd {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-radius: 0.375rem;
    background: var(--gs-surface);
    box-shadow: inset 0 0 0 1px var(--gs-line), 0 1px 0 var(--gs-line);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
    font-weight: 600;
    color: var(--gs-ink);
    white-space: nowrap;
}

/* ---------- Buttons ---------- */

.gs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-block-start: 2rem;
}

.gs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.75rem 1.375rem;
    border: 0;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.gs-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
}

.gs-btn:active {
    transform: translateY(1px);
}

.gs-btn--primary {
    background: var(--gs-brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(49, 46, 129, 0.2), 0 8px 20px -8px rgba(79, 70, 229, 0.7);
}

.gs a.gs-btn--primary,
.gs a.gs-btn--primary:visited {
    color: #fff;
}

.gs-btn--primary:hover {
    background: var(--gs-brand-hover);
}

.gs-btn--secondary {
    background: var(--gs-surface);
    color: var(--gs-ink);
    box-shadow: inset 0 0 0 1px var(--gs-line), var(--gs-shadow-sm);
}

.gs-btn--secondary:hover {
    background: var(--gs-bg);
    box-shadow: inset 0 0 0 1px #d1d5db, var(--gs-shadow-sm);
}

.gs-btn--light {
    background: #fff;
    color: var(--gs-brand-ink);
}

.gs a.gs-btn--light {
    color: var(--gs-brand-ink);
}

.gs-btn--light:hover {
    background: var(--gs-tint);
}

.gs-btn--ghost-light {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.gs a.gs-btn--ghost-light {
    color: #fff;
}

.gs-btn--ghost-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Breadcrumb ---------- */

.gs-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--gs-muted);
}

.gs-crumbs a:hover {
    color: var(--gs-ink);
}

.gs-crumbs li + li::before {
    content: "/";
    margin-inline-end: 0.375rem;
    color: #d1d5db;
}

.gs-crumbs [aria-current="page"] {
    color: var(--gs-ink-2);
    font-weight: 500;
}

/* ---------- Cards ---------- */

.gs-card {
    position: relative;
    padding: clamp(1.5rem, 3vw, 2rem);
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
    box-shadow: inset 0 0 0 1px var(--gs-line-soft), var(--gs-shadow-sm);
}

.gs-grid {
    display: grid;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.gs-grid--3 {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .gs-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .gs-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gs-grid--2 {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
    .gs-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.gs-icon-tile {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-block-end: 1.25rem;
    border-radius: 0.875rem;
    background: var(--gs-tint);
    color: var(--gs-brand);
}

.gs-icon-tile svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ---------- Brand logos (sprite: /assets/brands/brands.svg) ---------- */

.gs-logo {
    --h: 1.25rem;
    display: inline-block;
    flex: none;
    height: var(--h);
    width: calc(var(--h) * var(--r, 1));
    fill: currentColor;
    vertical-align: middle;
}

.gs-logo use {
    width: 100%;
    height: 100%;
}

.gs-wordmark {
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
}

.gs-logo-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 3rem) clamp(1.75rem, 5vw, 3.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
    color: #6b7280;
}

.gs-logo-cloud li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--gs-ink-2);
    transition: color 0.2s ease;
}

.gs-logo-cloud .gs-logo {
    color: #4b5563;
}

/* ---------- Callouts ---------- */

.gs-callout {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 1rem 1.125rem;
    border-radius: var(--gs-radius-sm);
    background: var(--gs-tint);
    color: var(--gs-brand-ink);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.gs-callout svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-block-start: 0.125rem;
}

.gs-callout strong {
    font-weight: 700;
}

.gs-callout--warn {
    background: var(--gs-warn-bg);
    color: var(--gs-warn);
    box-shadow: inset 0 0 0 1px rgba(252, 211, 77, 0.55);
}

/* ---------- FAQ ---------- */

.gs-faq {
    display: grid;
    gap: 0.75rem;
}

.gs-faq details {
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
    box-shadow: inset 0 0 0 1px var(--gs-line-soft), var(--gs-shadow-sm);
    transition: box-shadow 0.2s ease;
}

.gs-faq details[open] {
    box-shadow: inset 0 0 0 1px var(--gs-tint-2), var(--gs-shadow);
}

.gs-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--gs-ink);
}

.gs-faq summary::-webkit-details-marker {
    display: none;
}

.gs-faq summary:focus-visible {
    border-radius: var(--gs-radius);
    outline-offset: -2px;
}

.gs-faq__icon {
    position: relative;
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--gs-bg);
    transition: background-color 0.2s ease, transform 0.25s ease;
}

.gs-faq__icon::before,
.gs-faq__icon::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 0.75rem;
    height: 2px;
    margin: -1px 0 0 -0.375rem;
    border-radius: 2px;
    background: var(--gs-ink-2);
    transition: transform 0.25s ease;
}

.gs-faq__icon::after {
    transform: rotate(90deg);
}

.gs-faq details[open] .gs-faq__icon {
    background: var(--gs-tint);
}

.gs-faq details[open] .gs-faq__icon::after {
    transform: rotate(0deg);
}

.gs-faq__answer {
    padding: 0 1.5rem 1.375rem;
    color: var(--gs-body);
    max-width: 46rem;
}

.gs-faq__answer p + p {
    margin-block-start: 0.75rem;
}

/* ---------- Closing CTA band ---------- */

.gs-cta {
    position: relative;
    overflow: hidden;
    padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem);
    border-radius: var(--gs-radius-lg);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(167, 139, 250, 0.55) 0%, rgba(167, 139, 250, 0) 55%),
        radial-gradient(90% 120% at 0% 100%, rgba(56, 189, 248, 0.35) 0%, rgba(56, 189, 248, 0) 55%),
        linear-gradient(135deg, #4338ca 0%, #4f46e5 45%, #6d28d9 100%);
    color: #fff;
    box-shadow: var(--gs-shadow-lg);
}

.gs-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
    pointer-events: none;
}

.gs-cta > * {
    position: relative;
    z-index: 1;
}

.gs-cta__title {
    margin: 0;
    max-width: 36rem;
    font-size: clamp(1.875rem, 1.3rem + 2.2vw, 2.875rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.028em;
    color: #fff;
    text-wrap: balance;
}

.gs-cta__body {
    margin: 1rem 0 0;
    max-width: 34rem;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ---------- Reveal on scroll (progressive: content is visible without JS) ---------- */

.gs-js .gs-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gs-js .gs-reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .gs *,
    .gs *::before,
    .gs *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .gs-js .gs-reveal {
        opacity: 1;
        transform: none;
    }
}
