/* Opened class cards grow to fit their content instead of scrolling inside a fixed height. */
.class-flip-stage { display: grid; grid-template-columns: minmax(0, 1fr); }
.class-front, .class-flip { grid-area: 1 / 1; }
.service-grid:has(.class-flip[open]) { align-items: start; }
.class-flip[open] { position: relative; inset: auto; background: var(--emerald-night); animation: kb-flip-fill .65s step-end both; }
@keyframes kb-flip-fill { from { background: transparent; } 50% { background: var(--emerald-night); } }
.class-flip[open] .class-back { position: relative; inset: auto; overflow: visible; }
.class-flip[open] .class-details-scroll { height: auto; overflow: visible; scrollbar-gutter: auto; padding-bottom: 28px; }
.class-details-scroll .kb-card-action { display: flex; width: 100%; margin-top: 6px; padding-left: 16px; padding-right: 16px; text-align: center; }
.button { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .class-flip[open] { animation: none; } }

/* Class options */
.kb-step-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.kb-step-actions .button { flex: 0 1 auto; padding-left: 20px; padding-right: 20px; text-align: center; }
.kb-button-secondary { background: transparent; border-color: var(--emerald-night); color: var(--emerald-night); }
.kb-button-secondary:hover { background: var(--citrine); }
.next-step .button:focus-visible { outline-color: var(--emerald-night); outline-offset: 3px; }

/* Blog links */
.feature-article h3 a, .small-article h3 a { color: inherit; }
.article-meta .read-link { color: var(--emerald-night); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.kb-all-articles { margin-top: 40px; text-align: center; }
.insights .kb-all-articles .button:focus-visible { outline-color: var(--emerald-night); }

/* About Krizia */
#krizia { height: auto; max-height: none; min-height: 0; flex-direction: column; gap: 40px; padding: 72px 24px; }
.kb-bio { width: min(760px, 100%); text-align: center; color: var(--alabaster); }
.kb-bio p { font-size: 18px; line-height: 1.6; color: var(--alabaster); }
.kb-bio-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; margin-top: 24px; }
.kb-bio-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--citrine); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Sign-up dialog */
html:has(#booking[open]) { overflow: hidden; }
#booking { width: min(600px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid var(--rule); border-radius: 0; background: var(--alabaster); color: var(--emerald-night); overflow: auto; overscroll-behavior: contain; }
#booking::backdrop { background: color-mix(in srgb, var(--emerald-night) 75%, transparent); backdrop-filter: blur(8px); }
#booking [hidden] { display: none !important; }
#booking :focus-visible { outline: 3px solid var(--emerald-night); outline-offset: 2px; }
.kb-booking-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; background: var(--emerald-night); color: var(--alabaster); }
.kb-booking-head h2 { margin: 0; color: var(--alabaster); font: 900 clamp(20px, 5vw, 26px)/1.1 Inter, sans-serif; letter-spacing: -.02em; }
.kb-booking-head :focus-visible { outline-color: var(--citrine) !important; }
.kb-close { flex: none; min-height: 44px; padding: 8px 12px; border: 1px solid var(--citrine); background: transparent; color: var(--citrine); font: 600 12px/1.3 Barlow, sans-serif; letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.kb-close:hover { background: var(--citrine); color: var(--emerald-night); }
.kb-booking-body { padding: 24px; }
.kb-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.kb-field { display: block; min-width: 0; font: 600 14px/1.4 Barlow, sans-serif; color: var(--emerald-night); }
.kb-field input, .kb-field select, .kb-field textarea { display: block; width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--muted); border-radius: 0; background: #fff; color: var(--emerald-night); font: 400 16px/1.4 Barlow, sans-serif; }
.kb-field textarea { resize: vertical; }
.kb-field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.kb-location, .kb-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.kb-location { font-weight: 600; color: var(--emerald-night); }
.kb-error { margin: 0; padding: 10px 12px; border: 1px solid var(--emerald-night); background: var(--citrine); color: var(--emerald-night); font-size: 14px; font-weight: 600; }
.kb-submit { width: 100%; }
.kb-submit:disabled { opacity: .7; cursor: default; }
.kb-success-message { margin: 0 0 24px; font-size: 18px; line-height: 1.5; color: var(--emerald-night); }
.kb-success-message:focus { outline: none; }

/* Acuity scheduling fills the dialog once a URL is configured. */
#booking.kb-mode-acuity[open] { display: flex; flex-direction: column; width: min(960px, calc(100vw - 24px)); height: calc(100dvh - 24px); overflow: hidden; }
#booking.kb-mode-acuity .kb-booking-body { display: flex; flex: 1; min-height: 0; padding: 0; }
.kb-acuity { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.kb-acuity iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.kb-acuity-link { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; color: var(--emerald-night); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 700px) {
  #krizia { padding: 48px 20px; gap: 28px; }
  .kb-bio p { font-size: 16px; }
  .kb-booking-head { padding: 12px 16px; }
  .kb-booking-body { padding: 16px; }
}
@media (max-width: 400px) {
  .kb-field-pair { grid-template-columns: minmax(0, 1fr); }
}
