/* =============================================================================
   IC base polish. Phoenix base (ic-theme-base.css) already sets Bootstrap's
   reboot + typography + utilities. This file adds small niceties on top:
   antialiasing, scrollbar, selection color, loading-fade.
   ============================================================================= */

html {
	/* Reserve the scrollbar gutter so the page doesn't shift when the
	   offcanvas scroll-lock hides the main scrollbar. Prevents the sticky
	   sidebar (and any other sticky content) from repositioning when a
	   drawer opens. */
	scrollbar-gutter: stable;
}
html, body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	/* Inter — enable the designer-recommended character variants for crisper
	   rendering at UI sizes (alt 1, 4, 6/9/7 shapes, disambiguated l/r/t). */
	font-feature-settings: "cv02", "cv03", "cv04", "cv11", "calt", "ss01";
	font-variant-ligatures: common-ligatures contextual;
	font-optical-sizing: auto;
	letter-spacing: -0.005em;
	/* Prevent any stray child from triggering horizontal scroll on mobile. */
	overflow-x: clip;
	max-width: 100%;
}
/* Scope fluid-media only to content regions — and only cap max-width so that
   explicit height attributes (logos, icons) still win.  Individual images
   can add class="w-auto" to opt out of the max-width cap if needed. */
.ic-content img,
.ic-content video,
.ic-content svg:not(.fa-icon),
.ic-content canvas { max-width: 100%; }

/* Inherit smoothing on common interactive elements so Safari doesn't re-bold them */
button, input, select, textarea, .btn, .form-control, .nav-link, .dropdown-item {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: inherit;
}

::selection {
	background: color-mix(in srgb, var(--ic-primary) 30%, transparent);
	color: var(--ic-body-color, var(--bs-body-color));
}

/* -----------------------------------------------------------------------------
   Body-copy links — brand purple (#c075e1) with a left-to-right underline that
   animates in on hover.

   Scoped narrowly: only anchors inside typographic elements (p, li, dd,
   blockquote, figcaption) OR inside an explicit `.ic-prose` zone get the
   animated underline.  Wrapper anchors (cards, list rows, surface-style
   click targets) live in plain <div> / <a><article> markup and are
   automatically excluded — no per-card override needed.

   The `:not(.btn)` chain still excludes link-styled buttons / nav controls
   that might appear inline inside copy.
-------------------------------------------------------------------------------*/
:where(p, li, dd, blockquote, figcaption, .ic-prose) a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):not(.breadcrumb-item a):not(.ic-sidebar__link):not(.navbar-brand) {
	--ic-link-color: #c075e1;
	color: var(--ic-link-color);
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0% 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 240ms var(--ic-easing, cubic-bezier(.2,.8,.2,1)),
	            color 160ms var(--ic-easing, ease);
	padding-bottom: 1px;
}
:where(p, li, dd, blockquote, figcaption, .ic-prose) a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):not(.breadcrumb-item a):not(.ic-sidebar__link):not(.navbar-brand):hover,
:where(p, li, dd, blockquote, figcaption, .ic-prose) a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.list-group-item):not(.breadcrumb-item a):not(.ic-sidebar__link):not(.navbar-brand):focus {
	color: var(--ic-link-color);
	background-size: 100% 1px;
}

::-webkit-scrollbar        { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb  { background: color-mix(in srgb, var(--ic-body-color, var(--bs-body-color)) 18%, transparent); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ic-body-color, var(--bs-body-color)) 30%, transparent); }

body.loading { opacity: 0; }
body         { opacity: 1; transition: opacity var(--ic-motion, 180ms) var(--ic-easing, ease); }

/* iOS auto-zoom-on-focus fix: Safari on iOS zooms the viewport when an
   input has font-size < 16px. Force 16px on touch devices for inputs,
   textareas, and selects to suppress the zoom. Desktop styling is
   unaffected (pointer-fine devices skip this block). */
@media (hover: none) and (pointer: coarse) {
	input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
	textarea,
	select,
	.form-control,
	.form-select {
		font-size: 16px !important;
	}
	.form-floating > .form-control,
	.form-floating > .form-select {
		min-height: 3.4rem;
	}
}
