/*
Theme Name:  Bali Exotic Marine Park
Theme URI:   https://bali-dolphins.com
Description: Premium Astra child theme for Bali Exotic Marine Park & Lovina Dolphin Watching — cinematic, conversion-focused booking site (CPT programs, live booking, schema, glassmorphism front-end).
Author:      Starin Bali
Template:    astra
Version:     0.7.7
Requires PHP: 8.2
License:     GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bali-dolphins
*/

:root {
	--bd-primary: #0077b6;   /* ocean blue — replace with real brand color */
	--bd-accent: #00b4d8;
	--bd-coral: #ff6b4a;     /* warm accent, dolphindiscovery.com-style contrast — used sparingly (price only) */
	--bd-dark: #03045e;
	--bd-text: #334155;      /* body copy — softer than pure navy, easier to read at length */
	--bd-border: #e2e8f0;
	--bd-light: #caf0f8;
	--bd-whatsapp: #25d366;
	--bd-font-heading: "Poppins", "Segoe UI", sans-serif;
	--bd-font-body: "Inter", "Segoe UI", sans-serif;
	--bd-container: 1200px;  /* single width used everywhere so pages match Home */

	/* Bring Astra's own link/button/hover colors in line with the brand
	   palette above, instead of Astra's default blue — this is a global
	   override so header nav, footer widgets, and any core Astra button
	   all match without touching each one individually. */
	--ast-global-color-0: var(--bd-primary);
	--ast-global-color-1: var(--bd-accent);
	--ast-global-color-3: var(--bd-light);
	--ast-global-color-4: var(--bd-dark);
	--ast-global-color-5: var(--bd-text);
}

/* !important here because Astra prints its own dynamic Typography CSS
   (body font + heading font) as a separate inline block that isn't in
   our enqueue dependency chain, so normal cascade order can't be
   trusted to put us after it. */
body {
	font-family: var(--bd-font-body) !important;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--bd-text);
	overflow-x: hidden; /* safety net for the full-bleed hero below */
}

/* Astra renders #main as a flex item (flex: 0 1 auto) inside
   .ast-container. Without flex-grow, it shrinks to fit its content
   instead of filling the container — on Home, the 4-card program
   grid happens to be wide enough that this goes unnoticed, but on
   text-only pages (About/Contact/FAQ) it collapses to ~800px instead
   of the full ~1200px container, throwing off every width below it. */
#main {
	flex-grow: 1;
	min-width: 0; /* standard flexbox fix so content can't force overflow instead of wrapping */
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--bd-font-heading) !important;
	font-weight: 700;
	line-height: 1.25;
}

/* Hero — full-bleed edge-to-edge on desktop, breaking out of Astra's
   ast-container wrapper regardless of that container's max-width.
   !important because Astra's flex/container rules on ancestors have
   enough specificity to otherwise win and keep this boxed in. */
.bd-hero {
	position: relative;
	width: 100vw !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	background: linear-gradient(135deg, rgba(3, 4, 94, 0.92), rgba(0, 119, 182, 0.85)), var(--bd-hero-image, none);
	background-size: cover;
	background-position: center;
	color: #fff;
	padding: 5rem 1.5rem;
	text-align: center;
	overflow: hidden;
	box-sizing: border-box;
}

/* Decorative depth — used when no hero photo is set */
.bd-hero::before {
	content: "";
	position: absolute;
	inset: -20% -10% auto auto;
	width: 420px;
	height: 420px;
	background: radial-gradient(circle, rgba(0, 180, 216, 0.45), transparent 70%);
	pointer-events: none;
}

.bd-hero > * {
	position: relative;
}

.bd-hero h1 {
	color: #fff;
	font-size: clamp(1.9rem, 5vw, 3.25rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	margin-bottom: 0.75rem;
}

.bd-hero p {
	font-size: clamp(1rem, 2vw, 1.2rem);
	max-width: 640px;
	margin: 0 auto 1.5rem;
	opacity: 0.92;
}

/* Buttons */
.bd-btn {
	display: inline-block;
	padding: 0.85rem 1.75rem;
	border-radius: 999px;
	font-family: var(--bd-font-heading);
	font-weight: 600;
	text-decoration: none;
	min-height: 44px; /* touch target */
}

.bd-btn-whatsapp {
	background: var(--bd-whatsapp);
	color: #fff;
}

.bd-btn-whatsapp:hover {
	background: #1ebc59;
	color: #fff;
}

/* Program cards */
.bd-programs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1.5rem;
	padding: 3rem 1.5rem;
	max-width: var(--bd-container);
	margin: 0 auto;
}

.bd-program-card {
	border: 1px solid var(--bd-border);
	border-radius: 12px;
	padding: 1.5rem;
	text-align: center;
	transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.bd-program-card:hover {
	box-shadow: 0 20px 40px rgba(3, 4, 94, 0.15);
}

/* Reveal-on-scroll. Genuinely progressive: the hidden state only kicks
   in once JS adds `.js` to <html>, so if the script never loads the
   content stays visible instead of being stuck at opacity:0 (which would
   silently hide every program card). */
.bd-reveal {
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .bd-reveal {
	opacity: 0;
	transform: translateY(24px);
}

.js .bd-reveal.bd-revealed {
	opacity: 1;
	transform: translateY(0);
}

/* Accessible focus states */
a:focus-visible,
button:focus-visible,
select:focus-visible {
	outline: 3px solid var(--bd-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 8000ms !important;
		transition-duration: 100ms !important;
	}

	.bd-program-card:hover {
		transform: none !important;
	}
}

.bd-program-card h3 {
	color: var(--bd-dark);
	margin-bottom: 0.5rem;
}

.bd-program-card h3 a {
	color: inherit;
	text-decoration: none;
}

.bd-program-card h3 a:hover {
	text-decoration: underline;
}

.bd-program-card .bd-price {
	font-family: var(--bd-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--bd-coral);
	margin: 0.75rem 0 0.25rem;
}

.bd-price-child {
	font-size: 1rem;
	font-weight: 500;
	color: var(--bd-dark);
}

.bd-price-note,
.bd-duration {
	font-size: 0.875rem;
	color: #64748b;
	margin: 0.15rem 0;
}

/* WhatsApp floating action button */
.bd-wa-fab {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--bd-whatsapp);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	z-index: 999;
}

.bd-wa-fab svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}

/* Mobile sticky booking bar — hidden on desktop, replaces the FAB below 768px */
.bd-mobile-booking-bar {
	display: none;
}

@media (max-width: 768px) {
	.bd-wa-fab {
		display: none;
	}

	.bd-mobile-booking-bar {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 0.6rem;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999;
		background: var(--bd-whatsapp);
		color: #fff;
		font-family: var(--bd-font-heading);
		font-weight: 600;
		font-size: 1rem;
		text-decoration: none;
		padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
		box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
	}

	.bd-mobile-booking-bar svg {
		width: 22px;
		height: 22px;
		fill: #fff;
	}

	/* Keep the last section (and footer) from hiding behind the bar */
	body {
		padding-bottom: calc(64px + env(safe-area-inset-bottom));
	}
}

/* FAQ accordion — native <details>/<summary>, no JS needed.
   Outer width matches the site container (--bd-container) so the
   section lines up with Home; each item is re-centered to a narrower
   reading width since long paragraphs at full container width are
   harder to read. */
.bd-faq-list {
	max-width: var(--bd-container);
	margin: 0 auto;
	padding: 3rem 1.5rem;
}

.bd-faq-item,
.bd-faq-cta {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

.bd-faq-item {
	border-bottom: 1px solid var(--bd-border);
	padding: 1rem 0;
}

.bd-faq-item summary {
	cursor: pointer;
	font-family: var(--bd-font-heading);
	font-weight: 600;
	color: var(--bd-dark);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.bd-faq-item summary::-webkit-details-marker {
	display: none;
}

.bd-faq-item summary::after {
	content: "+";
	font-size: 1.5rem;
	color: var(--bd-primary);
	flex-shrink: 0;
}

.bd-faq-item[open] summary::after {
	content: "\2212"; /* minus sign */
}

.bd-faq-item p {
	margin-top: 0.75rem;
	color: #475569;
}

.bd-faq-cta {
	text-align: center;
	margin-top: 2rem;
	font-weight: 600;
}

.bd-faq-cta a {
	color: var(--bd-primary);
}

/* Generic content page (About, Contact, etc.) — same outer width as
   Home, text re-centered to a readable column inside it. */
.bd-content {
	max-width: var(--bd-container);
	margin: 0 auto;
	padding: 3rem 1.5rem;
}

.bd-content > * {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}

/* Editorial intro block followed by another section (programs/FAQ/form) —
   tighten the bottom gap so it doesn't double up with that section's own padding. */
.bd-editorial {
	padding-bottom: 0.5rem;
}

.bd-editorial p {
	line-height: 1.7;
	margin-bottom: 1rem;
}

.bd-content h2 {
	color: var(--bd-dark);
	margin-top: 2rem;
}

.bd-content > .bd-btn {
	display: table; /* shrink-to-fit while still centering via margin:auto */
	margin-top: 1rem;
}

.bd-list {
	padding-left: 1.25rem;
}

.bd-list li {
	margin-bottom: 0.5rem;
}

/* Rates page */
.bd-rates-table {
	margin-bottom: 2.5rem;
}

.bd-rates-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--bd-border);
}

.bd-rates-name {
	flex: 1 1 240px;
}

.bd-rates-name a {
	font-family: var(--bd-font-heading);
	font-weight: 600;
	color: var(--bd-dark);
	text-decoration: none;
}

.bd-rates-name a:hover {
	text-decoration: underline;
}

.bd-rates-duration {
	display: block;
	font-size: 0.8rem;
	color: #64748b;
}

.bd-rates-price {
	flex: 0 0 auto;
	font-family: var(--bd-font-heading);
	font-weight: 700;
	color: var(--bd-coral);
	white-space: nowrap;
}

.bd-rates-btn {
	flex: 0 0 auto;
	padding: 0.5rem 1.25rem;
	font-size: 0.9rem;
}

/* Single product detail page — body + sticky price sidebar */
.bd-content > .bd-product-detail {
	max-width: 960px;
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 2.5rem;
	align-items: start;
	text-align: left;
}

.bd-product-body p {
	margin-bottom: 1rem;
	line-height: 1.7;
}

.bd-product-sidebar {
	position: sticky;
	top: 1.5rem;
	border: 1px solid var(--bd-border);
	border-radius: 12px;
	padding: 1.5rem;
	background: #f8fafc;
}

.bd-product-sidebar .bd-price {
	font-family: var(--bd-font-heading);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--bd-coral);
	margin-bottom: 0.25rem;
}

.bd-product-sidebar p {
	font-size: 0.9rem;
	margin-bottom: 0.6rem;
}

.bd-product-sidebar-btn {
	display: block;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
	margin-top: 1rem;
}

@media (max-width: 720px) {
	.bd-content > .bd-product-detail {
		grid-template-columns: 1fr;
	}

	.bd-product-sidebar {
		position: static;
	}
}

.bd-map {
	margin-top: 1.5rem;
	border-radius: 12px;
	overflow: hidden;
}

/* Booking form */
.bd-booking-form {
	max-width: 640px;
	margin: 0 auto;
	background: #fff;
	border: 1px solid var(--bd-border);
	border-radius: 16px;
	padding: 2rem;
}

.bd-form-row {
	margin-bottom: 1.25rem;
}

.bd-form-row-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.bd-booking-form label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--bd-dark);
	margin-bottom: 0.35rem;
}

.bd-booking-form select,
.bd-booking-form input[type="date"],
.bd-booking-form input[type="number"],
.bd-booking-form input[type="text"] {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 1rem;
	font-family: var(--bd-font-body);
	box-sizing: border-box;
	accent-color: var(--bd-primary);
	background-color: #fff;
	color: var(--bd-text);
	/* Without this, browsers in OS/system dark mode render native
	   controls (especially the date input) with a dark background even
	   though the rest of the form is explicitly styled light. */
	color-scheme: light;
}

/* Native date input: the calendar icon can be recolored, but the
   popup calendar panel itself is drawn by the OS/browser and can't be
   restyled by any site's CSS — that part will stay each browser's
   own blue regardless of what we do here. */
.bd-booking-form input[type="date"] {
	position: relative;
	padding-right: 2.5rem;
	background-repeat: no-repeat;
	background-position: right 0.65rem center;
	background-size: 20px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230077b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.bd-booking-form input[type="date"]::-webkit-calendar-picker-indicator {
	opacity: 0;
	position: absolute;
	right: 0;
	width: 2.5rem;
	height: 100%;
	cursor: pointer;
}

.bd-booking-group-note,
.bd-booking-pickup-included-note {
	background: var(--bd-light);
	border-radius: 8px;
	padding: 0.75rem 1rem;
	font-size: 0.875rem;
	margin-bottom: 1.25rem;
}

.bd-booking-date-display {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: var(--bd-primary);
	font-weight: 600;
	min-height: 1.2em;
}

.bd-booking-checkbox {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--bd-dark);
	cursor: pointer;
}

.bd-booking-checkbox input[type="checkbox"] {
	width: 20px;
	height: 20px;
	accent-color: var(--bd-primary);
}

.bd-booking-pickup-address {
	margin-top: 0.75rem;
}

.bd-booking-summary {
	background: #f8fafc;
	border-radius: 12px;
	padding: 1.25rem;
	margin: 1.5rem 0;
}

.bd-booking-breakdown div {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	color: var(--bd-text);
	margin-bottom: 0.4rem;
}

.bd-booking-total-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	border-top: 1px solid var(--bd-border);
	padding-top: 0.75rem;
	margin-top: 0.5rem;
	font-family: var(--bd-font-heading);
}

.bd-booking-total-row strong {
	font-size: 1.5rem;
	color: var(--bd-coral);
}

.bd-booking-submit-btn {
	display: block;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

.bd-booking-disclaimer {
	font-size: 0.8rem;
	color: #64748b;
	text-align: center;
	margin-top: 0.75rem;
}

@media (max-width: 560px) {
	.bd-form-row-split {
		grid-template-columns: 1fr;
	}
}

/* Section heading above a full-width grid/section (Home programs, Lovina
   packages) — matches the site container and stays centered. */
.bd-section-heading {
	max-width: var(--bd-container);
	margin: 2.5rem auto 0;
	padding: 0 1.5rem;
	text-align: center;
	color: var(--bd-dark);
}

/* Breadcrumbs */
.bd-breadcrumbs {
	max-width: var(--bd-container);
	margin: 1.25rem auto 0;
	padding: 0 1.5rem;
	font-size: 0.85rem;
	color: #64748b;
}

.bd-breadcrumbs a {
	color: var(--bd-primary);
	text-decoration: none;
}

.bd-breadcrumbs a:hover {
	text-decoration: underline;
}

.bd-breadcrumb-sep {
	color: #94a3b8;
}

.bd-related-links {
	padding-top: 0;
}

/* Related programs grid on single product pages */
.bd-content > .bd-related-grid {
	max-width: 960px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 1rem;
	margin-top: 1rem;
	text-align: left;
}

.bd-related-card {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 1.2rem;
	border: 1px solid var(--bd-border);
	border-radius: 14px;
	text-decoration: none;
	color: var(--bd-text);
	background: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bd-related-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 30px rgba(3, 4, 94, 0.12);
}

.bd-related-card strong {
	color: var(--bd-dark);
	font-family: var(--bd-font-heading);
}

.bd-related-card span {
	font-size: 0.88rem;
	color: #64748b;
}

.bd-related-price {
	color: var(--bd-coral) !important;
	font-weight: 700;
	margin-top: 0.3rem;
}

/* Trust signals */
.bd-trust-strip {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2rem;
	padding: 2rem 1.5rem;
	background: var(--bd-light);
	text-align: center;
}
