/**
 * Espy Blog — mobile / responsive refinements.
 *
 * An ADDITIVE layer that loads after the theme's main.css (declared as a
 * dependency, so cascade order is guaranteed). It corrects the phone layout
 * without touching the theme itself: the fixed icon rail is reclaimed, page
 * gutters and the hero tighten, wide tables scroll inside their own box, and
 * comment threads / form fields stop overflowing.
 *
 * Layout-only, colours pulled from the theme design tokens (so it still adapts
 * to every reader theme), and zero JavaScript — no runtime cost, fully
 * reversible by removing this file.
 *
 * @package EspyBlogCore
 */

/* ============ Layout collapse: <= 1000px ============ */
/* The theme collapses its 3-column article grid to a single `1fr` track at this
   width. A plain `1fr` track keeps an `auto` minimum, so a wide child (a data
   table, a long token) can blow the track PAST the viewport and clip the text.
   Dropping to normal block flow removes the track entirely; the sidebars are
   already display:none here, so only the reading column remains. */
@media (max-width: 1000px) {
	.espy-article-layout { display: block; }
	.espy-article-body { min-width: 0; max-width: 100%; }
}

/* ============ Tablet / phone: <= 768px ============ */
@media (max-width: 768px) {

	/* The fixed 72px icon rail is desktop chrome. Hide it and reclaim the width
	   (the top bar keeps brand -> home and search reachable). */
	.espy-rail { display: none; }
	body { padding-left: 0; }

	/* Safety net against stray horizontal scroll. Use `clip` (not `hidden`) so it
	   does NOT create a scroll container — `hidden` would break position:sticky
	   for the relocated scroll-along panel; `clip` trims overflow without that. */
	html, body { overflow-x: clip; }

	/* Tighter page gutters. */
	.espy-shell { padding: 18px 16px 44px; }
	.espy-topbar { gap: 12px; margin-bottom: 18px; }
	.espy-brand { font-size: 18px; }
	.espy-search { min-width: 0; flex: 1 1 180px; max-width: none; }

	/* Hero: smaller frame + fluid heading so long titles never feel cramped. */
	.espy-hero { min-height: 220px; padding: 22px 18px; margin-bottom: 20px; }
	.espy-hero-title { font-size: clamp(1.55rem, 6.4vw, 2.3rem); max-width: none; }
	.espy-hero-meta { gap: 8px; font-size: 13px; }
	.espy-hero-meta .av { width: 30px; height: 30px; }

	/* Reading column. */
	.espy-article-layout { gap: 0; }
	.espy-article-body { font-size: 16.5px; line-height: 1.7; }
	.espy-article-body h2 { font-size: 22px; margin: 30px 0 12px; }
	.espy-article-body h3 { font-size: 18px; margin: 24px 0 9px; }
	.espy-article-body p,
	.espy-article-body li { overflow-wrap: anywhere; }

	/* Wide tables scroll inside their own box instead of blowing out the page. */
	.espy-article-body table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* Section header spacing. */
	.espy-section-h { margin: 20px 2px 12px; }

	/* Comments: shallower nesting + full-width, stacked form fields. */
	.espy-comment-list .children { margin-left: 16px; padding-left: 12px; }
	.espy-cbox input[type="text"],
	.espy-cbox input[type="email"],
	.espy-cbox input[type="url"] { width: 100%; margin: 6px 0 0; }

	/* Cards that sat side-by-side wrap cleanly. */
	.espy-authorcard { flex-wrap: wrap; }
	.espy-authorcard .info { flex: 1 1 60%; }
	.espy-authorcard .follow { margin-top: 4px; }
	.espy-shortcode { padding: 16px; }

	/* Footer stacks. */
	.espy-footer-in { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ============ Small phones: <= 480px ============ */
@media (max-width: 480px) {
	.espy-shell { padding: 14px 12px 36px; }
	.espy-crumb { font-size: 12px; margin-bottom: 14px; }
	.espy-hero { min-height: 190px; padding: 18px 16px; }
	.espy-hero-title { font-size: clamp(1.4rem, 7.2vw, 2rem); }
	.espy-article-body { font-size: 16px; }

	/* One column reads better than a cramped two-up. */
	.espy-cats { grid-template-columns: 1fr; }
	.espy-donut-wrap { flex-direction: column; align-items: flex-start; }
}
