/**
 * IC Events — front-end styles
 *
 * All selectors are prefixed with .rg- so they should not clash
 * with theme or page-builder styles. Override freely in your theme
 * or child theme to match your brand.
 *
 * NOTE: font-size is intentionally left to the theme. Do not add
 * font-size rules here.
 */

/* -------------------------------------------------------------
 * Icon helper — inline SVG icons (calendar, location, sterling).
 * Sized to match the surrounding text via 1em / currentColor.
 * ----------------------------------------------------------- */
.ic-event__icon {
	width: 1em;
	height: 1em;
	margin-right: 0.5em;
	opacity: 0.85;
	flex: 0 0 auto;
	display: inline-block;
	vertical-align: -0.125em;
	fill: currentColor;
}

/* -------------------------------------------------------------
 * Events grid (shortcode [ic_events_grid])
 * ----------------------------------------------------------- */
/*
 * The shortcode writes display, grid-template-columns and gap inline so
 * the grid renders even when this stylesheet is blocked by a page
 * builder. The rules below cover everything else (card styling,
 * hover, responsive breakpoints).
 */
.ic-events-grid {
	display: grid;
	gap: 1.5rem;
}

/*
 * Card chrome — kept visually in line with IC Business Directory's
 * .ic-business-card: same border treatment, same padding rhythm, same
 * dark ink for the title. The card itself is still the clickable
 * anchor; the meta lines + button sit inside.
 */
.ic-event-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	/* Reset inherited link colour from the host theme — the card title
	 * + meta lines override individually below. Without this, anchors
	 * inherit the theme accent and the h3 inside picks that up too. */
	color: #1a1f2e;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ic-event-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(11, 34, 23, 0.10);
	border-color: #d6dbe2;
}

.ic-event-card__image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.ic-event-card__body {
	display: flex;
	flex-direction: column;
	padding: 22px 24px 24px;
}

/*
 * Title — opinionated dark ink so the card title doesn't inherit
 * the link/accent colour from whichever theme is in play. Matches
 * the typography of .ic-business-title in IC Business Directory.
 */
.ic-event-card__title {
	margin: 0 0 12px;
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ic-events-accent-dark, #0B2217);
}

.ic-event-card__meta {
	margin: 4px 0;
	color: #4b5563;
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/*
 * The card's "MORE INFO" affordance. Visually a button; structurally
 * a <span> because the whole .ic-event-card is already an anchor —
 * nesting <button> inside <a> would be invalid HTML. The card itself
 * stays the clickable target; this just gives the affordance a
 * proper button look.
 */
.ic-event-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1.1rem;
	align-self: flex-start;
	padding: 0.65rem 1.15rem;
	background: var(--ic-events-accent, #2563eb);
	color: #fff;
	border-radius: var(--ic-events-radius-sm, 8px);
	font-weight: 600;
	letter-spacing: 0.04em;
	font-size: 0.85em;
	text-transform: uppercase;
	box-shadow: 0 4px 10px var(--ic-events-accent-soft, rgba(37, 99, 235, 0.18));
	transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* Lift the button slightly when the card itself is hovered — connects
 * the card-level hover-translate with the button affordance so they
 * feel like one interactive element. The background swaps to the
 * darker accent (`--ic-events-accent-dark`, computed from the site
 * accent in PHP) for a discrete colour shift rather than a brightness
 * filter. */
.ic-event-card:hover .ic-event-card__btn,
.ic-event-card:focus-visible .ic-event-card__btn {
	background: var(--ic-events-accent-dark, #1d4ed8);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px var(--ic-events-accent-glow, rgba(37, 99, 235, 0.3));
}

@media (max-width: 900px) {
	.ic-events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.ic-events-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------
 * Single event layout (shortcode [ic_event_details])
 * ----------------------------------------------------------- */
.ic-event {
	max-width: 860px;
	margin: 0 auto;
	padding: 2rem 1rem;
	color: #222;
}

.ic-event__header {
	margin-bottom: 2rem;
}

.ic-event__image img {
	width: 100%;
	height: auto;
	border-radius: 12px;
	display: block;
}

.ic-event__title {
	margin: 1.25rem 0 0;
	line-height: 1.2;
}

.ic-event__meta {
	list-style: none;
	padding: 1.25rem;
	margin: 0 0 2rem;
	background: #f6f7f9;
	border-radius: 12px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
}

.ic-event__meta li {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.ic-event__meta li > span {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.ic-event__meta-label {
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #777;
}

.ic-event__meta strong {
	color: #111;
}

.ic-event__meta small {
	color: #666;
}

.ic-event__content {
	margin-bottom: 2.5rem;
	line-height: 1.65;
}

.ic-event__content h2 {
	margin: 0 0 0.75rem;
}

.ic-event__content p {
	margin: 0 0 1em;
}

.ic-event__booking {
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.ic-event__booking h2 {
	margin: 0 0 1rem;
}

/* -------------------------------------------------------------
 * Booking form (shortcode [ic_event_booking])
 *
 * Self-contained "card" — sits comfortably below the_content on the
 * single-event template, or anywhere [ic_event_booking] is dropped.
 * All colours and radii come from CSS custom properties so the host
 * theme can re-skin the form by setting:
 *   --ic-events-accent
 *   --ic-events-ink
 *   --ic-events-border
 *   --ic-events-radius
 * at any ancestor selector.
 * ----------------------------------------------------------- */
.ic-event-booking {
	--_accent:       var(--ic-events-accent, #2563eb);
	--_accent-soft:  var(--ic-events-accent-soft, rgba(37, 99, 235, 0.14));
	--_ink:          var(--ic-events-ink, #1a1f2e);
	--_ink-soft:     var(--ic-events-ink-soft, #4b5563);
	--_border:       var(--ic-events-border, #d6dbe2);
	--_card-bg:      var(--ic-events-card-bg, #fff);
	--_meta-bg:      var(--ic-events-meta-bg, #f6f9f7);
	--_radius:       var(--ic-events-radius, 12px);
	--_radius-sm:    var(--ic-events-radius-sm, 8px);
	--_shadow:       var(--ic-events-shadow, 0 4px 14px rgba(0, 0, 0, 0.06));

	position: relative;
	background: var(--_card-bg);
	border: 1px solid var(--_border);
	border-radius: var(--_radius);
	box-shadow: var(--_shadow);
	padding: 1.75rem;
	color: var(--_ink);
}

@media (max-width: 480px) {
	.ic-event-booking { padding: 1.25rem; }
}

/* State banners — success / error / sold out */

.ic-event-booking__success,
.ic-event-booking__errors {
	padding: 1rem 1.1rem;
	border-radius: var(--_radius-sm);
	margin: 0 0 1.25rem;
	border: 1px solid;
	line-height: 1.5;
}

.ic-event-booking__success {
	background: rgba(34, 197, 94, 0.08);
	border-color: rgba(34, 197, 94, 0.3);
	color: #14532d;
}

.ic-event-booking__success p { margin: 0 0 0.25rem; }
.ic-event-booking__success p:last-child { margin: 0; }

.ic-event-booking__errors {
	background: rgba(220, 38, 38, 0.06);
	border-color: rgba(220, 38, 38, 0.3);
	color: #7f1d1d;
}

.ic-event-booking__errors ul {
	margin: 0;
	padding-left: 1.1rem;
	list-style: disc;
}

.ic-event-booking__errors li { margin: 0.15rem 0; }

.ic-event-booking__soldout {
	text-align: center;
	margin: 0;
	padding: 1.5rem 1rem;
	background: rgba(220, 38, 38, 0.08);
	border: 1px solid rgba(220, 38, 38, 0.25);
	border-radius: var(--_radius-sm);
	color: #7f1d1d;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ic-event-booking__unavailable {
	margin: 0;
	padding: 1.25rem;
	background: var(--_meta-bg);
	border: 1px dashed var(--_border);
	border-radius: var(--_radius-sm);
	color: var(--_ink-soft);
	text-align: center;
}

/* Form layout — single column, generous spacing */

.ic-event-booking__form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ic-event-booking__field {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin: 0;
}

.ic-event-booking__field label {
	font-weight: 600;
	color: var(--_ink);
	letter-spacing: 0.01em;
}

.ic-event-booking .ic-required {
	color: #dc2626;
	margin-left: 0.15em;
}

/* Inputs + selects share the same look */

.ic-event-booking__field input[type="text"],
.ic-event-booking__field input[type="email"],
.ic-event-booking__field input[type="tel"],
.ic-event-booking__field input[type="number"],
.ic-event-booking__field select {
	width: 100%;
	padding: 0.75rem 0.9rem;
	background: #fff;
	border: 1px solid var(--_border);
	border-radius: var(--_radius-sm);
	color: var(--_ink);
	font: inherit;
	line-height: 1.4;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ic-event-booking__field input::placeholder { color: #9aa3b2; }

.ic-event-booking__field input:hover,
.ic-event-booking__field select:hover {
	border-color: #9aa3b2;
}

.ic-event-booking__field input:focus,
.ic-event-booking__field input:focus-visible,
.ic-event-booking__field select:focus,
.ic-event-booking__field select:focus-visible {
	outline: none;
	border-color: var(--_accent);
	box-shadow: 0 0 0 4px var(--_accent-soft);
}

.ic-event-booking__field select {
	appearance: none;
	-webkit-appearance: none;
	background-image:
		linear-gradient(45deg, transparent 50%, currentColor 50%),
		linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
	background-size: 6px 6px;
	background-repeat: no-repeat;
	padding-right: 2.4rem;
	cursor: pointer;
}

/* Read-only single-ticket summary row */

.ic-event-booking__field--readonly {
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	padding: 0.85rem 1rem;
	background: var(--_meta-bg);
	border: 1px solid var(--_border);
	border-radius: var(--_radius-sm);
}

.ic-event-booking__ticket-label { font-weight: 600; }
.ic-event-booking__ticket-price { font-weight: 600; color: var(--_accent); }

/* Primary submit button — overrides the theme's .thebutton if present */

.ic-event-booking__btn {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
	padding: 0.95rem 1.6rem;
	background: var(--_accent);
	color: #fff;
	border: 0;
	border-radius: var(--_radius-sm);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1;
	box-shadow: 0 6px 14px var(--_accent-soft);
	transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ic-event-booking__btn:hover,
.ic-event-booking__btn:focus-visible {
	outline: none;
	background: var(--ic-events-accent-dark, #1d4ed8);
	box-shadow: 0 10px 22px var(--ic-events-accent-glow, rgba(37, 99, 235, 0.3));
	transform: translateY(-1px);
}

.ic-event-booking__btn:active {
	transform: translateY(0);
	background: var(--ic-events-accent-dark, #1d4ed8);
	box-shadow: 0 4px 10px var(--_accent-soft);
}

.ic-event-booking__btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.ic-event-booking__stock,
.ic-event-booking__note {
	margin: 0.6rem 0 0;
	color: var(--_ink-soft);
	font-size: 0.92em;
}

/* Optional ticket-tile + guest-name styling kept for backwards
 * compatibility with templates that emit these markup blocks. */

.ic-event-booking__tickets {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.ic-event-booking__ticket {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.85rem 1rem;
	background: var(--_meta-bg);
	border: 1px solid var(--_border);
	border-radius: var(--_radius-sm);
}

@media (max-width: 480px) {
	.ic-event-booking__ticket {
		flex-direction: column;
		align-items: flex-start;
	}
}

.ic-event-booking__ticket-name { line-height: 1.3; font-weight: 600; }

.ic-event-booking__ticket-qty { margin: 0; }

.ic-event-booking__ticket-qty .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* -------------------------------------------------------------
 * Guest name inputs (scaled by booking quantity, per ticket type)
 * ----------------------------------------------------------- */
.ic-guest-names {
	width: 100%;
	margin-top: 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ic-guest-names__group {
	padding: 0.75rem 1rem;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 8px;
}

.ic-guest-names__heading {
	margin: 0 0 0.5rem;
	font-weight: 600;
}

.ic-guest-names__rows {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ic-guest-names__row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.ic-guest-names__row span {
	min-width: 70px;
	color: #555;
}

.ic-guest-names__row input {
	flex: 1;
	padding: 0.55rem 0.75rem;
	border: 1px solid #ccc;
	border-radius: 6px;
	min-width: 220px;
}
