/*
Theme Name:   Bin Src
Theme URI:    https://binsrc.com/
Description:  Child theme for Astra, made for binsrc.com: Windows programs that run in the browser under wasm-wine. Shares its design system with graphlines.com and pdfwire.com. Atkinson Hyperlegible Next and JetBrains Mono are self-hosted, so pages make no requests to Google Fonts. Colours meet WCAG 2.2 AA, with a dark scheme that follows the visitor's system setting, visible focus rings and reduced motion.
Author:       Bin Src
Template:     astra
Version:      0.2.0
Requires at least: 6.3
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  binsrc-child
*/

/* ==========================================================================
   1. Fonts (self-hosted, SIL Open Font License; see fonts/OFL-*.txt)
   ========================================================================== */
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/AtkinsonHyperlegibleNext-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("fonts/AtkinsonHyperlegibleNext-Italic-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* ==========================================================================
   2. Tokens. Astra's global colours and the plugin's variables point at these,
      so the Customizer palette, the block editor and the front end stay in step.
   ========================================================================== */
:root {
	--bs-brand: #8C1D40;        /* wine red. Links, buttons, focus: 8.9:1 on white */
	--bs-brand-hover: #5F1029;  /* 13.2:1 */
	--bs-ink: #18161A;          /* headings */
	--bs-text: #2F2D33;         /* body */
	--bs-surface: #F6F4F5;      /* bands, footer */
	--bs-paper: #FFFFFF;
	--bs-line: #E4E0E2;         /* decorative borders */
	--bs-muted: #46424A;        /* secondary text */
	--bs-tint: #FBEEF2;         /* notices */
	--bs-tint-line: #EFC6D2;
	--bs-on-brand: #FFFFFF;
	--bs-band: #18161A;         /* dark band */
	--bs-band-text: #DAD6DA;
	--bs-band-link: #FFB0C4;
	--bs-ok: #1B7A3E;

	--bs-font: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, sans-serif;
	--bs-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--bs-wrap: 1200px;
	--bs-gutter: clamp(16px, 4vw, 24px);
	--bs-radius: 12px;

	--ast-global-color-0: var(--bs-brand);
	--ast-global-color-1: var(--bs-brand-hover);
	--ast-global-color-2: var(--bs-ink);
	--ast-global-color-3: var(--bs-text);
	--ast-global-color-4: var(--bs-surface);
	--ast-global-color-5: var(--bs-paper);
	--ast-global-color-6: var(--bs-line);
	--ast-global-color-7: var(--bs-muted);
	--ast-global-color-8: var(--bs-tint);

	/* The plugin's launcher, cards, licence box and ad slots. */
	--binsrc-ink: var(--bs-ink);
	--binsrc-text: var(--bs-text);
	--binsrc-paper: var(--bs-paper);
	--binsrc-surface: var(--bs-surface);
	--binsrc-line: var(--bs-line);
	--binsrc-muted: var(--bs-muted);
	--binsrc-accent: var(--bs-brand);
	--binsrc-accent-hover: var(--bs-brand-hover);
	--binsrc-on-accent: var(--bs-on-brand);
	--binsrc-mono: var(--bs-mono);
	--binsrc-radius: var(--bs-radius);
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bs-brand: #FFB0C4;      /* 10.9:1 on #151214 */
		--bs-brand-hover: #FFD3DE;
		--bs-ink: #FFFFFF;
		--bs-text: #E8E5E8;
		--bs-surface: #1E1A1C;
		--bs-paper: #151214;
		--bs-line: #352F33;
		--bs-muted: #B5AFB5;
		--bs-tint: #3A1622;
		--bs-tint-line: #6E2A40;
		--bs-on-brand: #151214;
		--bs-band: #0C0A0B;
		--bs-ok: #7FD9A0;
		color-scheme: dark;
	}
}

/* ==========================================================================
   3. Base
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; background-color: var(--bs-paper); color: var(--bs-text); font-size: 1.125rem; line-height: 1.65; }
body, button, input, select, textarea, .ast-button, .ast-custom-button { font-family: var(--bs-font); }
h1, h2, h3, h4, h5, h6, .entry-content :where(h1, h2, h3, h4, h5, h6), .site-title, .site-title a {
	font-family: var(--bs-font); font-weight: 700; color: var(--bs-ink); line-height: 1.2;
}
h1, .entry-content h1 { font-size: clamp(2.125rem, 4vw, 3rem); letter-spacing: -0.02em; line-height: 1.1; }
h2, .entry-content h2 { font-size: clamp(1.75rem, 3vw, 2rem); letter-spacing: -0.01em; }
h3, .entry-content h3 { font-size: clamp(1.3rem, 2vw, 1.45rem); line-height: 1.3; }
.entry-content :where(h2) { margin-top: 2.2em; margin-bottom: 0.5em; }
.entry-content :where(h3) { margin-top: 1.6em; margin-bottom: 0.4em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content p, .entry-content li { max-width: 70ch; }

a { color: var(--bs-brand); }
a:hover, a:focus { color: var(--bs-brand-hover); }
.entry-content a:where(:not(.wp-block-button__link, .wp-element-button, .binsrc-card__link)), .site-footer .widget a, .site-footer .footer-widget-area a {
	text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
}
.entry-content a:where(:not(.wp-block-button__link, .wp-element-button, .binsrc-card__link)):hover { text-decoration-thickness: 3px; }

:focus { outline: none; }
:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, .wp-block-button__link:focus-visible, .ast-custom-button:focus-visible, .menu-toggle:focus-visible {
	outline: 3px solid var(--bs-brand) !important; outline-offset: 3px !important; box-shadow: none; border-radius: 4px;
}
.skip-link.screen-reader-text:focus {
	clip: auto !important; clip-path: none; height: auto; width: auto; left: 16px; top: 16px; z-index: 100000;
	padding: 12px 18px; background: var(--bs-ink); color: var(--bs-paper); font-size: 1rem; font-weight: 700; border-radius: 8px; text-decoration: none;
}
::selection { background: var(--bs-tint); color: var(--bs-ink); }
code, kbd, pre, samp, tt { font-family: var(--bs-mono); font-size: 0.88em; }
:not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--bs-surface); color: var(--bs-ink); }
hr, .wp-block-separator { border: 0; border-top: 1px solid var(--bs-line); opacity: 1; }

/* ==========================================================================
   4. Header (Astra header builder)
   ========================================================================== */
.site-header, .ast-primary-header-bar, .main-header-bar, .ast-mobile-header-wrap .ast-primary-header-bar {
	background-color: var(--bs-paper); border-bottom: 1px solid var(--bs-line);
}
.site-title a, .site-title a:hover { color: var(--bs-ink); text-decoration: none; letter-spacing: -0.01em; }
.main-header-menu .menu-link, .ast-builder-menu .menu-item > .menu-link {
	min-height: 44px; display: flex; align-items: center; color: var(--bs-ink); font-weight: 700; font-size: 1rem; text-decoration: none;
}
.main-header-menu .menu-link:hover, .ast-builder-menu .menu-item > .menu-link:hover { color: var(--bs-brand); }
.main-header-menu .current-menu-item > .menu-link, .main-header-menu .current_page_item > .menu-link, .ast-builder-menu .current-menu-item > .menu-link {
	color: var(--bs-brand); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 10px;
}
.ast-header-button-1 .ast-custom-button, .ast-header-button-1 .ast-custom-button-link .ast-custom-button {
	min-height: 48px; display: inline-flex; align-items: center; padding: 0 20px; border-radius: 8px; border: 0;
	background-color: var(--bs-brand); color: var(--bs-on-brand); font-weight: 700; font-size: 1rem; line-height: 1.2;
}
.ast-header-button-1 .ast-custom-button:hover { background-color: var(--bs-brand-hover); color: var(--bs-on-brand); }
.menu-toggle, .ast-mobile-menu-trigger-minimal, .ast-mobile-menu-trigger-outline, .ast-mobile-menu-trigger-fill {
	min-height: 48px; min-width: 48px; border: 2px solid var(--bs-ink) !important; border-radius: 8px !important;
	background: var(--bs-paper) !important; color: var(--bs-ink) !important;
}
.menu-toggle .ast-mobile-svg { fill: var(--bs-ink); }
.ast-mobile-header-content, .ast-mobile-popup-drawer .ast-mobile-popup-inner { background-color: var(--bs-paper); }
.ast-mobile-header-content .menu-link, .ast-mobile-popup-drawer .menu-link { min-height: 48px; border-color: var(--bs-line) !important; }

/* ==========================================================================
   5. Page title band (inner pages, app pages, the apps archive)
   ========================================================================== */
.page .entry-header, .single .entry-header, .bs-archive-header {
	position: relative; margin-bottom: 2.5rem; padding: 2.5rem 0 2.75rem; background: var(--bs-surface);
	box-shadow: 0 0 0 100vmax var(--bs-surface); clip-path: inset(0 -100vmax); border-bottom: 1px solid var(--bs-line);
}
.page .entry-header .entry-title, .single .entry-header .entry-title, .bs-archive-header h1 {
	margin: 0; font-size: clamp(2.125rem, 4vw, 3rem); line-height: 1.1; letter-spacing: -0.02em;
}
/* The home page opens with the hero's own headline. */
.home.page .entry-header { display: none; }
.bs-archive-header p { margin: 0.6em 0 0; max-width: 60ch; color: var(--bs-muted); }
.single-binsrc_app .entry-meta, .single-binsrc_app .post-navigation { display: none; }

/* ==========================================================================
   6. Core blocks
   ========================================================================== */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-button__link, .wp-element-button, .ast-button, button.ast-button, input[type="submit"], .wp-block-search__button {
	min-height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0 24px;
	border: 2px solid var(--bs-brand); border-radius: 8px; background-color: var(--bs-brand); color: var(--bs-on-brand);
	font-family: var(--bs-font); font-weight: 700; font-size: 1.0625rem; line-height: 1.2; text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wp-block-button__link:hover, .wp-element-button:hover, .ast-button:hover, input[type="submit"]:hover {
	background-color: var(--bs-brand-hover); border-color: var(--bs-brand-hover); color: var(--bs-on-brand);
}
.wp-block-button.is-style-outline > .wp-block-button__link, .wp-block-button.is-style-outline > .wp-element-button {
	background: transparent; border-color: var(--bs-ink); color: var(--bs-ink);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--bs-ink); border-color: var(--bs-ink); color: var(--bs-paper); }
.wp-block-details { border-top: 1px solid var(--bs-line); border-bottom: 1px solid var(--bs-line); margin: 0; padding: 2px 0; }
.wp-block-details + .wp-block-details { border-top: 0; }
.wp-block-details summary { min-height: 52px; display: list-item; padding: 13px 0; font-weight: 700; color: var(--bs-ink); cursor: pointer; }
.wp-block-details summary::marker { color: var(--bs-brand); }
.wp-block-details > :not(summary) { margin: 0 0 1em 1.25em; }
.wp-block-columns { gap: 2rem clamp(24px, 4vw, 48px); }
.entry-content ul, .entry-content ol { margin-left: 1.4em; }
.entry-content li + li { margin-top: 0.35em; }

/* Paragraph › Eyebrow label */
p.is-style-bs-eyebrow {
	display: inline-block; margin-bottom: 1rem; padding: 4px 14px; border: 1px solid var(--bs-line); border-radius: 999px;
	background: var(--bs-paper); color: var(--bs-muted); font-size: 0.9375rem; font-weight: 700;
}

/* ==========================================================================
   7. Pattern layout (classes used by the theme's block patterns)
   ========================================================================== */
.entry-content > .alignfull.bs-band { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.bs-wrap { max-width: var(--bs-wrap); margin-left: auto !important; margin-right: auto !important; padding-left: var(--bs-gutter); padding-right: var(--bs-gutter); }
.bs-band { padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); margin-top: 0; margin-bottom: 0; }
.bs-band + .bs-band { margin-top: 0; }
.bs-band--surface { background: var(--bs-surface); border-top: 1px solid var(--bs-line); border-bottom: 1px solid var(--bs-line); }
.bs-band--dark { background: var(--bs-band); color: var(--bs-band-text); }
.bs-band--dark :where(h1, h2, h3, h4) { color: #FFFFFF; }
.bs-band--dark p, .bs-band--dark .bs-intro p { color: var(--bs-band-text); font-size: 1.25rem; }
.bs-band--dark a:where(:not(.wp-block-button__link)) { color: var(--bs-band-link); font-weight: 700; }

/* Hero */
.bs-hero { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(56px, 8vw, 96px); }
.bs-hero .wp-block-columns { align-items: center; gap: clamp(32px, 5vw, 56px); }
.entry-content .bs-hero-title, .bs-hero-title { margin: 0 0 0.4em; font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -0.025em; }
.bs-lead, .entry-content p.bs-lead { font-size: clamp(1.15rem, 1.6vw, 1.3125rem); line-height: 1.55; color: var(--bs-text); }
.bs-note { display: flex; align-items: center; gap: 8px; font-size: 1rem; color: var(--bs-muted); }
.bs-note::before {
	content: ""; flex: none; width: 20px; height: 20px; background-color: var(--bs-brand);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='9' width='12' height='8' rx='1.5'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='9' width='12' height='8' rx='1.5'/%3E%3Cpath d='M7 9V6.5a3 3 0 0 1 6 0V9'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Hero illustration: a browser tab holding a Windows program. Drawn in fixed colours, like a screenshot. */
.bs-figure { position: relative; max-width: 480px; margin: 0 auto; }
.bs-tab { border: 1px solid #D9D4D7; border-radius: 12px; background: #FFFFFF; box-shadow: 0 18px 40px rgba(24, 22, 26, 0.14); overflow: hidden; }
.bs-tab__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #F0EDEE; border-bottom: 1px solid #D9D4D7; }
.bs-tab__dot { width: 10px; height: 10px; border-radius: 50%; background: #CFC8CC; }
.bs-tab__url { flex: 1; margin-left: 6px; padding: 5px 12px; border-radius: 999px; background: #FFFFFF; color: #46424A; font: 500 12.5px/1.3 var(--bs-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-tab__desk { padding: 22px 22px 56px; background: #2C6E74; }
.bs-win { border: 1px solid #9AA0AA; background: #ECE9E2; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); font: 11.5px/1.2 Tahoma, "Segoe UI", sans-serif; color: #1B1B1F; }
.bs-win__cap { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 8px; background: linear-gradient(90deg, #1F4FB4, #4F8AF0); color: #FFFFFF; font-weight: 700; }
.bs-win__btns { display: flex; gap: 3px; }
.bs-win__btns i { width: 15px; height: 13px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.bs-win__menu { display: flex; gap: 12px; padding: 4px 8px; border-bottom: 1px solid #9AA0AA; }
.bs-win__menu u { text-decoration: underline; }
.bs-win__text { height: 150px; margin: 3px; padding: 6px 8px; border: 1px solid #8D8D93; background: #FFFFFF; font: 12.5px/1.5 var(--bs-mono); color: #18161A; }
.bs-win__text b { display: inline-block; width: 1px; height: 1.1em; margin-left: 1px; background: #18161A; vertical-align: text-bottom; }
.bs-win__status { padding: 3px 8px; border-top: 1px solid #C9C5BC; color: #46424A; }
.bs-ready {
	position: absolute; right: -20px; bottom: -28px; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
	border-radius: 10px; background: #FFFFFF; color: #18161A; border: 1px solid #E4E0E2; box-shadow: 0 10px 28px rgba(24, 22, 26, 0.16); line-height: 1.3;
}
.bs-ready::before {
	content: ""; flex: none; width: 26px; height: 26px; background-color: #1B7A3E;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m7.5 12.5 3 3 6-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m7.5 12.5 3 3 6-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bs-ready strong { display: block; font-size: 15px; }
.bs-ready small { display: block; font-size: 13.5px; color: #46424A; }
@media (max-width: 600px) { .bs-ready { right: 8px; bottom: -20px; } }

/* Section intro */
.bs-intro { max-width: 720px; margin-bottom: 2.5rem; }
.bs-intro h2 { margin: 0 0 0.35em; font-size: clamp(1.9rem, 3.2vw, 2.5rem); }
.bs-intro p { margin: 0; color: var(--bs-muted); }

/* Steps */
ol.bs-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: bs-step; }
ol.bs-steps > li { counter-increment: bs-step; max-width: none; margin: 0; display: flex; flex-direction: column; gap: 10px; color: var(--bs-text); }
ol.bs-steps > li::before {
	content: counter(bs-step); width: 44px; height: 44px; border-radius: 50%; background: var(--bs-ink); color: var(--bs-paper);
	font-weight: 700; display: flex; align-items: center; justify-content: center;
}
ol.bs-steps > li:last-child::before { background: var(--bs-brand); color: var(--bs-on-brand); }
ol.bs-steps strong { display: block; font-size: 1.25rem; color: var(--bs-ink); }

/* Call to action box */
.bs-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; padding: clamp(24px, 4vw, 40px); border: 2px solid var(--bs-ink); border-radius: 16px; }
.bs-cta > .wp-block-group:first-child { flex: 1 1 520px; }
.bs-cta h2 { margin: 0 0 0.3em; font-size: 1.875rem; }
.bs-cta p { margin: 0; }

/* ==========================================================================
   8. Footer (Astra footer builder)
   ========================================================================== */
.site-footer, .site-primary-footer-wrap, .site-above-footer-wrap, .site-below-footer-wrap { background-color: var(--bs-surface) !important; color: var(--bs-muted); font-size: 1rem; }
.site-footer { border-top: 1px solid var(--bs-line); }
.site-below-footer-wrap { border-top: 1px solid var(--bs-line); }
.site-footer a { color: var(--bs-brand); }
.site-footer .widget-title, .site-footer .footer-widget-area .widget-title { font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--bs-muted); }
.footer-nav-wrap .menu-link, .site-footer .ast-builder-menu .menu-link { min-height: 44px; display: flex; align-items: center; }
.ast-footer-copyright { color: var(--bs-muted); font-size: 0.9375rem; }

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