/* shared.css — site-wide tokens, header, footer and primitives
 *
 * Loaded by every page. Each tool page sets its own --accent before
 * this file loads (via a scoped <style> block in the <head> after
 * this link), which swaps the logo-mark border, highlighted word in
 * the logo-text and the current breadcrumb to that tool's colour.
 *
 * The calculator (index.html) keeps the site red as --accent. */

:root {
--bg: #1a1a1a;
--panel: #262626;
--panel2: #2d2d2d;
--border: #333333;
--border2: #3d3d3d;
--accent: #E7302A;       /* defaults to brand red, tool pages override */
--accent2: #ff4f49;
--brand-red: #E7302A;    /* always the brand red, for footer links etc */
--brand-red2: #ff4f49;
--muted: #888888;
--text: #F2F2F2;
--label: #D9D9D9;
--green: #4caf82;
--warn: #E0A020;
--red: #E7302A;
--mono: 'Share Tech Mono', monospace;
--sans: 'DM Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
background: var(--bg);
color: var(--text);
font-family: var(--sans);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
}

/* ============================================================
   Shared header
   Markup contract (every page):
     <header>
       <div class="site-bar">
         <a class="brand" href="/"><img src="aegfx-logo-white.svg" alt="AEGFX, Slide Size home"></a>
         <nav aria-label="Breadcrumb"><ol class="crumbs">
           <li><a href="/">Slide Size</a></li>
           <li aria-current="page">Tool Name</li>
         </ol></nav>
         <a class="site-contact" href="mailto:slidesize@aegfx.com">slidesize@aegfx.com</a>
       </div>
       <div class="logo-mark"></div>
       <div class="logo-text">Tool <span>Name</span></div>
     </header>
   The white logo sits on the left and goes back to the Slide Size home page.
   The trail is centred in the bar and reads Slide Size / Tool Name. The
   landing page has the single crumb <li aria-current="page">Slide Size</li>.
   The link out to aegfx.com is the coloured logo at the foot of the page.
   ============================================================ */

header {
width: 100%;
background: var(--panel);
border-bottom: 1px solid var(--border2);
padding: 0 0 18px;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.site-bar {
align-self: stretch;
display: grid;
grid-template-columns: 1fr auto 1fr;   /* equal sides keep the trail centred */
align-items: center;
column-gap: 14px;
padding: 12px 24px;
margin-bottom: 14px;
background: var(--bg);
border-bottom: 1px solid var(--border);
}
.brand { display: block; justify-self: start; line-height: 0; transition: opacity 0.15s; }
.brand:hover { opacity: 0.8; }
.brand img { display: block; height: 24px; width: auto; }
.site-bar nav { min-width: 0; }
.crumbs {
list-style: none;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
font-family: var(--sans);
font-size: 11px;
font-weight: 500;
letter-spacing: 1.5px;
text-transform: uppercase;
line-height: 1.5;
}
.crumbs li { display: flex; align-items: center; white-space: nowrap; }
.crumbs li + li::before { content: '/'; color: var(--muted); opacity: 0.6; margin: 0 11px; font-weight: 400; }
.crumbs a { color: var(--label); text-decoration: none; transition: color 0.15s; }
.crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--accent); font-weight: 700; }
.site-contact {
justify-self: end;
font-family: var(--sans);
font-size: 11px;
font-weight: 500;
letter-spacing: 0.5px;
color: var(--muted);
text-decoration: none;
white-space: nowrap;
transition: color 0.15s;
}
.site-contact:hover { color: var(--accent); }
@media (max-width: 560px) {
/* no room for the logo beside a centred trail, so the logo goes on its own
   row above it and both stay centred */
.site-bar { padding: 10px 16px; grid-template-columns: 1fr; row-gap: 8px; }
.brand { justify-self: center; }
.brand img { height: 20px; }
.crumbs { font-size: 10px; letter-spacing: 1px; }
.crumbs li + li::before { margin: 0 8px; }
.site-contact { display: none; }   /* still in the footer */
}
.logo-mark {
height: 24px; width: 42px;
border: 2px solid var(--accent);
flex-shrink: 0;
position: relative;
background: transparent;
}
.logo-mark::after {
content: '';
position: absolute;
inset: 3px;
background: var(--accent);
opacity: 0.2;
}
.logo-text {
font-family: var(--sans);
font-weight: 700;
font-size: 18px;
letter-spacing: 3px;
color: #fff;
text-transform: uppercase;
text-align: center;
}
.logo-text span { color: var(--accent); }
/* ============================================================
   Shared footer
   ============================================================ */

footer {
width: 100%;
border-top: 1px solid var(--border);
padding: 14px 24px 18px;
font-family: var(--sans);
font-size: 11px;
color: var(--muted);
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
gap: 3px;
line-height: 1.6;
}
footer a { color: var(--brand-red); text-decoration: none; }
footer a:hover { color: var(--brand-red2); }
.footer-sep { margin: 4px 0; height: 1px; width: 40px; background: var(--border2); }
/* coloured AEGFX logo, last thing on the page, out to aegfx.com in a new tab */
.footer-brand { display: block; line-height: 0; margin-top: 14px; transition: opacity 0.15s; }
.footer-brand:hover { opacity: 0.8; }
.footer-brand img { display: block; height: 28px; width: auto; }

/* ============================================================
   Shared helpers used across pages
   ============================================================ */

.intro {
font-family: var(--sans);
font-size: 13px;
line-height: 1.55;
color: var(--label);
max-width: 820px;
margin: 0 auto;
text-align: center;
}
.intro strong { color: var(--text); font-weight: 500; }

.spinner {
width: 14px; height: 14px;
border: 2px solid var(--border2);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
display: inline-block; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast, used by tiles for drag-drop feedback and tool pages for copy feedback */
.toast {
position: fixed;
bottom: 32px; left: 50%; transform: translateX(-50%);
background: var(--accent); color: #1a1026;
padding: 10px 20px; border-radius: 3px;
font-family: var(--sans); font-size: 12px; font-weight: 700;
letter-spacing: 0.5px; text-transform: uppercase;
opacity: 0; pointer-events: none; transition: opacity 0.2s;
z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.toast.visible { opacity: 1; }

/* Handoff: tile 'loading' state immediately after a drop, before navigation */
.tool-link.loading {
pointer-events: none;
position: relative;
}
.tool-link.loading::after {
content: 'Opening tool...';
position: absolute; inset: 0;
display: flex; align-items: center; justify-content: center;
background: rgba(26,26,26,0.9);
font-family: var(--sans); font-size: 11px; font-weight: 700;
letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
border-radius: 2px;
}

/* Handoff: destination-page overlay shown the moment ?pickup=1 is detected */
.ss-handoff-overlay {
position: fixed; inset: 0;
background: rgba(26,26,26,0.92);
display: flex; align-items: center; justify-content: center;
z-index: 1000;
animation: ss-fade 0.15s ease both;
}
@keyframes ss-fade { from { opacity: 0; } to { opacity: 1; } }
.ss-handoff-card {
background: var(--panel);
border: 1px solid var(--border2);
border-left: 2px solid var(--accent);
padding: 24px 32px;
border-radius: 2px;
display: flex; align-items: center; gap: 14px;
font-family: var(--sans); font-size: 13px; color: var(--label);
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.ss-handoff-card .spinner { width: 18px; height: 18px; margin: 0; }
.ss-handoff-label { letter-spacing: 0.3px; }
