/* ==========================================================================
   AMARTANGAIL.COM — homepage (loaded on the front page only)

   1. Hero            4. Timeline            7. News, events, business
   2. Quick explore   5. Tiles               8. Community band
   3. Introduction    6. Feature column
   ========================================================================== */

.at-home__heading {
	margin-bottom: var(--at-space-5);
	font-size: var(--at-text-2xl);
}

/* The footer supplies its own top margin on inner pages; the homepage's
   last band already ends with section spacing. */
.home .at-footer {
	margin-top: 0;
}

/* 1. Hero ----------------------------------------------------------------- */
.at-hero {
	position: relative;
	display: grid;
	align-items: center;
	min-height: clamp(480px, 70vw, 620px);
	overflow: hidden;
}

@media (min-width: 1024px) {
	.at-hero {
		min-height: 660px;
	}
}

.at-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A deep-green veil keeps the text readable over any photograph: even on
   narrow screens, and fading to clear on the right on wide ones. */
.at-hero--image::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 56, 50, 0.72);
}

@media (min-width: 1024px) {
	.at-hero--image::before {
		background: linear-gradient(90deg, rgba(0, 56, 50, 0.88) 0%, rgba(0, 56, 50, 0.62) 42%, rgba(0, 56, 50, 0.08) 100%);
	}
}

.at-hero__inner {
	position: relative;
	z-index: 2;
	padding-block: var(--at-space-8);
}

.at-hero__inner > * {
	max-width: 660px;
}

.at-hero__title {
	margin-bottom: var(--at-space-3);
	font-size: clamp(2.5rem, 1.6rem + 4.5vw, 4.25rem);
	line-height: 1.2;
}

.at-hero__title-accent {
	color: var(--at-gold);
}

.at-hero__tagline {
	margin-bottom: var(--at-space-5);
	font-size: var(--at-text-xl);
	line-height: 1.5;
}

.at-hero__actions {
	margin-bottom: var(--at-space-6);
}

/*
 * On a narrow phone the two buttons fit side by side in the fallback font
 * but not in the real one, so they used to jump onto two lines when the font
 * arrived and push the page down. They are stacked from the start instead.
 */
@media (max-width: 479px) {
	.at-hero__actions > .at-button {
		flex: 1 1 100%;
		justify-content: center;
	}
}

.at-hero__search .at-search {
	border-color: var(--at-white);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.at-hero__credit {
	position: absolute;
	inset-block-end: var(--at-space-2);
	inset-inline-end: var(--at-space-3);
	z-index: 2;
	margin: 0;
	padding: 2px 10px;
	border-radius: var(--at-radius-pill);
	background: rgba(0, 0, 0, 0.55);
	color: var(--at-white);
	font-size: var(--at-text-xs);
}

/* 2. Quick explore --------------------------------------------------------- */
.at-doors {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--at-space-4);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.at-doors {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.at-doors {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.at-door {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--at-space-1);
	height: 100%;
	padding: var(--at-space-5) var(--at-space-3) var(--at-space-6);
	border: 1px solid var(--at-border);
	border-radius: var(--at-radius-card);
	background: var(--at-white);
	box-shadow: var(--at-shadow-card);
	text-align: center;
	text-decoration: none;
}

.at-door:hover {
	border-color: var(--at-green);
}

.at-door__icon {
	margin-bottom: var(--at-space-2);
	color: var(--at-green);
}

.at-door__title {
	color: var(--at-green-deep);
	font-size: var(--at-text-lg);
	font-weight: 700;
	line-height: 1.3;
}

.at-door__text {
	color: var(--at-text-muted);
	font-size: var(--at-text-sm);
	line-height: 1.5;
}

.at-door__arrow {
	position: absolute;
	inset-block-end: var(--at-space-2);
	inset-inline-end: var(--at-space-3);
	color: var(--at-gold-ink);
}

/* 3. Introduction ----------------------------------------------------------- */
.at-intro {
	align-items: center;
}

.at-intro__text > p {
	max-width: 62ch;
}

.at-intro__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: var(--at-space-5) var(--at-space-3);
	padding: var(--at-space-6) var(--at-space-4);
	border: 1px solid var(--at-border);
	border-radius: var(--at-radius-card-lg);
	background: var(--at-white);
	box-shadow: var(--at-shadow-card);
}

/* 4. Timeline: a vertical line on narrow screens, horizontal on wide ------- */
.at-timeline {
	display: grid;
	gap: var(--at-space-5);
	margin: 0;
	padding: 0 0 0 var(--at-space-5);
	border-inline-start: 2px solid var(--at-gold);
	list-style: none;
}

.at-timeline__item {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.at-timeline__dot {
	position: absolute;
	inset-block-start: 0.45em;
	inset-inline-start: calc(-1 * var(--at-space-5) - 8px);
	width: 14px;
	height: 14px;
	border: 3px solid var(--at-parchment);
	border-radius: 50%;
	background: var(--at-gold-ink);
	box-shadow: 0 0 0 2px var(--at-gold);
}

.at-timeline__name {
	color: var(--at-green-deep);
	font-size: var(--at-text-lg);
	font-weight: 700;
	line-height: 1.3;
}

.at-timeline__text {
	color: var(--at-text-muted);
	font-size: var(--at-text-sm);
}

@media (min-width: 768px) {
	.at-timeline {
		grid-auto-columns: minmax(150px, 1fr);
		grid-auto-flow: column;
		gap: var(--at-space-4);
		padding: var(--at-space-6) 0 var(--at-space-2);
		overflow-x: auto;
		border-inline-start: 0;
		border-top: 2px solid var(--at-gold);
	}

	.at-timeline__item {
		align-items: center;
		text-align: center;
	}

	.at-timeline__dot {
		inset-block-start: calc(-1 * var(--at-space-6) - 8px);
		inset-inline-start: calc(50% - 7px);
	}
}

/* 5. Tiles ------------------------------------------------------------------ */
.at-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--at-space-4);
}

@media (min-width: 600px) {
	.at-tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.at-tiles {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.at-tiles--small {
	/* Whole rows only (TD-173): two to a row on phones, then the count set by the template. */
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--at-space-3);
	margin-top: var(--at-space-4);
}

.at-tile {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--at-border);
	border-radius: var(--at-radius-card);
	background: var(--at-white);
}

.at-tile:hover {
	border-color: var(--at-green);
}

.at-tile:focus-within {
	outline: 3px solid var(--at-focus);
	outline-offset: 2px;
}

.at-tile__media {
	aspect-ratio: 3 / 2;
	background: var(--at-bg);
}

.at-tile__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.at-tile__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--at-space-2);
	margin: 0;
	padding: var(--at-space-3);
	font-size: var(--at-text-base);
	line-height: 1.35;
}

@media (min-width: 600px) {
	.at-tiles--small {
		grid-template-columns: repeat(var(--at-tile-cols, 4), minmax(0, 1fr));
	}
}

.at-tiles--small .at-tile__title {
	padding: var(--at-space-2);
	font-size: var(--at-text-sm);
}

.at-tile__arrow {
	color: var(--at-gold-ink);
}

/* 6. Feature column: one large entry, tiles below --------------------------- */
.at-feature {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 280px;
	overflow: hidden;
	border-radius: var(--at-radius-card-lg);
}

.at-feature:focus-within {
	outline: 3px solid var(--at-green-deep);
	outline-offset: 2px;
}

.at-feature__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Darkens the lower part of the photograph, where the text sits. */
.at-feature__image + .at-feature__body {
	background: linear-gradient(0deg, rgba(0, 56, 50, 0.92) 0%, rgba(0, 56, 50, 0.7) 60%, rgba(0, 56, 50, 0) 100%);
}

.at-feature__body {
	position: relative;
	width: 100%;
	padding: var(--at-space-8) var(--at-space-5) var(--at-space-5);
}

.at-feature__lede {
	max-width: 34ch;
	margin-bottom: var(--at-space-3);
	font-size: var(--at-text-lg);
	line-height: 1.5;
}

.at-feature__title {
	margin: 0;
	font-size: var(--at-text-xl);
}

.at-feature__meta {
	margin: var(--at-space-1) 0 0;
	color: var(--at-on-deep-muted);
	font-size: var(--at-text-sm);
}

.at-feature-column__more {
	margin: var(--at-space-5) 0 0;
}

/* 7. News, events, business -------------------------------------------------- */
.at-now {
	display: grid;
	gap: var(--at-space-7) var(--at-space-6);
}

@media (min-width: 1024px) {
	.at-now {
		grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	}

	.at-now__news {
		grid-column: span 2;
	}
}

.at-now__news-grid {
	display: grid;
	gap: var(--at-space-5);
}

@media (min-width: 600px) {
	.at-now__news-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.at-now__news-list {
	display: grid;
	align-content: start;
	gap: var(--at-space-4);
}

.at-event:focus-within {
	outline: 3px solid var(--at-focus);
	outline-offset: 4px;
	border-radius: var(--at-radius-button);
}

.at-event__title {
	margin: 0;
	font-size: var(--at-text-base);
	line-height: 1.4;
}

.at-event__place {
	margin: var(--at-space-1) 0 0;
	color: var(--at-text-muted);
	font-size: var(--at-text-sm);
}

.at-event:hover .at-card__link,
.at-tile:hover .at-card__link {
	color: var(--at-green);
}

.at-events {
	display: grid;
	gap: var(--at-space-4);
	margin: 0 0 var(--at-space-5);
	padding: 0;
	list-style: none;
}

.at-event {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--at-space-3);
	padding: var(--at-space-3);
	border: 1px solid var(--at-border);
	border-radius: var(--at-radius-card);
	background: var(--at-white);
}

.at-event__date {
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: var(--at-radius-button);
	background: var(--at-error);
	color: var(--at-white);
	line-height: 1.15;
}

.at-event__day {
	font-size: var(--at-text-xl);
	font-weight: 700;
}

.at-event__month {
	font-size: var(--at-text-xs);
}

.at-now__business-links {
	margin: var(--at-space-4) 0 0;
}

/* 8. Community band ----------------------------------------------------------- */
.at-band {
	padding: var(--at-space-7) var(--at-space-5);
	border-radius: var(--at-radius-card-lg);
}

@media (min-width: 768px) {
	.at-band {
		padding: var(--at-space-8) var(--at-space-7);
	}
}

.at-band__title {
	font-size: var(--at-text-2xl);
}

.at-band__text {
	max-width: 48ch;
	color: var(--at-on-deep-muted);
	font-size: var(--at-text-lg);
}

.at-band > :last-child {
	margin-bottom: 0;
}

/* A period with history entries links to them. */
a.at-timeline__name {
	text-decoration: underline;
	text-decoration-color: var(--at-gold);
	text-underline-offset: 0.2em;
}

a.at-timeline__name:hover {
	color: var(--at-green);
}

/* Quick filters above a homepage row */
.at-home__pills {
	margin-bottom: var(--at-space-5);
}

/* A period's picture, round, above its marker on the line */
.at-timeline__image {
	width: 72px;
	height: 72px;
	border: 3px solid var(--at-white);
	border-radius: 50%;
	box-shadow: 0 0 0 2px var(--at-gold);
	object-fit: cover;
}

@media (min-width: 768px) {
	.at-timeline__image {
		width: 88px;
		height: 88px;
		margin-bottom: var(--at-space-2);
	}

	/* The line then runs under the pictures: move it from the top edge to the dots. */
	.at-timeline:has(.at-timeline__image) {
		padding-top: 0;
		border-top: 0;
	}

	.at-timeline:has(.at-timeline__image) .at-timeline__dot {
		position: static;
		margin-bottom: var(--at-space-2);
	}
}

/* Two community panels side by side on wide screens */
.at-bands {
	display: grid;
	gap: var(--at-space-5);
}

@media (min-width: 1024px) {
	.at-bands {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Upazilas: the district map beside the grid on a wide screen, above it on a narrow one. */
.at-home__upazilas {
	display: grid;
	gap: var(--at-space-6);
	align-items: start;
}

.at-home__upazilas .at-map__svg {
	max-width: 440px;
	margin-inline: auto;
}

@media (min-width: 1024px) {
	.at-home__upazilas {
		grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
	}
}
