/* alter – frizerski studio · theme (responsive)
   Named theme.css so it doesn't touch your old _css/style.css while pages are being moved over. */

:root {
  --u: 181px;            /* size of one square tile on desktop */
  --brown: #4b2c25;      /* swap for the exact colour of _images/brown_cube_big.jpg */
  --line: #999;
  --ink: #111;
  --muted: #8a8a8a;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll;   /* always reserve the scrollbar, so short and long pages sit at the same place */
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.55 Arial, Helvetica, sans-serif;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

.stage {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

/* ---------- top bar: language + social ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: .05em;
  color: #666;
}
.topbar a:hover { color: var(--brown); }
.topbar .lang a[aria-current] { font-weight: 700; color: var(--brown); }
.social { display: flex; gap: 8px; }
.social img { height: 30px; width: auto; }

/* ---------- tile grid (mobile first) ---------- */
.nav { display: contents; }

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-areas:
    "logo logo"
    "n1   n2"
    "n3   n4"
    "n5   n6"
    "aside aside"
    "text  text";
}

/* brown corner block behind the logo */
.grid::before {
  content: "";
  position: absolute;
  left: -10px;
  top: -10px;
  width: 110px;
  height: 110px;
  background: var(--brown);
  z-index: 0;
}

.tile {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  margin: 0 -1px -1px 0;
  text-transform: uppercase;
  text-align: center;
  font-size: 14px;
  letter-spacing: .01em;
  transition: background .2s, color .2s;
}
a.tile:hover { background: #f6f2f0; color: var(--brown); }
a.tile.t-logo:hover { background: #fff; }
.tile[aria-current] { font-weight: 700; color: var(--brown); }

.t-logo { grid-area: logo; min-height: 150px; padding: 14px; }
.t-logo img { width: 100%; max-width: 180px; height: auto; }
.t1 { grid-area: n1; }
.t2 { grid-area: n2; }
.t3 { grid-area: n3; }
.t4 { grid-area: n4; }
.t5 { grid-area: n5; }
.t6 { grid-area: n6; }

/* ---------- right-hand column (only exists when a page asks for it) ---------- */
.aside {
  grid-area: aside;
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.slide {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #eee;
  overflow: hidden;
  border: 1px solid #000;
}
.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}
.slide img.is-active { opacity: 1; }

.aside-box {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  font-size: 14.5px;
}

/* ---------- content ---------- */
.text {
  grid-area: text;
  position: relative;
  padding: 28px 2px 0;
}
.heading,
.text h1 {
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.aside-box p { margin: 0 0 1em; }
.aside-box > :last-child { margin-bottom: 0; }
.aside-box h2:first-child { margin-top: 0; }
.text h2,
.aside-box h2 {
  margin: 28px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.text p, .text ul, .text ol { margin: 0 0 1.1em; }
.text ul, .text ol { padding-left: 1.2em; }
.text li { margin-bottom: .3em; }
.text a:not(.tile) { border-bottom: 1px solid var(--brown); }
.text a:not(.tile):hover { color: var(--brown); }
.text a.tel { white-space: nowrap; }

/* old editor output (<font size="2">) must not fight the theme's text size */
.text font { font-size: inherit; }

.notice {
  margin: 26px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid var(--brown);
  font-size: 14.5px;
}
.notice strong { display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.notice p { margin: 0 0 .7em; }
.notice p:last-child { margin-bottom: 0; }

/* embedded map (contact page) */
.text .map {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 350px;
  margin: 1.4em 0 .5em;
  border: 1px solid var(--line);
}
.map-link { font-size: 13px; }

.holiday { font-size: 14.5px; color: #333; }
.holiday strong { text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }

.foot {
  margin: 28px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- small tablets: three tiles per row ---------- */
@media (min-width: 520px) {
  .stage { padding: 24px 24px 32px; }
  .grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas:
      "logo  logo  logo"
      "n1    n2    n3"
      "n4    n5    n6"
      "aside aside aside"
      "text  text  text";
  }
  .grid::before { width: 140px; height: 140px; left: -14px; top: -14px; }
  .tile { min-height: 72px; }
  .text { padding: 32px 4px 0; }
}

/* ---------- desktop: the original tile composition ---------- */
@media (min-width: 1040px) {
  body {
    font-size: 15px;
    line-height: 1.5;
    /* faded artwork (scissors left, salon photo right); path is relative to this CSS file */
    /* -1px: the artwork's horizontal line sat 1px below the bottom edge of the first tile row */
    background: #fff url("../_images/background.jpg") center -1px no-repeat;
  }

  /* the old .container was 1000px wide with content starting ~37px in */
  .stage { padding: 0 0 32px; }
  .layout { margin-left: 37px; width: calc(var(--u) * 4); }

  .topbar {
    height: 65px;
    align-items: flex-start;
    margin: 0;
    padding: 26px 0 0 calc(var(--u) + 60px);
  }
  .social { margin-top: -6px; margin-right: 4px; }

  .grid {
    grid-template-columns: repeat(4, var(--u));
    /* the artwork's lines are 180px apart below the first row (first row 181px), so the rows follow it */
    grid-template-rows: var(--u) 180px 180px 180px auto;
    /* no right column: the text uses the space (columns 2-4) */
    grid-template-areas:
      "logo n1   n2   n3"
      "n4   text text text"
      "n5   text text text"
      "n6   text text text"
      ".    text text text";
  }
  /* with a right column: text in columns 2-3, column 4 for the slideshow / aside */
  .grid.has-aside {
    grid-template-areas:
      "logo n1   n2   n3"
      "n4   text text aside"
      "n5   text text aside"
      "n6   text text aside"
      ".    text text aside";
  }

  .grid::before {
    left: -43px;
    top: -46px;
    width: 271px;
    height: 271px;
  }

  .tile { min-height: 0; }
  .t-logo { min-height: 0; padding: 0; }
  .t-logo img { max-width: 100%; }

  /* the column deliberately reaches past the 4th tile, like the original photo did */
  .aside {
    width: 402px;
    margin: 0;
    align-self: start;
    justify-self: start;
  }

  .text { padding: 52px 20px 24px 39px; }
  .text::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 47px;
    height: 43px;
    background: var(--brown);
  }

  .foot { margin-left: calc(var(--u) * 3); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .slide img { transition: none; }
}

/* =====================================================================
   Booking form (orders.php includes booking.php)
   Moved here from the <style> block that used to be inside booking.php,
   restyled to match the site. Every rule is scoped to #alter-booking so
   nothing leaks into other pages.
   NOTE: the 640px breakpoint at the end must stay in sync with the script in
   booking.php (matchMedia '(max-width: 640px)' decides 3 or 6 days per row).
   ===================================================================== */
#alter-booking {
  --acc: var(--brown);
  --acc-dark: #3a211b;
  --acc-ink: #fff;
  --mute: #6b6b6b;
  --err: #b3261e;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
#alter-booking, #alter-booking * { box-sizing: border-box; }

/* booking.php opened on its own (not through orders.php) */
#alter-booking .wrap { max-width: 760px; margin: 2rem auto; padding: 0 1rem; }
/* inside the theme the content column already provides the spacing */
.text #alter-booking .wrap { max-width: none; margin: 0; padding: 0; }

#alter-booking .card { background: #fff; border: 1px solid var(--line); padding: 20px; }

#alter-booking h1 { margin: 0 0 20px; font-size: 16px; font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
#alter-booking h2 { margin: 0 0 16px; font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* step indicator */
#alter-booking .steps { display: flex; gap: 8px; margin: 0 0 16px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
#alter-booking .steps span { flex: 1; padding-bottom: 6px; border-bottom: 3px solid #ddd; }
#alter-booking .steps .on { color: var(--ink); border-color: var(--acc); font-weight: 700; }

/* fields */
#alter-booking label { display: block; margin: 14px 0 4px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
#alter-booking input[type=text],
#alter-booking input[type=email],
#alter-booking input[type=password],
#alter-booking input[type=tel],
#alter-booking select,
#alter-booking textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
}
#alter-booking textarea { min-height: 5rem; resize: vertical; }

/* buttons */
#alter-booking button {
  font: inherit;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 10px 16px;
  transition: background .2s, color .2s, border-color .2s;
}
#alter-booking button:hover:not(:disabled) { background: #f6f2f0; color: var(--acc); }
#alter-booking button.primary { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 700; }
#alter-booking button.primary:hover:not(:disabled) { background: var(--acc-dark); color: var(--acc-ink); border-color: var(--acc-dark); }
#alter-booking button:disabled { opacity: .5; cursor: not-allowed; }
#alter-booking .link { background: none; border: 0; padding: 0; color: var(--acc); text-decoration: underline; text-transform: none; letter-spacing: 0; font-size: inherit; }
#alter-booking .link:hover:not(:disabled) { background: none; }
#alter-booking :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* layout helpers */
#alter-booking .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
#alter-booking .row.end { justify-content: space-between; }
#alter-booking .or { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--mute); }
#alter-booking .or::before, #alter-booking .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#alter-booking .err { min-height: 1.2em; margin-top: 8px; font-size: 14px; color: var(--err); }
#alter-booking .hp { position: absolute; left: -9999px; }
#alter-booking [hidden] { display: none !important; }

/* week picker */
#alter-booking .week-nav { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 12px; }
#alter-booking .week { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
/* Day headers: always two lines – weekday ("sri") above the date ("11.11.") – so every column looks the same
   and the time buttons start at the same height. */
#alter-booking .day h4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
}
#alter-booking .day h4 .dt { font-weight: 400; letter-spacing: 0; }
#alter-booking .day button { display: block; width: 100%; margin-bottom: 6px; padding: 6px 0; font-size: 14px; letter-spacing: 0; text-transform: none; }
#alter-booking .day button[aria-pressed=true] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
#alter-booking .none { text-align: center; color: var(--mute); }
#alter-booking .day button:disabled { background: transparent; color: var(--mute); opacity: .4; border-style: dashed; }

/* summary + appointments list */
#alter-booking dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
#alter-booking dt { color: var(--mute); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
#alter-booking dd { margin: 0; }
#alter-booking .appts { margin: 20px 0 8px; }
#alter-booking .appts h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
#alter-booking .appt { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; border: 1px solid var(--line); padding: 10px 14px; margin-bottom: 8px; }
#alter-booking .appt small { display: block; color: var(--mute); }
#alter-booking .appt .when { font-weight: 700; }

@media (max-width: 640px) {
  #alter-booking .week { grid-template-columns: repeat(3, 1fr); }
}

/* While the next week loads, booking.php keeps the previous grid and dims it (no collapse, no jump). */
#alter-booking .week.loading { opacity: .45; pointer-events: none; transition: opacity .15s; }

/* =====================================================================
   Gallery (gallery.php) + lightbox (_scripts/lightbox.js)
   ===================================================================== */
.text .gallery {
  list-style: none;
  margin: 0 0 1.2em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 72px);      /* thumbnails are 72x72 files: keep them crisp */
  gap: 8px;
}
.text .gallery li { margin: 0; }
.text .gallery a { display: block; border-bottom: 0; }
.text .gallery img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  transition: border-color .2s, opacity .2s;
}
.text .gallery a:hover img,
.text .gallery a:focus-visible img { border-color: var(--brown); opacity: .85; }
.credit { font-size: 12px; color: var(--muted); }

.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 72px 24px;
  background: rgba(24, 14, 11, .94);
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lb-img { max-width: 100%; max-height: calc(100vh - 130px); width: auto; height: auto; border: 1px solid #fff; background: #222; }
.lb-cap { color: #fff; font-size: 13px; letter-spacing: .03em; text-align: center; }
.lb-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  font: 28px/1 Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}
.lb-btn:hover { background: #f6f2f0; color: var(--brown); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; margin-top: -22px; }
.lb-next { right: 12px; top: 50%; margin-top: -22px; }
@media (max-width: 640px) {
  .lb { padding: 64px 8px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; margin-top: 0; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-img { max-height: calc(100vh - 190px); }
}
