/* The business directory: listing cards, a listing page, its reviews, and the listing form. */

/* Stars: five small squares filled with a star shape, whole or half. */
.stars { display: inline-flex; gap: 1px; vertical-align: -2px; }
.stars i { width: 15px; height: 15px; background: var(--line);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.9 7.5.7-5.7 5 1.7 7.4L12 18l-6.5 4 1.7-7.4-5.7-5 7.5-.7z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3 6.9 7.5.7-5.7 5 1.7 7.4L12 18l-6.5 4 1.7-7.4-5.7-5 7.5-.7z'/%3E%3C/svg%3E") center / contain no-repeat; }
.stars i.on { background: var(--amber); }
.stars i.half { background: linear-gradient(90deg, var(--amber) 50%, var(--line) 50%); }
.rating { display: inline-flex; align-items: center; gap: 5px; }
a .rating { color: var(--ink); }

/* Logos: the business's own, or its initials. */
.biz-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.biz-logo-small { width: 64px; height: 64px; }
.biz-logo-large { width: 112px; height: 112px; }
.biz-initials { background: var(--forest); border-color: var(--forest); color: var(--paper); font: 700 1.6rem/1 'Barlow Condensed', sans-serif; letter-spacing: .03em; }
.biz-logo-large.biz-initials { font-size: 2.6rem; }

/* Cards */
.biz-grid { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.biz-card a { display: flex; gap: 14px; height: 100%; box-sizing: border-box; padding: 16px; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--amber); border-radius: 8px; color: var(--ink); text-decoration: none; }
.biz-card a:hover strong { text-decoration: underline; }
.biz-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.biz-card strong { font: 700 1.35rem/1.1 'Barlow Condensed', sans-serif; color: var(--forest); }
.directory-region small, .cat-chips small { display: inline; opacity: .7; margin-left: 3px; }
.cat-chips a[aria-current] { background: var(--forest); color: var(--paper); }
.biz-cta { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; margin: 10px 0 40px; }
.biz-cta p { margin: 4px 0 0; }

/* A listing */
.biz-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.biz-head h1 { margin: 0 0 6px; }
.biz-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.biz-meta .pill { text-decoration: none; }
.biz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.biz-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 28px; align-items: start; margin-bottom: 40px; }
.biz-main > section { margin-top: 30px; }
.biz-main > section:first-child { margin-top: 0; }
.biz-side { display: flex; flex-direction: column; gap: 14px; }
.biz-side .panel { gap: 8px; }
.biz-side p { margin: 0; }
@media (max-width: 860px) { .biz-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .biz-head { align-items: flex-start; } .biz-logo-large { width: 76px; height: 76px; } }

/* Photo mosaic: the first photo large, up to four beside it. data-count is how many tiles show. */
.biz-gallery {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(96px, 13vw, 170px);
  gap: 6px; margin-bottom: 22px; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 var(--line), 0 10px 26px rgba(6, 42, 25, .1);
}
.biz-gallery-item { position: relative; display: block; overflow: hidden; background: var(--sage); cursor: zoom-in; }
.biz-gallery-item[hidden] { display: none; }
.biz-gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease, filter .3s ease; }
.biz-gallery-item:hover img { transform: scale(1.04); filter: brightness(1.05); }
.biz-gallery-item:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; z-index: 1; }
.biz-gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
.biz-gallery-more {
  position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 42, 25, .6);
  color: #fff; font: 700 1.6rem 'Barlow Condensed', sans-serif; letter-spacing: .01em; transition: background .3s ease;
}
.biz-gallery-item:hover .biz-gallery-more { background: rgba(6, 42, 25, .5); }
.biz-gallery[data-count="1"] { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
.biz-gallery[data-count="1"] .biz-gallery-item { grid-column: auto; grid-row: auto; aspect-ratio: 16 / 9; }
.biz-gallery[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(170px, 24vw, 320px); }
.biz-gallery[data-count="2"] .biz-gallery-item { grid-column: auto; grid-row: auto; }
.biz-gallery[data-count="3"] .biz-gallery-item:not(:first-child) { grid-column: span 2; }
.biz-gallery[data-count="4"] .biz-gallery-item:nth-child(2) { grid-column: span 2; }
@media (max-width: 560px) {
  .biz-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 30vw; border-radius: 10px; gap: 4px; }
  .biz-gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
  .biz-gallery[data-count="3"] .biz-gallery-item:not(:first-child) { grid-column: auto; }
  .biz-gallery[data-count="2"] { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 52vw; }
}

/* The lightbox public/gallery.js opens over the page. */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #07120c; color: #fff;
}
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
body:has(.lightbox[open]) { overflow: hidden; }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 8px 20px; font-size: .95rem; }
.lightbox-count { color: rgba(255, 255, 255, .78); font-variant-numeric: tabular-nums; }
.lightbox-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 72px; touch-action: pan-y; }
.lightbox-stage img {
  display: block; max-width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; border-radius: 6px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5); user-select: none; -webkit-user-drag: none; transition: opacity .2s ease;
}
.lightbox-stage img.loading { opacity: .35; }
.lightbox button { font: inherit; color: inherit; cursor: pointer; }
.lightbox-nav, .lightbox-close {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); transition: background .2s ease;
}
.lightbox-nav:hover, .lightbox-close:hover { background: rgba(255, 255, 255, .24); }
.lightbox-nav:focus-visible, .lightbox-close:focus-visible, .lightbox-thumbs button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.lightbox-nav svg, .lightbox-close svg { width: 24px; height: 24px; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 14px; }
.lightbox-next { right: 14px; }
.lightbox-thumbs { display: flex; gap: 8px; justify-content: center; padding: 12px 16px 18px; overflow-x: auto; }
.lightbox-thumbs button {
  flex: none; width: 68px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  background: none; opacity: .5; transition: opacity .2s ease, border-color .2s ease;
}
.lightbox-thumbs button:hover { opacity: .85; }
.lightbox-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--amber); }
.lightbox-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lightbox.single .lightbox-nav, .lightbox.single .lightbox-thumbs { display: none; }
@media (max-width: 560px) {
  .lightbox-stage { padding: 0 6px; }
  .lightbox-stage img { max-height: calc(100dvh - 150px); border-radius: 0; }
  .lightbox-nav { width: 40px; height: 40px; background: rgba(0, 0, 0, .45); }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-thumbs button { width: 54px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .biz-gallery-item img, .lightbox-stage img { transition: none; }
  .biz-gallery-item:hover img { transform: none; }
}
.biz-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.biz-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

table.hours { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.hours th { text-align: left; font-weight: 500; padding: 3px 10px 3px 0; }
table.hours td { text-align: right; padding: 3px 0; }

/* Reviews */
.review-list { list-style: none; margin: 0 0 20px; padding: 0; }
.review-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.review-list p { margin: 0 0 6px; }
.review-form h3 { margin: 0; }
.star-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.star-pick legend { font-weight: 700; margin-bottom: 4px; }
.star-pick label { display: flex; gap: 5px; align-items: center; font-weight: 500; }

/* The listing form */
.biz-form fieldset { border: 0; border-top: 1px solid var(--line); padding: 14px 0 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.biz-form fieldset:first-of-type { border-top: 0; padding-top: 0; }
.biz-form legend { font: 700 1.25rem/1.2 'Barlow Condensed', sans-serif; color: var(--forest); padding: 0; margin-bottom: 4px; }
.hours-grid { display: flex; flex-direction: column; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hours-row .check { white-space: nowrap; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row > span:first-child { grid-column: 1 / -1; font-weight: 700; } .hours-row > span.muted { display: none; } }
.current-media { display: flex; gap: 12px; align-items: center; }
.current-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-pick { display: flex; flex-direction: column; gap: 4px; }
.photo-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }

/* The admin's view of a listing */
.admin-biz { display: flex; gap: 12px; align-items: center; }
.admin-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-photos img { width: 90px; height: 68px; object-fit: cover; border-radius: 4px; }

/* Confirming the owner's mobile number */
.phone-check { display: flex; flex-direction: column; gap: 12px; }
.phone-step { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.phone-step[hidden] { display: none; }
.phone-step label { align-self: stretch; }
.phone-check button.link { background: none; border: 0; padding: 0; color: var(--forest); text-decoration: underline; cursor: pointer; }
.phone-status:empty { display: none; }


/* By appointment only: a badge by the business name, and a line above the hours. */
.biz-meta .pill-appt { background: var(--amber); color: var(--forest-deep); }
.appt-note { font-weight: 700; margin: 0 0 8px; }

/* A listing's video leads the page, above the photos. */
.biz-video-feature { margin-bottom: 14px; }
.biz-video-feature .biz-video { border-radius: 14px; box-shadow: 0 1px 0 var(--line), 0 10px 26px rgba(6, 42, 25, .14); }
