/**
 * websiteInteractive.css — baked styling for the AI website builder's interactive
 * primitives (modal, tabs, dropdown). Paired with websiteInteractive.js.
 *
 * In Tailwind mode the AI writes NO CSS — it styles the *look* of content with
 * Tailwind utilities and uses the class/attribute contracts below for behavior.
 * This file owns only what the behavior needs: positioning, show/hide state, and
 * the enter/leave transition. Colors, padding, radius, shadows, fonts → Tailwind
 * utilities on the same elements (utility specificity overrides these defaults).
 *
 * Loaded by website.php (Tailwind-mode pages) and injected into the GrapesJS
 * canvas for those pages.
 */

/* ---- Modal --------------------------------------------------------------- */
.ai-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.ai-modal.ai-modal--open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.ai-modal-box {
	position: relative;
	margin: auto;
	max-width: 560px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	/* enter motion — overridden look comes from Tailwind on the same element */
	transform: translateY(12px) scale(0.97);
	transition: transform 0.25s ease;
}
.ai-modal.ai-modal--open .ai-modal-box {
	transform: none;
}
.ai-modal-close {
	position: absolute;
	top: 10px;
	right: 16px;
	font-size: 28px;
	line-height: 1;
	background: none;
	border: none;
	cursor: pointer;
}
body.ai-modal-lock {
	overflow: hidden;
}

/* ---- Tabs ---------------------------------------------------------------- */
.ai-tab {
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.ai-tab-pane {
	display: none;
}
.ai-tab-pane.ai-tab-pane--active {
	display: block;
}

/* ---- Countdown ------------------------------------------------------------
   The JS runtime ticks [data-countdown-date] containers every second and adds
   .ai-countdown--done when the target passes; these rules swap the units for
   the optional "done" message. */
[data-countdown-date] [data-countdown-done] {
	display: none;
}
[data-countdown-date].ai-countdown--done [data-countdown-done] {
	display: block;
}
[data-countdown-date].ai-countdown--done [data-countdown-units] {
	display: none;
}

/* ---- Dropdown ------------------------------------------------------------ */
.ai-dropdown {
	position: relative;
}
.ai-dropdown-toggle {
	background: none;
	border: none;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.ai-dropdown-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 180px;
	z-index: 100;
}
.ai-dropdown.ai-dropdown--open .ai-dropdown-menu {
	display: block;
}

/* ---- Inline forms (websiteForms.js) --------------------------------------- */
/* Behavior state only: success/error boxes stay hidden until the runtime flips
   the form's state class after an actual submit. Look = Tailwind utilities. */
.ai-form-success,
.ai-form-error {
	display: none;
}
form[data-ai-form].ai-form--done .ai-form-success {
	display: block;
}
form[data-ai-form].ai-form--done .ai-form-fields,
/* The submit button is part of the fields even when authored outside the
   .ai-form-fields wrapper; keep a single success box if one got duplicated. */
form[data-ai-form].ai-form--done button[type=submit],
form[data-ai-form].ai-form--done button:not([type]),
form[data-ai-form].ai-form--done input[type=submit],
form[data-ai-form].ai-form--done .ai-form-success ~ .ai-form-success {
	display: none;
}
form[data-ai-form].ai-form--error .ai-form-error {
	display: block;
}
form[data-ai-form].ai-form--loading button[type=submit],
form[data-ai-form].ai-form--loading input[type=submit] {
	opacity: 0.6;
	pointer-events: none;
}

/* ---- Event listing (directory websites) -----------------------------------
   websiteEvents.js re-renders [data-ai-template] sections that bind the
   `events` collection and marks the current numbered page button. The AI
   styles the buttons with Tailwind; this only owns the active/current state
   and a subtle busy cue while a page is being fetched. */
[data-events-page] {
	cursor: pointer;
}
.ai-events-page--active {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}
[data-ai-template][data-events-loading] {
	opacity: 0.6;
	pointer-events: none;
	transition: opacity 0.15s ease;
}
[data-events-scope],
[data-events-mode],
[data-events-tag] {
	cursor: pointer;
}
.ai-events-filter--active,
.ai-events-tag--active {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---- Built-in components ------------------------------------------------- */
/* Tailwind's preflight resets headings to inherit; legacy pages got these sizes
   from bootstrap. Scoped to the Components tab blocks (.cst-hN). */
.cst-h1.cst-text-content { font-size: 2.25rem; font-weight: 500; line-height: 1.1; }
.cst-h2.cst-text-content { font-size: 1.875rem; font-weight: 500; line-height: 1.1; }
.cst-h3.cst-text-content { font-size: 1.5rem; font-weight: 500; line-height: 1.1; }
.cst-h4.cst-text-content { font-size: 1.125rem; font-weight: 500; line-height: 1.1; }

/* Carousel/expandable icons use glyphicon classes. The published page aliases
   them via complete.css (which wins with !important); the canvas only has
   Font Awesome 5, so map the few icons these components use. */
.glyphicon { display: inline-block; font-family: "Font Awesome 5 Free"; font-weight: 900; font-style: normal; line-height: 1; }
.glyphicon-chevron-left::before { content: "\f053"; }
.glyphicon-chevron-right::before { content: "\f054"; }
.glyphicon-plus::before { content: "\f067"; }
.glyphicon-minus::before { content: "\f068"; }
