/*
 * ConnectLanka design tokens and plugin components.
 * Palette from ConnectLanka-Page-and-Image-Blueprint.md. Only plugin-rendered
 * components are styled here; theme layout belongs in tagDiv Cloud Templates.
 */

:root {
	--cl-ocean-ink: #173b45;
	--cl-island-green: #2f6b57;
	--cl-cinnamon: #c96f45;
	--cl-warm-sand: #f5f1e8;
	--cl-cloud: #f8faf9;
	--cl-charcoal: #243238;
	--cl-white: #ffffff;
	--cl-button: #a9562f; /* editable in ConnectLanka → Colours */
	--cl-radius: 0;
	--cl-border: 1px solid rgba(23, 59, 69, 0.14);
	--cl-space: 1rem;
	/* One font family site-wide: tagDiv's default fonts fall back to these
	   variables (never defined by the theme), so Open Sans/Roboto aren't needed. */
	--td_default_google_font_1: "Montserrat", sans-serif;
	--td_default_google_font_2: "Montserrat", sans-serif;
}

/* Plugin components use the article font (Montserrat), not the theme's
   Verdana body font, so guide pages read as one design. */
.cl-breadcrumb, .cl-status, .cl-affiliate-note, .cl-facts, .cl-trust,
.cl-related, .cl-sources, .cl-popular, .cl-share {
	font-family: var(--td_default_google_font_1);
}

/* Status notices */
.cl-status {
	margin: 0 0 calc(var(--cl-space) * 1.5);
	padding: var(--cl-space) calc(var(--cl-space) * 1.25);
	border: var(--cl-border);
	border-left: 4px solid var(--cl-island-green);
	border-radius: var(--cl-radius);
	background: var(--cl-warm-sand);
	color: var(--cl-charcoal);
}
.cl-status--warning { border-left-color: var(--cl-cinnamon); }
.cl-status--closed { border-left-color: var(--cl-ocean-ink); background: #eef2f2; }
.cl-status__label {
	margin: 0 0 0.25rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--cl-ocean-ink);
}
.cl-status__title { margin: 0 0 0.5rem; font-weight: 600; }
.cl-status__body > :last-child { margin-bottom: 0; }
.cl-status__meta { margin: 0.75rem 0 0; font-size: 0.875rem; }
.cl-status a { color: var(--cl-island-green); text-decoration: underline; }

/* Affiliate disclosure */
.cl-affiliate-note {
	margin-top: calc(var(--cl-space) * 2);
	padding: 0.75rem var(--cl-space);
	border-radius: var(--cl-radius);
	background: var(--cl-cloud);
	border: var(--cl-border);
	font-size: 0.875rem;
	color: var(--cl-charcoal);
}

/* Ad slots reserve their height to avoid layout shift */
.cl-ad-slot {
	display: block;
	width: 100%;
	margin: calc(var(--cl-space) * 2) 0;
	background: var(--cl-cloud);
	contain: layout;
}

/* Breadcrumb */
.cl-breadcrumb ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.5rem;
	margin: 0 0 var(--cl-space);
	padding: 0;
	list-style: none;
	font-size: 0.875rem;
	color: var(--cl-charcoal);
}
.cl-breadcrumb li { margin: 0; }
.cl-breadcrumb li + li::before {
	content: "›";
	margin-right: 0.5rem;
	color: rgba(36, 50, 56, 0.55);
}
.cl-breadcrumb a { color: var(--cl-island-green); text-decoration: none; }
.cl-breadcrumb a:hover, .cl-breadcrumb a:focus-visible { text-decoration: underline; }
.cl-breadcrumb [aria-current="page"] { color: rgba(36, 50, 56, 0.75); }

/* Quick-planning panel */
.cl-facts {
	margin: 0 0 calc(var(--cl-space) * 2);
	padding: calc(var(--cl-space) * 1.25);
	border: var(--cl-border);
	border-radius: var(--cl-radius);
	background: var(--cl-warm-sand);
	color: var(--cl-charcoal);
}
.cl-facts__title {
	margin: 0 0 0.75rem;
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--cl-ocean-ink);
}
.cl-facts dl { margin: 0; }
.cl-facts__row {
	display: grid;
	grid-template-columns: minmax(6.5rem, 34%) 1fr;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-top: 1px solid rgba(23, 59, 69, 0.1);
}
.cl-facts__row:first-child { border-top: 0; }
.cl-facts dt { font-weight: 600; color: var(--cl-ocean-ink); }
.cl-facts dd { margin: 0; }
.cl-facts a { color: var(--cl-island-green); }
.cl-facts__checked { margin: 0.75rem 0 0; font-size: 0.8125rem; }

/* Related cards */
.cl-related { margin: calc(var(--cl-space) * 2.5) 0; }
.cl-related__title {
	margin: 0 0 var(--cl-space);
	font-size: 1.375rem;
	line-height: 1.3;
	color: var(--cl-ocean-ink);
}
.cl-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--cl-space);
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 600px) { .cl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cl-card { margin: 0; }
.cl-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: var(--cl-border);
	border-radius: var(--cl-radius);
	background: var(--cl-white);
	color: var(--cl-charcoal);
	text-decoration: none;
	transition: transform 180ms ease, box-shadow 180ms ease;
}
.cl-card__link:hover, .cl-card__link:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(23, 59, 69, 0.12);
}
.cl-card__link:focus-visible { outline: 3px solid var(--cl-island-green); outline-offset: 2px; }
.cl-card__media { display: block; aspect-ratio: 4 / 3; background: var(--cl-cloud); }
.cl-card__media--empty { background: linear-gradient(135deg, var(--cl-island-green), var(--cl-ocean-ink)); }
.cl-card__media img, .cl-card__image { display: block; width: 100%; height: 100%; object-fit: cover; }
.cl-card__body { display: block; padding: 0.875rem 1rem 1rem; }
.cl-card__title { display: block; font-weight: 700; color: var(--cl-ocean-ink); }
.cl-card__text { display: block; margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: rgba(36, 50, 56, 0.78); } /* as .cl-popular__text */
/* Guide-page cards ("story" style): photo, "TYPE · N MIN READ", bold name,
   short description, square "Read guide" button. Up to 3 per row; a
   horizontal swipe row on phones; more than 3 cards scroll with arrows. */
.cl-cards--story { gap: 1.75rem; }
.cl-cards--story .cl-card__link {
	border: 0;
	background: none;
	transition: none;
}
.cl-cards--story .cl-card__link:hover, .cl-cards--story .cl-card__link:focus-visible { transform: none; box-shadow: none; }
.cl-cards--story .cl-card__media { overflow: hidden; }
.cl-cards--story .cl-card__image { transition: transform 400ms ease; }
.cl-cards--story .cl-card__link:hover .cl-card__image { transform: scale(1.04); }
.cl-card__meta {
	display: block;
	margin-top: 0.875rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(36, 50, 56, 0.7);
}
.cl-cards--story .cl-card__title { margin-top: 0.375rem; font-size: 1.25rem; line-height: 1.25; }
.cl-cards--story .cl-card__link:hover .cl-card__title { color: var(--cl-island-green); }
.cl-cards--story .cl-card__text { margin-top: 0.375rem; }
.cl-card__cta {
	display: inline-block;
	align-self: flex-start;
	margin-top: 0.875rem;
	padding: 0.5rem 1rem;
	border: 1px solid var(--cl-ocean-ink);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cl-ocean-ink);
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.cl-card__link:hover .cl-card__cta, .cl-card__link:focus-visible .cl-card__cta { background: var(--cl-island-green); border-color: var(--cl-island-green); color: var(--cl-white); }
/* Phones: one swipeable row (a single card keeps the full width). */
@media (max-width: 599px) {
	.cl-cards--story { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
	.cl-cards--story > .cl-card { flex: 0 0 82%; scroll-snap-align: start; }
	.cl-cards--story > .cl-card:only-child { flex-basis: 100%; }
}
/* More than 3 cards: horizontal scroller at every width, with arrows. */
.cl-related { position: relative; }
.cl-cards--scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.cl-cards--scroll::-webkit-scrollbar { display: none; }
.cl-cards--scroll > .cl-card { flex: 0 0 calc((100% - 3.5rem) / 3); scroll-snap-align: start; }
@media (max-width: 599px) { .cl-cards--scroll > .cl-card { flex-basis: 82%; } }
.cl-related__nav { position: absolute; top: 0; right: 0; display: flex; gap: 6px; }
.cl-related__arrow {
	width: 32px;
	height: 32px;
	border: 1px solid var(--cl-ocean-ink);
	background: var(--cl-white);
	color: var(--cl-ocean-ink);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.cl-related__arrow:hover, .cl-related__arrow:focus-visible { background: var(--cl-ocean-ink); color: var(--cl-white); }
.cl-related__arrow[disabled] { opacity: 0.35; cursor: default; }

/* Trust line and sources */
.cl-trust { margin: 0 0 var(--cl-space); font-size: 0.875rem; color: rgba(36, 50, 56, 0.8); }
/* WordPress wraps shortcode blocks in empty <p></p> tags that still add 26 px. */
.vc_column_text p:empty { display: none; }
/* Sources: one quiet line of references, no box */
.cl-sources {
	margin: 0; /* the article already ends with 26 px + the theme's 16 px */
	font-size: 0.875rem;
	font-style: italic;
	line-height: 1.6;
	color: rgba(36, 50, 56, 0.75);
}
.cl-sources__label { font-weight: 600; }
.cl-sources a { color: var(--cl-island-green); }

/* FAQ section in post content (group block with class "cl-faq"): bold
   questions, answer close under its question, clear gap between pairs.
   Answers keep the article's own paragraph style. */
.cl-faq h3 {
	margin: 26px 0 6px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}
.cl-faq h3 + p { margin-top: 0; }

/* Byline row ([cl_byline]): "BY AUTHOR · DATE · LAST CHECKED …" left, share
   links right (below on narrow screens), divider line underneath. The theme
   gives text blocks 48 px below; keep the article close. */
.td_block_wrap.vc_column_text:has(.cl-byline) { margin-bottom: 22px !important; }
.cl-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
	padding-bottom: 14px;
	border-bottom: var(--cl-border);
}
.cl-byline__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-family: var(--td_default_google_font_1);
	font-size: 12px;
	line-height: 1.6;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(36, 50, 56, 0.75);
}
.cl-byline__meta strong { font-weight: 700; color: #111; }
.cl-byline__text { display: flex; flex-direction: column; gap: 2px; }
.cl-byline__checked { font-size: 11px; }
.cl-byline__item + .cl-byline__item::before { content: "\00b7"; margin: 0 8px; }
.cl-share { display: flex; align-items: center; gap: 6px; }
.cl-share__label {
	margin-right: 4px;
	font-family: var(--td_default_google_font_1);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: rgba(36, 50, 56, 0.7);
}
.cl-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: var(--cl-border);
	color: var(--cl-ocean-ink) !important;
	font-size: 15px;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.cl-share__link:hover, .cl-share__link:focus-visible { background: var(--cl-island-green); border-color: var(--cl-island-green); color: var(--cl-white) !important; }
.cl-share__link:focus-visible { outline: 3px solid var(--cl-island-green); outline-offset: 2px; }

/* Section titles: sidebar "Popular" and the guide page's "Where to base
   yourself", "Nearby"… (not the homepage [cl_cards] sections) */
.cl-side-title, .cl-related:not(.cl-section) > .cl-related__title {
	margin: 0 0 1rem;
	padding-bottom: 0.625rem;
	border-bottom: 2px solid var(--cl-island-green);
	font-family: var(--td_default_google_font_1);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--cl-ocean-ink);
}
.cl-popular { margin: 0 0 calc(var(--cl-space) * 2); }
.cl-popular__list { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.cl-popular__item { margin: 0; }
.cl-popular__link { display: flex; align-items: flex-start; gap: 0.875rem; color: var(--cl-ocean-ink); text-decoration: none; }
.cl-popular__media { flex: 0 0 96px; height: 72px; overflow: hidden; background: var(--cl-cloud); }
.cl-popular__media--empty { background: linear-gradient(135deg, var(--cl-island-green), var(--cl-ocean-ink)); }
.cl-popular__image { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.cl-popular__body { display: block; min-width: 0; }
.cl-popular__title { display: block; font-family: var(--td_default_google_font_1); font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.cl-popular__text { display: block; margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.45; color: rgba(36, 50, 56, 0.78); }
.cl-popular__link:hover .cl-popular__title, .cl-popular__link:focus-visible .cl-popular__title { color: var(--cl-island-green); }
.cl-popular__link:hover .cl-popular__image { transform: scale(1.05); }
.cl-popular__link:focus-visible { outline: 3px solid var(--cl-island-green); outline-offset: 2px; }

/* Homepage hero: full-bleed photo, H1 and actions */
.cl-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(78vh, 640px);
	margin: 0 calc(50% - 50vw);
	overflow: hidden;
	background: var(--cl-ocean-ink);
	color: var(--cl-white);
}
.cl-hero--plain { min-height: 0; padding-top: 4rem; }
.cl-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.cl-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(23, 59, 69, 0) 30%, rgba(23, 59, 69, 0.82) 100%);
}
.cl-hero__content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 20px 2.5rem;
}
.cl-hero__title {
	max-width: 18ch;
	margin: 0 0 0.75rem;
	font-size: clamp(2rem, 6vw, 3.5rem);
	line-height: 1.1;
	font-weight: 700;
	color: var(--cl-white);
}
.cl-hero__text {
	max-width: 46ch;
	margin: 0 0 1.5rem;
	font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.92);
}
.cl-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Buttons (white on dark cinnamon: 5.17:1) */
.cl-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 1.4rem;
	border-radius: 10px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 180ms ease, color 180ms ease;
}
.cl-button--primary { background: var(--cl-button); color: var(--cl-white) !important; }
.cl-button--primary:hover, .cl-button--primary:focus-visible { background: #8f4625; background: color-mix(in srgb, var(--cl-button) 84%, #000); }
.cl-button--secondary { border: 2px solid var(--cl-white); color: var(--cl-white) !important; }
.cl-button--secondary:hover, .cl-button--secondary:focus-visible { background: rgba(255, 255, 255, 0.14); }
.cl-button:focus-visible { outline: 3px solid var(--cl-warm-sand); outline-offset: 2px; }

/* Homepage sections */
.cl-section { scroll-margin-top: 90px; }
.cl-section__intro { max-width: 70ch; margin: -0.25rem 0 1.25rem; color: var(--cl-charcoal); }
.cl-home-intro {
	max-width: 760px;
	margin: 2.5rem auto 0;
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--cl-charcoal);
}

/* Magazine homepage: title band and photo banner tiles */
.cl-home-band { max-width: 820px; margin: 8px auto 40px; text-align: center; }
.cl-home-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.625rem, 3.2vw, 2.375rem);
	line-height: 1.2;
	font-weight: 700;
	color: var(--cl-ocean-ink);
}
.cl-home-band p { margin: 0; font-size: 1.0625rem; line-height: 1.7; color: var(--cl-charcoal); }
.cl-tiles {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 0 0 56px;
	padding: 0;
	list-style: none;
}
@media (min-width: 768px) { .cl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.cl-tile { margin: 0; }
.cl-tile__link {
	position: relative;
	display: flex;
	align-items: flex-end;
	height: 190px;
	overflow: hidden;
	border-radius: 6px;
	background: var(--cl-ocean-ink);
	color: var(--cl-white);
	text-decoration: none;
}
@media (min-width: 1019px) { .cl-tile__link { height: 220px; } }
.cl-tile__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}
.cl-tile__link::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(23, 59, 69, 0.05) 20%, rgba(23, 59, 69, 0.7) 100%);
}
.cl-tile__link:hover .cl-tile__image, .cl-tile__link:focus-visible .cl-tile__image { transform: scale(1.05); }
.cl-tile__link:focus-visible { outline: 3px solid var(--cl-island-green); outline-offset: 2px; }
.cl-tile__body { position: relative; z-index: 1; display: block; padding: 18px 20px; }
.cl-tile__title {
	display: block;
	margin-bottom: 10px;
	font-size: clamp(1.375rem, 2.2vw, 1.75rem);
	font-weight: 700;
	line-height: 1.15;
	color: var(--cl-white);
}
.cl-button--small { min-height: 34px; padding: 0 0.9rem; border-radius: 4px; font-size: 0.8125rem; }

/* CL Footer: the logo's dark lettering would vanish on the dark footer. */
.cl-footer-logo img { filter: brightness(0) invert(1); }

/* New homepage only (it carries the title band): slightly richer photos. */
body:has(.cl-home-band) .td-thumb-css,
body:has(.cl-home-band) .entry-thumb { filter: saturate(1.18) contrast(1.06); }

/* Footer and plain link lists */
.cl-link-list { margin: 0; padding: 0; list-style: none; }
.cl-link-list li { margin: 0 0 0.6rem; }
.cl-link-list a { color: inherit; text-decoration: none; opacity: 0.9; }
.cl-link-list a:hover, .cl-link-list a:focus-visible { text-decoration: underline; opacity: 1; }
.td-footer-template-wrap .cl-link-list a { color: #fff; }

/* Entity pages without a featured image: the template's title row is
   positioned over the (empty) hero image in white; show it as a heading. */
.cl-no-hero .vc_row_inner.absolute_inner_full:has(.tdb_title) {
	position: static !important;
	padding: 0 !important;
	margin-bottom: 1rem;
}
.cl-no-hero .tdb_title {
	/* The overlay design uses negative side margins on phones. */
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-right: 0 !important;
}
.cl-no-hero .tdb_title .tdb-title-text {
	color: var(--cl-ocean-ink) !important;
}

@media (prefers-reduced-motion: reduce) {
	.cl-status, .cl-affiliate-note, .cl-card__link, .cl-tile__image { transition: none; }
	.cl-tile__link:hover .cl-tile__image, .cl-tile__link:focus-visible .cl-tile__image { transform: none; }
	.cl-card__link:hover, .cl-card__link:focus-visible { transform: none; }
}
