/* ---------------------------------------------------------------
   Craft floor.

   Everything below is byte-identical in every page that gets it
   right, so it ships here rather than being re-typed from the
   rules each time. Replace the :root values with the page's own
   palette; do not delete the rules that consume them.
   --------------------------------------------------------------- */

:root {
  /* Cork board and paper bulletin board palette */
  --ink: #2B1810; /* Espresso brown ink */
  --ink-muted: #5C4A3D;
  --bg: #C9A876; /* Cork board tan */
  --surface: #FFF9F0; /* Cream paper */
  --surface-alt: #F5EDE0; /* Aged paper */
  --rule: #B09A75;
  --accent: #B8860B; /* Brass/gold for pins */
  --accent-ink: #2B1810;
  --pin-brass: #C8A040;
  --pin-shadow: rgba(43, 24, 16, 0.3);

  --measure: 60ch;

  scrollbar-color: var(--accent) transparent;
  caret-color: var(--accent);
  color-scheme: light dark;
}

/* The same seven properties, for readers whose OS is set to dark.
   Replace these alongside the light ones — a page that restyles
   :root and leaves this block holding the placeholder greys has a
   dark mode that belongs to a different design.

   Darken by desaturating and lifting, not by inverting: --bg wants a
   near-black carrying a little of the accent's hue, --ink a soft
   off-white rather than #fff, and --accent usually needs lightening
   to stay legible, since a colour tuned against white rarely clears
   4.5:1 against black. */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5EDE0;
    --ink-muted: #C9B89A;
    --bg: #3A2E20; /* Dark cork */
    --surface: #2B1F14; /* Dark paper */
    --surface-alt: #251B11;
    --rule: #5C4A3D;
    --accent: #D4A574; /* Lighter brass */
    --accent-ink: #2B1810;
    --pin-brass: #E5C080;
    --pin-shadow: rgba(0, 0, 0, 0.5);
  }
}

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

/* Prevent any overflowing element from widening the document past the
   viewport. Without this a single oversized heading or image at a
   narrow viewport stretches the scroll width, which makes every
   paragraph on the page measure as flush to the viewport edge. */
html {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

p {
  text-wrap: pretty;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* The surfaces you did not draw, which otherwise ship with browser
   defaults belonging to no design system. */
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

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

/* Put on any cell holding a figure, so columns of numbers line up. */
.num {
  font-variant-numeric: tabular-nums;
}

/* 44px is the smallest reliably tappable target. Anything the reader
   presses needs it; a link inside a paragraph does not, which is why
   this is not on `a`. */
button,
[role="button"],
summary,
input[type="checkbox"],
input[type="radio"] {
  min-height: 44px;
}

button {
  min-width: 44px;
}

/* A document is one column, so the only thing that reliably breaks it
   is content that cannot shrink: a wide table, a long URL, a code
   block. These make the narrow viewport survivable without needing a
   layout per breakpoint. */
img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

pre {
  overflow-x: auto;
}

table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 480px) {
  body {
    /* Thumbs cover the edges; text should not start underneath them. */
    padding-inline: 1rem;
  }
}

/* Motion only for readers who have not asked the OS to stop it. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .pin {
    display: none;
  }

  .card {
    transform: none !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}

/* ---------------------------------------------------------------
   Bulletin Board Layout
   --------------------------------------------------------------- */

.board {
  min-height: 100vh;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 768px) {
  .board {
    padding: 3rem 2rem;
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .board {
    grid-template-columns: repeat(3, 1fr);
    padding: 4rem 3rem;
    gap: 3rem;
  }
}

/* ---------------------------------------------------------------
   Card System
   --------------------------------------------------------------- */

.card {
  background: var(--surface);
  padding: 2rem 1.5rem;
  position: relative;
  box-shadow:
    0 2px 4px rgba(43, 24, 16, 0.1),
    0 4px 12px rgba(43, 24, 16, 0.08);
  border: 1px solid rgba(43, 24, 16, 0.08);
}

/* Card rotations via data attribute */
.card[data-rotation="2"] {
  transform: rotate(2deg);
}

.card[data-rotation="-1.5"] {
  transform: rotate(-1.5deg);
}

.card[data-rotation="1.5"] {
  transform: rotate(1.5deg);
}

.card[data-rotation="-2"] {
  transform: rotate(-2deg);
}

.card[data-rotation="1"] {
  transform: rotate(1deg);
}

.card[data-rotation="-0.5"] {
  transform: rotate(-0.5deg);
}

.card[data-rotation="2.5"] {
  transform: rotate(2.5deg);
}

/* Specific card sizing */
.card-hero {
  grid-column: 1 / -1;
  background: var(--surface);
  padding: 2.5rem 2rem;
  text-align: center;
}

.card-menu {
  grid-column: span 2;
  background: var(--surface-alt);
}

@media (max-width: 767px) {
  .card-menu {
    grid-column: 1 / -1;
  }
}

.card-hours {
  background: var(--surface);
}

.card-about {
  grid-column: span 2;
  background: var(--surface);
}

@media (max-width: 767px) {
  .card-about {
    grid-column: 1 / -1;
  }
}

.card-contact {
  grid-column: span 2;
  background: var(--surface-alt);
}

@media (max-width: 767px) {
  .card-contact {
    grid-column: 1 / -1;
  }
}

/* ---------------------------------------------------------------
   Push Pins
   --------------------------------------------------------------- */

.pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--pin-brass), var(--accent));
  box-shadow:
    0 1px 2px var(--pin-shadow),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  z-index: 10;
}

.pin::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
}

.pin-tl {
  top: 12px;
  left: 12px;
}

.pin-tr {
  top: 12px;
  right: 12px;
}

.pin-bl {
  bottom: 12px;
  left: 12px;
}

.pin-br {
  bottom: 12px;
  right: 12px;
}

/* ---------------------------------------------------------------
   Typography — Handwritten & Clean
   --------------------------------------------------------------- */

.handwritten {
  font-family: 'Bradley Hand', 'Marker Felt', 'Comic Sans MS', cursive;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.3;
}

.card-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0 0 0.5rem 0;
}

.tagline {
  font-size: 1.125rem;
  color: var(--ink-muted);
  margin: 0;
}

.card h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 1.5rem 0;
}

.handwritten-small {
  font-family: 'Bradley Hand', 'Marker Felt', 'Comic Sans MS', cursive;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 3rem 0 0.75rem 0;
  color: var(--ink);
}

.handwritten-medium {
  font-family: 'Bradley Hand', 'Marker Felt', 'Comic Sans MS', cursive;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--ink);
}

.handwritten-price {
  font-family: 'Bradley Hand', 'Marker Felt', 'Comic Sans MS', cursive;
  font-weight: 600;
  color: var(--ink);
}

.card p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.card p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Menu Styling
   --------------------------------------------------------------- */

.menu-section {
  margin-bottom: 2rem;
}

.menu-section:last-child {
  margin-bottom: 0;
}

.menu-section:first-of-type h3:first-child {
  margin-top: 0;
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--rule);
}

.menu-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.item-name {
  flex: 1;
  font-size: 1rem;
}

.item-price {
  font-size: 1.125rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------
   Hours List
   --------------------------------------------------------------- */

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.hours-row:last-child {
  border-bottom: none;
}

.day {
  font-weight: 500;
  font-size: 1rem;
}

.time {
  font-size: 1.125rem;
}

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

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border: 2px solid var(--rule);
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  transition: border-color 150ms ease-out;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.6;
}

.submit-btn {
  padding: 0.875rem 2rem;
  font-size: 1.25rem;
  border: none;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(43, 24, 16, 0.2);
  transition: all 150ms ease-out;
  align-self: flex-start;
}

.submit-btn:hover {
  background: var(--pin-brass);
  box-shadow: 0 4px 8px rgba(43, 24, 16, 0.25);
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(43, 24, 16, 0.2);
}

/* ---------------------------------------------------------------
   Special Item
   --------------------------------------------------------------- */

.special-item h3 {
  margin-bottom: 0.5rem;
}

.special-item p {
  margin-bottom: 0.75rem;
}

.special-price {
  font-size: 1.5rem;
  margin: 0;
}

/* ---------------------------------------------------------------
   Address Block
   --------------------------------------------------------------- */

.address {
  line-height: 1.8;
}

.address strong {
  font-size: 1.125rem;
  display: block;
  margin-bottom: 0.25rem;
}

/* ---------------------------------------------------------------
   Responsive Adjustments
   --------------------------------------------------------------- */

@media (max-width: 480px) {
  .card {
    padding: 1.5rem 1.25rem;
  }

  .card[data-rotation] {
    /* Reduce rotations on mobile for better readability */
    transform: rotate(0deg) !important;
  }

  .board {
    gap: 1.5rem;
  }
}
@media (max-width: 480px) {
  /* --impeccable-mobile-pad */
  body { padding-inline: max(1rem, 16px); }
  .container, [class*="container"], section, header, footer, nav, main, article {
    padding-inline: max(1rem, 16px);
  }
}
/* --impeccable-measure */
p, li, dt, dd, blockquote, figcaption, td, th { max-width: min(var(--measure), 100%); }
