/* Mobile repair layer: loaded last to normalize the legacy responsive rules. */

@media screen and (max-width: 767px) {
	html,
	body,
	#page,
	.body,
	#primary {
		max-width: 100%;
		overflow-x: clip;
	}

	img,
	video,
	iframe {
		max-width: 100%;
	}

	.afg-container,
	.afg-header--refined .afg-container,
	.afg-services .afg-container {
		width: calc(100% - 24px);
		max-width: none;
	}

	.afg-section {
		padding-block: 46px;
	}

	.afg-section-head {
		margin-bottom: 22px;
	}

	.afg-section-head h2,
	.afg-about__content h2 {
		font-size: clamp(22px, 7vw, 28px);
		line-height: 1.55;
	}

	.afg-header--refined .afg-mainbar__inner {
		position: relative;
		justify-content: space-between;
		gap: 8px;
		min-height: 72px;
	}

	.afg-header--refined .afg-brand {
		position: static;
		flex: 0 1 auto;
		min-width: 0;
		max-width: calc(50% - 28px);
		margin-inline-end: auto;
	}

	.afg-header--refined .afg-brand img {
		position: absolute;
		left: 50%;
		width: 44px;
		height: 44px;
		transform: translateX(-50%);
	}

	.afg-header--refined .afg-brand__copy {
		min-width: 0;
		padding-inline-start: 0;
		border-inline-start: 0;
		overflow: visible;
	}

	.afg-header--refined .afg-brand__copy strong {
		overflow: visible;
		font-size: 12px;
		line-height: 1.45;
		text-overflow: clip;
		white-space: normal;
	}

	.afg-header--refined .afg-header-actions {
		display: none;
	}

	.afg-header--refined .afg-header-action,
	.afg-header--refined .afg-mobile-toggle,
	.afg-header--refined .afg-mobile-nav__close {
		min-width: 44px;
		min-height: 44px;
	}

	.afg-header--refined .afg-mobile-nav {
		flex: 0 0 auto;
		margin-inline-start: auto;
	}

	#Header2.afg-header--refined.is-compact .afg-brand img {
		transform: translateX(-50%) scale(.88);
	}

	.afg-header--refined .afg-mobile-toggle {
		justify-content: center;
	}

	.afg-header--refined .afg-mobile-nav__panel {
		top: 0;
		bottom: 0;
		width: min(390px, calc(100vw - 16px));
		max-width: 100%;
		max-height: none;
		padding: 18px;
	}

	.afg-header--refined .afg-mobile-actions a,
	.afg-header--refined .afg-mobile-actions button,
	.afg-header--refined .afg-mobile-submenu a {
		min-height: 44px;
	}

	.afg-hero[data-afg-hero] .afg-hero-arrow {
		width: 44px;
		height: 44px;
	}

	.afg-alert-strip__items,
	.afg-alert-strip__items a {
		min-height: 44px;
	}

	.afg-link-more {
		min-height: 44px;
		padding-block: 8px;
	}

	.afg-btn {
		min-height: 48px;
	}

	.afg-quick-item {
		min-height: 48px;
	}

	.afg-news-mini {
		position: relative;
	}

	.afg-news-mini h3 a::after {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
	}

	.afg-about__grid {
		gap: 26px;
	}

	.afg-rich-text {
		font-size: 15px;
		line-height: 2;
	}

	.afg-stats-grid {
		gap: 8px;
		padding: 10px;
	}

	.afg-stat-card {
		min-height: 126px;
		padding: 12px 8px;
	}

	.afg-stat-card strong {
		font-size: 22px;
	}

	.afg-stat-card span {
		font-size: 12px;
	}

	#footer .mycust {
		width: calc(100% - 32px);
		margin-inline: auto;
	}

	#footer .mycust .row {
		margin-inline: 0;
	}

	#footer .mycust :is(a, .link-hover-style-1) {
		display: inline-flex;
		align-items: center;
		min-height: 40px;
		padding-block: 5px;
	}
}

@media screen and (max-width: 430px) {
	.afg-header--refined .afg-header-action--primary {
		width: 44px;
		max-width: 44px;
		padding: 0;
	}

	.afg-header--refined .afg-header-action--primary span,
	.afg-header--refined .afg-menu-text {
		display: none;
	}

	.afg-header--refined .afg-mobile-toggle {
		width: 44px;
		padding: 0;
	}

	.afg-header--refined .afg-brand {
		max-width: calc(100% - 104px);
	}

	.afg-header--refined .afg-brand__copy strong {
		font-size: 11.5px;
	}

	.afg-news-mini {
		grid-template-columns: 96px minmax(0, 1fr);
	}
}

@media screen and (max-width: 350px) {
	.afg-header--refined .afg-brand__copy {
		display: none;
	}

	.afg-header--refined .afg-brand {
		max-width: none;
	}

	.afg-service-grid {
		grid-template-columns: 1fr;
	}

	.afg-stats-grid {
		grid-template-columns: 1fr;
	}
}

/* Homepage mobile composition: compact, swipeable and content-first. */
@media screen and (max-width: 767px) {
	.afg-section {
		padding-block: 40px;
	}

	.afg-section.afg-services {
		padding-block: 28px 32px;
	}

	.afg-section-head {
		margin-bottom: 18px;
	}

	.afg-section-head h2,
	.afg-about__content h2 {
		font-size: clamp(21px, 6.4vw, 26px);
		line-height: 1.5;
		text-wrap: balance;
	}

	.afg-section-head p:not(.afg-eyebrow),
	.afg-book-showcase__intro {
		font-size: 14px;
		line-height: 1.85;
	}

	/* Hero: compact image-first composition with copy over the artwork. */
	.afg-hero[data-afg-hero] {
		height: clamp(270px, 72vw, 340px);
		min-height: 270px;
		background: #102a61;
	}

	.afg-hero[data-afg-hero] .afg-hero-slide__image {
		top: 0;
		bottom: 0;
		height: 100%;
		object-position: center;
	}

	.afg-hero[data-afg-hero] .afg-hero-image-trigger {
		inset: 0;
		height: 100%;
	}

	.afg-hero[data-afg-hero] .afg-hero-slide::after {
		inset: 0;
		height: 100%;
		background: linear-gradient(180deg, rgba(7, 18, 45, .02) 38%, rgba(7, 18, 45, .72) 100%);
	}

	.afg-hero[data-afg-hero] .afg-hero__grid {
		position: absolute;
		inset: 0;
		grid-template-columns: minmax(0, 1fr);
		align-items: end;
		justify-items: center;
		width: 100%;
		height: 100%;
		padding: 0 58px 18px;
		background: transparent;
		pointer-events: none;
	}

	.afg-hero[data-afg-hero] .afg-hero-copy,
	.afg-hero[data-afg-hero] .afg-hero-copy.is-active {
		display: flex;
		align-items: center;
		justify-content: center;
		width: fit-content;
		max-width: 100%;
		min-height: 44px;
		padding: 8px 16px;
		border: 1px solid rgba(255, 255, 255, .12);
		border-radius: 11px;
		background: rgba(38, 43, 51, .96);
		box-shadow: 0 8px 22px rgba(5, 13, 32, .24);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		pointer-events: auto;
	}

	.afg-hero[data-afg-hero] .afg-hero-copy::before {
		display: none;
	}

	.afg-hero[data-afg-hero] :is(h1, h2) {
		display: block;
		-webkit-line-clamp: unset;
		overflow: visible;
		max-width: none;
		margin: 0;
		font-size: 15px;
		line-height: 1.65;
		text-align: center;
	}

	.afg-hero[data-afg-hero] .afg-hero-copy > p {
		display: none;
	}

	.afg-hero[data-afg-hero] .afg-hero-preview-btn {
		display: none;
	}

	.afg-hero[data-afg-hero] .afg-hero-dots {
		display: none;
	}

	.afg-hero[data-afg-hero] .afg-hero-arrow {
		top: 50%;
		width: 44px;
		height: 44px;
		margin-top: -22px;
		background: rgba(7, 18, 45, .62);
		touch-action: manipulation;
	}

	/* Services stay scannable in two columns, including narrow phones. */
	.afg-service-grid,
	.afg-stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.afg-service-grid {
		gap: 8px;
	}

	.afg-service-card {
		min-height: 108px;
		padding: 12px 8px;
	}

	.afg-service-card span {
		width: 38px;
		height: 38px;
		margin-bottom: 7px;
	}

	.afg-service-card strong {
		font-size: 13px;
	}

	.afg-service-card small {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		font-size: 11px;
		line-height: 1.65;
	}

	/* High-volume lists become short, touch-friendly horizontal rails. */
	.afg-quick-list {
		grid-template-rows: repeat(2, minmax(54px, auto));
		grid-auto-flow: column;
		grid-auto-columns: min(76vw, 270px);
		gap: 8px;
		overflow-x: auto;
		padding: 12px;
		scroll-padding-inline: 12px;
		scroll-snap-type: inline mandatory;
		overscroll-behavior-inline: contain;
	}

	.afg-quick-item {
		height: 100%;
		min-height: 54px;
		padding: 7px 9px;
		border-color: #e8edf4;
		background: #fbfcfe;
		scroll-snap-align: start;
	}

	.afg-news-columns {
		gap: 18px;
		padding: 12px;
	}

	.afg-news-list {
		grid-template-columns: repeat(4, min(78vw, 300px));
		grid-template-rows: auto auto;
		grid-auto-flow: column;
		gap: 9px;
		overflow-x: auto;
		padding-bottom: 5px;
		scroll-snap-type: inline mandatory;
		overscroll-behavior-inline: contain;
	}

	.afg-news-list-title {
		grid-row: 1;
		margin-bottom: 2px;
	}

	.afg-news-mini {
		grid-row: 2;
		grid-template-columns: 96px minmax(0, 1fr);
		min-height: 116px;
		scroll-snap-align: start;
	}

	.afg-news-mini__media,
	.afg-news-mini__media img {
		min-height: 116px;
	}

	.afg-news-mini__body {
		padding: 9px 10px;
	}

	.afg-news-mini p {
		display: none;
	}

	/* Academic calendar: one horizontal timeline instead of six tall cards. */
	#taghvim.afg-calendar-section,
	.afg-calendar-section {
		padding-block: 32px;
	}

	.afg-calendar-section__inner {
		width: calc(100% - 24px);
		padding: 17px;
		border-radius: 18px;
	}

	.afg-calendar-section__head {
		gap: 13px;
		margin-bottom: 17px;
		padding-bottom: 14px;
	}

	.afg-calendar-section h2 {
		font-size: 21px;
		line-height: 1.55;
	}

	.afg-header-text p {
		font-size: 13px;
		line-height: 1.75;
	}

	.afg-status-legend {
		width: auto;
		gap: 7px 12px;
		justify-content: flex-start;
		padding: 7px 10px;
	}

	.afg-status-legend .legend-item {
		gap: 5px;
		font-size: 11px;
	}

	.afg-status-legend .dot {
		width: 8px;
		height: 8px;
	}

	.afg-academic-timeline-wrapper {
		margin-inline: -17px;
	}

	.afg-calendar-section .afg-academic-timeline {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: min(76vw, 272px);
		gap: 10px;
		overflow-x: auto;
		padding: 2px 17px 9px;
		scroll-padding-inline: 17px;
		scroll-snap-type: inline mandatory;
		overscroll-behavior-inline: contain;
	}

	.afg-calendar-section .timeline-step-card {
		min-height: 188px;
		padding: 15px;
		border-radius: 14px;
		scroll-snap-align: start;
	}

	.afg-calendar-section .timeline-step-card:hover {
		transform: none;
	}

	.afg-calendar-section .timeline-step-card .card-header {
		margin-bottom: 10px;
	}

	.afg-calendar-section .date-display {
		margin-bottom: 8px;
	}

	.afg-calendar-section .day-num {
		font-size: 27px;
	}

	.afg-calendar-section .event-desc {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		font-size: 12px;
		line-height: 1.7;
	}

	.afg-calendar-section .timeline-step-card[aria-current="step"] {
		box-shadow: 0 12px 26px rgba(180, 83, 9, .16);
		scroll-snap-align: center;
	}

	.afg-research {
		padding-top: 58px;
	}

	/* Achievements and gallery use the same swipe pattern. */
	.afg-compact-grid,
	.afg-gallery-grid {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: min(82vw, 310px);
		gap: 11px;
		overflow-x: auto;
		padding: 2px 1px 8px;
		scroll-snap-type: inline mandatory;
		overscroll-behavior-inline: contain;
	}

	.afg-compact-card,
	.afg-gallery-card {
		scroll-snap-align: start;
	}

	.afg-compact-card > a {
		height: 156px;
	}

	.afg-compact-card > div {
		padding: 14px;
	}

	.afg-gallery-card {
		min-height: 205px;
	}

	/* Keep the publication feature useful without dominating the page. */
	.afg-book-showcase .afg-section-head {
		gap: 5px;
		margin-bottom: 18px;
	}

	.afg-book-showcase .afg-link-more {
		font-weight: 950;
	}

	.afg-book-showcase__slide {
		gap: 14px;
		padding: 15px 14px 74px;
	}

	.afg-book-showcase__cover {
		padding: 10px;
		border-radius: 14px;
	}

	.afg-book-showcase__cover img {
		height: 160px;
		max-height: 160px;
		aspect-ratio: auto;
	}

	.afg-book-showcase__meta {
		margin-bottom: 6px;
	}

	.afg-book-showcase__content h3 {
		margin-bottom: 10px;
		font-size: 18px;
		line-height: 1.6;
	}

	.afg-book-showcase__content > p:not(.afg-book-showcase__meta) {
		display: none;
	}

	.afg-book-showcase__content > a {
		min-height: 44px;
	}

	.afg-book-showcase__controls {
		bottom: 12px;
	}

	.afg-book-showcase__tab {
		grid-template-columns: 50px minmax(0, 1fr);
		flex-basis: 175px;
		min-height: 68px;
	}

	.afg-book-showcase__tab img {
		width: 50px;
		height: 50px;
	}

	/* About content is summarized; the full history remains one tap away. */
	.afg-about__grid {
		gap: 20px;
	}

	.afg-rich-text p {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 6;
		overflow: hidden;
		margin-bottom: 14px;
	}

	.afg-rich-text {
		position: relative;
		max-height: 12.5em;
		overflow: hidden;
	}

	.afg-rich-text::after {
		content: "";
		position: absolute;
		right: 0;
		bottom: 0;
		left: 0;
		height: 2.8em;
		background: linear-gradient(180deg, transparent, #fff 88%);
		pointer-events: none;
	}

	.afg-about-video {
		border-radius: 13px;
	}

	.afg-stats-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
		gap: 7px;
		padding: 8px;
	}

	.afg-stat-card {
		grid-column: span 2;
		min-height: 104px;
		padding: 10px 7px;
	}

	.afg-stat-card:nth-last-child(-n + 2) {
		grid-column: span 3;
	}

	.afg-about .afg-stat-card img,
	.afg-stat-card img {
		width: 50px;
		height: 50px;
		margin-bottom: 9px;
		padding: 10px;
		border-radius: 14px;
	}

	/* Faculties become one connected navigation list. */
	.afg-faculty-grid {
		display: grid;
		grid-template-columns: 1fr;
		gap: 0;
		border: 1px solid var(--afg-border);
		border-radius: 14px;
		background: #fff;
		box-shadow: 0 8px 22px rgba(16, 42, 97, .06);
		overflow: hidden;
	}

	.afg-faculty-card {
		display: grid;
		grid-template-columns: 42px minmax(0, 1fr);
		grid-template-rows: auto auto;
		column-gap: 11px;
		min-height: 0;
		padding: 15px;
		border: 0;
		border-bottom: 1px solid var(--afg-border);
		border-radius: 0;
		box-shadow: none;
	}

	.afg-faculty-card:last-child {
		border-bottom: 0;
	}

	.afg-faculty-card > span {
		grid-row: 1 / 3;
		width: 38px;
		height: 38px;
		margin: 1px 0 0;
	}

	.afg-faculty-card h3 {
		margin: 0 0 3px;
		font-size: 15px;
		line-height: 1.7;
	}

	.afg-faculty-card p {
		font-size: 13px;
		line-height: 1.75;
	}

	.afg-final-cta {
		padding-block: 34px;
	}

	/* Legacy footer widgets share two compact columns on phones. */
	#footer .mycust .row {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px 14px;
		padding-block: 30px !important;
		margin-block: 0 !important;
	}

	#footer .mycust .row > [class*="col-"] {
		width: auto;
		max-width: none;
		margin: 0 !important;
		padding: 0;
	}

	#footer .mycust h5 {
		font-size: 14px;
		line-height: 1.7;
	}

	#footer .mycust ul {
		margin: 0;
		padding: 0;
	}

	#footer .mycust li,
	#footer .mycust a {
		font-size: 12px;
		line-height: 1.75;
	}

	#footer .mycust :is(a, .link-hover-style-1) {
		min-height: 36px;
		padding-block: 4px;
	}

	#footer .footer-logo {
		width: 72px;
		height: auto;
	}

	/* Rails stay usable but do not add visible browser chrome. */
	.afg-quick-list,
	.afg-news-list,
	.afg-calendar-section .afg-academic-timeline,
	.afg-compact-grid,
	.afg-gallery-grid {
		scrollbar-width: none;
	}

	.afg-quick-list::-webkit-scrollbar,
	.afg-news-list::-webkit-scrollbar,
	.afg-calendar-section .afg-academic-timeline::-webkit-scrollbar,
	.afg-compact-grid::-webkit-scrollbar,
	.afg-gallery-grid::-webkit-scrollbar {
		display: none;
	}
}
