/* Hallmark · shared foundation · forms, language control, accessibility */
@import url("../../tokens.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); line-height: 1.75; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a, summary, select { touch-action: manipulation; }
h1, h2, h3, p, figure { margin-block-start: 0; }
h1, h2, h3 { overflow-wrap: anywhere; min-width: 0; }

.skip-link { position: fixed; inset-block-start: .5rem; inset-inline-start: .5rem; z-index: var(--z-menu); padding: .65rem .9rem; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.language { position: relative; }
.language-button, .mobile-menu-button {
  min-width: 44px; min-height: 44px; border: 1px solid currentColor; background: transparent; cursor: pointer; white-space: nowrap;
}
.language-button { padding-inline: .8rem; }
.language-menu { position: absolute; inset-block-start: calc(100% + .4rem); inset-inline-end: 0; z-index: var(--z-menu); min-width: 12rem; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); }
.language-menu button { display: block; width: 100%; min-height: 44px; padding: .65rem .9rem; border: 0; border-block-end: 1px solid var(--rule); background: transparent; text-align: start; cursor: pointer; }
.language-menu button:last-child { border-block-end: 0; }
.mobile-menu-button { display: grid; place-items: center; }
.mobile-nav { display: none; padding: 0 var(--gutter) var(--space-md); border-block-end: 2px solid var(--ink); background: var(--paper); }
.mobile-nav.is-open { display: grid; }
.mobile-nav a { min-height: 44px; display: flex; align-items: center; border-block-end: 1px solid var(--rule); text-decoration: none; white-space: nowrap; }
a:active, button:active { opacity: .76; }
button:disabled, [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn, .primary-button, .outline-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--ink); text-decoration: none; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-press) var(--ease-out);
}
.primary-button { background: var(--ink); color: var(--paper); }
.outline-button { background: transparent; color: currentColor; }
.btn:active, .primary-button:active, .outline-button:active { transform: translateY(1px); }
.btn[disabled], .primary-button[disabled], .outline-button[disabled] { opacity: .55; cursor: not-allowed; }

.contact-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
.contact-form label { display: grid; gap: .35rem; font-weight: 700; }
.contact-form label > span { font-size: var(--text-sm); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; min-height: 48px; border: 1px solid var(--rule-strong); outline: 2px solid transparent; outline-offset: 1px; border-radius: 0; background: var(--paper); padding: .7rem .85rem; font-weight: 400;
}
.contact-form textarea { min-height: 8rem; resize: vertical; }
.contact-form input:focus-visible, .contact-form select:focus-visible, .contact-form textarea:focus-visible { border-color: var(--ink); outline: 2px solid var(--focus); outline-offset: 1px; }
.contact-form input:invalid:not(:placeholder-shown), .contact-form textarea:invalid:not(:placeholder-shown) { border-color: var(--error); }
.contact-form input:disabled, .contact-form select:disabled, .contact-form textarea:disabled { opacity: .55; cursor: not-allowed; background: var(--paper-3); }
.field-help { min-height: 1lh; margin: 0; color: var(--muted); font-size: var(--text-xs); font-weight: 400; }

.faq details { border-block-start: 1px solid currentColor; }
.faq details:last-child { border-block-end: 1px solid currentColor; }
.faq summary { min-height: 52px; padding-block: .8rem; cursor: pointer; font-weight: 700; }
.faq details p { max-width: 60ch; padding-block-end: 1rem; }

.schedule { font-variant-numeric: tabular-nums; }
.schedule-row { display: grid; grid-template-columns: 5.7rem minmax(0, 1fr); gap: 1rem; padding-block: 1rem; border-block-start: 1px solid currentColor; }
.schedule-row:last-child { border-block-end: 1px solid currentColor; }
.schedule-row time { font-family: var(--font-outlier); font-weight: 700; }
.schedule-row p { margin-block-end: 0; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (hover: hover) and (pointer: fine) {
  .language-menu button:hover { background: var(--paper-2); }
  .contact-form input:hover, .contact-form select:hover, .contact-form textarea:hover { background: var(--paper-2); }
  .primary-button:hover { background: var(--tomato-dark); color: var(--tomato-ink); }
  .outline-button:hover { background: var(--ink); color: var(--paper); }
}

@media (min-width: 40rem) {
  .mobile-menu-button { display: none; }
  .contact-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-form .full, .contact-form > button { grid-column: 1 / -1; }
  .contact-form > button { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media (max-width: 22rem) {
  .mobile-menu-button { width: 44px; padding: 0; font-size: 0; }
  .mobile-menu-button::before { content: "≡"; font-size: 1.35rem; line-height: 1; }
}
