/*
 * Amity Investment Solutions Table
 * Version: 2.0.0
 * Prefix: aist-
 *
 * Brand palette
 *   Navy   : #213964
 *   Purple : #674f93
 *   Teal   : #35ad96
 *   Silver : #bdb9b9
 */

/* =============================================================================
   RESET & WRAPPER
   ============================================================================= */

.aist-wrap {
	font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
	line-height: 1.3;
	/* Break out of Divi column — 95 vw, anchored to the left */
	width: 95vw;
	margin-left: calc(-1 * ((95vw - 100%) / 2));
}

.aist-wrap *,
.aist-wrap *::before,
.aist-wrap *::after {
	box-sizing: border-box;
}

/* =============================================================================
   LAYOUT — TABLE LEFT + PANEL RIGHT
   ============================================================================= */

.aist-layout {
	display: flex;
	align-items: stretch;
	gap: 0;
}

.aist-table-col {
	flex: 0 0 70%;
	min-width: 0;
}

.aist-panel-col {
	flex: 0 0 30%;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* =============================================================================
   TABLE SCROLL WRAPPER
   ============================================================================= */

.aist-scroll {
	width: 100%;
	overflow-x: hidden; /* table-layout: fixed keeps content in bounds */
	-webkit-overflow-scrolling: touch;
}

/* Allow scroll only on very small screens where the table genuinely can't fit */
@media (max-width: 600px) {
	.aist-scroll {
		overflow-x: auto;
	}
}

/* =============================================================================
   TABLE SKELETON
   ============================================================================= */

.aist-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed; /* columns respect declared widths; prevents overflow */
}

/* =============================================================================
   HEADER ROWS
   ============================================================================= */

/* Title row */
.aist-title {
	background: #213964;
	color: #ffffff !important;
	font-size: clamp(15px, 1.9vw, 22px);
	font-weight: 700;
	text-align: center;
	padding: 18px 28px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Blank cell above Horizon / Equity */
.aist-th--blank {
	background: #bdb9b9;
	border-right: 2px solid #a8a4a4;
}

/* "Model Portfolios" span */
.aist-th--model {
	background: #1a5c4f;
	color: #ffffff !important;
	font-size: clamp(13px, 1.5vw, 17px);
	font-weight: 700;
	text-align: center;
	padding: 11px 14px;
	border-right: 2px solid rgba(0,0,0,0.15);
}

/* "CIS" span */
.aist-th--cis-hd {
	background: #4a3569;
	color: #ffffff !important;
	font-size: clamp(13px, 1.5vw, 17px);
	font-weight: 700;
	text-align: center;
	padding: 11px 14px;
}

/* Column label headers */
.aist-th {
	padding: 11px 14px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	color: #ffffff !important;
	border-right: 1px solid rgba(0,0,0,0.15);
	line-height: 1.25;
}

.aist-th:last-child {
	border-right: none;
}

.aist-th--horizon {
	background: #bdb9b9;
	color: #ffffff !important;
	font-size: 13px;
	width: 8%;
	min-width: 64px;
}

.aist-th--equity {
	background: #bdb9b9;
	color: #ffffff !important;
	font-size: 13px;
	width: 11%;
	min-width: 80px;
}

.aist-th--accum    { background: #35ad96; }
.aist-th--decum    { background: #2a8a78; } /* darker teal */
.aist-th--offshore { background: #213964; } /* navy */
.aist-th--pcm      { background: #674f93; } /* purple */

/* =============================================================================
   DATA ROWS
   ============================================================================= */

.aist-row {
	border-top: 2px solid #c8c5c5;
}

.aist-row:last-child {
	border-bottom: 2px solid #c8c5c5;
}

.aist-row--7a {
	border-top: 2px solid #c8c5c5;
}

.aist-row--7b {
	border-top: 1px solid #d6d3d3;
}

.aist-td {
	background: #f4f3f3;
	padding: 14px 16px;
	vertical-align: middle;
	border-right: 1px solid #d6d3d3;
}

.aist-td:last-child {
	border-right: none;
}

.aist-td--empty {
	background: #eeecec;
}

/* Investment Horizon cell */
.aist-td--horizon {
	background: #dbd8d8;
	font-weight: 700;
	font-size: 13px;
	color: #213964;
	text-align: center;
	border-right: 2px solid #c8c5c5;
	letter-spacing: 0.01em;
}

.aist-td--span {
	vertical-align: middle;
}

/* Equity exposure cell */
.aist-td--equity {
	background: #e4e2e2;
	text-align: center;
	border-right: 2px solid #c8c5c5;
}

/* =============================================================================
   EQUITY DIAL (SVG)
   ============================================================================= */

.aist-dial-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}

.aist-dial {
	width: 36px;
	height: 36px;
	display: block;
}

.aist-track {
	fill: none;
	stroke: #c8c5c5;
	stroke-width: 4;
}

.aist-arc {
	fill: none;
	stroke: #35ad96;
	stroke-width: 4;
	stroke-linecap: round;
}

.aist-dial-label {
	font-family: 'Montserrat', sans-serif;
	font-size: 9px;
	font-weight: 700;
	color: #213964;
	white-space: nowrap;
}

/* =============================================================================
   FUND BUTTONS
   ============================================================================= */

.aist-btn {
	display: block;
	width: 100%;
	padding: 8px 10px;
	margin-bottom: 6px;
	border: none;
	border-radius: 4px;
	font-family: 'Montserrat', 'Open Sans', Arial, sans-serif;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	color: #ffffff;
	white-space: normal;
	word-break: break-word;
	transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease, outline 0.1s;
	box-shadow: 0 2px 5px rgba(0,0,0,0.16);
}

.aist-btn:last-child {
	margin-bottom: 0;
}

.aist-btn:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.aist-btn:active {
	filter: brightness(0.9);
	transform: translateY(0);
	box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

.aist-btn:focus-visible {
	outline: 3px solid rgba(255,255,255,0.85);
	outline-offset: 2px;
}

/* Active / selected state */
.aist-btn.is-active {
	box-shadow: 0 0 0 3px rgba(255,255,255,0.9), 0 0 0 5px currentColor;
	filter: brightness(1.08);
}

/* Button colour variants */
.aist-btn--accum    { background: #35ad96; }
.aist-btn--decum    { background: #2a8a78; }
.aist-btn--offshore { background: #213964; }
.aist-btn--cis      { background: #674f93; }

/* =============================================================================
   DETAIL PANEL
   ============================================================================= */

.aist-panel {
	background: #ffffff;
	border-left: 1px solid #e0dede;
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* ── Empty state ── */

.aist-panel-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 24px;
	gap: 16px;
	opacity: 1;
	transition: opacity 0.25s ease;
}

.aist-panel-empty.is-hiding {
	opacity: 0;
}

.aist-panel-empty-text {
	font-size: clamp(16px, 1.9vw, 22px);
	font-weight: 700;
	color: #bdb9b9;
	text-align: center;
	line-height: 1.4;
	letter-spacing: 0.02em;
	margin: 0;
	padding: 0 16px;
}

/* ── Detail view ── */

.aist-panel-detail {
	flex: 1;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
	position: relative;
}

.aist-panel-detail.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Accent bar at top — colour set by JS via inline style */
.aist-panel-accent {
	height: 5px;
	width: 100%;
	background: #35ad96; /* default; overridden by JS */
	flex-shrink: 0;
}

/* Close button */
.aist-panel-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 28px;
	height: 28px;
	border: none;
	background: rgba(0,0,0,0.06);
	border-radius: 50%;
	font-size: 18px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
	color: #666;
	padding: 0;
	transition: background 0.15s;
	z-index: 2;
}

.aist-panel-close:hover {
	background: rgba(0,0,0,0.13);
}

/* Body scroll area */
.aist-panel-body {
	padding: 20px 22px 24px;
	overflow-y: auto;
	flex: 1;
}

/* Category tag */
.aist-panel-cat {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #ffffff;
	background: #35ad96; /* overridden by JS */
	border-radius: 3px;
	padding: 3px 8px;
	margin-bottom: 10px;
}

/* Fund title */
.aist-panel-title {
	font-size: clamp(16px, 2vw, 22px);
	font-weight: 800;
	color: #213964;
	margin: 0 0 12px;
	line-height: 1.2;
}

/* Meta pills row */
.aist-panel-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.aist-meta-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 600;
	color: #213964;
	background: #f0eeee;
	border-radius: 20px;
	padding: 4px 10px;
	white-space: nowrap;
}

.aist-meta-pill svg {
	flex-shrink: 0;
	opacity: 0.6;
}

/* Description */
.aist-panel-desc {
	font-size: 13px;
	color: #444;
	line-height: 1.65;
	margin: 0 0 18px;
}
.aist-panel-desc p {
	margin: 0 0 10px;
}
.aist-panel-desc p:last-child {
	margin-bottom: 0;
}

/* Divider */
.aist-panel-divider {
	height: 1px;
	background: #e8e6e6;
	margin: 0 0 16px;
}

/* Performance heading */
.aist-panel-perf-heading {
	font-size: 12px;
	font-weight: 700;
	color: #213964;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin: 0 0 12px;
}

.aist-panel-perf-heading span {
	font-weight: 400;
	color: #bdb9b9;
	text-transform: none;
	letter-spacing: 0;
}

/* Performance stat cards */
.aist-perf-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	margin-bottom: 14px;
}

.aist-perf-card {
	background: #f7f6f6;
	border-radius: 6px;
	padding: 10px 12px;
	border-left: 3px solid #35ad96; /* overridden per-card by JS */
}

.aist-perf-card-period {
	font-size: 10px;
	font-weight: 600;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 4px;
}

.aist-perf-card-value {
	font-size: 20px;
	font-weight: 800;
	color: #213964;
	line-height: 1;
}

/* Disclaimer */
.aist-panel-disclaimer {
	font-size: 10px;
	color: #bdb9b9;
	line-height: 1.5;
	margin: 0 0 18px;
}

/* Download button */
.aist-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #213964;
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	padding: 11px 20px;
	border-radius: 5px;
	letter-spacing: 0.02em;
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 6px rgba(33,57,100,0.25);
}

.aist-download-btn:hover {
	background: #2d4f85;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(33,57,100,0.3);
	color: #ffffff;
	text-decoration: none;
}

.aist-download-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 4px rgba(33,57,100,0.2);
}

/* =============================================================================
   MODEL PORTFOLIO CHARACTERISTICS TABLE
   ============================================================================= */

.aist-chars {
	margin-top: 4px;
}

.aist-chars-heading {
	font-size: clamp(11px, 1.1vw, 13px);
	font-weight: 700;
	color: #213964;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	word-spacing: 0.15em;
	margin: 0 0 14px;
	line-height: 1.4;
}

.aist-chars-table {
	display: flex;
	align-items: flex-start;
	gap: 0;
}

.aist-chars-col {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.aist-chars-col--labels {
	flex: 0 0 auto;
	padding-right: 16px;
	border-right: 2px solid #213964;
}

.aist-chars-col--values {
	flex: 1;
	padding-left: 16px;
}

.aist-chars-cell {
	font-size: 12px;
	line-height: 1.4;
	color: #213964;
}

.aist-chars-col--labels .aist-chars-cell {
	font-style: italic;
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
}

.aist-chars-col--values .aist-chars-cell {
	font-style: normal;
	font-size: 14px;
	color: #333;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

/* Large laptop — tighten padding and font sizes slightly */
@media (max-width: 1380px) {
	.aist-th {
		padding: 9px 10px;
		font-size: 12px;
	}

	.aist-td {
		padding: 12px 10px;
	}

	.aist-btn {
		font-size: 10px;
		padding: 7px 8px;
	}

	.aist-title {
		padding: 14px 18px;
	}
}

/* Small laptop — compress further */
@media (max-width: 1180px) {
	.aist-th {
		padding: 8px 6px;
		font-size: 11px;
	}

	.aist-td {
		padding: 10px 6px;
	}

	.aist-btn {
		font-size: 10px;
		padding: 6px 5px;
	}

	.aist-dial {
		width: 30px;
		height: 30px;
	}

	.aist-dial-label {
		font-size: 8px;
	}

	.aist-th--model,
	.aist-th--cis-hd {
		padding: 8px 6px;
		font-size: clamp(11px, 1.2vw, 14px);
	}
}

/* Stack panel below table on narrow screens */
@media (max-width: 900px) {
	.aist-layout {
		flex-direction: column;
	}

	.aist-table-col,
	.aist-panel-col {
		flex: 1 1 100%;
		width: 100%;
		position: static;
	}

	.aist-panel {
		border-left: none;
		border-top: 1px solid #e0dede;
	}
}

@media (max-width: 600px) {
	.aist-title {
		padding: 13px 14px;
		font-size: 13px;
	}

	.aist-th {
		padding: 9px 8px;
	}

	.aist-td {
		padding: 10px 10px;
	}

	.aist-btn {
		font-size: 10px;
		padding: 8px 8px;
	}

	.aist-dial {
		width: 30px;
		height: 30px;
	}

	.aist-dial-label {
		font-size: 8px;
	}

	.aist-perf-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* =============================================================================
   EMAIL VERIFICATION MODAL
   ============================================================================= */

.aist-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.aist-modal[hidden] {
	display: none;
}

.aist-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.aist-modal.is-open .aist-modal-overlay {
	opacity: 1;
}

.aist-modal-box {
	position: relative;
	background: #ffffff;
	border-radius: 10px;
	padding: 36px 32px 32px;
	max-width: 420px;
	width: calc(100% - 32px);
	box-shadow: 0 20px 60px rgba(0,0,0,0.25);
	opacity: 0;
	transform: translateY(12px) scale(0.97);
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 1;
}

.aist-modal.is-open .aist-modal-box {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.aist-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 30px;
	height: 30px;
	border: none;
	background: rgba(0,0,0,0.06);
	border-radius: 50%;
	font-size: 20px;
	line-height: 30px;
	text-align: center;
	cursor: pointer;
	color: #555;
	padding: 0;
	transition: background 0.15s;
}

.aist-modal-close:hover {
	background: rgba(0,0,0,0.13);
}

.aist-modal-lock {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.aist-modal-lock svg {
	width: 56px;
	height: 56px;
}

.aist-modal-heading {
	font-size: 20px;
	font-weight: 800;
	color: #213964;
	text-align: center;
	margin: 0 0 10px;
}

.aist-modal-desc {
	font-size: 13px;
	color: #555;
	text-align: center;
	line-height: 1.6;
	margin: 0 0 20px;
}

.aist-modal-email {
	display: block;
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #d0cece;
	border-radius: 5px;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	color: #213964;
	outline: none;
	transition: border-color 0.15s;
	margin-bottom: 10px;
	box-sizing: border-box;
}

.aist-modal-email:focus {
	border-color: #35ad96;
	box-shadow: 0 0 0 3px rgba(53,173,150,0.15);
}

.aist-modal-submit {
	display: block;
	width: 100%;
	padding: 12px;
	background: #213964;
	color: #ffffff;
	border: none;
	border-radius: 5px;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
	margin-bottom: 12px;
}

.aist-modal-submit:hover:not(:disabled) {
	background: #2d4f85;
}

.aist-modal-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.aist-modal-message {
	font-size: 12px;
	line-height: 1.55;
	text-align: center;
	min-height: 18px;
}

.aist-modal-message.is-error {
	color: #c0392b;
}

.aist-modal-message.is-success {
	color: #27ae60;
}

.aist-modal-contact {
	margin: 16px 0 0;
	font-size: 13px;
	color: #999;
	text-align: center;
}

.aist-modal-contact a {
	color: #213964;
	text-decoration: underline;
}

.aist-modal-contact a:hover {
	color: #35ad96;
}

/* =============================================================================
   MOBILE SHORTCODE  [amity_investment_solutions_mobile]
   ============================================================================= */

.aist-mob-wrap { font-family: 'Open Sans', sans-serif; width: 100%; box-sizing: border-box; }

.aist-mob-tabs {
	display: flex;
	overflow-x: auto;
	border-bottom: 2px solid #e8e8e8;
	margin-bottom: 16px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.aist-mob-tabs::-webkit-scrollbar { display: none; }
.aist-mob-tab {
	flex-shrink: 0;
	padding: 11px 14px;
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: #aaa;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
	margin-bottom: -2px;
}
.aist-mob-tab.is-active {
	color: var(--mob-active-color, #35ad96);
	border-bottom-color: var(--mob-active-color, #35ad96);
}

.aist-mob-panel { display: none; }
.aist-mob-panel.is-active { display: block; }

.aist-mob-card {
	border: 1px solid #e6e6e6;
	border-left: 4px solid var(--mob-color, #35ad96);
	border-radius: 4px;
	margin-bottom: 10px;
	background: #fff;
	overflow: hidden;
}
.aist-mob-card-hd {
	width: 100%;
	display: block;
	text-align: left;
	padding: 14px 16px;
	background: none;
	border: none;
	cursor: pointer;
}
.aist-mob-card-nav {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	text-align: center;
	padding: 16px;
	gap: 10px;
	background: none;
	text-decoration: none;
	cursor: pointer;
}
.aist-mob-card-nav .aist-mob-card-title-row {
	justify-content: center;
	margin-bottom: 0;
}
.aist-mob-card-nav .aist-mob-pills {
	justify-content: center;
}
.aist-mob-card-nav-btn {
	display: inline-block;
	padding: 10px 24px;
	background: #213964;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	border-radius: 4px;
	transition: background 0.2s ease;
	margin-top: 4px;
}
.aist-mob-card-nav:hover .aist-mob-card-nav-btn,
.aist-mob-card-nav:focus .aist-mob-card-nav-btn {
	background: #35ad96;
}
.aist-mob-card-title-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 10px;
}
.aist-mob-card-name {
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #213964;
	line-height: 1.3;
}
.aist-mob-chevron {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: #bbb;
	transition: transform 0.25s ease;
	margin-top: 1px;
}
.aist-mob-card-hd[aria-expanded="true"] .aist-mob-chevron { transform: rotate(180deg); }

.aist-mob-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.aist-mob-pill {
	display: inline-block;
	padding: 3px 9px;
	font-family: 'Montserrat', sans-serif;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	border-radius: 20px;
	background: #f0f0f0;
	color: #666;
}
.aist-mob-pill--hi {
	background: transparent;
	color: var(--mob-color, #35ad96);
	border: 1px solid var(--mob-color, #35ad96);
}

.aist-mob-card-body {
	display: none;
	padding: 4px 16px 16px;
	border-top: 1px solid #f0f0f0;
}
.aist-mob-card-body.is-open { display: block; }
.aist-mob-card-desc {
	font-size: 13px;
	line-height: 1.75;
	color: #555;
	margin: 14px 0;
}

.aist-mob-chars { margin: 0 0 16px; padding: 0; }
.aist-mob-char-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 7px 0;
	border-bottom: 1px solid #f5f5f5;
	font-size: 13px;
}
.aist-mob-char-row:last-child { border-bottom: none; }
.aist-mob-char-row dt { color: #999; font-weight: 400; flex-shrink: 0; }
.aist-mob-char-row dd { color: #213964; font-weight: 600; text-align: right; margin: 0; }

.aist-mob-dl-btn {
	display: block;
	width: 100%;
	padding: 12px 16px;
	background: var(--mob-color, #35ad96);
	color: #fff !important;
	font-family: 'Montserrat', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-sizing: border-box;
}
.aist-mob-dl-btn:hover { opacity: 0.88; transform: translateY(-1px); }
