/*
 * iw-info — Global Info Card (expandable + optional related-news sidebar).
 * Source: Figma 4420:144234 (file Fpt.vn 2.0 Copy).
 *
 * Layout: 2 cột trong 1 max-width container.
 *   .iw-info__main    — left card (border + bg + padding, expandable body)
 *   .iw-info__sidebar — right list (5 tag-filtered row cards)
 * Mobile: stack vertically (sidebar dưới content).
 */

.iw-info {
	padding: 80px 0 40px;
	position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
}

.iw-info .iw-info__inner {
	max-width: var(--iw-container-max);
	margin: 0 auto;
	box-sizing: border-box;
	display: flex;
	gap: 24px;
	align-items: flex-start;
}

/* `@media (max-width: 1535px)` — moved to bottom Responsive section. */

/* ===================== LEFT — content card ===================== */
.iw-info__main {
	flex: 1 1 0;
	min-width: 0;
	border: 1px solid #e7e7e7;
	border-radius: 12px;
	padding: 24px;
	background: #fff;
	box-sizing: border-box;
	position: relative;
}

.iw-info__heading {
	margin: 0 0 16px;
	font-size: 18px;
	line-height: 24px;
	font-weight: 700;
	color: #3d3d3d;
}

.iw-info__divider {
	border: 0;
	height: 1px;
	background: #e7e7e7;
	margin: 0 0 20px;
	opacity: 1;
}

.iw-info__body {
	position: relative;
	overflow: hidden;
	transition: max-height 0.4s ease;
	color: #3d3d3d;
	font-size: 16px;
	line-height: 24px;
}

.iw-info__body-inner > :first-child { margin-top: 0; }
.iw-info__body-inner > :last-child  { margin-bottom: 0; }

.iw-info__body-inner img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Bullet/số thứ tự: marker nằm "outside" — padding-left 0 đẩy marker ra ngoài
   mép trái và .iw-info__body (overflow:hidden) cắt mất → nhìn như mất bullet.
   Chỉ áp list KHÔNG class (gõ trong editor). List có class (nội dung dán từ
   Google Docs — info-default-body.html, class c1…) tự có thụt lề riêng →
   không đụng, tránh thụt lề 2 lần. */
.iw-info__body-inner ul:not([class]),
.iw-info__body-inner ol:not([class]) {
	margin: 0 0 16px;
	padding-left: 24px;
}
.iw-info__body-inner ul:not([class]) { list-style: disc; }
.iw-info__body-inner ol:not([class]) { list-style: decimal; }
.iw-info__body-inner ul:not([class]) > li:not([class]),
.iw-info__body-inner ol:not([class]) > li:not([class]) {
	margin-bottom: 8px;
}

/* Fade gradient overlay khi collapsed */
.iw-info__main.iw-info--collapsible .iw-info__body::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 120px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 60%, #fff 100%);
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.iw-info__main.iw-info--collapsible.iw-info--expanded .iw-info__body {
	max-height: none !important;
}

.iw-info__main.iw-info--collapsible.iw-info--expanded .iw-info__body::after {
	opacity: 0;
}

/* Toggle button — Figma 407:44043. Reset Flatsome `.button` defaults. */
.iw-info__main .iw-info__toggle {
	position: absolute;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 13px 24px;
	background: #fff;
	color: #3d3d3d;
	font-family: inherit;
	font-size: 16px;
	line-height: 22px;
	font-weight: 510;
	letter-spacing: 0;
	text-transform: none;
	border: 1px solid #d1d1d1;
	border-radius: 8px;
	box-shadow: none;
	cursor: pointer;
	min-height: 0;
	min-width: 0;
	z-index: 2;
}

.iw-info__main .iw-info__toggle:hover,
.iw-info__main .iw-info__toggle:focus,
.iw-info__main .iw-info__toggle:focus-visible,
.iw-info__main .iw-info__toggle:active {
	background: #fff;
	color: #3d3d3d;
	border-color: #d1d1d1;
	box-shadow: none;
}

/* Expanded: fade overlay đã ẩn → nút absolute sẽ đè dòng chữ cuối. Đưa nút về
   flow, nằm dưới body + căn giữa (tham khảo fpt.vn/internet/gia-dinh).
   Collapsed giữ absolute — nút nổi trên vùng fade như thiết kế. */
.iw-info__main.iw-info--expanded .iw-info__toggle {
	position: static;
	transform: none;
	display: flex;
	width: fit-content;
	margin: 24px auto 0;
}

/* Nội dung dán từ Word/web (inline width cố định, white-space:nowrap) không
   được tràn ra ngoài card / bị cắt mép phải trên mobile. Chỉ nhắm đúng phần
   tử có inline width / nowrap — KHÔNG ép mọi phần tử (`*`) vì sẽ đổi layout
   nội dung soạn sẵn (bảng Google Docs bị chia lại cột). Bảng giữ nguyên.
   break-word (không dùng `anywhere`): chỉ ngắt từ dài khi tràn, không đổi
   min-content → không làm co cột bảng. */
.iw-info__body-inner {
	overflow-wrap: break-word;
}
.iw-info__body-inner [style*="width"]:not(table):not(thead):not(tbody):not(tr):not(td):not(th):not(col):not(colgroup) {
	max-width: 100%;
	box-sizing: border-box;
}
.iw-info__body-inner [style*="nowrap"] {
	white-space: normal !important;
}

/* ===================== RIGHT — related news sidebar ===================== */
.iw-info__sidebar {
	flex: 0 0 336px;
	max-width: 336px;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.iw-info__sidebar-title {
	margin: 0;
	font-family: inherit;
	font-weight: 700;
	font-size: 20px;
	line-height: 28px;
	color: #3d3d3d;
}

.iw-info__sidebar-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Reset Flatsome `.col-inner ul li { margin-left: 1.3em }` + `li { margin-bottom: .6em }`.
   Specificity bump (0,2,1) bằng cách chain class để win với Flatsome rule. */
.iw-info .iw-info__sidebar-list > li {
	margin: 0;
	padding: 0;
}

.iw-info__sidebar-empty {
	margin: 0;
	padding: 16px 0;
	color: #777;
	font-size: 14px;
	font-style: italic;
}

.iw-info__sidebar-list .iw-news-card--row {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
}

.iw-info__sidebar-list .iw-news-card--row .iw-news-card__media {
	flex: 0 0 161px;
	width: 161px;
	height: 96px;
	border-radius: 8px;
	overflow: hidden;
}

.iw-info__sidebar-list .iw-news-card--row .iw-news-card__body {
	flex: 1 1 0;
	min-width: 0;
	gap: 8px;
}

.iw-info__sidebar-list .iw-news-card--row .iw-news-card__title {
	font-weight: 590;
	font-size: 14px;
	line-height: 20px;
}

/* ===================== Responsive overrides ===================== */
/* Cascade order: rộng → hẹp. */

/* ≤1535: inner thắt margin theo container pad-x (1488 max + lề). */
@media (max-width: 1535px) {
	.iw-info .iw-info__inner {
		margin-left: var(--iw-container-pad-x);
		margin-right: var(--iw-container-pad-x);
	}
}

/* ≤991: MOBILE — stack columns. */
@media (max-width: 991px) {
	.iw-info {
		padding-top: 40px;
	}
	.iw-info .iw-info__inner {
		flex-direction: column;
		/* stretch: card luôn bằng bề ngang khung — flex-start làm card giãn theo
		   nội dung rộng rồi bị .iw-info overflow:hidden cắt mép phải. */
		align-items: stretch;
		gap: 32px;
	}
	.iw-info__main {
		padding: 20px;
		border-radius: 10px;
	}
	.iw-info__heading {
		font-size: 16px;
		line-height: 22px;
		margin-bottom: 12px;
	}
	.iw-info__divider {
		margin-bottom: 16px;
	}
	.iw-info__body {
		font-size: 14px;
		line-height: 22px;
	}
	.iw-info__main .iw-info__toggle {
		bottom: 20px;
		padding: 11px 20px;
		font-size: 14px;
		line-height: 20px;
	}
	.iw-info__sidebar {
		flex: 1 1 auto;
		max-width: none;
		min-width: 0;
	}
	.iw-info__sidebar-title {
		font-size: 18px;
		line-height: 24px;
	}
}
