/*
 * Design system — the Cinema on the Sea system, shared by every page.
 * The space scale (--s2 … --s9), --radius-lg and the Cinema colours live in Theme Options > Custom CSS;
 * this file adds what the other pages need on top of them.
 *
 * Contents
 *   tokens     section rhythm, banner height, title and text sizes
 *   type       type-eyebrow, type-title (-md, -light), type-title-sm, type-banner, type-statement, type-lead, type-text, type-measure, links in text
 *   meta       type-meta, type-meta-row
 *   icon items one build for every icon + title + text
 *   states     keyboard focus, link colours on hover, cards, burger and to-top button
 *   motion     what the scroll animations need from the stylesheet
 *   buttons    teal link variant
 *   menu-1     menu popup (Reusable Block "Header Popup")
 *   header     solid colour on pages with no opening photo, burger icon (shared Impreza header)
 */

/* Tokens
   ========================================================================== */

:root {
	--font-display: var(--h1-font-family);
	--font-text: var(--font-family);

	/* Space between sections: Impreza's "huge" row at desktop, easing down on small screens */
	--section-y: clamp(64px, 7.2vw, 104px);

	/* Titles keep growing a little past 1440px, so they hold their own beside the wider photos on large screens */
	--title-hero: clamp(38px, 5vw, 84px);
	--title-lg: clamp(30px, 3.34vw, 56px);
	--title-md: clamp(26px, 2.5vw, 42px);
	--title-sm: 17px;

	/* Running text: 16px, with a larger lead and a smaller step for captions. Nothing on the site is under 12px. */
	--text-lead: 18px;
	--text-md: 16px;
	--text-sm: 14px;

	--radius-xl: 20px;

	/* Photo banner at the top of every inner page */
	--banner-h: clamp(320px, 32.8vw, 520px);

	--color-eyebrow: #cbb98a;
}

/* Type
   ========================================================================== */

/* Tracked capitals above a title (Cinema's eyebrow) */
.type-eyebrow,
.type-eyebrow-lg {
	font-family: var(--sans);
	font-weight: 700;
	font-size: 14px;
	line-height: 21px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--color-eyebrow);
	margin: 0 0 var(--s3);
}

.type-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--title-lg);
	line-height: 1.04;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--color-teal);
}

/* A title written in a text block keeps its inner tag for the outline but takes the title's look */
.type-title :is(h1, h2, h3, p) {
	margin: 0;
	padding: 0;
	font: inherit;
	letter-spacing: inherit;
	color: inherit;
}

/* A long title set a step smaller */
.type-title.type-title-md {
	font-size: var(--title-md);
	line-height: 1.08;
}

.type-title.type-title-light {
	color: var(--color-white);
}

/* Small uppercase heading for cards and lists */
.type-title-sm {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--title-sm);
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--color-ink);
}

/* Page title on a banner photo */
.type-banner {
	max-width: 75%;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(32px, 4.4vw, 64px);
	line-height: 1.08;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--color-white);
}

/* Headings placed as elements keep the spacing their wrapper gives them */
:is(h1, h2, h3).w-text:is(.type-title, .type-title-sm, .type-banner) {
	margin: 0;
	padding: 0;
}

/* Heading group: an eyebrow, a title, text and actions that follow one another keep the same gaps wherever they
   appear. 16px under the eyebrow, 24px under the title, 32px above the actions. Columns and wrappers put margins
   of their own on these elements, so those are cleared first; the tag names are only there to outrank them. */
:is(.wpb_wrapper, .w-vwrapper) > :is(div, p, h1, h2, h3):is(.type-title, .type-lead),
:is(.wpb_wrapper, .w-vwrapper) > :is(div, p).type-text:has(+ .w-btn-wrapper) {
	margin-bottom: 0;
}

:is(.wpb_wrapper, .w-vwrapper) > :is(div, p, h1, h2, h3).type-eyebrow {
	margin-bottom: var(--s3);
}

:is(.type-title, .type-lead) + :is(div, p).type-text,
.type-title + :is(div, p).type-lead {
	margin-top: var(--s4);
}

:is(div, p, h1, h2, h3):is(.type-title, .type-lead, .type-text) + .w-btn-wrapper {
	margin-top: var(--s5);
}

.type-lead p,
.type-text p:last-child {
	margin-bottom: 0;
}

/* Large light sentence on a photo */
.type-statement,
.type-statement p {
	font-size: clamp(22px, 2.4vw, 34px);
	line-height: 1.3;
	font-weight: 300;
}

.type-lead {
	font-size: var(--text-lead);
	line-height: 1.5;
	font-weight: 400;
}

.type-text,
.type-text :is(p, li) {
	font-size: var(--text-md);
	line-height: 1.6;
	font-weight: 300;
}

.type-text-sm,
.type-text-sm :is(p, li) {
	font-size: var(--text-sm);
	line-height: 1.55;
	font-weight: 300;
}

.type-text,
.type-text-sm,
.type-lead,
.type-statement {
	color: var(--color-ink);
}

:is(.type-text, .type-text-sm, .type-lead, .type-statement).type-text-light {
	color: var(--color-white);
}

/* Titles break into lines of similar length; running text never leaves one word on its last line */
.type-title,
.type-title-sm,
.type-banner,
.type-statement,
.type-lead {
	text-wrap: balance;
}

.type-text,
.type-text-sm {
	text-wrap: pretty;
}

/* Comfortable line length for running text */
.type-measure {
	max-width: 56ch;
}

/* Links in running text are underlined; on photos and bands they take the text's own colour */
:is(.type-text, .type-text-sm, .type-lead) a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* Bullets take the gold accent, as the Meet the Mañana lists do */
:is(.type-text, .type-text-sm, .type-lead) ul > li::marker {
	color: var(--color-gold);
}

.type-text-light a {
	color: inherit;
}

/* Links change colour by what they are at rest: teal links in text turn gold (Theme Options), ink links turn teal,
   and light links on a photo or a band turn the eyebrow's pale gold */
:is(.type-text-light, .type-meta-light) a:hover {
	color: var(--color-eyebrow);
}

@media (max-width: 1024px) {
	.type-banner {
		max-width: none;
	}
}

/* Meta: supporting facts about an item (place, date, category). Quiet by design: small tracked capitals in a
   softened ink with a gold icon, and no box, so it never competes with the title above or the text below. */
.type-meta,
.type-meta p {
	font-family: var(--font-text);
	font-weight: 400;
	font-size: 12px;
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.type-meta {
	margin: 0;
	color: var(--ink-70);
}

.type-meta a {
	color: inherit;
}

.type-meta i {
	margin-right: 0.6em;
	font-size: 1.1em;
	color: var(--color-gold);
}

.type-meta.type-meta-light {
	color: var(--ink-light-dim);
}

.type-meta.type-meta-light i {
	color: var(--color-eyebrow);
}

/* Several meta items in a line */
.w-hwrapper.type-meta-row {
	flex-wrap: wrap;
	gap: var(--s2) var(--s4);
}

/* Icon items
   ========================================================================== */

/* An icon with a title and a line of text is built one way everywhere: an Icon Box with a 32px line icon in a
   40px column, the title and text beside it, left-aligned. A new one joins this list instead of getting its own look. */
.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) {
	display: flex;
	align-items: flex-start;
	text-align: left;
}

.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) .w-iconbox-icon {
	flex: 0 0 40px;
	width: 40px;
	margin: 0 var(--s3) 0 0;
	line-height: 1;
	text-align: center;
}

.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) .w-iconbox-meta {
	flex: 1 1 auto;
	min-width: 0;
}

.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) .w-iconbox-title {
	margin: 0;
	padding: 0;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--title-sm);
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--color-ink);
}

.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) .w-iconbox-text {
	max-width: 34ch;
	margin-top: 4px;
	font-size: var(--text-sm);
	line-height: 1.55;
	font-weight: 300;
	color: var(--color-ink);
	text-wrap: pretty;
}

.w-iconbox:is(.intro-1-item, .values-1-item, .included-1-item, .features-1-item) .w-iconbox-text p {
	margin: 0;
	font-size: inherit;
	line-height: inherit;
}

/* Feature size: where the items are the section's subject and not a caption, each sits under a hairline with a
   44px icon centred on its words */
.w-iconbox.values-1-item {
	align-items: center;
	padding-top: var(--s4);
	border-top: 1px solid var(--hairline);
}

.w-iconbox.values-1-item .w-iconbox-icon {
	flex-basis: 56px;
	width: 56px;
	margin-right: var(--s4);
}

.w-iconbox.values-1-item .w-iconbox-text {
	margin-top: var(--s2);
}

/* States
   ========================================================================== */

/* Keyboard focus: the ring is set once in Theme Options (2px, teal). On photos and on the teal and ink bands it
   turns white, so it can always be seen. */
:is(.l-header, .w-popup-box, .hero-1, .hero-2, .banner-1, .statement-1, .split-1-dark, .hire-1, .corporate-1-panel, .residency-1-promo, .contact-1, .steps-1-dark, .dark-feature, .founders-cta) :focus-visible {
	outline-color: var(--color-white);
}

.contact-1 .contact-1-card :focus-visible {
	outline-color: var(--color-teal);
}

/* Hover rules carry Impreza's .no-touch, so nothing stays lit after a tap on a phone */

/* Cards: pointing at any linked part of a card turns its title teal… */
.no-touch :is(.card-1, .history-1-card):has(a:hover) :is(.card-1-title, .history-1-card-title) a {
	color: var(--color-teal);
}

/* …and a linked photo eases in a little inside its rounded frame. The frame does the rounding, so the photo has
   one clipping edge. */
:is(.card-1-image, .history-1-card-image, .charters-2-image, .w-gallery-item-img) {
	overflow: hidden;
	border-radius: var(--radius-lg);
}

:is(.card-1-image, .history-1-card-image, .charters-2-image) a img,
.w-gallery-item-img img {
	transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.no-touch :is(.card-1-image, .history-1-card-image, .charters-2-image) a:hover img,
.no-touch .w-gallery-item:hover .w-gallery-item-img img {
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.no-touch :is(.card-1-image, .history-1-card-image, .charters-2-image) a:hover img,
	.no-touch .w-gallery-item:hover .w-gallery-item-img img {
		transform: none;
	}
}

/* Carousel arrows and dots are small on purpose; an unseen margin round each makes them easy to hit with a thumb */
:is(.charters-1-prev, .charters-1-next, .reviews-1-prev, .reviews-1-next, .gallery-1-prev, .gallery-1-next, .charters-1-dot) {
	position: relative;
}

:is(.charters-1-prev, .charters-1-next, .reviews-1-prev, .reviews-1-next, .gallery-1-prev, .gallery-1-next)::after {
	content: "";
	position: absolute;
	inset: -6px;
}

.charters-1-dot::after {
	content: "";
	position: absolute;
	inset: -10px -4px;
}

/* Back-to-top button */
.no-touch .w-toplink:hover {
	background: var(--color-teal);
}

/* Motion
   ========================================================================== */

/* Scroll animations run through Dash's GSAP system: js/home-v2.js marks the elements, js/gsap-animations.js moves them */

/* A photo that slides in starts 50px outside its place, which on a phone is past the screen edge; its section
   clips that so the page never scrolls sideways */
.l-section:is(.split-1, .feature-1, .charter-1, .values-1) {
	overflow-x: clip;
}

/* Buttons
   ========================================================================== */

/* Tertiary link on a light background: Cinema's underlined link, in teal */
.link-btn.link-btn-teal {
	color: var(--color-teal) !important;
	text-decoration-color: currentColor !important;
}

.link-btn.link-btn-teal:hover {
	color: var(--color-gold) !important;
}

/* menu-1  Menu popup: four groups of links, two across (Reusable Block "Header Popup")
   ========================================================================== */

/* The links sit centred in the teal half and scroll inside it on screens too short for every group */
.menu-1 .menu-1-side > .vc_column-inner {
	display: flex;
	flex-direction: column;
	justify-content: safe center;
	height: 100dvh;
	padding: var(--s7);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

.menu-1 .menu-1-groups {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s6);
	align-items: start;
}

.menu-1 .menu-1-heading {
	margin-bottom: var(--s2);
}

.menu-1 .menu-1-list {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 20px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.menu-1 .menu-1-socials {
	margin-top: var(--s6);
	font-size: 24px;
}

/* Links, icons and the close button all answer the pointer the same way; the page you are on keeps that colour.
   The menu element writes its hover and current colours inline, hence !important. */
.menu-1 .menu-1-list {
	--main-hover-color: var(--color-eyebrow) !important;
	--main-active-color: var(--color-eyebrow) !important;
}

.menu-1 :is(.menu-1-list, .menu-1-socials) a,
.w-popup-closer {
	transition: color 0.2s;
}

.no-touch .menu-1 .menu-1-socials a:hover,
.no-touch .w-popup-closer:hover {
	color: var(--color-eyebrow);
}

/* Laptops: the photo gives up a tenth of the width so the longest link stays on one line */
@media (min-width: 1025px) and (max-width: 1439px) {
	.menu-1 .menu-1-layout.g-cols {
		grid-template-columns: 2fr 3fr;
	}

	.menu-1 .menu-1-side > .vc_column-inner {
		padding: var(--s6);
	}

	.menu-1 .menu-1-list {
		font-size: 18px;
	}
}

@media (max-width: 1024px) {
	.menu-1 .menu-1-side > .vc_column-inner {
		padding: var(--s8) var(--s5) var(--s5);
	}
}

@media (max-width: 767px) {
	.menu-1 .menu-1-side > .vc_column-inner {
		padding: var(--s8) var(--s4) var(--s4);
	}

	/* One column fills the screen, so the mermaid watermark would sit behind the links.
	   !important because the column's Design options set the image that way. */
	.menu-1 .menu-1-side {
		background-image: none !important;
	}

	.menu-1 .menu-1-groups {
		grid-template-columns: 1fr;
		gap: var(--s4);
	}

	.menu-1 .menu-1-list {
		font-size: 17px;
	}

	/* 40px tap targets; the element sets this variable inline, hence !important */
	.menu-1 .menu-1-list {
		--main-ver-indent: 0.58em !important;
	}

	.menu-1 .menu-1-socials {
		margin-top: var(--s4);
	}
}

/* Header (shared by every page)
   ========================================================================== */

/* A page that doesn't open on a photo takes the header's solid colour straight away, as it does once scrolled,
   so the white logo never sits on the cream page. Only the opening section counts, hence :first-of-type
   (templates print a style element before it, so :first-child would miss). */
.l-canvas:not(:has(> .l-main > .l-section:first-of-type:is(.hero-1, .banner-1, .contact-1, .antigua-hero-row, .with_img, .with_video))) > .l-header.bg_transparent:not(.sticky) .l-subheader.at_middle {
	background: var(--color-teal);
}

/* When the header shrinks on scroll, Impreza eases the bar and the logo on different curves, so the logo dips
   before it rises. On the bar's own curve the two change as one motion. */
.l-header .w-image {
	transition-timing-function: cubic-bezier(0.78, 0.13, 0.15, 0.86);
}

/* Burger: a 41px box with three 2px lines, centred */
.l-header .w-popup > .w-popup-trigger.type_icon {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	color: var(--color-white);
}

.l-header .w-popup > .w-popup-trigger.type_icon i {
	position: absolute;
	top: calc(50% - 7.5px); /* whole pixels in the 37px inner box: 11 above, 12 below */
	left: calc(50% - 10.5px);
	width: 21px;
	height: 2px;
	font-size: 0;
	background: currentColor;
	box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.l-header .w-popup > .w-popup-trigger.type_icon i::before {
	content: none;
}

/* Under the pointer the box fills white and the lines turn teal, as the Light Outline button does */
.l-header .w-popup,
.l-header .w-popup > .w-popup-trigger.type_icon {
	transition: background 0.3s, color 0.3s;
}

.no-touch .l-header .w-popup:hover {
	background: var(--color-white);
}

.no-touch .l-header .w-popup:hover > .w-popup-trigger.type_icon {
	color: var(--color-teal);
}
