/*
 * Example Studio: the fictional site behind EaseWeb's sample report.
 * It is built to fail exactly the checks the report lists and pass the rest, so its look
 * is deliberately unlike EaseWeb's own. Nothing here is shared with the main site.
 */

:root {
  --kiln: #f3f5f1;
  --paper: #ffffff;
  --ink: #1c2230;
  --muted: #4a5263;
  --cobalt: #233d8f;
  --cobalt-deep: #172a66;
  --celadon: #9dbfa8;
  --celadon-pale: #dce8df;
  --line: #c9d1cb;
  /* Form borders. The error red and the default grey are the same lightness, which is the
     point of finding 13.A: in greyscale an invalid field looks like every other field. */
  --field: #6a6a6a;
  --error: #c0392b;

  --display: 'Bagel Fat One', 'Zen Maru Gothic', system-ui, sans-serif;
  --body: 'Figtree', 'Zen Maru Gothic', system-ui, sans-serif;
}

:lang(ja) {
  --display: 'Zen Maru Gothic', system-ui, sans-serif;
  --body: 'Zen Maru Gothic', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  /* The header is sticky, so anything scrolled or tabbed to stops below it. */
  scroll-padding-top: 100px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--kiln);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--cobalt);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cobalt-deep);
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.5em;
}

/* Japanese headings break between phrases, not inside a word or before a lone kana. */
:lang(ja) :is(h1, h2, h3) {
  font-weight: 900;
  line-height: 1.35;
  word-break: auto-phrase;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

h3 {
  font-size: 1.3rem;
}

p {
  margin: 0 0 1em;
  max-width: 62ch;
}

.wrap {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

/* Skip link: off screen until it has focus. */
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--paper);
  border: 2px solid var(--cobalt);
  border-radius: 999px;
  font-weight: 600;
}

.skip:focus {
  top: 12px;
}

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

.masthead {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.masthead-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.1;
  text-decoration: none;
}

:lang(ja) .logo {
  font-weight: 900;
}

.logo-mark {
  flex: none;
  width: 34px;
  height: 34px;
}

/* Finding 4.A: a div styled as a control. It has no role and no tabindex, so Tab passes it. */
.menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  flex: none;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.menu-trigger svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.menu-trigger.open svg {
  transform: rotate(180deg);
}

.search-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

.menu {
  position: absolute;
  right: max(20px, (100% - 1120px) / 2);
  top: calc(100% - 6px);
  z-index: 10;
  width: min(300px, 100% - 40px);
  padding: 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--celadon);
}

.menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.menu a:hover {
  background: var(--celadon-pale);
}

.menu a[aria-current='page'] {
  background: var(--celadon-pale);
  box-shadow: inset 4px 0 0 var(--cobalt);
}

.search {
  border-top: 1px solid var(--line);
  padding: 16px 0 20px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.search label {
  flex-basis: 100%;
  font-weight: 600;
}

.search input {
  flex: 1 1 220px;
}

/* ---------- Shared pieces ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border: 2px solid var(--cobalt);
  border-radius: 999px;
  background: var(--cobalt);
  color: var(--paper);
  font: 600 1rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}

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

.button.quiet {
  background: transparent;
  color: var(--cobalt);
}

.button.quiet:hover {
  background: var(--celadon-pale);
  color: var(--cobalt-deep);
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--field);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

/* Finding 13.A / 5.F: the only sign of an error is this border colour. */
.invalid {
  border-color: var(--error);
}

.section {
  padding: clamp(48px, 8vw, 96px) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.lede {
  font-size: 1.2rem;
  color: var(--muted);
}

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: clamp(48px, 8vw, 104px) 0;
}

.hero h1 {
  max-width: 11ch;
}

:lang(ja) .hero h1 {
  max-width: 13em;
}

.hero .lede {
  margin-bottom: 1.6em;
}

.tiles-title {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Glaze test tiles: bare clay at the top, the glaze below, a hole for hanging. */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  margin-bottom: 8px;
  border-radius: 10px 10px 22px 22px;
  border: 2px solid var(--ink);
}

/* The middle column hangs a little lower, like tiles on a peg rail. */
.tile:nth-child(3n + 2) {
  padding-top: 14px;
}

.offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 24px 48px;
  padding: 28px 0;
  border-top: 2px solid var(--ink);
}

.offer:last-child {
  border-bottom: 2px solid var(--ink);
}

.offer h3 {
  margin: 0;
}

.offer p {
  margin-bottom: 0.6em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding-top: 64px;
  position: relative;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cobalt);
  color: var(--paper);
  font-family: var(--display);
  font-size: 1.3rem;
}

.steps h3 {
  margin-bottom: 0.3em;
}

.steps p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Services ---------- */

.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.course {
  display: flex;
  flex-direction: column;
  padding: 0 0 22px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px 10px 28px 28px;
  overflow: hidden;
}

.course::before {
  content: '';
  height: 64px;
  margin-bottom: 20px;
  background: linear-gradient(to bottom, #d9c9b4 0 35%, var(--glaze) 35%);
  border-bottom: 2px solid var(--ink);
}

.course > * {
  margin-inline: 22px;
}

.course h2 {
  font-size: 1.5rem;
}

.course .length {
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.6em;
}

/*
 * Finding 1.4.10: at 320px the frame is still 560px wide, so the page scrolls sideways,
 * and the frame clips whatever of the table is past 560px: the price column.
 */
.table-frame {
  width: 560px;
  max-width: none;
  overflow: hidden;
  margin-top: 24px;
}

@media (min-width: 760px) {
  .table-frame {
    width: auto;
  }
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: var(--paper);
  white-space: nowrap;
}

caption {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 10px;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

thead th {
  border-bottom: 2px solid var(--ink);
}

td:last-child,
th:last-child {
  text-align: right;
  font-weight: 700;
}

.enquire {
  display: grid;
  grid-template-columns: minmax(0, 2fr) auto;
  gap: 24px;
  align-items: center;
  padding: 32px;
  background: var(--celadon-pale);
  border-radius: 24px;
}

.enquire p {
  margin: 0;
}

/* Finding 4.F: an overlay drawn as a dialog. Nothing keeps focus inside it. */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(28 34 48 / 0.6);
}

.overlay[hidden] {
  display: none;
}

.dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 8px 0 var(--celadon);
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.sent {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--celadon-pale);
  font-weight: 600;
}

.sent[hidden] {
  display: none;
}

.details {
  padding: 28px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
}

.details dl {
  margin: 0;
}

.details dt {
  font-weight: 700;
}

.details dd {
  margin: 0 0 16px;
}

/* ---------- Gallery ----------
 * Not one of the pages the sample report tests. It carries the failures many sites have that a
 * checker reading the page as it loads doesn't see, each marked with its WCAG success criterion.
 */

/* 2.2.2: news that scrolls by for ever, with nothing to pause it. */
.ticker {
  overflow: hidden;
  background: var(--celadon-pale);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-weight: 600;
}

.ticker p {
  display: inline-block;
  max-width: none;
  margin: 0;
  padding: 8px 0 8px 100%;
  animation: ticker 30s linear infinite;
}

@keyframes ticker {
  to {
    transform: translateX(-100%);
  }
}

.reel {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(70vh, 520px);
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

.reel video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(28 34 48 / 0.9), rgb(28 34 48 / 0) 65%);
}

.reel .wrap {
  position: relative;
  z-index: 1;
  padding: 48px 0;
}

.reel p {
  margin: 0;
  font-size: 1.2rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 28px;
}

/* 2.1.1: divs that take clicks only. */
.filter {
  padding: 8px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.filter.on {
  background: var(--ink);
  color: var(--paper);
}

.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px;
}

.work[hidden] {
  display: none;
}

.work img {
  width: 100%;
  height: auto;
  border-bottom: 2px solid var(--ink);
}

.work h3 {
  margin: 16px 18px 4px;
}

/* 1.4.3: the maker's name, 2.3:1 on white. */
.work .maker {
  margin: 0 18px 18px;
  color: #a3aab4;
}

.like {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

.like svg {
  width: 22px;
  height: 22px;
}

/* Forced colours: liked is shown by the fill alone, and focus by a shadow alone. The theme
   replaces the one and drops the other. */
.like[aria-pressed='true'] {
  background: var(--celadon);
}

.like:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--cobalt);
}

.events {
  position: relative;
  padding: 32px;
  background: var(--celadon-pale);
  border-radius: 24px;
}

.slides {
  display: grid;
}

/* 1.4.4: a fixed height with the overflow cut off, so text at 200% is lost. */
.slide {
  height: 200px;
  overflow: hidden;
  padding-right: 120px;
}

.slide .when {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--cobalt);
}

.book {
  padding: 0;
  border: 0;
  background: none;
  color: var(--cobalt);
  font: 700 1rem/1.4 var(--body);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

/* 2.4.7: no focus ring. */
.book:focus-visible {
  outline: none;
}

/* 2.1.1: divs that take clicks only. */
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 32px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

.carousel-prev {
  right: 88px;
}

.carousel-next {
  right: 32px;
}

.carousel-prev svg,
.carousel-next svg {
  width: 20px;
  height: 20px;
}

.notes {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}

.notes label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.recipe textarea {
  margin-bottom: 16px;
  font-family: ui-monospace, Consolas, monospace;
  tab-size: 20;
}

.letter {
  padding: 28px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
}

/* 1.4.11: a border of 1.3:1 against white. */
.letter .faint {
  margin-bottom: 16px;
  border: 1px solid #dfe3e0;
}

/* 1.4.12: a fixed width with the label clipped to it. */
.button.fixed {
  width: 168px;
  padding-inline: 0;
  white-space: nowrap;
  overflow: hidden;
}

.follow {
  display: block;
}

.follow img {
  width: 100%;
  height: auto;
  border-radius: 24px;
}

/* 1.4.10: centred with a transform, with no height limit and no scroll of its own. */
.booking,
.confirm {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 30;
  width: min(480px, 100% - 40px);
  padding: 28px;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 0 0 0 100vmax rgb(28 34 48 / 0.6);
}

/* The confirmation is short, and scrolls when the window is shorter still. */
.confirm {
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.booking[hidden],
.confirm[hidden] {
  display: none;
}

.booking-event {
  font-weight: 700;
  color: var(--muted);
}

/* 2.4.11: pinned over the bottom of the window, with nothing under the page to make room for it. */
.promo {
  position: fixed;
  inset: auto 0 0;
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 12px 20px;
  background: var(--paper);
  border-top: 2px solid var(--ink);
}

.promo p {
  margin: 0;
  font-weight: 600;
}
@media (max-width: 860px) {
  .notes {
    grid-template-columns: minmax(0, 1fr);
  }

  .slide {
    height: 300px;
    padding: 64px 0 0;
  }

  .carousel-prev,
  .carousel-next {
    top: 24px;
  }
}

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

.footer {
  background: var(--cobalt);
  color: var(--paper);
  padding: 56px 0 32px;
}

.footer a {
  color: var(--paper);
}

.footer :focus-visible {
  outline-color: var(--paper);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer h2 {
  font-size: 1.35rem;
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer li + li {
  margin-top: 6px;
}

.hours {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0;
}

.hours dd {
  margin: 0;
}

.fiction {
  margin: 40px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 0.35);
  font-size: 0.95rem;
  max-width: none;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .hero,
  .contact,
  .offer,
  .enquire {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps li {
    padding: 0 0 0 68px;
    min-height: 48px;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .masthead-row {
    gap: 8px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .menu-trigger {
    padding: 8px 12px;
  }
}
