/*
 * Lindell Street Dental: shared styles (tokens, base, components, header and footer).
 * Page styles live in home.css and booking.css.
 */

/*
 * Design tokens. Warm limestone neutrals, one restrained primary (eucalypt), and a serif/sans pairing:
 * Literata for headings and the few moments that should feel personal, Hanken Grotesk for everything else.
 */
:root {
  /* Colour */
  --limestone: #eeebe5;
  --paper: #f8f6f2;
  --stone: #e4dfd6;
  --ink: #1d2320;
  --slate: #57605a;
  /* The practice colour: the business's brand colour from Slotly when it has one. */
  --eucalypt: var(--brand-primary, #27463f);
  --eucalypt-deep: color-mix(in srgb, var(--eucalypt) 78%, #000);
  --eucalypt-ink: color-mix(in srgb, var(--on-eucalypt) 88%, var(--eucalypt));
  --on-eucalypt: var(--brand-primary-contrast, #f8f6f2);
  --sage: #d5ddd4;
  --sage-soft: #e3e8e0;
  --rule: #d6d0c6;
  --rule-strong: #b9b1a4;
  --error: #9b3a2e;
  --error-soft: #f5e6e1;

  /* Type */
  --font-serif: "Literata", Georgia, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: clamp(1.3125rem, 1.15rem + 0.6vw, 1.5625rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 1.9vw, 2.75rem);
  --text-3xl: clamp(2.5rem, 1.55rem + 3.9vw, 4.5rem);

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --section: clamp(4.5rem, 2.5rem + 7vw, 8.5rem);
  --gutter: clamp(1.25rem, 0.75rem + 2.2vw, 2.5rem);
  --max: 76rem;
  --measure: 38rem;

  /* Shape and motion. Images keep nearly square corners; controls are softer. */
  --radius-image: 3px;
  --radius: 6px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --duration: 180ms;

  --header-height: 4.5rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--limestone);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--leading-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.005em;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: text-decoration-color var(--duration) var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--eucalypt);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--sage);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

strong {
  font-weight: 600;
}

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

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}


@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3rem;
  padding: 0.75rem 1.375rem;
  border: 1px solid var(--eucalypt);
  border-radius: var(--radius);
  background: var(--eucalypt);
  color: var(--on-eucalypt);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.button:hover {
  background: var(--eucalypt-deep);
  border-color: var(--eucalypt-deep);
}

.button:active {
  transform: translateY(1px);
}

.button--secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.button--secondary:hover {
  background: var(--paper);
  border-color: var(--ink);
}

.button--light {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--eucalypt-deep);
}

.button--light:hover {
  background: var(--sage);
  border-color: var(--sage);
}

.button--outline-light {
  background: transparent;
  border-color: color-mix(in srgb, var(--on-eucalypt) 50%, transparent);
  color: var(--on-eucalypt);
}

.button--outline-light:hover {
  background: color-mix(in srgb, var(--on-eucalypt) 10%, transparent);
  border-color: var(--on-eucalypt);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button .spinner {
  width: 1rem;
  height: 1rem;
}

.text-link {
  font-weight: 600;
  color: var(--eucalypt);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--limestone);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--rule);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: var(--header-height);
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  text-decoration: none;
  margin-right: auto;
}

.wordmark__name {
  font-family: var(--font-serif);
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
}

.wordmark__kind {
  margin-top: 0.3rem;
  font-size: var(--text-xs);
  color: var(--slate);
  letter-spacing: 0.02em;
}

.site-nav ul {
  display: flex;
  gap: var(--space-5);
}

.site-nav ul a {
  font-size: var(--text-sm);
  text-decoration: none;
  padding-block: var(--space-2);
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1px;
  transition: background-size var(--duration) var(--ease);
}

.site-nav ul a:hover,
.site-nav ul a[aria-current="page"] {
  background-size: 100% 1px;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.site-header__phone {
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__actions .button {
  min-height: 2.625rem;
  padding: 0.5rem 1.125rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.menu-toggle__icon {
  position: relative;
  width: 1rem;
  height: 0.625rem;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--duration) var(--ease), top var(--duration) var(--ease);
}

.menu-toggle__icon::before {
  top: 0;
}

.menu-toggle__icon::after {
  top: calc(100% - 1.5px);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::before {
  top: calc(50% - 0.75px);
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon::after {
  top: calc(50% - 0.75px);
  transform: rotate(-45deg);
}

@media (max-width: 64rem) {
  .site-header__phone {
    display: none;
  }
}

@media (max-width: 56rem) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-header__actions .button {
    display: none;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: var(--space-3) var(--gutter) var(--space-6);
    background: var(--limestone);
    border-bottom: 1px solid var(--rule);
  }

  .site-nav.is-open {
    display: block;
    animation: menu-in 200ms var(--ease);
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav li + li {
    border-top: 1px solid var(--rule);
  }

  .site-nav ul a {
    display: block;
    padding-block: var(--space-4);
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    background: none;
  }

  .site-nav__mobile-actions {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }
}

@media (min-width: 56.0625rem) {
  .site-nav__mobile-actions {
    display: none;
  }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: var(--space-8) var(--space-6);
  background: var(--paper);
  font-size: var(--text-sm);
  color: var(--slate);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.25fr 1.3fr 0.9fr 0.9fr;
  gap: var(--space-6);
}

.site-footer h2 {
  margin-bottom: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}

.site-footer .wordmark {
  margin-bottom: var(--space-4);
  color: var(--ink);
}

.site-footer ul {
  display: grid;
  gap: var(--space-2);
}

.site-footer a {
  text-decoration-color: transparent;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.site-footer .site-footer__hours {
  gap: 0;
  max-width: 24rem;
  border-top: 1px solid var(--rule);
}

.site-footer__hours li {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  padding-block: 0.625rem;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}

.site-footer__hours-day {
  color: var(--ink);
  font-weight: 600;
}

.hours-periods {
  display: grid;
  gap: 0.375rem;
  line-height: 1.4;
}

.hours-period {
  display: grid;
  grid-template-columns: 4.5rem 0.8rem 4.5rem;
  white-space: nowrap;
}

.hours-period span:nth-child(2) {
  text-align: center;
  color: var(--rule-strong);
}

.hours-periods__closed {
  color: var(--slate);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
  font-size: var(--text-xs);
}

.site-footer__emergency {
  max-width: 22rem;
  margin-top: var(--space-4);
}

@media (max-width: 70rem) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }
}

@media (max-width: 30rem) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Forms ---------- */

.field {
  display: grid;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.field__optional {
  font-weight: 400;
  color: var(--slate);
}

.field__hint {
  font-size: var(--text-xs);
  color: var(--slate);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  font-size: var(--text-base);
  line-height: 1.4;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--slate);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--eucalypt);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--eucalypt) 22%, transparent);
}

.textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231d2320' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--error);
}

.field__error {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--error);
}

.field__error:empty {
  display: none;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 3rem;
  padding: 0.625rem 1rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  font-size: var(--text-sm);
  transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.choice:hover {
  border-color: var(--slate);
}

.choice:has(input:checked) {
  border-color: var(--eucalypt);
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px var(--eucalypt);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--eucalypt);
  outline-offset: 3px;
}

.choice input {
  margin: 0;
  accent-color: var(--eucalypt);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  cursor: pointer;
}

.checkbox input {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0.2rem 0 0;
  accent-color: var(--eucalypt);
}

/* ---------- Notices ---------- */

.notice {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--error-soft);
  font-size: var(--text-sm);
}

.notice__title {
  font-weight: 600;
  font-size: var(--text-base);
}

.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-2);
}

.notice:focus {
  outline: none;
}

/* ---------- Loading ---------- */

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  display: block;
  border-radius: var(--radius);
  background: var(--stone);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

/* ---------- Server-side validation states (set by the ASP.NET Core tag helpers) ---------- */

.input.input-validation-error,
.select.input-validation-error,
.textarea.input-validation-error {
  border-color: var(--error);
}

.field__error.field-validation-valid {
  display: none;
}

.choice:has(input.input-validation-error) {
  border-color: var(--error);
}

.checkbox input.input-validation-error {
  outline: 2px solid var(--error);
  outline-offset: 2px;
}

/* ---------- Simple pages (privacy, errors) ---------- */

.page {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--section);
}

.page__head {
  max-width: 46rem;
}

.page__head--band {
  max-width: none;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) 0;
}

.page__head--band .page__lede {
  max-width: 42rem;
}

.page__lede {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  color: var(--slate);
}

.page__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-7);
}

.page__meta {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--slate);
}

.prose {
  max-width: var(--measure);
  margin-top: var(--space-7);
}

.prose h2 {
  margin-top: var(--space-7);
  font-size: var(--text-xl);
}

.prose p {
  margin-top: var(--space-3);
  color: var(--slate);
}

.wordmark__logo {
  max-height: 2.25rem;
  width: auto;
  margin-bottom: var(--space-2);
}

address {
  font-style: normal;
}

a[href^="tel:"] {
  white-space: nowrap;
}

/* ---------- Customer account link in the header ---------- */

.site-header__account {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-header__account svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.site-header__account:hover,
.site-header__account[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

@media (max-width: 56rem) {
  .site-header__account {
    display: none;
  }
}
