/**
 * Malaysia eVisa — Gutenberg block styles
 * All existing page/post content on malaysia-evisa.org is authored in core
 * blocks, so these rules do most of the visual heavy lifting on inner pages.
 */

/* =========================================================================
   ALIGNMENT SUPPORT
   ========================================================================= */

.entry-content .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.me-shell--sidebar .entry-content .alignfull {
	width: auto;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

.entry-content .alignwide {
	margin-block: var(--me-space-6);
}

/* =========================================================================
   HEADINGS INSIDE BLOCKS
   ========================================================================= */

.wp-block-heading {
	scroll-margin-top: calc(var(--me-header-h) + var(--me-admin-offset) + 1.25rem);
}

/* =========================================================================
   PARAGRAPH / TEXT
   ========================================================================= */

.has-drop-cap:not(:focus)::first-letter {
	float: left;
	margin: 0.1em 0.6rem 0 0;
	color: var(--me-primary);
	font-size: 3.4em;
	font-weight: 800;
	line-height: 0.82;
}

.wp-block-paragraph.has-background {
	padding: var(--me-space-5);
	border-radius: var(--me-radius);
}

/* =========================================================================
   COLUMNS
   ========================================================================= */

.wp-block-columns {
	gap: clamp(1.25rem, 3vw, 2.25rem) !important;
	margin-bottom: var(--me-space-6);
	align-items: flex-start;
}

.wp-block-column {
	min-width: 0;
}

.wp-block-column > *:last-child {
	margin-bottom: 0;
}

.wp-block-column.has-background {
	padding: clamp(1.25rem, 2.5vw, 2rem);
	border-radius: var(--me-radius-lg);
}

@media (max-width: 781px) {
	.wp-block-columns:not(.is-not-stacked-on-mobile) {
		gap: var(--me-space-5) !important;
	}
}

/* =========================================================================
   GROUP / STACK / ROW
   ========================================================================= */

.wp-block-group.has-background {
	padding: clamp(1.5rem, 3vw, 2.5rem);
	border-radius: var(--me-radius-lg);
}

.wp-block-group > *:last-child {
	margin-bottom: 0;
}

/* =========================================================================
   COVER (used on the current home page hero)
   ========================================================================= */

.wp-block-cover,
.wp-block-cover-image {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: clamp(16rem, 34vw, 26rem);
	padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 4vw, 3rem);
	overflow: hidden;
	border-radius: var(--me-radius-xl);
	background-color: var(--me-navy-900);
	color: #fff;
	text-align: center;
}

.wp-block-cover.alignfull,
.wp-block-cover-image.alignfull {
	border-radius: 0;
}

.wp-block-cover img.wp-block-cover__image-background,
.wp-block-cover video.wp-block-cover__video-background {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
}

.wp-block-cover__background,
.wp-block-cover__gradient-background {
	position: absolute;
	inset: 0;
}

.wp-block-cover:not(.has-background-dim) > .wp-block-cover__background {
	background: linear-gradient(180deg, rgba(0, 0, 38, 0.55), rgba(0, 0, 38, 0.8));
}

.wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 52rem;
}

.wp-block-cover__inner-container > *:last-child {
	margin-bottom: 0;
}

.wp-block-cover h1,
.wp-block-cover h2,
.wp-block-cover h3,
.wp-block-cover h4,
.wp-block-cover p,
.wp-block-cover li {
	color: inherit;
	text-shadow: 0 1px 18px rgba(0, 0, 38, 0.35);
}

.wp-block-cover h1,
.wp-block-cover h2 {
	letter-spacing: -0.03em;
}

.wp-block-cover ul > li::before,
.wp-block-cover ol > li::before {
	background: var(--me-gold-400);
	box-shadow: none;
	color: var(--me-navy-900);
}

/* =========================================================================
   IMAGE / FIGURE / GALLERY
   ========================================================================= */

.wp-block-image {
	margin-bottom: var(--me-space-6);
}

.wp-block-image img {
	border-radius: var(--me-radius);
	box-shadow: var(--me-shadow-sm);
}

.wp-block-image.is-style-rounded img,
.wp-block-image .is-style-rounded {
	border-radius: var(--me-radius-xl);
}

.wp-block-image figcaption {
	margin-top: var(--me-space-3);
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	border-radius: var(--me-radius);
}

.wp-block-gallery.has-nested-images {
	gap: var(--me-space-4);
	margin-bottom: var(--me-space-6);
}

.wp-block-media-text {
	gap: clamp(1.25rem, 3vw, 2.5rem);
	margin-bottom: var(--me-space-6);
	border-radius: var(--me-radius-lg);
	overflow: hidden;
}

.wp-block-media-text.has-background {
	padding: clamp(1.25rem, 3vw, 2rem);
}

.wp-block-media-text__content > *:last-child {
	margin-bottom: 0;
}

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

.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.7rem;
	margin-bottom: var(--me-space-6);
}

.wp-block-button__link,
.wp-block-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.8rem 1.6rem;
	border: 1px solid transparent;
	border-radius: var(--me-radius-pill);
	background: var(--me-primary);
	color: #fff;
	font-size: var(--me-text-sm);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	transition: all var(--me-transition);
}

.wp-block-button__link:hover {
	background: var(--me-primary-dark);
	color: #fff;
	box-shadow: var(--me-shadow-md);
	transform: translateY(-1px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	border-color: var(--me-primary);
	background: transparent;
	color: var(--me-primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--me-primary);
	color: #fff;
}

/* Theme block styles registered in PHP */
.wp-block-button.is-style-me-accent .wp-block-button__link {
	background: var(--me-cta);
	color: var(--me-cta-text);
	box-shadow: 0 6px 18px rgba(212, 37, 38, 0.3);
}

.wp-block-button.is-style-me-accent .wp-block-button__link:hover {
	background: var(--me-cta-hover);
	color: var(--me-cta-text);
}

.wp-block-button.is-style-me-gold .wp-block-button__link {
	background: linear-gradient(135deg, var(--me-gold-400), var(--me-accent));
	color: var(--me-navy-900);
	box-shadow: 0 6px 18px rgba(185, 140, 0, 0.28);
}

.wp-block-button.is-style-me-gold .wp-block-button__link:hover {
	background: var(--me-accent);
	color: var(--me-navy-950);
}

/* Theme block style: notice / callout box (core/group) */
.wp-block-group.is-style-me-notice {
	padding: clamp(1.1rem, 2.5vw, 1.6rem) clamp(1.1rem, 2.5vw, 1.75rem);
	border: 1px solid var(--me-blue-100);
	border-left: 4px solid var(--me-primary);
	border-radius: var(--me-radius-lg);
	background: var(--me-blue-50);
}

.wp-block-group.is-style-me-notice > *:last-child {
	margin-bottom: 0;
}

.wp-block-group.is-style-me-notice strong {
	color: var(--me-navy-900);
}

/* =========================================================================
   TABLES  (visa fees, requirements, processing times)
   ========================================================================= */

.wp-block-table {
	margin-bottom: var(--me-space-6);
}

.wp-block-table > table,
.entry-content table,
.me-prose table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--me-border);
	border-radius: var(--me-radius-lg);
	overflow: hidden;
	background: var(--me-white);
	box-shadow: var(--me-shadow-xs);
	font-size: var(--me-text-sm);
}

.wp-block-table figcaption {
	margin-top: var(--me-space-3);
}

/* Horizontal scroll wrapper injected by theme.js for wide tables */
.me-table-scroll {
	position: relative;
	max-width: var(--me-content);
	margin: 0 auto var(--me-space-6);
	/* 1px of breathing room so overflow clipping never shaves the rounded
	   corners or the right-hand border off the table. */
	padding: 1px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.me-shell--full .me-table-scroll {
	max-width: none;
}

.me-table-scroll > table,
.me-table-scroll > .wp-block-table {
	margin-bottom: 0;
	min-width: 34rem;
}

.entry-content th,
.entry-content td,
.me-prose th,
.me-prose td {
	padding: 0.8rem 1rem;
	border-bottom: 1px solid var(--me-gray-100);
	text-align: left;
	vertical-align: top;
}

.entry-content thead th,
.me-prose thead th {
	background: var(--me-navy-800);
	border-bottom: 0;
	color: #fff;
	font-size: var(--me-text-xs);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.entry-content tbody tr:nth-child(even),
.me-prose tbody tr:nth-child(even) {
	background: var(--me-gray-25);
}

.entry-content tbody tr:hover,
.me-prose tbody tr:hover {
	background: var(--me-blue-50);
}

.entry-content tbody tr:last-child td,
.me-prose tbody tr:last-child td {
	border-bottom: 0;
}

.entry-content tbody th,
.me-prose tbody th {
	background: var(--me-gray-50);
	color: var(--me-navy-900);
	font-weight: 700;
}

.entry-content table li,
.me-prose table li {
	padding-left: 1.1rem;
	margin-bottom: 0.25rem;
}

.entry-content table ul > li::before,
.me-prose table ul > li::before {
	left: 0;
	width: 5px;
	height: 5px;
	box-shadow: none;
}

.wp-block-table.is-style-stripes > table {
	border-collapse: separate;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--me-gray-25);
}

/* =========================================================================
   QUOTE / PULLQUOTE
   ========================================================================= */

.wp-block-quote,
.entry-content blockquote,
.me-prose blockquote {
	position: relative;
	margin-bottom: var(--me-space-6);
	padding: var(--me-space-5) var(--me-space-5) var(--me-space-5) var(--me-space-7);
	border: 0;
	border-left: 4px solid var(--me-accent);
	border-radius: 0 var(--me-radius-lg) var(--me-radius-lg) 0;
	background: var(--me-gold-100);
	color: var(--me-navy-800);
	font-size: var(--me-text-lg);
	font-style: normal;
	line-height: 1.6;
}

.wp-block-quote::before,
.entry-content blockquote::before {
	content: "\201C";
	position: absolute;
	top: 0.35rem;
	left: 0.85rem;
	color: var(--me-gold-500);
	font-family: Georgia, serif;
	font-size: 2.75rem;
	line-height: 1;
	opacity: 0.6;
}

.wp-block-quote p:last-child,
.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

.wp-block-quote cite,
.entry-content blockquote cite {
	display: block;
	margin-top: var(--me-space-3);
	color: var(--me-gray-600);
	font-size: var(--me-text-sm);
	font-style: normal;
	font-weight: 700;
}

.wp-block-pullquote {
	padding: clamp(1.5rem, 3vw, 2.5rem);
	border-top: 3px solid var(--me-accent);
	border-bottom: 3px solid var(--me-accent);
	background: none;
	text-align: center;
}

.wp-block-pullquote blockquote {
	padding: 0;
	border: 0;
	background: none;
	font-size: var(--me-h3);
	font-weight: 600;
}

.wp-block-pullquote blockquote::before {
	display: none;
}

/* =========================================================================
   SEPARATOR / SPACER
   ========================================================================= */

.wp-block-separator {
	max-width: 6rem;
	height: 3px;
	margin: var(--me-space-7) auto;
	border: 0;
	border-radius: 3px;
	background: var(--me-gray-200);
	opacity: 1;
}

.wp-block-separator.is-style-wide,
.wp-block-separator.has-alpha-channel-opacity {
	max-width: 100%;
	height: 1px;
	background: var(--me-border);
}

.wp-block-separator.is-style-dots {
	max-width: none;
	height: auto;
	background: none;
	color: var(--me-gray-300);
}

/* =========================================================================
   DETAILS / FAQ ACCORDION
   ========================================================================= */

.wp-block-details,
.me-accordion {
	margin-bottom: var(--me-space-4);
	padding: 0;
	border: 1px solid var(--me-border);
	border-radius: var(--me-radius-lg);
	background: var(--me-white);
	box-shadow: var(--me-shadow-xs);
	overflow: hidden;
	transition: box-shadow var(--me-transition), border-color var(--me-transition);
}

.wp-block-details[open],
.me-accordion[open] {
	border-color: var(--me-blue-100);
	box-shadow: var(--me-shadow-sm);
}

.wp-block-details > summary,
.me-accordion > summary {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	color: var(--me-navy-900);
	font-size: var(--me-text-base);
	font-weight: 700;
	line-height: 1.45;
	cursor: pointer;
	list-style: none;
	transition: background-color var(--me-transition);
}

.wp-block-details > summary::-webkit-details-marker,
.me-accordion > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary:hover,
.me-accordion > summary:hover {
	background: var(--me-blue-50);
}

.wp-block-details > summary::after,
.me-accordion > summary::after {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	margin-left: auto;
	border-right: 2px solid var(--me-primary);
	border-bottom: 2px solid var(--me-primary);
	transform: rotate(45deg);
	transition: transform var(--me-transition);
}

.wp-block-details[open] > summary::after,
.me-accordion[open] > summary::after {
	transform: rotate(-135deg);
}

.wp-block-details > *:not(summary),
.me-accordion > *:not(summary) {
	padding-inline: 1.25rem;
}

.wp-block-details > *:not(summary):first-of-type {
	padding-top: 0.25rem;
}

.wp-block-details > *:last-child,
.me-accordion > *:last-child {
	margin-bottom: 0;
	padding-bottom: 1.25rem;
}

/* =========================================================================
   EMBEDS / VIDEO
   ========================================================================= */

.wp-block-embed {
	margin-bottom: var(--me-space-6);
}

.wp-block-embed__wrapper {
	position: relative;
	border-radius: var(--me-radius-lg);
	overflow: hidden;
	box-shadow: var(--me-shadow-sm);
}

.wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper::before {
	content: "";
	display: block;
	padding-top: 56.25%;
}

.wp-block-embed.wp-has-aspect-ratio iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wp-block-video video {
	width: 100%;
	border-radius: var(--me-radius-lg);
}

/* =========================================================================
   LISTS, LATEST POSTS, CATEGORIES (block versions used in the footer)
   ========================================================================= */

.wp-block-latest-posts,
.wp-block-categories,
.wp-block-archives,
.wp-block-page-list {
	padding-left: 0;
	list-style: none;
}

.wp-block-latest-posts li,
.wp-block-categories li,
.wp-block-archives li,
.wp-block-page-list li {
	padding-left: 0;
	margin-bottom: 0.15rem;
}

.wp-block-latest-posts li::before,
.wp-block-categories li::before,
.wp-block-archives li::before,
.wp-block-page-list li::before {
	display: none;
}

.wp-block-latest-posts__post-date {
	display: block;
	color: var(--me-gray-400);
	font-size: var(--me-text-xs);
}

.wp-block-latest-posts.is-grid {
	display: grid;
	gap: var(--me-space-4);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.wp-block-categories li,
.wp-block-archives li {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
}

/* =========================================================================
   CODE / PREFORMATTED / VERSE
   ========================================================================= */

.wp-block-code,
.wp-block-preformatted {
	margin-bottom: var(--me-space-6);
}

.wp-block-code pre,
.wp-block-preformatted {
	padding: var(--me-space-5);
	border-radius: var(--me-radius);
	background: var(--me-navy-950);
	color: #e6edf3;
	overflow-x: auto;
}

.wp-block-verse {
	padding: var(--me-space-5);
	border-radius: var(--me-radius);
	background: var(--me-gray-50);
	font-family: inherit;
}

/* =========================================================================
   COLOR PALETTE UTILITIES (theme.json palette slugs)
   ========================================================================= */

.has-me-primary-color { color: var(--me-primary) !important; }
.has-me-primary-background-color { background-color: var(--me-primary) !important; }
.has-me-navy-color { color: var(--me-navy-900) !important; }
.has-me-navy-background-color { background-color: var(--me-navy-900) !important; }
.has-me-accent-color { color: var(--me-accent) !important; }
.has-me-accent-background-color { background-color: var(--me-accent) !important; }
.has-me-light-color { color: var(--me-gray-50) !important; }
.has-me-light-background-color { background-color: var(--me-gray-50) !important; }
.has-me-tint-color { color: var(--me-blue-50) !important; }
.has-me-tint-background-color { background-color: var(--me-blue-50) !important; }
.has-me-white-color { color: #fff !important; }
.has-me-white-background-color { background-color: #fff !important; }
.has-me-red-color { color: var(--me-cta) !important; }
.has-me-red-background-color { background-color: var(--me-cta) !important; }

.has-me-red-background-color {
	color: #fff;
}

/* Dark backgrounds: force readable foreground for nested elements */
.has-me-navy-background-color,
.has-me-primary-background-color {
	color: #fff;
}

.has-me-navy-background-color :where(h1, h2, h3, h4, h5, h6, p, li, strong),
.has-me-primary-background-color :where(h1, h2, h3, h4, h5, h6, p, li, strong) {
	color: inherit;
}

.has-me-navy-background-color a,
.has-me-primary-background-color a {
	color: var(--me-gold-400);
}

/* Gradients from theme.json */
.has-me-brand-gradient-gradient-background {
	background: linear-gradient(135deg, var(--me-navy-900), var(--me-blue-600)) !important;
	color: #fff;
}

.has-me-gold-gradient-gradient-background {
	background: linear-gradient(135deg, var(--me-gold-400), var(--me-accent)) !important;
	color: var(--me-navy-900);
}

/* =========================================================================
   PRINT
   ========================================================================= */

@media print {
	.me-header,
	.me-topbar,
	.me-footer,
	.me-sidebar,
	.me-to-top,
	.me-mobile-cta,
	.me-share,
	.me-post-nav,
	.me-comments,
	.me-progress,
	.me-toc,
	.me-drawer,
	.me-drawer-backdrop,
	.me-search-modal {
		display: none !important;
	}

	body {
		padding: 0;
		background: #fff;
		color: #000;
		font-size: 11pt;
	}

	.me-shell,
	.me-shell--sidebar {
		display: block;
		padding: 0;
	}

	.entry-content > *,
	.me-prose > * {
		max-width: none;
	}

	.me-page-hero {
		padding-block: 0 1rem;
		background: none !important;
		color: #000;
	}

	.me-page-hero h1,
	.me-page-hero__text {
		color: #000;
	}

	a {
		color: #000;
		text-decoration: underline;
	}

	.entry-content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		word-break: break-all;
	}

	h2,
	h3 {
		break-after: avoid;
	}

	table,
	figure,
	.wp-block-details {
		break-inside: avoid;
	}
}
