/* ==========================================================================
   The Barber Castle — inner page components
   ========================================================================== */

/* --- Page hero ------------------------------------------------------------ */

.page-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(3rem, 7vw, 5.5rem));
  padding-bottom: clamp(2rem, 4vw, 3.5rem);
  background: var(--bc-canvas-2);
  border-bottom: 1px solid var(--bc-line);
  overflow: hidden;
}

.page-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.34;
}

.page-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 15, 14, 0.97) 20%, rgba(13, 15, 14, 0.72) 62%, rgba(13, 15, 14, 0.9) 100%);
}

.page-hero > .shell {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  max-width: 18ch;
}

.page-hero .lede {
  max-width: 54ch;
  margin-top: 1.25rem;
}

.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bc-line);
}

.page-hero__meta div {
  min-width: 0;
}

.page-hero__meta dt {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--bc-brass);
  margin-bottom: 0.3rem;
}

.page-hero__meta dd {
  margin: 0;
  font-size: var(--fs-small);
}

/* --- Breadcrumbs ---------------------------------------------------------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: var(--fs-meta);
  color: var(--bc-ink-3);
}

.breadcrumbs a {
  color: var(--bc-ink-2);
}

.breadcrumbs a:hover {
  color: var(--bc-brass);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--bc-line-2);
}

/* --- Anchor bar ----------------------------------------------------------- */

.anchor-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: rgba(13, 15, 14, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bc-line);
}

.anchor-bar ol {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0.9rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.anchor-bar ol::-webkit-scrollbar {
  display: none;
}

.anchor-bar a {
  white-space: nowrap;
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--bc-ink-2);
}

.anchor-bar a:hover {
  color: var(--bc-brass);
}

@media (max-width: 640px) {
  .anchor-bar ol {
    gap: 1.1rem;
  }
}

/* --- Prose ---------------------------------------------------------------- */

.prose {
  max-width: 68ch;
}

.prose h2 {
  font-size: var(--fs-display-s);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose ul,
.prose ol {
  /* Bullet markers hang off the start edge of the content box, so the indent
     has to be on the same edge or the marker lands inside the text. */
  padding-inline-start: 1.15rem;
  color: var(--bc-ink-2);
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose > :first-child {
  margin-top: 0;
}

/* --- Notices --------------------------------------------------------------- */

.notice {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--bc-line);
  border-inline-start: 2px solid var(--bc-brass);
  border-radius: var(--r-1);
  background: var(--bc-surface);
  color: var(--bc-ink-2);
  font-size: var(--fs-small);
}

.notice strong {
  color: var(--bc-ink);
  display: block;
  margin-bottom: 0.25rem;
}

.notice__mark {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--bc-brass);
}

/* --- Cards grid (generic) --------------------------------------------------- */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Package cards ---------------------------------------------------------- */

.pkg {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: clamp(1.5rem, 2.4vw, 2rem);
  border: 1px solid var(--bc-line);
  border-radius: var(--r-1);
  background: var(--bc-surface);
}

.pkg--feature {
  border-color: var(--bc-brass);
  background: linear-gradient(180deg, rgba(18, 86, 76, 0.28), rgba(25, 30, 27, 0.9));
}

.pkg__name {
  font-family: var(--font-display);
  font-size: var(--fs-display-s);
  text-transform: uppercase;
  line-height: 1.05;
}

.pkg__price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.pkg__price b {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 600;
}

.pkg__price s {
  color: var(--bc-ink-3);
  font-size: var(--fs-small);
}

.pkg__save {
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--bc-brass);
}

.pkg__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: var(--fs-small);
  color: var(--bc-ink-2);
  flex: 1;
}

.pkg__list li {
  padding-inline-start: 1.1rem;
  position: relative;
}

.pkg__list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.62em;
  width: 6px;
  height: 1px;
  background: var(--bc-brass);
}

/* --- Comparison table ------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bc-line);
  border-radius: var(--r-1);
}

table.compare {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

table.compare caption {
  text-align: start;
  padding: 1rem 1.25rem;
  color: var(--bc-ink-3);
  font-size: var(--fs-meta);
}

table.compare th,
table.compare td {
  padding: 0.9rem 1.25rem;
  text-align: start;
  border-bottom: 1px solid var(--bc-line);
  vertical-align: top;
}

table.compare thead th {
  font-family: var(--font-display);
  font-size: var(--fs-display-s);
  text-transform: uppercase;
  font-weight: 400;
  color: var(--bc-ink);
  white-space: nowrap;
}

table.compare tbody th {
  font-weight: 500;
  color: var(--bc-ink-2);
  white-space: nowrap;
}

table.compare td {
  color: var(--bc-ink-2);
}

table.compare tbody tr:last-child th,
table.compare tbody tr:last-child td {
  border-bottom: 0;
}

.yes {
  color: var(--bc-brass);
}

/* --- FAQs ------------------------------------------------------------------- */

.faq {
  border-top: 1px solid var(--bc-line);
}

.faq details {
  border-bottom: 1px solid var(--bc-line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.15rem 0;
  cursor: pointer;
  font-size: var(--fs-body);
  font-weight: 500;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--bc-brass);
  border-bottom: 1.5px solid var(--bc-brass);
  transform: rotate(45deg) translateY(-3px);
  transition: transform var(--dur) var(--ease-out);
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-3px);
}

.faq__body {
  padding: 0 3rem 1.35rem 0;
  color: var(--bc-ink-2);
  font-size: var(--fs-small);
  max-width: 72ch;
}

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

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.5rem, 1.2vw, 0.9rem);
}

.gallery__item {
  position: relative;
  margin: 0;
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  overflow: hidden;
  border-radius: var(--r-1);
  display: block;
  width: 100%;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 900ms var(--ease-out), opacity var(--dur) var(--ease-out);
}

.gallery__item:hover img {
  transform: scale(1.04);
}

.gallery__item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0.9rem 0.8rem;
  text-align: start;
  font-size: var(--fs-meta);
  color: var(--bc-ink);
  background: linear-gradient(to top, rgba(8, 10, 9, 0.88), transparent);
}

.gallery__item--wide {
  grid-column: span 2;
}

.gallery__item--wide img {
  aspect-ratio: 16 / 9;
}

@media (max-width: 860px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Lightbox ----------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(6, 8, 7, 0.94);
}

.lightbox.is-open {
  display: flex;
}

.lightbox__figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lightbox__figure img {
  max-height: 72vh;
  width: auto;
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--r-1);
}

.lightbox__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--fs-small);
  color: var(--bc-ink-2);
}

.lightbox__nav {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--bc-line-2);
  border-radius: var(--r-1);
  background: rgba(13, 15, 14, 0.6);
  color: var(--bc-ink);
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(244, 242, 236, 0.1);
}

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  inset-inline-end: clamp(1rem, 3vw, 2rem);
}

/* --- Immersive gallery mode ----------------------------------------------------- */

.immersive {
  margin-top: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--bc-line);
  border-radius: var(--r-1);
  background: #060807;
  overflow: hidden;
}

.immersive__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bc-line);
}

.immersive__stage {
  position: relative;
  height: clamp(20rem, 62vh, 34rem);
}

.immersive__canvas {
  position: absolute;
  inset: 0;
}

.immersive__canvas canvas {
  width: 100%;
  height: 100%;
}

.immersive__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  text-align: center;
  color: var(--bc-ink-3);
  font-size: var(--fs-small);
  background: #060807;
}

.immersive__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--bc-line);
}

.immersive__caption {
  font-size: var(--fs-small);
  color: var(--bc-ink-2);
  margin-inline-end: auto;
}

.immersive__strip {
  display: flex;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  overflow-x: auto;
  border-top: 1px solid var(--bc-line);
}

.immersive__strip button {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--bc-line-2);
  border-radius: var(--r-1);
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.immersive__strip button[aria-current="true"] {
  border-color: var(--bc-brass);
}

.immersive__strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Team ---------------------------------------------------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (max-width: 800px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .team-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (max-width: 800px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.contact-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--bc-line);
  font-size: var(--fs-small);
}

.contact-list b {
  flex: none;
  width: 7rem;
  font-size: var(--fs-micro);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--bc-brass);
  padding-top: 0.2rem;
}

/* --- Journal ---------------------------------------------------------------------- */

.article {
  max-width: 68ch;
}

.article__meta {
  font-size: var(--fs-meta);
  color: var(--bc-ink-3);
  margin-bottom: 1.5rem;
}

.article figure {
  margin: 2rem 0;
}

.article figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--r-1);
}

.article figcaption {
  margin-top: 0.6rem;
  font-size: var(--fs-meta);
  color: var(--bc-ink-3);
}
/* --- Inline link list ------------------------------------------------------ */

.link-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.link-list li {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--bc-line);
}

/* --- Service category blocks ------------------------------------------------ */

.category-block + .category-block {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.category-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-margin-top: calc(var(--header-h) + 60px);
}

.immersive--closed .immersive__stage,
.immersive--closed .immersive__controls,
.immersive--closed .immersive__strip {
  display: none;
}

.immersive__stage:focus-visible {
  outline: 2px solid var(--bc-focus);
  outline-offset: -2px;
}

.immersive__stage canvas {
  cursor: grab;
}

.immersive__stage:active canvas {
  cursor: grabbing;
}

/* --- Breadcrumbs clear the fixed masthead ---------------------------------- */

.breadcrumbs {
  padding-top: calc(var(--header-h) + 1.25rem);
  margin-bottom: 0;
}

.page-hero + .shell .breadcrumbs,
.breadcrumbs + main .page-hero {
  margin-top: 0;
}

/* A class-level `display` must not defeat the hidden attribute. */
.immersive__fallback[hidden] {
  display: none;
}

/* --- Five package cards read as one row on wide screens ------------------ */

.grid-packages {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

@media (max-width: 1180px) {
  .grid-packages {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .grid-packages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid-packages {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Arabic / RTL

   The lists, callout edge, table alignment, caption alignment, close button and
   immersive caption are all logical above. The one thing that cannot be is the
   FAQ disclosure chevron: it is drawn from two adjacent borders and rotated, so
   both the border pair and the angle have to flip together. Swapping only the
   borders would leave it pointing sideways; swapping only the angle would leave
   it built from the wrong corner.
   ========================================================================== */

[dir="rtl"] .faq summary::after {
  border-right: 0;
  border-left: 1.5px solid var(--bc-brass);
  transform: rotate(-45deg) translateY(-3px);
}

[dir="rtl"] .faq details[open] summary::after {
  transform: rotate(135deg) translateY(-3px);
}

/* ==========================================================================
   404

   Reached by a mistyped URL, so it carries the full chrome and offers the four
   destinations people actually mistype towards. The heading block reuses
   .page-hero; only the recovery list is new.
   ========================================================================== */

.notfound {
  max-width: 46ch;
}

.notfound__lead {
  margin: 0 0 var(--s-4);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--bc-ink-3);
}

.notfound__links {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--bc-line);
}

.notfound__links li {
  border-bottom: 1px solid var(--bc-line);
}

/* `.link-arrow` animates its rule on hover; here the row is the target, so the
   link keeps its own inline-flex behaviour and the row gets the hover tint. */
.notfound__links .link-arrow {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding-block: 0.35rem;
}

.notfound__links li:hover {
  background: color-mix(in oklab, var(--bc-brass) 5%, transparent);
}

.notfound__foot {
  margin: var(--s-5) 0 0;
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  color: var(--bc-ink-3);
}
