/* Shared public chrome (AYAH-21): header, footer, sample-book dialog. Loaded by the Inertia root view and the
   /artikel Blade layout, so both render the same markup (resources/views/partials/site) with the same look.
   Self-contained tokens (design system, docs/design-system/tokens.css); dark only when <html> has .dark. */
:root {
    --sx-bg: #fdf6e9; --sx-fg: #2a1f3d; --sx-heading: #3b1a57; --sx-muted: #6b5d73; --sx-card: #ffffff;
    --sx-border: #ecdcc0; --sx-soft: #f0e6fa; --sx-highlight: #fcaf01; --sx-ring: #8a57be;
    --sx-cta: #c64300; --sx-cta-hover: #a93b04; --sx-cta-fg: #ffffff; --sx-cta-shadow: 0 6px 18px -6px rgb(198 67 0 / 0.55);
    --sx-display: 'Fredoka Variable', 'Fredoka', ui-rounded, ui-sans-serif, system-ui, sans-serif;
    --sx-sans: 'SN Pro Variable', 'SN Pro', ui-sans-serif, system-ui, sans-serif;
    --sx-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
html.dark {
    --sx-bg: #1b1430; --sx-fg: #f3eefa; --sx-heading: #ffffff; --sx-muted: #b9b0cc; --sx-card: #241b3b;
    --sx-border: #3a2e55; --sx-soft: #3a2e55; --sx-highlight: #fdce5c; --sx-ring: #a97dd4;
    --sx-cta: #fb9233; --sx-cta-hover: #fdb06a; --sx-cta-fg: #231033; --sx-cta-shadow: 0 6px 18px -6px rgb(251 146 51 / 0.45);
}
html { scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html:has(.sx-dialog[open]) { overflow: hidden; }

.sx-wrap { max-width: 1152px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .sx-wrap { padding: 0 32px; } }

.sx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 999px; font: 600 16px/1 var(--sx-display); text-decoration: none; white-space: nowrap; transition: transform 0.15s var(--sx-ease), background-color 0.2s var(--sx-ease), box-shadow 0.2s var(--sx-ease); }
.sx-btn:active { transform: scale(0.97); }
.sx-btn-cta { background: var(--sx-cta); color: var(--sx-cta-fg); box-shadow: var(--sx-cta-shadow); }
.sx-btn-cta:hover { background: var(--sx-cta-hover); transform: translateY(-1px); }
.sx-btn-sm { height: 40px; padding: 0 18px; font-size: 15px; }

.sx-header a:focus-visible, .sx-header summary:focus-visible, .sx-footer a:focus-visible, .sx-dialog button:focus-visible { outline: 3px solid var(--sx-ring); outline-offset: 2px; border-radius: 10px; }

/* Header */
.sx-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--sx-bg) 86%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); border-bottom: 1px solid transparent; transition: border-color 0.25s var(--sx-ease), box-shadow 0.25s var(--sx-ease); font-family: var(--sx-sans); }
.sx-header.is-scrolled { border-bottom-color: var(--sx-border); box-shadow: 0 6px 24px -18px rgb(59 26 87 / 0.45); }
.sx-header-row { display: flex; align-items: center; gap: 12px; height: 68px; }
.sx-logo { display: flex; flex: none; }
.sx-logo img { height: 40px; width: auto; display: block; }
.sx-logo-dark, html.dark .sx-logo-light { display: none !important; }
html.dark .sx-logo-dark { display: block !important; }
.sx-nav { display: none; margin-left: 20px; gap: 2px; }
.sx-nav a, .sx-account { position: relative; color: var(--sx-fg); text-decoration: none; font-weight: 700; font-size: 15px; padding: 9px 13px; border-radius: 999px; transition: background-color 0.2s var(--sx-ease), color 0.2s var(--sx-ease); }
.sx-nav a:hover, .sx-account:hover { background: var(--sx-soft); color: var(--sx-heading); }
.sx-nav a[aria-current]::after { content: ''; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 3px; border-radius: 3px; background: var(--sx-highlight); }
.sx-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sx-account { display: none; }
@media (min-width: 900px) { .sx-nav { display: flex; } .sx-account { display: inline-flex; } .sx-logo img { height: 44px; } }
@media (max-width: 480px) { .sx-logo img { height: 34px; } }
@media (max-width: 380px) { .sx-logo img { height: 30px; } .sx-btn-sm { padding: 0 14px; } }

.sx-menu { position: relative; }
.sx-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; color: var(--sx-heading); }
.sx-menu summary::-webkit-details-marker { display: none; }
.sx-menu summary:hover, .sx-menu[open] summary { background: var(--sx-soft); }
.sx-menu-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--sx-card); border: 1px solid var(--sx-border); border-radius: 20px; padding: 8px; box-shadow: 0 2px 4px rgb(59 26 87 / 0.06), 0 18px 40px -12px rgb(59 26 87 / 0.35); display: grid; transform-origin: top right; animation: sx-pop 0.22s var(--sx-ease) both; }
.sx-menu-panel a { color: var(--sx-fg); text-decoration: none; font-weight: 700; padding: 12px 14px; border-radius: 12px; }
.sx-menu-panel a:hover, .sx-menu-panel a[aria-current] { background: var(--sx-soft); color: var(--sx-heading); }
@media (min-width: 900px) { .sx-menu { display: none; } }
@keyframes sx-pop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }

/* Footer (plum in both themes) */
.sx-footer { background: #231033; color: #dcd6e8; padding: 56px 0 28px; font: 400 15px/1.6 var(--sx-sans); }
.sx-social { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: #fdce5c; font-weight: 700; text-decoration: none; }
.sx-social:hover { text-decoration: underline; }
.sx-footer-cols { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.sx-footer-cols > div:first-child { grid-column: 1 / -1; }
@media (min-width: 860px) { .sx-footer-cols { grid-template-columns: 1.5fr 1fr 1fr 1fr; } .sx-footer-cols > div:first-child { grid-column: auto; } }
.sx-footer img { height: 40px; width: auto; margin-bottom: 14px; display: block; }
.sx-footer p { margin: 0; max-width: 34ch; }
.sx-footer h2 { margin: 0 0 10px; color: #fff; font: 600 16px/1.3 var(--sx-display); }
.sx-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sx-footer a { color: #dcd6e8; text-decoration: none; }
.sx-footer a:hover { color: #fdce5c; }
.sx-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid #3a2e55; margin-top: 36px; padding-top: 18px; font-size: 13px; color: #b9b0cc; }

/* Sample-book dialog: full screen on phones, large card on desktop */
.sx-dialog { padding: 0; border: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; background: #1b1430; color: #fff; display: none; flex-direction: column; overflow: hidden; font-family: var(--sx-sans); }
.sx-dialog[open] { display: flex; animation: sx-dialog-in 0.32s var(--sx-ease) both; }
.sx-dialog::backdrop { background: rgb(20 14 34 / 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: sx-fade 0.25s ease both; }
@media (min-width: 768px) {
    .sx-dialog { width: min(1200px, 94vw); height: min(860px, 92dvh); margin: auto; border-radius: 24px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6); }
}
.sx-dialog-bar { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; background: #231033; border-bottom: 1px solid #3a2e55; }
.sx-dialog-bar h2 { margin: 0; font: 600 16px/1.25 var(--sx-display); color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-dialog-bar h2 span { color: #fdce5c; }
.sx-dialog-close { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.1); color: #fff; font: 700 14px/1 var(--sx-sans); cursor: pointer; transition: background-color 0.2s var(--sx-ease); }
.sx-dialog-close:hover { background: rgb(255 255 255 / 0.2); }
.sx-dialog-frame { flex: 1; width: 100%; border: 0; background: #1b1430; }
@keyframes sx-dialog-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sx-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sx-dialog[open], .sx-dialog::backdrop, .sx-menu-panel { animation: none; } }
