/* The Mark Apps — shared shell.
   Loaded AFTER each app's own style.css on every app page (/markit/, /marka/, /gurobank/).
   It owns layout and structure for the pieces every app shares: skip link, family bar,
   header, mobile menu, footer, page hero, manual layout, contact card and closing CTA.
   It reads only the tokens every app already defines (--bg, --surface, --border, --text,
   --text-muted, --accent, --accent-dark, --on-accent, --radius*, --font-*), so each app keeps
   its own colours and type. Optional per-app tokens: --accent-soft, --logo-accent.
   Do not put app-specific colours here. */

html { scroll-padding-top: 88px; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* ── Skip link ── */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; }
.skip-link:focus { left: 8px; }

/* ── Family bar ── */
.parent-bar { background: var(--surface); border-bottom: 1px solid var(--border); font-family: var(--font-body); font-size: 13px; line-height: 1.2; }
.parent-bar-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; column-gap: 12px; }
.parent-bar a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; color: var(--text-muted); font-weight: 500; border-radius: var(--radius-sm); }
.parent-bar a:hover { color: var(--text); }
.parent-bar a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.parent-bar-brand { margin-left: -8px; color: var(--text) !important; font-weight: 600 !important; }
.parent-bar-brand img { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; }
.parent-bar-links { display: flex; align-items: center; }
.parent-bar a[aria-current="page"] { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

/* ── Header ── */
.site-header { position: sticky; top: 0; z-index: 100; background: transparent; border-bottom: 1px solid var(--border); }
/* Blur on a pseudo-element: backdrop-filter on the header itself would make it the
   containing block for the fixed mobile menu. */
.site-header::before { content: ''; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; gap: 32px; height: 64px; }

.logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text); font-family: var(--font-heading); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; line-height: 1; transition: opacity .15s; }
.logo:hover { opacity: .85; }
.logo-mark { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: block; }
.logo-accent { color: var(--logo-accent, var(--accent)); }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a { white-space: nowrap; color: var(--text-muted); font-family: var(--font-body); font-size: 15px; font-weight: 500; padding: 6px 12px; border-radius: var(--radius-sm); transition: color .15s, background .15s; }
.main-nav > a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.main-nav > a[aria-current="page"] { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
.mobile-nav-ctas { display: none; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 44px; min-height: 44px; padding: 8px; margin-left: auto; background: none; border: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Page hero (inner pages) ── */
.section-label { display: block; font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.page-hero { padding: 72px 0 40px; border-bottom: 0; text-align: left; }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; margin: 0 0 16px; max-width: 22ch; }
.page-hero p:not(.section-label) { color: var(--text-muted); font-size: 1.15rem; max-width: 60ch; margin: 0; }
.page-hero p a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.page-hero + section { padding-top: 24px; }

/* ── Manual: chapter index ── */
.manual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.manual-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; color: var(--text); transition: border-color .2s, transform .2s, box-shadow .2s; }
.manual-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .08); }
.manual-card .num { display: block; color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: .08em; margin-bottom: 8px; }
.manual-card h2, .manual-card h3 { font-size: 1.1rem; margin: 0 0 6px; }
.manual-card p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

/* ── Manual: chapter page ── */
.manual-section { padding: 48px 0 96px; }
.manual-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; }
.manual-side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; }
.manual-side ol { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; }
.manual-side li a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14.5px; line-height: 1.35; color: var(--text-muted); }
.manual-side li a:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.manual-side li a[aria-current="page"] { background: var(--accent-soft, color-mix(in srgb, var(--accent) 16%, transparent)); color: var(--text); font-weight: 600; }
.manual-side .section-label a { color: inherit; padding: 0; }
.manual-side .section-label a:hover { text-decoration: underline; }
.manual-article { max-width: 760px; min-width: 0; }
.manual-article h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.15; margin: 0 0 16px; }
.manual-article > h1 + p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 32px; }
.manual-article h2 { font-size: 1.5rem; margin: 40px 0 12px; padding-top: 8px; }
.manual-article h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.manual-article p, .manual-article li { color: var(--text-muted); line-height: 1.7; }
.manual-article p { margin: 0 0 16px; }
.manual-article ul { list-style: disc; padding-left: 22px; margin: 0 0 16px; }
.manual-article ol { list-style: decimal; padding-left: 24px; margin: 0 0 16px; }
.manual-article li { margin-bottom: 8px; }
.manual-article strong { color: var(--text); }
.manual-article a:not(.btn) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.manual-article code { font-family: var(--font-mono); font-size: .9em; background: color-mix(in srgb, var(--text) 8%, transparent); padding: 1px 6px; border-radius: 4px; color: var(--text); }
.manual-article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; }
.manual-article th, .manual-article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.manual-article th { color: var(--text); }
.manual-article img { max-width: 100%; height: auto; border-radius: var(--radius); }
.callout { background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent)); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text) !important; }
.manual-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); font-weight: 600; }
.manual-pager a { color: var(--accent); }

/* ── Contact card ── */
.contact-card { max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px 32px; }
.contact-item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--border); }
.contact-item:last-child { border-bottom: 0; }
.contact-item svg { width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }
.contact-item h2, .contact-item h3 { font-size: 1.05rem; margin: 0 0 4px; }
.contact-item p { color: var(--text-muted); margin: 0 0 4px; font-size: 15px; }
.contact-item a { color: var(--accent); }

/* ── Closing call to action ── */
.cta-banner { padding: 96px 0; text-align: center; }
.cta-banner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 16px; }
.cta-banner p { color: var(--text-muted); font-size: 1.1rem; max-width: 52ch; margin: 0 auto 32px; }
.cta-banner .cta-actions, .cta-banner .hero-ctas { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* ── Footer ── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 0 32px; margin-top: 0; font-family: var(--font-body); }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; }
.footer-brand .logo { font-size: 18px; }
.footer-tagline { color: var(--text-muted); font-size: 15px; line-height: 1.5; margin: 14px 0 0; max-width: 34ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 40px; justify-content: flex-end; }
.footer-nav-group { min-width: 120px; }
.footer-title { font-family: var(--font-body); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin: 0 0 14px; }
.footer-nav a { display: block; color: var(--text-muted); font-size: 15px; margin-bottom: 10px; }
.footer-nav a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.footer-bottom p { margin: 0; max-width: 70ch; }
.footer-bottom a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom a:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .manual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { justify-content: flex-start; }
}
/* Tablet: logo + up to six links + two buttons must fit without clipping. */
@media (min-width: 769px) and (max-width: 1080px) {
  .header-inner { gap: 16px; }
  .logo { font-size: 17px; gap: 8px; }
  .logo-mark { width: 26px; height: 26px; }
  .main-nav { gap: 0; }
  .main-nav > a { font-size: 14px; padding: 6px 8px; }
  .header-actions { gap: 6px; }
  .header-actions .btn { padding: 8px 14px; font-size: 14px; min-height: 0; }
}
@media (min-width: 769px) and (max-width: 900px) {
  .header-actions .btn-ghost { display: none; }
}
@media (max-width: 768px) {
  .parent-bar a { min-height: 44px; }
  /* The fixed mobile menu starts 64px from the top; drop the bar while it is open. */
  body:has(.main-nav.open) .parent-bar { display: none; }
  .header-actions { display: none; }
  .nav-toggle { display: flex; }
  .main-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; flex-direction: column; align-items: stretch; gap: 4px; padding: 16px 24px; background: var(--bg); overflow-y: auto; z-index: 99; }
  .main-nav.open { display: flex; }
  .main-nav > a { font-size: 17px; padding: 14px 12px; }
  .mobile-nav-ctas { display: grid; gap: 10px; margin-top: 16px; }
  .mobile-nav-ctas .btn { width: 100%; justify-content: center; }
  .logo { min-height: 44px; }
  .page-hero { padding: 48px 0 24px; }
  .manual-grid { grid-template-columns: 1fr; }
  .manual-layout { grid-template-columns: 1fr; gap: 24px; }
  .manual-side { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); }
  .manual-section { padding: 32px 0 64px; }
  .contact-card { padding: 4px 20px; }
  .cta-banner { padding: 64px 0; }
  .footer-nav { gap: 28px; }
  .footer-nav a { padding: 6px 0; margin-bottom: 4px; }
}
@media (max-width: 400px) {
  .parent-bar { font-size: 12px; }
  .parent-bar a { padding: 0 6px; }
  .parent-bar-brand { margin-left: -6px; }
}
