/**
 * Myco panel — base: reset, typography, page header and layout grids.
 * (App shell / sidebar / mobile nav / wizard chrome / auth split: shell.css)
 *
 * Component skins live in components.css; page-specific rules live in
 * assets/css/pages/<route>.css (auto-enqueued by Myco_Assets when present).
 * Tokens only — never a raw colour in this file.
 */

/* ---- Reset & typography ---- */

.myco-body {
	margin: 0;
	font-family: var( --myco-font-body );
	font-size: 14px;
	line-height: 1.5;
	color: var( --myco-text );
	background: var( --myco-bg );
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

.myco-body *,
.myco-body *::before,
.myco-body *::after {
	box-sizing: border-box;
}

/* `hidden` must beat any display rule (JS toggles blocks with el.hidden). */
[hidden] {
	display: none !important;
}

/* Element-level on purpose: native controls otherwise take the UA's font and
   colour-scheme colours, not the theme's. Any classed control still wins. */
button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

/* ---- Scrollbars: thin, theme-coloured (viewport and every scroll box) ---- */

html,
.myco-body * {
	scrollbar-width: thin;
	scrollbar-color: var( --myco-border-strong ) transparent;
}

::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background-color: var( --myco-border-strong );
	border-radius: var( --myco-radius-pill );
	border: 2px solid transparent;
	background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
	background-color: var( --myco-muted );
}

/* Element-level (0,0,1) on purpose: any classed link (.myco-brand,
   .myco-nav__item, .myco-link…) wins without specificity games. */
.myco-body a {
	text-decoration: none;
}

a {
	color: var( --myco-link );
}

a:hover {
	color: var( --myco-link-hover );
}

.myco-body h1,
.myco-body h2,
.myco-body h3,
.myco-body h4 {
	margin: 0;
	line-height: 1.3;
	font-weight: 700;
}

.myco-body p {
	margin: 0;
}

.myco-body code,
.myco-mono {
	font-family: var( --myco-font-mono );
	font-size: 0.92em;
}

/* Display type (Fraunces) only at ≥16px. */
.myco-display {
	font-family: var( --myco-font-display );
	font-weight: var( --myco-display-weight );
	line-height: 1.25;
}

.myco-display em {
	font-style: italic;
	font-weight: var( --myco-display-italic-weight );
}

/* Eyebrow: mono 11px, uppercase, tracked. */
.myco-eyebrow {
	font-family: var( --myco-font-mono );
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var( --myco-muted );
}

.myco-text-2 {
	color: var( --myco-text-2 );
}

.myco-muted {
	color: var( --myco-muted );
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

:focus-visible {
	outline: 2px solid var( --myco-accent );
	outline-offset: 2px;
}

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

/* ---- Page header ---- */

.myco-page-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.myco-page-head__text {
	min-width: 0;
}

.myco-page-head__titlerow {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}

.myco-panel__title,
.myco-page-head__title {
	font-family: var( --myco-font-display );
	font-weight: var( --myco-display-weight );
	font-size: 26px;
	line-height: 1.2;
	margin: 0;
	color: var( --myco-text );
}

.myco-page-head__title em {
	font-style: italic;
	font-weight: var( --myco-display-italic-weight );
}

.myco-page-head__count {
	font-size: 14px;
	color: var( --myco-muted );
}

.myco-page-head__sub {
	font-size: 14px;
	color: var( --myco-text-2 );
	margin-top: 4px;
}

.myco-page-head__actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.myco-crumbs {
	font-size: 13px;
	color: var( --myco-muted );
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.myco-crumbs a {
	color: var( --myco-link );
}

.myco-crumbs__sep {
	color: var( --myco-muted );
}

/* Section heading inside a page (Fraunces 16). */
.myco-section-title,
.myco-card__title {
	font-family: var( --myco-font-display );
	font-weight: var( --myco-display-weight );
	font-size: 16px;
	line-height: 1.3;
	margin: 0;
}

.myco-card__title--lg {
	font-size: 20px;
}

.myco-card__lead {
	font-size: 14px;
	color: var( --myco-text-2 );
	margin-top: 4px;
}

/* ---- Layout grids ---- */

.myco-grid {
	display: grid;
	gap: var( --myco-gap );
}

.myco-grid--2 { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
.myco-grid--3 { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); }
.myco-grid--4 { grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); }
.myco-grid--main { grid-template-columns: 1.2fr 1fr; align-items: start; }
.myco-grid--aside { grid-template-columns: minmax( 0, 1fr ) 380px; align-items: start; }

.myco-stack {
	display: flex;
	flex-direction: column;
	gap: var( --myco-gap );
}

.myco-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.myco-row--between {
	justify-content: space-between;
}

.myco-grow {
	flex: 1 1 auto;
	min-width: 0;
}

/* Legacy helper kept for templates: two form fields side by side. */
.myco-grid-2,
.myco-field-row {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: 14px;
}

/* ---- Responsive (typography + grids) ---- */

@media ( max-width: 1200px ) {
	.myco-grid--4 {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}

	.myco-grid--aside {
		grid-template-columns: minmax( 0, 1fr ) 320px;
	}
}

@media ( max-width: 960px ) {
	.myco-grid--3,
	.myco-grid--main,
	.myco-grid--aside {
		grid-template-columns: minmax( 0, 1fr );
	}
}

@media ( max-width: 900px ) {
	.myco-panel__title,
	.myco-page-head__title {
		font-size: 21px;
	}

	.myco-page-head {
		align-items: flex-start;
	}

	.myco-grid--2,
	.myco-grid--4 {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 560px ) {
	.myco-grid--2,
	.myco-grid-2,
	.myco-field-row {
		grid-template-columns: minmax( 0, 1fr );
	}
}
