/* ─────────────────────────────────────────────────────────────────────────
 * RECATOOLS Studio — the shared look for new interactive tools.
 *
 * Owner, 21 Nov 2026: a new tool may carry its own modern style, as long as
 * the global frame (header, nav, ad slots, admin controls, footer) is left
 * intact. This file is that style, shared so each new tool does not reinvent
 * it.
 *
 * OPT-IN AND SCOPED. Nothing here applies unless a widget wraps its content in
 * <div class="rt-studio">. The ad sections inside that wrapper are NOT
 * restyled: every rule below names its own studio class or a content section,
 * never .ad-section / .ad-unit / .ad-slot (docs/cls-conventions.md: the
 * pre-paint ad-slot gate must see slot markup unchanged).
 *
 * Load it from the widget, before the tool's own style.css:
 *   @push('head') <link rel="stylesheet" href="{{ asset('assets/css/tool-studio.css') }}?v=…"> @endpush
 *
 * Colours come from rt-tokens.css only, so dark mode follows the site theme,
 * which is the [data-theme="dark"] toggle ONLY: rt-tokens.css leaves the OS
 * preference block commented out, so a tool must not answer it either (it
 * would paint dark parts onto a light page).
 * No --rt-result-* tokens (docs/contrast-conventions.md). No third-party
 * assets, fonts or icons: icons are inline SVG in the markup.
 * ───────────────────────────────────────────────────────────────────────── */

.rt-studio {
    --st-radius: 16px;
    --st-radius-sm: 10px;
    --st-shadow: 0 1px 2px rgba(13, 27, 42, 0.04), 0 8px 24px -12px rgba(13, 27, 42, 0.18);
    --st-shadow-lift: 0 2px 4px rgba(13, 27, 42, 0.06), 0 18px 40px -18px rgba(13, 27, 42, 0.30);
    --st-grad: linear-gradient(135deg, var(--rt-brand-orange) 0%, #F08A4B 100%);   /* fills only, never behind text */
    --st-grad-ink: linear-gradient(135deg, var(--rt-accent-fill) 0%, var(--rt-accent-fill-hover) 100%); /* white text: 4.6:1 and up */
    --st-ease: cubic-bezier(.2, .8, .2, 1);
    min-width: 0;
}
[data-theme="dark"] .rt-studio {
    --st-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.6);
    --st-shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 44px -18px rgba(0, 0, 0, 0.7);
}

/* ── content sections become calm cards ────────────────────────────────── */
.rt-studio > .tool-section,
.rt-studio > .faq-section {
    background: var(--rt-surface);
    border: 1px solid var(--rt-hairline);
    border-radius: var(--st-radius);
    padding: clamp(20px, 3.2vw, 36px);
    box-shadow: var(--st-shadow);
}
.rt-studio > .tool-section + .tool-section,
.rt-studio > .tool-section + .faq-section,
.rt-studio > .ad-section + .tool-section,
.rt-studio > .ad-section + .faq-section,
.rt-studio > section + .tool-section { margin-top: 20px; }
/* the house .educational-content caps the WHOLE section's width; inside a
   studio card the cap belongs on the text, not the card */
.rt-studio > .tool-section.educational-content { max-width: none; }
.rt-studio > .educational-content > p,
.rt-studio > .educational-content > h3,
.rt-studio > .educational-content > ul,
.rt-studio > .educational-content > ol { max-width: 72ch; }
.rt-studio > .tool-section .section-heading,
.rt-studio > .faq-section .section-heading {
    margin-top: 0;
}
.rt-studio .st-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font: var(--rt-eyebrow); letter-spacing: .16em; text-transform: uppercase;
    color: var(--rt-accent-text); margin: 0 0 6px;
}
.rt-studio .st-kicker::before {
    content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--rt-accent);
}
.rt-studio .st-lede {
    font: var(--rt-body-lg); color: var(--rt-ink-soft); max-width: 68ch; margin: 0 0 var(--rt-s-6);
}

/* ── how-to steps: numbered cards on a track ───────────────────────────── */
.rt-studio .how-to-steps {
    list-style: none; margin: var(--rt-s-4) 0 0; padding: 0;
    display: grid; gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    counter-reset: st-step;
    position: relative;
}
.rt-studio .how-to-step {
    position: relative; display: flex; flex-direction: column; gap: 12px;
    margin: 0; padding: 20px 18px 18px;
    background: var(--rt-surface-2);
    border: 1px solid var(--rt-hairline);
    border-radius: var(--st-radius);
    transition: transform .25s var(--st-ease), box-shadow .25s var(--st-ease), border-color .25s;
}
.rt-studio .how-to-step:hover {
    transform: translateY(-3px); box-shadow: var(--st-shadow-lift); border-color: transparent;
}
.rt-studio .how-to-step .step-num {
    width: 40px; height: 40px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 12px; background: var(--st-grad-ink); color: #fff;
    font: 700 17px/1 var(--rt-font-mono);
    box-shadow: 0 6px 16px -6px rgba(232, 98, 42, 0.6);
}
/* the track: a hairline joining the numbers on wide screens */
.rt-studio .how-to-step:not(:last-child)::after {
    content: ""; position: absolute; top: 39px; left: calc(18px + 40px + 10px); right: -14px;
    height: 2px; border-radius: 2px;
    background: repeating-linear-gradient(90deg, var(--rt-hairline) 0 6px, transparent 6px 11px);
}
.rt-studio .how-to-step .step-body h3 {
    margin: 0 0 6px; font: 600 16px/1.3 var(--rt-font-sans); color: var(--rt-ink);
}
.rt-studio .how-to-step .step-body p {
    margin: 0; font-size: 14px; line-height: 1.6; color: var(--rt-ink-soft);
}
@media (max-width: 960px) {
    .rt-studio .how-to-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rt-studio .how-to-step::after { display: none; }
}
@media (max-width: 560px) {
    .rt-studio .how-to-steps { grid-template-columns: 1fr; gap: 10px; }
    .rt-studio .how-to-step { flex-direction: row; align-items: flex-start; padding: 16px; }
}

/* ── sources: one card per publisher ───────────────────────────────────── */
.rt-studio .st-src-intro {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; margin: 0 0 var(--rt-s-6);
    border-radius: var(--st-radius-sm);
    background: var(--rt-bg-inset); color: var(--rt-ink-soft);
    font-size: 14px; line-height: 1.55;
}
.rt-studio .st-src-intro svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--rt-ink-muted); }
.rt-studio .st-src-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    align-items: start;
}
.rt-studio .st-src-card {
    margin: 0; padding: 0; overflow: hidden;
    background: var(--rt-surface);
    border: 1px solid var(--rt-hairline);
    border-radius: var(--st-radius);
    transition: box-shadow .25s var(--st-ease), transform .25s var(--st-ease);
}
.rt-studio .st-src-card:hover { box-shadow: var(--st-shadow-lift); transform: translateY(-2px); }
.rt-studio .st-src-head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--rt-hairline);
    background: var(--rt-surface-2);
}
.rt-studio .st-src-mono {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center;
    background: var(--rt-ink); color: var(--rt-surface);
    font: 700 12px/1 var(--rt-font-mono); letter-spacing: .02em;
}
.rt-studio .st-src-agency {
    margin: 0; flex: 1 1 auto; min-width: 0;
    font: 600 15px/1.3 var(--rt-font-sans); color: var(--rt-ink);
}
.rt-studio .st-src-count {
    flex: 0 0 auto; font: var(--rt-label); color: var(--rt-ink-muted);
    padding: 3px 8px; border-radius: 999px; background: var(--rt-bg-inset);
}
.rt-studio .st-src-list { list-style: none; margin: 0; padding: 6px 0; }
.rt-studio .st-src-item {
    display: grid; grid-template-columns: 18px 1fr; gap: 10px;
    padding: 10px 16px; scroll-margin-top: 120px;
}
.rt-studio .st-src-item + .st-src-item { border-top: 1px dashed var(--rt-hairline); }
.rt-studio .st-src-item:target { background: var(--rt-accent-soft); }
.rt-studio .st-src-icon { width: 16px; height: 16px; margin-top: 3px; color: var(--rt-ink-muted); }
.rt-studio .st-src-item cite {
    display: block; font-style: normal; font-weight: 600; font-size: 14px; line-height: 1.45; color: var(--rt-ink);
}
.rt-studio .st-src-item a { color: inherit; text-decoration: none; }
.rt-studio .st-src-item a cite { color: var(--rt-link); }
.rt-studio .st-src-item a:hover cite { text-decoration: underline; }
.rt-studio .st-src-id { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--rt-ink-muted); }
.rt-studio .st-src-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.rt-studio .st-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font: 500 11.5px/1.3 var(--rt-font-mono); color: var(--rt-ink-muted);
    padding: 3px 7px; border-radius: 6px; background: var(--rt-bg-inset);
}
.rt-studio .st-pill--date { color: var(--rt-ink-soft); }
.rt-studio .st-pill--title-only { background: transparent; border: 1px solid var(--rt-hairline); }

/* ── shared pieces a tool may use ─────────────────────────────────────── */
.rt-studio .st-panel {
    background: var(--rt-surface); border: 1px solid var(--rt-hairline);
    border-radius: var(--st-radius); box-shadow: var(--st-shadow);
}
.rt-studio .st-progress {
    position: relative; height: 6px; border-radius: 999px; overflow: hidden; background: var(--rt-bg-inset);
}
.rt-studio .st-progress > span {
    position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--st-grad);
    transition: width .5s var(--st-ease);
}
.rt-studio .st-kbd {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    font: 600 11px/1 var(--rt-font-mono); color: var(--rt-ink-soft);
    border: 1px solid var(--rt-hairline); border-bottom-width: 2px; border-radius: 6px; background: var(--rt-surface);
}
/* An OUTLINE, not a ring: components carry their own box-shadows, which would
   override a shadow-based ring and leave no visible focus (audit job 8). */
.rt-studio :focus-visible { outline: 3px solid var(--rt-accent-fill); outline-offset: 2px; }

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