/* ============================================================
   TRAVEL — masonry photo mosaic + keyboard-navigable lightbox
   Dark-themed for jorgeroac; blue accent to match the site.
   (Adapted from the cv-to-website gallery template: kept only
   the .art-mosaic + .art-lightbox; flag "hero" strip added.)
   ============================================================ */

/* Custom page layout — full-bleed content + clear the fixed navbar.
   quarto-nav.js zeroes body.paddingTop (it looks for header.fixed-top); this
   site uses position:fixed via CSS, so restore the ~80px clearance, mirroring
   portfolio/software. */
#quarto-content { padding: 0; }
#title-block-header { display: none !important; }
body { padding-top: 80px !important; }

.art-mosaic-section {
  width: 100% !important;
  max-width: 1280px !important;  /* override Quarto's ~643px reading-width cap on <section> */
  margin: 1.5rem auto 3rem !important;
  padding: 0 1.5rem;
}

.art-mosaic-section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(100, 181, 246, 0.18);
}
.art-mosaic-section__heading h2 {
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.96);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.art-mosaic-section__heading h2 i { color: #64B5F6; font-size: 1.25rem; }
.art-mosaic-section__hint {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

/* ---- Region section labels ---- */
.art-region-section { margin-bottom: 2.5rem; }
.art-region__label {
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.art-region__label i { color: #64B5F6; font-size: 0.8rem; }

/* ---- Masonry columns (desktop) ---- */
.art-mosaic { column-count: 4; column-gap: 12px; }
@media (max-width: 1024px) { .art-mosaic { column-count: 3; } }
@media (max-width: 720px)  { .art-mosaic { column-count: 2; } }

/* ---- Mobile: horizontal scroll strips ---- */
@media (max-width: 600px) {
  .art-region-section { margin-bottom: 1.8rem; }
  .art-region__label  { margin-bottom: 0.6rem; font-size: 0.65rem; }
  .art-mosaic {
    column-count: unset !important;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .art-mosaic::-webkit-scrollbar { display: none; }
  .art-cell {
    flex-shrink: 0;
    width: 72vw;
    height: auto;
    margin-bottom: 0;
    break-inside: auto;
    scroll-snap-align: start;
  }
  .art-cell > img {
    width: 100%;
    height: auto;
    max-width: none;
  }
}

/* Landscape phones: size by height so tiles fill the viewport naturally */
@media (max-height: 500px) and (orientation: landscape) {
  .art-mosaic {
    column-count: unset !important;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .art-mosaic::-webkit-scrollbar { display: none; }
  .art-cell {
    flex-shrink: 0;
    height: 72vh;
    width: auto;
    margin-bottom: 0;
    break-inside: auto;
    scroll-snap-align: start;
  }
  .art-cell > img {
    height: 100%;
    width: auto;
    max-width: none;
  }
}

.art-cell {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  outline: 1px solid rgba(255, 255, 255, 0.08);
  outline-offset: -1px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              outline-color 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  contain: layout style;
}
.art-cell:hover {
  transform: translateY(-3px);
  outline-color: rgba(100, 181, 246, 0.55);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(100, 181, 246, 0.18);
}

.art-cell > img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.45s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateZ(0);
  backface-visibility: hidden;
}
.art-cell:hover > img { filter: saturate(1.12) brightness(1.04); transform: scale(1.04); }

/* ---- Flag "hero" strip — always visible at the bottom ---- */
.art-cell__cap {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  padding: 2rem 0.75rem 0.65rem;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.85) 100%);
  z-index: 2;
  pointer-events: none;
}
.art-cell__city {
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.art-cell__year {
  display: block;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 0.52rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.07em;
  text-align: right;
  line-height: 1.3;
  margin-top: 0.1rem;
}
.art-cell__row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.art-cell__flag {
  width: 28px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 1px 4px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}
.art-cell__name {
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.art-cell__sep {
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0.2rem 0 0.15rem;
  flex-shrink: 0;
}
.art-cell__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.4rem;
}
.art-cell__pin {
  color: #D63030;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-right: 0.2rem;
}
.art-cell__coords {
  font-size: 0.54rem;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.07em;
  text-align: right;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Lightbox modal
   ============================================================ */
.art-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.art-lightbox.is-open { display: flex; }

.art-lightbox__inner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.art-lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 6px;
  outline: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
}
.art-lightbox__caption { max-width: 720px; text-align: center; color: #f3f4f6; }
.art-lightbox__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}
.art-lightbox__flag { width: 30px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.art-lightbox__region {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64B5F6;
  margin-top: 0.25rem;
}
.art-lightbox__coords {
  display: block;
  font-size: 0.72rem;
  font-family: 'Quicksand', system-ui, sans-serif;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.07em;
  margin-top: 0.25rem;
}

.art-lightbox__close,
.art-lightbox__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.art-lightbox__close { top: -2.6rem; right: 0; width: 38px; height: 38px; }
.art-lightbox__close svg { width: 18px; height: 18px; }
.art-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.08); }

.art-lightbox__nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; }
.art-lightbox__nav svg { width: 22px; height: 22px; }
.art-lightbox__nav:hover { background: rgba(100, 181, 246, 0.3); transform: translateY(-50%) scale(1.08); }
.art-lightbox__nav--prev { left: -3.6rem; }
.art-lightbox__nav--next { right: -3.6rem; }

@media (max-width: 760px) {
  .art-lightbox__nav--prev { left: 0.4rem; }
  .art-lightbox__nav--next { right: 0.4rem; }
  .art-lightbox__close { top: 0.4rem; right: 0.4rem; }
}

/* ============================================================
   Missing GPS section
   ============================================================ */
.missing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.missing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  min-width: 100px;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.missing-card:hover {
  border-color: rgba(100, 181, 246, 0.4);
  background: rgba(100, 181, 246, 0.06);
}
.missing-card img {
  width: 36px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0.65;
}
.missing-card span {
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.3;
}

/* ---- Mobile tile caption: hide coords, center flag+country ---- */
@media (max-width: 600px),
       (max-height: 500px) and (orientation: landscape) {
  .art-cell__coords { display: none; }
  .art-cell__year   { display: none; }
  .art-cell__footer { justify-content: center; }
}
