/* I Morelli Barber Shop — mobile-first stylesheet.
   Base styles target ~360px phones; wider layouts are added with min-width queries. */

@font-face {
  font-family: 'Oswald';
  src: url('../fonts/oswald-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/playfair-italic-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #111111;
  --surface: #191816;
  --surface-2: #211f1b;
  --line: #2f2b25;
  --text: #efe8da;
  --muted: #a9a194;
  --brass: #b8925a;
  --brass-hi: #d2ad76;
  --brass-lo: #6f5634;
  --on-brass: #15120d;

  --font-display: 'Oswald', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --font-accent: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --gutter: 16px;
  --wrap: 1120px;
  --header-h: 64px;
  --radius: 12px;
  --callbar-h: 76px;

  color-scheme: dark;
}

/* ---------- Reset & base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--brass-hi); text-underline-offset: 3px; }
a:hover { color: var(--text); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.1;
  margin: 0;
}

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

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

[hidden] { display: none !important; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brass);
  color: var(--on-brass);
  font-weight: 600;
  border-radius: 6px;
}
.skip-link:focus { top: 10px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* The logo JPG has a solid black background: "screen" makes black
   see-through on the dark page while the white artwork stays white. */
.logo-blend { mix-blend-mode: screen; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .2s;
}
.btn .icon { width: 1.1em; height: 1.1em; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brass);
  color: var(--on-brass);
}
.btn-primary:hover { background: var(--brass-hi); color: var(--on-brass); }

.btn-ghost {
  border-color: var(--brass-lo);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--brass); color: var(--brass-hi); }

.btn-sm { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn-block { display: flex; width: 100%; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 17, 17, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--header-h);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 44px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand-est {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: .85rem;
  color: var(--brass);
}

.header-call,
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--brass-hi);
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.header-call:hover,
.nav-toggle:hover { border-color: var(--brass-lo); color: var(--text); }
.header-call-text { display: none; }

.nav-toggle { display: none; padding: 0; }
.nav-toggle .icon-close { display: none; }

/* Without JS the nav is a simple row of links under the logo */
.site-nav { order: 10; width: 100%; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 4px 0 12px; }
.site-nav a {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text);
  text-decoration: none;
}
.site-nav a.is-active,
.site-nav a:hover { color: var(--brass-hi); }

/* With JS the nav becomes a drop-down panel behind the hamburger */
.js .nav-toggle { display: inline-flex; }
.js .site-nav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  width: auto;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility 0s linear .2s;
}
.js .site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 20px; }
.js .site-nav li + li { border-top: 1px solid var(--line); }
.js .site-nav a {
  display: flex;
  align-items: center;
  min-height: 56px;
  font-size: 1.35rem;
}
.nav-open .site-nav {
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: opacity .2s, transform .2s !important;
}
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }
.no-scroll { overflow: hidden; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 55% at 50% 28%, rgba(184, 146, 90, .16), transparent 70%),
    repeating-linear-gradient(135deg, rgba(239, 232, 218, .018) 0 18px, transparent 18px 36px),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 32px;
  padding-bottom: 28px;
}

.hero-logo {
  width: min(68vw, 300px);
  margin-bottom: 20px;
}

.est-line {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--brass);
}
.est-line::before,
.est-line::after {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--brass-lo);
}

.hero h1 {
  margin-top: 8px;
  font-size: clamp(2rem, 9vw, 3.6rem);
  letter-spacing: .06em;
}

.hero-lead {
  max-width: 34ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  margin-top: 28px;
}

.hero-scroll {
  display: inline-flex;
  margin-top: 28px;
  padding: 8px;
  color: var(--brass-lo);
  animation: nudge 2.4s ease-in-out infinite;
}
.hero-scroll:hover { color: var(--brass); }

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---------- Sections ---------- */

.section {
  padding: 64px 0;
  scroll-margin-top: var(--header-h);
}
.hero { scroll-margin-top: var(--header-h); }

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  margin-bottom: 36px;
  text-align: center;
}
.kicker {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--brass);
}
.section-head h2 {
  margin-top: 4px;
  font-size: clamp(2rem, 8vw, 2.9rem);
}
.section-head h2::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  margin: 16px auto 0;
  background: var(--brass);
}

/* ---------- Barbers ---------- */

.barbers {
  display: grid;
  gap: 20px;
}

.barber {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.barber-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.barber-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.barber-body { padding: 20px; }
.barber h3 { font-size: 1.7rem; }
.barber-role {
  margin-top: 2px;
  font-family: var(--font-accent);
  font-style: italic;
  color: var(--brass);
}
.barber-bio {
  margin-top: 12px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.chips li {
  padding: 4px 12px;
  border: 1px solid var(--brass-lo);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--text);
}

/* ---------- Price list ---------- */

.price-groups {
  display: grid;
  gap: 36px;
  max-width: 640px;
  margin: 0 auto;
}

.price-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 1.3rem;
  letter-spacing: .12em;
  color: var(--brass);
}
.price-group h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--brass-lo);
}

.price-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.price-item:last-child { border-bottom: 0; }

.price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.price-name {
  font-size: 1.05rem;
  font-weight: 600;
}
.price-dots {
  flex: 1 1 auto;
  min-width: 16px;
  border-bottom: 2px dotted var(--brass-lo);
  transform: translateY(-5px);
}
.price-value {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--brass-hi);
  white-space: nowrap;
}
.price-note {
  margin-top: 2px;
  font-size: .9rem;
  color: var(--muted);
}
.price-time { white-space: nowrap; }

.price-footnote {
  margin-top: 32px;
  text-align: center;
  font-size: .9rem;
  color: var(--muted);
}

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 12px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(184, 146, 90, .12), transparent 60%),
    repeating-linear-gradient(135deg, rgba(184, 146, 90, .05) 0 12px, transparent 12px 24px),
    var(--surface-2);
}
.gallery-ph .icon {
  width: 44px;
  height: 44px;
  color: var(--brass);
}
.gallery-ph span {
  font-family: var(--font-display);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Real photos are links: tap opens the lightbox (or the image itself without JS) */
.gallery-link {
  display: block;
  height: 100%;
  cursor: zoom-in;
}
/* The tile clips overflow, so draw the focus ring inside it */
.gallery-link:focus-visible { outline-offset: -3px; }

/* ---------- Lightbox (gallery viewer) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 10, 10, .97);
  color: var(--text);
  overflow: hidden;
  /* Horizontal swipes are handled in JS; vertical pan and pinch stay native */
  touch-action: pan-y pinch-zoom;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-in .2s ease-out;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: calc(72px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
  cursor: zoom-out;
}

.lightbox-img {
  width: auto;
  max-width: min(100%, 1400px);
  /* Leave room for the top bar and the caption */
  max-height: calc(100vh - 170px);
  max-height: calc(100svh - 170px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  font-family: var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.lightbox-count {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  font-family: var(--font-display);
  line-height: 48px;
  letter-spacing: .1em;
  color: var(--muted);
}

.lightbox-btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--brass-lo);
  border-radius: 50%;
  background: rgba(17, 17, 17, .75);
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.lightbox-btn:hover { border-color: var(--brass); color: var(--brass-hi); }
.lightbox-btn .icon { width: 22px; height: 22px; }

.lightbox-close {
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
}
.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* ---------- Contacts & hours ---------- */

.contact-grid {
  display: grid;
  gap: 20px;
}

.card {
  padding: 24px 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 1.2rem;
  letter-spacing: .1em;
  color: var(--brass);
}

.contact-address {
  font-style: normal;
  font-size: 1.1rem;
}

/* Side by side only when both labels fit on one line */
.btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.btn-row .btn { white-space: nowrap; }

.contact-phone-title { margin-top: 32px; }
.contact-phone {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--text);
  text-decoration: none;
}
.contact-hint {
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: .95rem;
}

.hours {
  width: 100%;
  border-collapse: collapse;
}
.hours th,
.hours td {
  padding: 11px 8px;
  border-bottom: 1px dashed var(--line);
  vertical-align: top;
}
.hours tr:last-child th,
.hours tr:last-child td { border-bottom: 0; }
.hours th {
  text-align: left;
  font-weight: 500;
}
.hours td { text-align: right; }
.hours .slot { display: block; white-space: nowrap; }
.hours .closed { color: var(--muted); }

.hours .is-today th,
.hours .is-today td {
  background: rgba(184, 146, 90, .1);
  color: var(--brass-hi);
}
.hours .is-today th { border-radius: 6px 0 0 6px; }
.hours .is-today td { border-radius: 0 6px 6px 0; }
.today-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brass);
  color: var(--on-brass);
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  vertical-align: 2px;
}

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

.site-footer {
  padding: 48px 0 calc(var(--callbar-h) + 24px);
  border-top: 1px solid var(--line);
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.footer-logo { width: 72px; }
.footer-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.footer-contact { color: var(--muted); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin: 8px 0;
}
.footer-nav a {
  padding: 6px 0;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .9rem;
}
.footer-nav a:hover { color: var(--brass-hi); }
.footer-legal {
  font-size: .8rem;
  color: var(--muted);
}

/* ---------- Mobile call bar ---------- */

.callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(17, 17, 17, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  transition: transform .25s ease;
}
.js .callbar { transform: translateY(110%); }
.js .callbar.is-visible { transform: none; }

/* ---------- Tablet ---------- */

@media (min-width: 640px) {
  :root { --gutter: 24px; }

  .hero-inner { padding-top: 48px; padding-bottom: 36px; }
  .hero-cta { flex-direction: row; justify-content: center; max-width: none; }

  .section { padding: 84px 0; }

  .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }

  .card { padding: 28px; }
}

@media (min-width: 760px) {
  .barbers { grid-template-columns: repeat(3, 1fr); }
  .barber-photo { aspect-ratio: 4 / 5; }
  .barber h3 { font-size: 1.5rem; }

  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* ---------- Desktop ---------- */

@media (min-width: 960px) {
  :root { --header-h: 76px; }

  .brand img { width: 52px; }
  .brand-name { font-size: 1.45rem; }

  .js .nav-toggle { display: none; }
  .site-nav,
  .js .site-nav {
    position: static;
    order: 0;
    width: auto;
    margin-right: 20px;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .site-nav ul,
  .js .site-nav ul { flex-direction: row; gap: 32px; padding: 0; }
  .js .site-nav li + li { border: 0; }
  .site-nav a,
  .js .site-nav a {
    position: relative;
    min-height: 44px;
    font-size: 1rem;
  }
  .site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    height: 1px;
    background: var(--brass);
    transform: scaleX(0);
    transition: transform .2s;
  }
  .site-nav a.is-active::after,
  .site-nav a:hover::after { transform: scaleX(1); }

  .header-call {
    width: auto;
    gap: 10px;
    padding: 0 18px;
    border-radius: 6px;
    border-color: var(--brass-lo);
    font-family: var(--font-display);
    letter-spacing: .06em;
    color: var(--text);
    text-decoration: none;
  }
  .header-call .icon { width: 1.05em; height: 1.05em; color: var(--brass-hi); }
  .header-call-text { display: inline; }

  .hero-inner { padding-top: 64px; padding-bottom: 44px; }
  .hero-logo { width: 320px; }

  .section { padding: 104px 0; }

  .price-groups { grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: none; }

  .site-footer { padding-bottom: 40px; }
  .callbar,
  .js .callbar { display: none; }

  /* Arrows sit beside the photo instead of over it */
  .lightbox-figure { padding-left: 96px; padding-right: 96px; }
  .lightbox-prev { left: 24px; }
  .lightbox-next { right: 24px; }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
