/**
 * Hussain Aware Bookings — front-end styles.
 *
 * Scoped entirely under .haw-* class names so nothing here can leak into
 * the theme, and written with CSS custom properties so a theme can
 * restyle the widget by redefining the variables rather than overriding
 * selectors.
 *
 * RTL is handled with logical properties (margin-inline, inset-inline,
 * text-align: start) instead of a separate -rtl stylesheet, so the same
 * file is correct in both directions (CLAUDE.md §16: "The UI is
 * responsive and RTL-compatible").
 */

.haw-session,
.haw-booking {
	--haw-bg: #faf8f5;
	--haw-surface: #ffffff;
	--haw-ink: #1c1a17;
	--haw-muted: #6f6a63;
	--haw-line: #e6e1d9;
	--haw-accent: #9a7b4f;
	--haw-dark: #12100e;
	--haw-radius: 12px;
	--haw-gap: 1.25rem;
}

/* ---------------------------------------------------------------- Session */

.haw-session {
	color: var(--haw-ink);
}

.haw-session__hero {
	display: grid;
	gap: var(--haw-gap);
	align-items: center;
	padding: clamp(1.5rem, 4vw, 3.5rem);
	background: var(--haw-dark);
	color: #f6f2ec;
}

.haw-session__hero.has-image {
	grid-template-columns: 1fr;
}

@media (min-width: 900px) {
	.haw-session__hero.has-image {
		grid-template-columns: 1fr 1fr;
	}
}

.haw-session__hero-media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--haw-radius);
}

.haw-session__title {
	margin: 0 0 0.5rem;
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1.15;
}

.haw-session__lede {
	margin: 0 0 1.5rem;
	max-width: 46ch;
	color: #d9d2c8;
	font-size: 1.05rem;
	line-height: 1.7;
}

.haw-session__attributes {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1rem, 3vw, 2.5rem);
	margin: 0 0 1.75rem;
	padding: 0;
	list-style: none;
}

.haw-session__attributes li {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.haw-session__attribute-value {
	font-size: 1.15rem;
	font-weight: 600;
}

.haw-session__attribute-label {
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #b6ada0;
}

.haw-session__content {
	max-width: 70ch;
	margin-inline: auto;
	padding: clamp(1.5rem, 4vw, 3rem) 1.25rem;
	line-height: 1.8;
}

.haw-session__closed {
	padding: 2rem 1.25rem;
	text-align: center;
	color: var(--haw-muted);
}

/* ---------------------------------------------------------------- Buttons */

.haw-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.9rem 1.75rem;
	border: 0;
	border-radius: 8px;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.haw-button--primary {
	background: var(--haw-accent);
	color: #fff;
}

.haw-session__cta {
	background: var(--haw-accent);
}

.haw-button:hover {
	opacity: 0.9;
}

.haw-button:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.haw-button.is-loading {
	opacity: 0.7;
	cursor: progress;
}

/* Never remove the focus ring: keyboard users need it (CLAUDE.md §16). */
.haw-button:focus-visible,
.haw-slot:focus-visible,
.haw-calendar__day:focus-visible,
.haw-calendar__nav:focus-visible,
.haw-field__input:focus-visible {
	outline: 2px solid var(--haw-accent);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- Booking */

.haw-booking {
	padding: clamp(1.5rem, 4vw, 3rem) 1.25rem;
	background: var(--haw-bg);
}

.haw-booking__heading {
	margin: 0 0 1.75rem;
	text-align: center;
	font-size: clamp(1.4rem, 3vw, 2rem);
}

.haw-booking__grid {
	display: grid;
	gap: var(--haw-gap);
	max-width: 1120px;
	margin-inline: auto;
	grid-template-columns: 1fr;
}

@media (min-width: 720px) {
	.haw-booking__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1040px) {
	.haw-booking__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.haw-booking__calendar,
.haw-booking__slots,
.haw-booking__form {
	padding: 1.25rem;
	background: var(--haw-surface);
	border: 1px solid var(--haw-line);
	border-radius: var(--haw-radius);
}

.haw-booking__subheading {
	margin: 0 0 0.75rem;
	font-size: 1rem;
	font-weight: 600;
}

.haw-booking__selected-date,
.haw-booking__hint {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: var(--haw-muted);
}

.haw-booking__error {
	margin: 0 0 0.75rem;
	padding: 0.65rem 0.85rem;
	border-radius: 8px;
	background: #fdeceb;
	color: #8f2119;
	font-size: 0.9rem;
}

.haw-booking__reassurance {
	margin: 0.75rem 0 0;
	font-size: 0.8rem;
	color: var(--haw-muted);
	text-align: center;
}

/* --------------------------------------------------------------- Calendar */

.haw-calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.haw-calendar__month {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
}

.haw-calendar__nav {
	width: 2rem;
	height: 2rem;
	border: 1px solid var(--haw-line);
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}

/* The chevrons are direction-agnostic glyphs; flipping the container in
   RTL keeps "previous" on the correct side without swapping characters. */
[dir="rtl"] .haw-calendar__header {
	flex-direction: row-reverse;
}

.haw-calendar__weekdays,
.haw-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.haw-calendar__weekday {
	padding: 0.35rem 0;
	text-align: center;
	font-size: 0.75rem;
	color: var(--haw-muted);
}

.haw-calendar__day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
}

.haw-calendar__day--empty {
	cursor: default;
}

.haw-calendar__day.is-available {
	border-color: var(--haw-line);
}

.haw-calendar__day.is-available:hover {
	border-color: var(--haw-accent);
}

.haw-calendar__day.is-unavailable {
	color: #c4bdb2;
	cursor: not-allowed;
}

.haw-calendar__day.is-selected {
	background: var(--haw-dark);
	border-color: var(--haw-dark);
	color: #fff;
}

.haw-calendar__timezone {
	margin: 0.9rem 0 0;
	font-size: 0.8rem;
	color: var(--haw-muted);
	text-align: center;
}

/* ------------------------------------------------------------------ Slots */

.haw-slots {
	display: grid;
	gap: 0.5rem;
}

.haw-slot {
	padding: 0.75rem 1rem;
	border: 1px solid var(--haw-line);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: center;
	cursor: pointer;
}

.haw-slot:hover:not(:disabled) {
	border-color: var(--haw-accent);
}

.haw-slot.is-selected {
	background: var(--haw-dark);
	border-color: var(--haw-dark);
	color: #fff;
}

.haw-slot.is-unavailable,
.haw-slot:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ----------------------------------------------------------------- Fields */

.haw-field {
	margin: 0 0 0.9rem;
}

.haw-field__label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.85rem;
	font-weight: 500;
}

.haw-field__input {
	display: block;
	width: 100%;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--haw-line);
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
	/* Logical alignment: correct in both LTR and RTL without an override. */
	text-align: start;
}

.haw-field__input--textarea {
	resize: vertical;
	min-height: 5rem;
}

.haw-booking__submit {
	width: 100%;
	background: var(--haw-dark);
	color: #fff;
}

/* --------------------------------------------------- Confirmation (P15) */

.haw-confirmation {
	--haw-bg: #faf8f5;
	--haw-surface: #ffffff;
	--haw-ink: #1c1a17;
	--haw-muted: #6f6a63;
	--haw-line: #e6e1d9;
	--haw-accent: #9a7b4f;
	--haw-dark: #12100e;
	--haw-radius: 12px;
	max-width: 1080px;
	margin-inline: auto;
	padding: clamp(2rem, 5vw, 4rem) 1.25rem;
	color: var(--haw-ink);
}

.haw-confirmation__header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.haw-confirmation__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: #e3f2e6;
	color: #2f7d4f;
	font-size: 1.5rem;
}

.haw-confirmation__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.6rem, 4vw, 2.5rem);
	color: #2f7d4f;
}

.haw-confirmation__lede {
	margin: 0;
	color: var(--haw-muted);
	line-height: 1.7;
}

.haw-confirmation__grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

@media (min-width: 860px) {
	.haw-confirmation__grid {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
}

.haw-confirmation__panel {
	padding: 1.5rem;
	background: var(--haw-surface);
	border: 1px solid var(--haw-line);
	border-radius: var(--haw-radius);
}

.haw-confirmation__panel-title {
	margin: 0 0 1rem;
	font-size: 1rem;
}

.haw-confirmation__actions {
	display: grid;
	gap: 0.5rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
}

.haw-confirmation__note {
	margin: 1rem 0 0;
	font-size: 0.85rem;
	color: var(--haw-muted);
}

.haw-action {
	display: block;
	padding: 0.75rem 1rem;
	border: 1px solid var(--haw-line);
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	font-size: 0.9rem;
	text-align: center;
}

.haw-action--static {
	color: var(--haw-muted);
	border-style: dashed;
}

/* Meeting card */

.haw-meeting {
	padding: 1.25rem;
	border-radius: var(--haw-radius);
	background: #f3efe8;
}

.haw-meeting__title {
	margin: 0 0 0.5rem;
	font-size: 1rem;
}

.haw-meeting__text {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--haw-muted);
}

.haw-meeting__join {
	width: 100%;
	background: var(--haw-dark);
	color: #fff;
}

/* Summary shared partial */

.haw-summary__head {
	display: flex;
	gap: 0.9rem;
	align-items: center;
	margin-bottom: 1rem;
}

.haw-summary__image {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
}

.haw-summary__title {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
}

.haw-summary__meta {
	margin: 0;
	font-size: 0.85rem;
	color: #6f6a63;
}

.haw-summary__details {
	margin: 0;
}

.haw-summary__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid #e6e1d9;
}

.haw-summary__row:last-child {
	border-bottom: 0;
}

.haw-summary__row dt {
	margin: 0;
	color: #6f6a63;
	font-size: 0.85rem;
}

.haw-summary__row dd {
	margin: 0;
	font-weight: 600;
	/* Logical alignment keeps values on the trailing edge in both LTR and RTL. */
	text-align: end;
}

/* ------------------------------------------------- My Account (P17) */

.haw-account-bookings__heading {
	margin: 1.5rem 0 0.75rem;
	font-size: 1.05rem;
}

.haw-account-bookings__list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 0.75rem;
}

.haw-account-booking {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border: 1px solid #e6e1d9;
	border-radius: 12px;
	background: #fff;
}

.haw-account-booking--cancelled {
	opacity: 0.6;
}

.haw-account-booking__title {
	margin: 0 0 0.25rem;
	font-size: 1rem;
}

.haw-account-booking__when {
	margin: 0 0 0.15rem;
	font-weight: 600;
}

.haw-account-booking__meta {
	margin: 0;
	font-size: 0.85rem;
	color: #6f6a63;
}

.haw-account-booking__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.haw-account-booking__pending {
	font-size: 0.85rem;
	color: #6f6a63;
}

.haw-account-bookings__empty,
.haw-account-bookings__note {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	color: #6f6a63;
}

/* ------------------------------------------------ Cancel/reschedule (P18) */

.haw-action--danger {
	width: 100%;
	background: transparent;
	border-color: #d9534f;
	color: #b3352f;
	font: inherit;
	cursor: pointer;
}

.haw-action--danger:hover {
	background: #fdeceb;
}

.haw-action--danger:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
