/* ==========================================================================
   Locations page  (loads after css/style.css — reuses its variables,
   header, footer, language-switch and the shared lightbox rules)
   ========================================================================== */

/* current page in the header nav */
.desktop-nav a.is-current,
.main-nav a.is-current {
  color: var(--color-accent);
}

.loc-container {
  max-width: var(--container, 1240px);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- page heading ---------- */
.loc-hero {
  position: relative;
  overflow: hidden;
  padding: 18px 0 22px;
}

.loc-branch {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: auto;
  pointer-events: none;
}

.loc-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .74rem;
  color: var(--color-text-soft);
}

.loc-breadcrumb li + li::before {
  content: "›";
  margin-right: 8px;
}

.loc-breadcrumb a:hover {
  color: var(--color-accent);
}

.loc-title {
  margin: 22px 0 14px;
  font-size: 1.85rem;
  letter-spacing: .06em;
  line-height: 1.3;
}

.loc-lead {
  max-width: 660px;
  margin: 0;
  font-size: .84rem;
  line-height: 1.95;
  color: var(--color-text-soft);
}

/* ---------- temple links (sticky tabs) ---------- */
.loc-tabs-anchor {
  height: 0;
  margin: 0;
  padding: 0;
}

.loc-tabs-wrap {
  position: relative;
  z-index: 40;
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* JS adds .is-fixed after the tab bar reaches the site header. Using
   fixed positioning here avoids sticky being captured by an ancestor's
   overflow/scrolling context (a known sticky-positioning limitation). */
.loc-tabs-wrap.is-fixed {
  position: fixed;
  top: var(--site-header-height, 0px);
  left: 0;
  right: 0;
  width: 100%;
}

.loc-tabs-spacer {
  display: none;
  height: var(--loc-tabs-height, 0px);
}

.loc-tabs-spacer.is-active {
  display: block;
}

.loc-tabs-inner {
  position: relative;
  max-width: var(--container, 1240px);
  margin: 0 auto;
}

.loc-tabs {
  position: relative;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-behavior: smooth;
}

.loc-tabs::-webkit-scrollbar {
  display: none;
}

.loc-tabs li {
  flex: 0 0 auto;
}

.loc-tabs a {
  display: block;
  padding: 10px 2px 12px;
  margin-bottom: -1px;
  font-family: var(--font-display);
  font-size: .84rem;
  color: var(--color-text);
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.loc-tabs a:hover,
.loc-tabs a.is-active {
  color: var(--color-accent);
}

.loc-tabs a.is-active {
  border-bottom-color: var(--color-accent);
}

/* SP: a real button is used so the right arrow is tappable. */
.loc-tabs-arrow {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 1px;
  width: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--color-accent);
  background:
    linear-gradient(90deg, rgba(250, 246, 238, 0), var(--color-bg) 68%);
  cursor: pointer;
  z-index: 2;
}

.loc-tabs-arrow svg {
  transform: translateX(6px);
}

.loc-tabs-arrow[hidden] {
  display: none;
}

/* Leave room under the sticky header so anchor jumps are not covered. */
.loc-item,
#loc-list {
  scroll-margin-top: calc(
    var(--site-header-height, 0px) +
    var(--loc-tabs-height, 0px) -
    30px
  );
}

/* ---------- temple sections ---------- */
.loc-list {
  padding: 6px 0 64px;
}

.loc-item {
  padding: 28px 0 34px;
  border-top: 1px solid var(--color-cream-line);
}

.loc-item:first-child {
  border-top: none;
}

.loc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 14px;
}

.loc-name {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: .06em;
  line-height: 1.3;
}

.loc-seasons {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-accent);
}

.loc-seasons li {
  display: flex;
}

.loc-seasons img {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* seasons that don't suit a temple can be dimmed with class="is-off" on the <li> */
.loc-seasons li.is-off {
  opacity: .25;
}

/* SP: main image → thumbnails → text */
.loc-body {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "thumbs"
    "text";
  gap: 10px;
}

.loc-main {
  grid-area: main;
}

.loc-thumbs {
  grid-area: thumbs;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.loc-text {
  grid-area: text;
  margin: 6px 0 0;
  font-size: .8rem;
  line-height: 1.95;
  color: var(--color-text-soft);
}

/* ---------- clickable image ---------- */
.loc-img {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #E9DFC9;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.loc-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .45s ease;
  object-position: center center;
}

.loc-img:hover img {
  transform: scale(1.05);
}

.loc-img-main {
  aspect-ratio: 2 / 1;
}

/* small magnifier badge on the large image */
.loc-img-main::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / 16px no-repeat,
    rgba(33, 27, 21, .5);
  pointer-events: none;
}

/* ==========================================================================
   Tablet / PC  (≥ 900px)
   ========================================================================== */
@media (min-width: 900px) {
  .loc-container {
    padding: 0 32px;
  }

  .loc-branch {
    display: block;
  }

  .loc-hero {
    padding-top: 22px;
    padding-bottom: 28px;
  }

  .loc-title {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 26px 0 16px;
    font-size: 2.5rem;
  }

  .loc-title::after {
    content: "";
    width: 90px;
    height: 1px;
    background: var(--color-accent);
  }

  .loc-lead {
    font-size: .95rem;
  }

  .loc-tabs-wrap {
    margin: 0;
  }

  .loc-tabs-inner {
    padding: 0 32px;
  }

  .loc-tabs {
    justify-content: space-between;
    gap: 14px;
    padding: 0 4px;
    overflow: visible;
  }

  .loc-tabs a {
    font-size: .92rem;
  }

  .loc-tabs-arrow {
    display: none;
  }

  .loc-item {
    padding: 34px 0 40px;
  }

  .loc-name {
    font-size: 2.1rem;
  }

  .loc-seasons {
    gap: 16px;
  }

  .loc-seasons svg {
    width: 28px;
    height: 28px;
  }

  .loc-body {
    grid-template-columns: 45% 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "main text"
      "main thumbs";
    column-gap: 28px;
    row-gap: 18px;
  }

  .loc-main {
    position: relative;
    min-height: 260px;
  }

  .loc-img-main {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    aspect-ratio: auto;
  }

  .loc-text {
    margin: 0;
    font-size: .88rem;
  }

  .loc-thumbs {
    gap: 10px;
    align-content: start;
  }

  .loc-thumbs .loc-img {
    aspect-ratio: 16 / 10;
  }

  .loc-item,
  #loc-list {
  scroll-margin-top: calc(
    var(--site-header-height, 0px) +
    var(--loc-tabs-height, 0px) -
    100px
  );
  }

}

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