/* Page shell: top bar, top art, the street column with the cards, bottom art, footer.
   The street tile is anchored to the bottom of the column, so it joins street-bottom.svg exactly. Its cut at the top
   sits under the hero card, which overlaps the top art. */
/* 780×1200 and the tile's 1200 height are the viewBox sizes in tools/art/draw.py; change them together. */
body {
  margin: 0;
  background: var(--roof) url('/art/roofs-wide.svg') center top / 780px 1200px repeat;
  color: var(--on-surface);
  font: var(--body);
}

a {
  color: var(--primary);
}

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

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 8px 0 16px;
  background: var(--surface);
}

.top-bar-name {
  font: var(--title);
}

.top-bar-logo {
  display: block;
  width: 90px;
  height: auto;
}

.lang-nav {
  display: flex;
  border: 1px solid var(--outline);
  border-radius: 24px;
  overflow: hidden;
}

.lang-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 48px;
  color: var(--on-surface);
  font: var(--label-large);
  text-decoration: none;
}

.lang-nav a + a {
  border-left: 1px solid var(--outline);
}

.lang-nav a[aria-current='page'] {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.lang-nav a:focus-visible {
  outline-offset: -3px;
}

/* Art pieces stay 390 px and centred; on narrower screens the sides are clipped rather than scaled. */
.art {
  overflow-x: hidden; /* Safari < 16 has no clip */
  overflow-x: clip;
}

.art img {
  display: block;
  width: var(--art);
  height: auto;
  margin-inline: calc(50% - var(--art) / 2);
}

.street {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0 16px 140px;           /* the last stretch of queue before the square, as in the design */
  background: url('/art/street.svg') center bottom / var(--art) 1200px repeat-y;
}

/* Below about 422 px the hero card no longer covers the tile's cut at the sides. A ridge line across the art width makes
   the cut read as one more building edge. */
.street::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: min(var(--art), 100%);
  margin-inline: auto;
  height: 1.2px;
  background: #9e4428; /* the roof outline colour in tools/art/draw.py */
}

.card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--column);
  margin-inline: auto;
  padding: 24px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.card-hero {
  margin-top: -48px;
}

.card h1 {
  margin: 0;
  font: var(--display);
  letter-spacing: -0.5px;
}

.hero-logo {
  display: block;
  width: min(300px, 100%);
  height: auto;
  margin-inline: auto;
}

.card h2 {
  margin: 0;
  font: var(--headline);
}

.card p {
  margin: 12px 0 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--on-surface-variant);
  font: var(--label);
}

.gap {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--column);         /* the dry lines line up with the cards on wide screens */
  margin-inline: auto;
  height: 210px;                    /* tall enough to read the street and one dry line */
}

.gap-line {
  box-sizing: border-box;
  max-width: var(--column);
  min-height: 40px;
  margin: 0;
  padding: 6px 16px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--tertiary);
  font: var(--label-large);
  box-shadow: 0 1px 3px rgba(42, 22, 34, 0.25);
}

/* Hero */
.accent {
  color: var(--primary);
}

.hero-foot {
  margin-top: 20px;
  text-align: center;
}

.card .hero-foot p {
  margin: 0;
}

.card .tagline {
  font: var(--body);
}

.card .hero-foot .hero-address {
  margin-top: 4px;
  color: var(--on-surface-variant);
  font: var(--label);
}

/* Pills: the dashed one marks a placeholder, the filled one a season. */
.placeholder-chip,
.card .product .chip {
  width: fit-content;
  padding: 2px 10px;
  border-radius: 8px;
}

.placeholder-chip {
  border: 1px dashed var(--outline);
  color: var(--on-surface-variant);
  font: var(--body-small);
}

.today {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-container);
}

.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.today-text,
.contact-text {
  display: flex;
  flex-direction: column;
}

.today-label,
.contact-sub {
  color: var(--on-surface-variant);
  font: var(--body-small);
}

.today-value {
  font: 500 19px / 26px var(--font);
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 28px;
  font: var(--label-large);
  text-align: center;
  text-decoration: none;
}

.button-filled {
  background: var(--primary);
  color: var(--on-primary);
}

.button-tonal {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.button-outlined {
  border: 1px solid var(--outline);
  color: var(--primary);
}

.muted,
.card .note {
  color: var(--on-surface-variant);
}

.card .note {
  margin: 4px 0 6px;
  font: var(--body-small);
}

/* The price list (P3S8). A fixed layout with wrapping cells: at 200 % text on a phone the names and prices wrap
   instead of pushing the table off the screen (P3S8-A5, P3S9-A2). */
.price-page {
  padding-top: 16px;
  padding-bottom: 24px;
}

.price-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font: var(--body);
}

.price-table th,
.price-table td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--outline-variant);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.price-table thead th {
  font: var(--label);
  color: var(--on-surface-variant);
}

.price-table .price-hr {
  width: 30%;
  padding-left: 0;
}

.price-table .price-en {
  width: 30%;
  color: var(--on-surface-variant);
}

.price-table tbody th {
  font-weight: inherit;
}

.price-table td {
  font-variant-numeric: tabular-nums;
}

.price-table td:last-child {
  font-weight: 600;
}

/* Below 592 px the English name goes under the Croatian one, beside the two prices (Ivan, 2026-11-22). The rows become grids;
   the roles in the markup keep the table's meaning for screen readers. */
@media (max-width: 591px) {
  .price-table,
  .price-table thead,
  .price-table tbody {
    display: block;
  }

  .price-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 76px;
    grid-template-areas: "hr anchor current" "en anchor current";
    column-gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--outline-variant);
  }

  .price-table th,
  .price-table td,
  .price-table .price-hr,
  .price-table .price-en {
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .price-table .price-hr { grid-area: hr; }
  .price-table .price-en { grid-area: en; }
  .price-table tbody .price-en { font: var(--body-small); }
  .price-table .price-anchor { grid-area: anchor; }
  .price-table .price-current { grid-area: current; }
}

.price-vat,
.price-link {
  margin-top: 12px;
}

/* Što pečemo */
.products,
.seasons,
.contact,
.closures,
.map-legend {
  margin: 0;
  padding: 0;
  list-style: none;
}

.product {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
}

.product + .product {
  border-top: 1px solid var(--outline-variant);
}

/* The photos load only as the visitor scrolls (P3S6-A5). loading="lazy" alone doesn't do it: Chromium fetches lazy images up
   to ~2500 px below the screen, which on a phone is every photo on the page. So each photo's box is kept empty
   (content-visibility: hidden, at its final size, so nothing jumps) until js/photos.js marks it .near, about one screen
   before it scrolls in. Without JavaScript, css/nojs.css shows them all at once. */
.product picture,
.shop-front,
.history-photo picture {
  display: block;
  content-visibility: hidden;
}

.product picture.near,
.shop-front.near,
.history-photo picture.near {
  content-visibility: visible;
}

@media print {
  .product picture,
  .shop-front,
  .history-photo picture {
    content-visibility: visible;
  }
}

.product picture {
  width: 76px;
  height: 76px;
}

.product img {
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;                /* the owner's photos keep this square without jumping */
}

.product h3 {
  margin: 0;
  font: var(--title-bold);
}

.card .product p {
  margin: 2px 0 0;
  color: var(--on-surface-variant);
  font: 400 17px / 24px var(--font);
}

.card .product .chip {
  margin-top: 6px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font: var(--label);
}

/* Kad što ima */
.seasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.seasons li {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  font-size: 16px;
}

.seasons strong {
  margin-right: 0.3em;
  font-weight: 600;
}

/* The history (P3S7): the year wreath beside the title, then a timeline of years with the old photos. */
.history-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.card .wreath {
  position: relative;
  flex: none;
  width: 104px;
  height: 104px;
  margin: 0;                        /* not .card p's 12px top margin: it would push the badge off the title's centre */
}

.wreath img {
  display: block;
  width: 100%;
  height: 100%;
}

/* The number sits in the ring's open middle: "89 godina", or "od 1937." without JavaScript. */
.wreath-text {
  position: absolute;
  inset: 22px 18px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--on-surface);
  font: var(--label);
}

/* The shop owner's anniversary logo (js/wreath.js): his wreath has the number in it and a white ground, which multiply
   drops into the card's colour. The text stays for screen readers. */
.wreath-owner img {
  mix-blend-mode: multiply;
}

.wreath-owner .wreath-text {
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.wreath-number {
  font: 600 32px / 32px var(--font);
  color: var(--primary);
}

.wreath-label {
  font: 500 13px / 16px var(--font);
}

.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.timeline li {
  padding: 12px 0 12px 16px;
  border-left: 3px solid var(--primary-container);
}

.card .timeline h3 {
  margin: 0 0 4px;
  font: var(--title-bold);
  color: var(--primary);
}

.card .timeline p {
  margin: 0;
}

.history-photo {
  margin: 12px 0 0;
}

.history-photo picture {
  aspect-ratio: 480 / 353;           /* the photos' shape (crops.json), so the empty box is already the right height */
}

.history-photo-plaque picture {
  aspect-ratio: 480 / 383;           /* the 2024 charter in its frame (crops.json) */
}

.history-photo-portrait {
  max-width: 240px;
}

.history-photo-portrait picture {
  aspect-ratio: 240 / 351;
}

.history-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.card .history-photo figcaption {
  margin-top: 6px;
  font: var(--body-small);
  color: var(--on-surface-variant);
}

/* Dođite */
.shop-front {
  aspect-ratio: 3 / 2;              /* the photo's shape (480 × 320), so the empty box is already the right height */
  margin-top: 16px;
}

.shop-front img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.contact {
  margin-top: 8px;
}

.contact-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 56px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
}

.contact-head {
  font: 500 18px / 24px var(--font);
  overflow-wrap: anywhere;          /* the e-mail address is longer than a 320 px column */
}

.placeholder {
  font-style: italic;
}

.hours-title {
  margin: 20px 0 8px;
  font: var(--title-bold);
}

.hours {
  width: 100%;
  border-collapse: collapse;
}

.hours th,
.hours td {
  padding: 8px 0;
  border-bottom: 1px solid var(--outline-variant);
  text-align: left;
}

.hours th {
  font-weight: 400;
}

.hours td {
  text-align: right;
}

.hours tr[data-today] th,
.hours tr[data-today] td {
  font-weight: 600;
}

p.holidays,
.closures li {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font: var(--body-small);
}

.map {
  margin: 20px 0 0;
}

.map img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
  font: var(--body-small);
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The colours are MAP_COLOURS in tools/art/draw.py. */
.key {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--outline-variant);
}

.key-shop { background: var(--primary); }
.key-gate { background: var(--tertiary); border-radius: 3px; }
.key-statue { background: #4f5e4a; } /* the statue's bronze in draw.py */
.key-queue {
  width: 18px;
  height: 0;
  border: 0;
  border-top: 3px dotted var(--tertiary);
  border-radius: 0;
  box-shadow: none;
}

.card .map-credit {
  margin: 6px 0 0;
  color: var(--on-surface-variant);
  font: var(--body-small);
}

/* Small text links still get a 48 px tap target. */
.map-credit a,
.site-footer a,
.price-link a,
.price-page a,
.plain a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
}

.map-links {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

/* Below the square */
.grgur {
  margin: 0;
  padding: 4px 16px 32px;
  background: var(--square);
  font: 500 21px / 28px var(--font);
}

@media (min-width: 592px) {
  .grgur {
    padding-inline: calc(50% - var(--column) / 2);
  }
}

.site-footer {
  padding: 28px 16px 40px;
  background: var(--tertiary);
  color: var(--on-tertiary);
  font: var(--body-small);
}

.site-footer p {
  max-width: var(--column);
  margin: 0 auto 8px;
}

.site-footer .footer-name {
  font: 600 18px / 26px var(--font);
}

.site-footer .placeholder-chip {
  padding: 6px 10px;
  border-color: #a8949c;            /* the design's muted outline on plum (design/round3/build.py) */
  color: inherit;
}

.site-footer a {
  color: inherit;
}

/* 404 page: no art, just a card on the roofs. */
.plain {
  padding: 24px 16px 48px;
}
