/* ALSQ Core front-end components. Uses theme presets with safe fallbacks. RTL via logical properties. */
:root {
	--alsq-navy: var(--wp--preset--color--navy, #082c50);
	--alsq-emerald: var(--wp--preset--color--emerald, #16865d);
	--alsq-gold: var(--wp--preset--color--gold, #e4b947);
	--alsq-ink: var(--wp--preset--color--ink, #17243a);
	--alsq-muted: var(--wp--preset--color--muted, #4a5a70);
	--alsq-danger: #b42318;
}

/* ---------- Programs: arched panels ---------- */
.alsq-programs { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 0; }
.alsq-program {
	display: flex; flex-direction: column; gap: .35rem; box-sizing: border-box;
	border-radius: 150px 150px 18px 18px; background: var(--alsq-cream, #FFF9EF); border: 1px solid var(--alsq-sand, #EADFC8);
	padding: 4.5rem 2rem 2rem;
}
.alsq-program p { margin: 0; }
.alsq-program__age { font-family: var(--alsq-heading, 'Readex Pro', sans-serif); font-weight: 700; font-size: 3.5rem; line-height: 1; color: var(--alsq-navy); }
.alsq-program__age-label { font-size: .88rem; color: var(--alsq-muted); }
.alsq-program__title { margin: .75rem 0 .1rem; font-size: 1.45rem; }
.alsq-program__title a { color: var(--alsq-navy); text-decoration: none; }
.alsq-program__title a:hover { text-decoration: underline; }
.alsq-program__text { color: var(--alsq-muted); }
.alsq-program .alsq-placeholder { margin-block-start: .5rem; }
.alsq-program__more { margin-block-start: auto !important; padding-block-start: .75rem; }
.alsq-program__more a { font-weight: 600; color: var(--alsq-emerald-text, #0F6E4C); }
.alsq-program:nth-child(3n) { background: var(--alsq-navy); border-color: var(--alsq-navy); }
.alsq-program:nth-child(3n) .alsq-program__age { color: var(--alsq-gold); }
.alsq-program:nth-child(3n) .alsq-program__age-label, .alsq-program:nth-child(3n) .alsq-program__text { color: #DCE4EE; }
.alsq-program:nth-child(3n) .alsq-program__title a { color: #fff; }
.alsq-program:nth-child(3n) .alsq-program__more a { color: var(--alsq-gold); }
.alsq-program:nth-child(3n) .alsq-placeholder { background: rgba(255,244,214,.12); color: #F3DFA0; border-color: rgba(228,185,71,.6); }
@media (max-width: 600px) { .alsq-program { border-radius: 120px 120px 16px 16px; padding: 3.5rem 1.5rem 1.5rem; } .alsq-program__age { font-size: 2.75rem; } }

/* ---------- Events: rows with arched date block ---------- */
.alsq-events { list-style: none; margin: 1.5rem 0; padding: 0; border-block-start: 1px solid var(--alsq-sand, #EADFC8); }
.alsq-event { display: flex; gap: 1.35rem; align-items: center; padding: 1.25rem 0; border-block-end: 1px solid var(--alsq-sand, #EADFC8); }
.alsq-event__date {
	flex: none; width: 72px; height: 84px; border-radius: 36px 36px 10px 10px; background: var(--alsq-navy); color: #fff;
	display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--alsq-heading, 'Readex Pro', sans-serif);
}
.alsq-event:nth-child(even) .alsq-event__date { background: var(--alsq-cream, #FFF9EF); color: var(--alsq-navy); border: 1px solid var(--alsq-sand, #EADFC8); }
.alsq-event__day { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.alsq-event__month { font-size: .8rem; }
.alsq-event__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.alsq-event__title { margin: 0; font-size: 1.2rem; }
.alsq-event__title a { color: var(--alsq-navy); text-decoration: none; }
.alsq-event__title a:hover { text-decoration: underline; }
.alsq-event__meta { margin: 0; color: var(--alsq-muted); font-size: .95rem; }
.alsq-event.is-past { opacity: .8; }
.alsq-badge { display: inline-block; width: fit-content; padding: .15rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: rgba(22,134,93,.12); color: #0E5C40; }
.alsq-badge--alert { background: #FDE8E7; color: var(--alsq-danger); }
.alsq-placeholder { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem; border-radius: 8px; background: #FFF4D6; color: #6B4E00; border: 1px dashed #C9A227; font-size: .88em; font-weight: 500; width: fit-content; }
.alsq-placeholder--sm { font-size: .8rem; }
.alsq-empty { color: var(--alsq-muted); padding: 1.25rem 1.5rem; background: var(--alsq-cream, #FFF9EF); border: 1px dashed var(--alsq-sand, #EADFC8); border-radius: 12px; margin: 1.5rem 0; }
.alsq-section.has-cream-background-color .alsq-empty { background: #fff; }

/* ---------- News ---------- */
.alsq-news { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.alsq-news__item { display: flex; flex-direction: column; gap: .6rem; }
.alsq-card__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; border-radius: 16px; }
.alsq-card__img--placeholder { background: var(--alsq-sand, #EADFC8); }
.alsq-news__body { display: flex; flex-direction: column; gap: .35rem; }
.alsq-news__body p { margin: 0; color: var(--alsq-muted); }
.alsq-news__body h3 { margin: 0; font-size: 1.2rem; }
.alsq-news__body h3 a { color: var(--alsq-navy); text-decoration: none; }
.alsq-news__body h3 a:hover { text-decoration: underline; }
.alsq-news__date { font-size: .9rem; }
.alsq-card__more a { font-weight: 600; color: var(--alsq-emerald-text, #0F6E4C); }

/* Single program / event */
.alsq-program-details h2 { font-size: 1.3rem; margin-block-start: 2rem; }
.alsq-event-meta dl { display: grid; gap: .75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 1rem 0 1.5rem; }
.alsq-event-meta dt { font-size: .85rem; color: var(--alsq-muted); }
.alsq-event-meta dd { margin: 0; font-weight: 600; color: var(--alsq-navy); }

.alsq-contact-list { list-style: none; padding: 0; display: grid; gap: .6rem; }

/* ---------- Forms ---------- */
.alsq-form-wrap { max-width: 760px; margin-inline: auto; scroll-margin-top: 110px; }
.alsq-form-intro { background: #f5f7fa; border-inline-start: 4px solid var(--alsq-emerald); padding: 1rem 1.25rem; border-radius: 8px; }
.alsq-form-alert { background: #fde8e7; color: var(--alsq-danger); border: 1px solid #f4b4ae; padding: 1rem 1.25rem; border-radius: 10px; margin-block: 1rem; font-weight: 600; }
.alsq-form { background: #fff; border-radius: 18px; border: 1px solid var(--alsq-sand, #EADFC8); padding: clamp(1.25rem, 4vw, 2.5rem); }
.alsq-step + .alsq-step { margin-block-start: 2rem; padding-block-start: 2rem; border-block-start: 1px solid #e3e8ef; }
.alsq-form.is-enhanced .alsq-step + .alsq-step { margin: 0; padding: 0; border: 0; }
.alsq-step__title { font-family: var(--alsq-heading, 'Readex Pro', sans-serif); font-size: 1.35rem; margin: 0 0 1.25rem; }
.alsq-step__title:focus { outline: none; }
.alsq-step__count { display: block; font-size: .85rem; font-weight: 500; color: var(--alsq-muted); margin-block-end: .25rem; }

.alsq-field { margin-block-end: 1.25rem; }
.alsq-field > label, .alsq-field legend { display: block; font-weight: 600; margin-block-end: .4rem; color: var(--alsq-ink); padding: 0; }
.alsq-field fieldset { border: 0; padding: 0; margin: 0; }
.alsq-req { color: var(--alsq-danger); }
.alsq-opt { font-weight: 400; color: var(--alsq-muted); font-size: .9em; }
.alsq-hint { margin: -.15rem 0 .4rem; font-size: .9rem; color: var(--alsq-muted); }
.alsq-field input[type="text"], .alsq-field input[type="email"], .alsq-field input[type="tel"],
.alsq-field input[type="date"], .alsq-field select, .alsq-field textarea {
	width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
	padding: .75rem .9rem; border: 1.5px solid #b8c2d0; border-radius: 10px; background: #fff; color: var(--alsq-ink);
	min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.alsq-field input:focus, .alsq-field select:focus, .alsq-field textarea:focus { border-color: var(--alsq-navy); box-shadow: 0 0 0 3px rgba(228,185,71,.45); outline: none; }
[dir="rtl"] .alsq-field input[dir="ltr"] { text-align: right; }
.alsq-field.has-error input, .alsq-field.has-error select, .alsq-field.has-error textarea { border-color: var(--alsq-danger); }
.alsq-error { margin: .35rem 0 0; color: var(--alsq-danger); font-size: .9rem; font-weight: 500; }
.alsq-error:empty { display: none; }
.alsq-error:not(:empty)::before { content: "⚠ "; }

.alsq-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.alsq-choice { display: inline-flex; align-items: flex-start; gap: .6rem; cursor: pointer; padding: .7rem 1rem; border: 1.5px solid #d3dae4; border-radius: 10px; min-height: 48px; box-sizing: border-box; }
.alsq-choice:has(input:checked) { border-color: var(--alsq-emerald); background: rgba(22,134,93,.06); }
.alsq-choice input { width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--alsq-emerald); flex: none; }
.alsq-field--consent .alsq-choice { display: flex; border: 0; padding: .4rem 0; font-weight: 400; }
.alsq-field--consent a { display: inline-block; margin-inline-start: 2rem; font-size: .9rem; }
.alsq-field--radio .alsq-choices { flex-direction: column; }
.alsq-field--radio .alsq-choices:has(> :nth-child(2):last-child) { flex-direction: row; }
.alsq-note { background: #fff9ef; border: 1px solid #f0dfb2; padding: 1rem; border-radius: 10px; }

.alsq-form-nav { display: flex; gap: .75rem; justify-content: space-between; flex-wrap: wrap; margin-block-start: 1.5rem; }
.alsq-form-nav .alsq-next, .alsq-form-nav .alsq-submit { margin-inline-start: auto; }
.alsq-form-nav .alsq-btn { min-height: 48px; }
.alsq-btn[disabled] { opacity: .7; cursor: progress; }
.alsq-arrow--back { transform: none; }
[dir="rtl"] .alsq-arrow--back { transform: scaleX(-1); }

/* Progress indicator (visual only; each step heading announces "Step x of y") */
.alsq-progress { display: none; }
.alsq-form-wrap.is-enhanced .alsq-progress { display: flex; list-style: none; padding: 0; margin: 1.5rem 0; gap: .5rem; counter-reset: s; }
.alsq-progress li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .8rem; color: var(--alsq-muted); text-align: center; position: relative; }
.alsq-progress li::before { content: ""; position: absolute; inset-block-start: 17px; inset-inline-start: -50%; width: 100%; height: 2px; background: #d3dae4; z-index: 0; }
.alsq-progress li:first-child::before { display: none; }
.alsq-progress__num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #d3dae4; font-weight: 700; position: relative; z-index: 1; }
.alsq-progress li.is-current { color: var(--alsq-navy); font-weight: 600; }
.alsq-progress li.is-current .alsq-progress__num { border-color: var(--alsq-navy); background: var(--alsq-navy); color: #fff; }
.alsq-progress li.is-done .alsq-progress__num { border-color: var(--alsq-emerald); background: var(--alsq-emerald); color: #fff; }
.alsq-progress li.is-done::before, .alsq-progress li.is-current::before { background: var(--alsq-emerald); }
@media (max-width: 480px) { .alsq-progress__label { display: none; } }

/* Review */
.alsq-review__list { margin: 0 0 1.5rem; }
.alsq-review__head { display: flex; justify-content: space-between; align-items: center; border-block-end: 1px solid #e3e8ef; margin-block: 1.25rem .5rem; }
.alsq-review__head h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.alsq-review__list > div:not(.alsq-review__head) { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 1rem; padding: .35rem 0; }
.alsq-review__list dt { color: var(--alsq-muted); }
.alsq-review__list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.alsq-link-btn { background: none; border: 0; color: var(--alsq-emerald); font-weight: 600; cursor: pointer; text-decoration: underline; padding: .25rem; font: inherit; }

.alsq-success { background: #eef7f2; border: 1px solid #b6dcc8; border-radius: 16px; padding: 2rem; text-align: center; }
.alsq-success:focus { outline: 3px solid var(--alsq-gold); }

/* Honeypot */
.alsq-hp { position: absolute !important; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alsq-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
