/* ============================================================
   FRONT PAGE — "Sri Lanka at a Glance" Section
   File   : assets/css/components/front-page-glance.css
   Author : tourwill-theme
   Note   : Mobile-first. Breakpoints: 480px / 640px / 1024px / 1280px
   ============================================================ */


/* ── 1. LOCAL CSS CUSTOM PROPERTIES ─────────────────────────
   These mirror the theme's global variables but are scoped
   here so the section is self-contained and easy to restyle.
   ─────────────────────────────────────────────────────────── */
.glance-section {
	--g-teal:         #134e4a;
	--g-teal-mid:     #0f766e;
	--g-teal-light:   rgba(19, 78, 74, 0.08);
	--g-teal-border:  rgba(19, 78, 74, 0.12);
	--g-gold:         #eab308;
	--g-gold-dark:    #ca8a04;
	--g-bg:           #f9fafb;
	--g-card-bg:      rgba(255, 255, 255, 0.88);
	--g-text:         #1c1917;
	--g-muted:        #78716c;
	--g-radius-lg:    24px;
	--g-radius-md:    20px;
	--g-radius-sm:    12px;
	--g-shadow-card:  0 2px 16px rgba(19, 78, 74, 0.07);
	--g-shadow-hover: 0 14px 44px rgba(19, 78, 74, 0.14);
}


/* ── 2. SECTION WRAPPER ──────────────────────────────────────
   Mobile-first: generous vertical padding that grows on desktop
   ─────────────────────────────────────────────────────────── */
.glance-section {
	position: relative;
	background-color: var(--g-bg);
	padding: 64px 0 64px;
	overflow: hidden;
}

/* Subtle grain texture overlay (100 % CSS — no extra image asset) */
.glance-section::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
	pointer-events: none;
	z-index: 0;
}



/* ── 3. CONTAINER ─────────────────────────────────────────────
   Responsive centred wrapper
   ─────────────────────────────────────────────────────────── */
.glance-container {
	position: relative;
	z-index: 1;
	width: 92%;
	max-width: 1200px;
	margin-inline: auto;
}


/* ── 4. SECTION HEADER ───────────────────────────────────────
   Centred title + subtitle block
   ─────────────────────────────────────────────────────────── */
.glance-header {
	text-align: center;
	margin-bottom: 40px;

	/* Entrance animation — starts hidden, JS adds .is-visible */
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.65s ease, transform 0.65s ease;
}

.glance-header.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Ornament SVG (flower) */
.glance-header__ornament {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.glance-header__ornament svg,
.glance-header__ornament img {
	width: 42px;
	height: 42px;
	color: var(--g-gold);
	fill: var(--g-gold);
}

/* Main headline */
.glance-header__title {
	font-size: clamp(2rem, 7vw, 3.25rem);
	font-weight: 600;
	color: var(--g-teal);
	line-height: 1.1;
	margin: 0 0 18px;
	letter-spacing: -0.025em;
}

/* Section eyebrow — handwritten kicker above the title */
.glance-header__eyebrow {
	color: var(--g-gold);
	margin-bottom: 8px;
	display: block;
}

/* Subtitle / subheading */
.glance-header__subtitle {
	font-size: clamp(0.9rem, 2.2vw, 1.05rem);
	color: var(--g-muted);
	max-width: 580px;
	margin-inline: auto;
	line-height: 1.75;
}


/* ── 5. BODY — SPLIT GRID ─────────────────────────────────────
   Mobile: single column (collage first, cards below)
   Desktop (≥1024px): 2-column side-by-side
   ─────────────────────────────────────────────────────────── */
.glance-body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: start;
}

/* When admin has hidden the collage (master toggle off, or all 4
 * tiles individually hidden), force a single full-width column for
 * the fact cards. This rule needs to win at every breakpoint, hence
 * the more specific selector. */
.glance-body.glance-body--no-collage,
.glance-body--no-collage {
	grid-template-columns: 1fr !important;
}
.glance-body--no-collage .glance-cards {
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
}


/* ── 6. IMAGE COLLAGE (LEFT PANEL) ────────────────────────────
   4-image mosaic with gradient overlay + floating badge
   ─────────────────────────────────────────────────────────── */
.glance-collage {
	position: relative;
	border-radius: var(--g-radius-lg);
	overflow: hidden;

	/* Entrance animation */
	opacity: 0;
	transform: translateX(-28px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.glance-collage.is-visible {
	opacity: 1;
	transform: translateX(0);
}

/* 2-column mosaic grid */
.glance-collage__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 180px 180px 180px;
	gap: 6px;
}

/* Individual photo cells */
.glance-collage__item {
	position: relative;
	overflow: hidden;
	background-color: #e7e5e4; /* placeholder colour while image loads */
}

.glance-collage__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glance-collage__item:hover img {
	transform: scale(1.07);
}

/* ── Grid placement of each photo ── */

/* Photo 1 (Sigiriya / hero) — spans 2 rows on left side */
.glance-collage__item--1 {
	grid-column: 1 / 2;
	grid-row: 1 / 3;
}

/* Photo 2 (Wildlife) — top-right */
.glance-collage__item--2 {
	grid-column: 2 / 3;
	grid-row: 1 / 2;
}

/* Photo 3 (Train) — mid-right */
.glance-collage__item--3 {
	grid-column: 2 / 3;
	grid-row: 2 / 3;
}

/* Photo 4 (Beach / Galle) — bottom full-width */
.glance-collage__item--4 {
	grid-column: 1 / -1;
	grid-row: 3 / 4;
}

/* Gradient overlay — teal fade from bottom-left */
.glance-collage__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		145deg,
		rgba(19, 78, 74, 0.55) 0%,
		rgba(19, 78, 74, 0.15) 45%,
		transparent 70%
	);
	pointer-events: none;
	border-radius: var(--g-radius-lg);
}

/* Floating text badge — bottom-left of collage */
.glance-collage__badge {
	position: absolute;
	bottom: 24px;
	left: 22px;
	z-index: 2;
	line-height: 1.2;
	pointer-events: none;
}

.glance-collage__badge-sub {
	display: block;
	font-size: clamp(1rem, 2.2vw, 1.25rem);
	font-weight: 600;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.glance-collage__badge-main {
	display: block;
	font-size: clamp(1.5rem, 4vw, 2.25rem);
	font-weight: 800;
	font-style: italic;
	color: var(--g-gold);
	text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
	letter-spacing: -0.01em;
}


/* ── 7. FACT CARDS GRID (RIGHT PANEL) ─────────────────────────
   Mobile: single column
   Tablet (≥640px): 2 columns
   ─────────────────────────────────────────────────────────── */
.glance-cards {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}


/* ── 8. INDIVIDUAL FACT CARD ──────────────────────────────────
   Glass-morphism card with icon + text body
   ─────────────────────────────────────────────────────────── */
.glance-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	background: var(--g-card-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--g-teal-border);
	border-radius: var(--g-radius-md);
	padding: 20px 20px;
	box-shadow: var(--g-shadow-card);
	cursor: default;

	/* Entrance animation state (overridden when .is-visible applied by JS) */
	opacity: 0;
	transform: translateY(22px);
	transition:
		opacity  0.55s ease,
		transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
		box-shadow 0.3s ease,
		border-color 0.3s ease;
	will-change: transform, opacity;
}

/* Card revealed */
.glance-card.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Hover lift (only after card is visible) */
.glance-card.is-visible:hover {
	transform: translateY(-6px);
	box-shadow: var(--g-shadow-hover);
	border-color: rgba(234, 179, 8, 0.40);
}


/* ── 8a. ICON BUBBLE ──────────────────────────────────────── */
.glance-card__icon {
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	min-width: 52px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glance-card.is-visible:hover .glance-card__icon {
	transform: scale(1.14) rotate(-8deg);
}

.glance-card__icon svg {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

/* Colour variants */
.glance-card--icon-teal .glance-card__icon {
	background-color: var(--g-teal);
	color: #ffffff;
}

.glance-card--icon-gold .glance-card__icon {
	background-color: var(--g-gold);
	color: #ffffff;
}


/* ── 8b. CARD TEXT BODY ───────────────────────────────────── */
.glance-card__body {
	flex: 1;
	min-width: 0;
}

.glance-card__title {
	font-size: 0.975rem;
	font-weight: 700;
	color: var(--g-teal);
	margin: 0 0 8px;
	line-height: 1.35;
}

/* Gold accent divider */
.glance-card__divider {
	width: 28px;
	height: 2px;
	background-color: var(--g-gold);
	border-radius: 2px;
	margin-bottom: 8px;
	transition: width 0.35s ease;
}

.glance-card.is-visible:hover .glance-card__divider {
	width: 44px;
}

.glance-card__desc {
	font-size: 0.855rem;
	color: var(--g-muted);
	line-height: 1.7;
	margin: 0;
}


/* ── 9. CTA BAR ───────────────────────────────────────────────
   Bottom strip: icon + label + button
   ─────────────────────────────────────────────────────────── */
.glance-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	margin-top: 40px;
	padding: 24px 22px;
	background: var(--g-card-bg);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1.5px dashed rgba(19, 78, 74, 0.22);
	border-radius: var(--g-radius-md);
	text-align: center;

	/* Entrance animation */
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.glance-cta.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Round icon container */
.glance-cta__icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--g-teal-light);
	border: 1.5px dashed var(--g-teal-border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--g-teal);
}

/* CTA label text */
.glance-cta__label {
	font-size: 1rem;
	font-weight: 600;
	color: var(--g-teal);
	margin: 0;
}

/* CTA button */
.glance-cta__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 28px;
	background-color: var(--g-gold);
	color: #1c1917;
	font-size: 0.95rem;
	font-weight: 700;
	border-radius: 50px;
	text-decoration: none;
	letter-spacing: 0.01em;
	white-space: nowrap;
	transition:
		background-color 0.3s ease,
		color            0.3s ease,
		transform        0.3s ease,
		box-shadow       0.3s ease;
}

.glance-cta__btn:hover,
.glance-cta__btn:focus-visible {
	background-color: var(--g-teal);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 8px 26px rgba(19, 78, 74, 0.28);
	outline: none;
}

.glance-cta__btn:focus-visible {
	outline: 2px solid var(--g-gold);
	outline-offset: 3px;
}

/* Arrow nudge on hover */
.glance-cta__btn-arrow {
	display: inline-block;
	transition: transform 0.3s ease;
}

.glance-cta__btn:hover .glance-cta__btn-arrow,
.glance-cta__btn:focus-visible .glance-cta__btn-arrow {
	transform: translateX(5px);
}


/* ════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════ */

/* ── 480px — Small phone improvements ───────────────────── */
@media (min-width: 480px) {

	.glance-collage__grid {
		grid-template-rows: 200px 200px 200px;
	}
}


/* ── 640px — Tablet / large phone ───────────────────────── */
@media (min-width: 640px) {

	.glance-cards {
		grid-template-columns: 1fr 1fr;
		gap: 14px;
	}

	.glance-cta {
		flex-direction: row;
		text-align: left;
		gap: 18px;
	}

	.glance-cta__btn {
		margin-left: auto;
	}

	.glance-card__title {
		font-size: 1rem;
	}
}


/* ── 1024px — Desktop layout (main split) ────────────────── */
@media (min-width: 1024px) {

	.glance-section {
		padding: 100px 0;
	}

	.glance-header {
		margin-bottom: 56px;
	}

	.glance-body {
		grid-template-columns: 1fr 1fr;
		gap: 40px;
		align-items: center;
	}

	.glance-collage__grid {
		grid-template-rows: 185px 185px 185px;
		gap: 8px;
	}

	.glance-cards {
		grid-template-columns: 1fr 1fr;
		gap: 16px;
		align-content: start;
	}

	.glance-card {
		padding: 20px 20px;
	}

	.glance-cta {
		margin-top: 48px;
	}
}


/* ── 1280px — Wide desktop ────────────────────────────────── */
@media (min-width: 1280px) {

	.glance-body {
		grid-template-columns: 460px 1fr;
		gap: 52px;
	}

	.glance-collage__grid {
		grid-template-rows: 200px 200px 200px;
	}

	.glance-card {
		padding: 22px 22px;
	}

	.glance-card__title {
		font-size: 1.05rem;
	}

	.glance-card__desc {
		font-size: 0.88rem;
	}
}


/* ── Reduced-motion: disable all transitions + animations ─── */
@media (prefers-reduced-motion: reduce) {

	.glance-header,
	.glance-collage,
	.glance-card,
	.glance-cta {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.glance-collage__item img {
		transition: none;
	}

	.glance-card__divider {
		transition: none;
	}
}