/*
 * XChat Museum — meeting photo galleries
 * Visual layer only. Gallery behavior lives in museum-meetings.js.
 */


/* Museum nav has several historical sections. */
.xmuseum-window nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}


.xmuseum-window nav > button {
  flex: 0 0 auto;
  white-space: nowrap;
}


/* ──────────────────────────────────────────────────────────
   GALLERY HEADER
   ────────────────────────────────────────────────────────── */

.xmuseum-meeting-head {
  position: relative;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin: 1px 0 22px;
  padding: 0 0 18px;

  border-bottom: 1px solid rgba(255, 255, 255, .08);
}


.xmuseum-meeting-head::after {
  content: "";

  position: absolute;
  left: 0;
  bottom: -1px;

  width: 112px;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      #f6d979,
      transparent
    );
}


.xmuseum-meeting-head h2 {
  margin: 0 0 6px;

  color: #fff0bb;

  font-family:
    Georgia,
    "Times New Roman",
    serif;

  font-size: 29px;
  line-height: 1.1;
  font-weight: 700;
}


.xmuseum-meeting-head p {
  max-width: 650px;

  margin: 0;

  color: #8f9dbb;

  font-size: 13px;
  line-height: 1.5;
}


.xmuseum-meeting-head strong {
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 36px;

  padding: 8px 12px;

  border: 1px solid rgba(246, 217, 121, .26);
  border-radius: 10px;

  color: #f6d979;

  background:
    linear-gradient(
      180deg,
      rgba(246, 217, 121, .10),
      rgba(246, 217, 121, .045)
    );

  box-shadow:
    0 5px 16px rgba(0, 0, 0, .1);

  font-size: 12px;
  font-weight: 750;
}


/* ──────────────────────────────────────────────────────────
   PHOTO GRID
   ────────────────────────────────────────────────────────── */

.xmuseum-meeting-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(175px, 1fr));

  gap: 13px;
}


.xmuseum-meeting-card {
  appearance: none;

  position: relative;

  min-width: 0;

  margin: 0;
  padding: 7px 7px 9px;

  overflow: hidden;

  border: 1px solid rgba(171, 190, 234, .12);
  border-radius: 13px;

  color: #dce5fa;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, .055),
      rgba(255, 255, 255, .026)
    );

  box-shadow:
    0 9px 24px rgba(0, 0, 0, .13);

  font: inherit;

  cursor: pointer;

  transition:
    transform 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    box-shadow 170ms ease;
}


.xmuseum-meeting-card::after {
  content: "Открыть";

  position: absolute;
  left: 50%;
  top: 50%;

  padding: 6px 10px;

  border: 1px solid rgba(255, 255, 255, .21);
  border-radius: 999px;

  color: #fff;

  background: rgba(3, 8, 22, .72);

  box-shadow:
    0 6px 20px rgba(0, 0, 0, .28);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: .045em;

  opacity: 0;

  transform:
    translate(-50%, -38%);

  transition:
    opacity 160ms ease,
    transform 160ms ease;

  pointer-events: none;
}


.xmuseum-meeting-card:hover {
  transform: translateY(-4px);

  border-color: rgba(246, 217, 121, .3);

  background:
    linear-gradient(
      180deg,
      rgba(246, 217, 121, .085),
      rgba(255, 255, 255, .028)
    );

  box-shadow:
    0 16px 34px rgba(0, 0, 0, .23);
}


.xmuseum-meeting-card:hover::after {
  opacity: 1;

  transform:
    translate(-50%, -50%);
}


.xmuseum-meeting-card > span {
  position: relative;

  height: 165px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 9px;

  background:
    radial-gradient(
      circle at 50% 20%,
      #17213a,
      #070b17 68%
    );

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .035) inset;
}


.xmuseum-meeting-card img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;

  transition:
    transform 240ms ease,
    filter 240ms ease;
}


.xmuseum-meeting-card:hover img {
  transform: scale(1.025);

  filter: brightness(.73);
}


.xmuseum-meeting-card small {
  display: block;

  margin-top: 8px;

  color: #8896b5;

  font-size: 10px;
  line-height: 1.3;

  text-align: center;
}


/* ──────────────────────────────────────────────────────────
   GALLERY PAGINATION
   ────────────────────────────────────────────────────────── */

.xmuseum-meeting-pagination {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  flex-wrap: wrap;

  margin: 25px 0 8px;
}


.xmuseum-meeting-pagination > div {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 5px;

  flex-wrap: wrap;
}


.xmuseum-meeting-pagination button {
  appearance: none;

  min-width: 37px;
  min-height: 37px;

  padding: 7px 10px;

  border: 1px solid rgba(166, 187, 235, .14);
  border-radius: 10px;

  color: #aebad5;

  background: rgba(255, 255, 255, .038);

  font: inherit;
  font-size: 12px;
  font-weight: 650;

  cursor: pointer;

  transition:
    transform 130ms ease,
    border-color 130ms ease,
    color 130ms ease,
    background 130ms ease;
}


.xmuseum-meeting-pagination button:hover:not(:disabled) {
  transform: translateY(-1px);

  border-color: rgba(246, 217, 121, .32);

  color: #fff0b3;

  background: rgba(246, 217, 121, .075);
}


.xmuseum-meeting-pagination button.active {
  border-color: #e7c45d;

  color: #171306;

  background:
    linear-gradient(
      180deg,
      #f6dc82,
      #d3ab42
    );

  box-shadow:
    0 5px 13px rgba(118, 82, 9, .2);

  font-weight: 800;
}


.xmuseum-meeting-pagination button:disabled {
  opacity: .28;
  cursor: default;
}


/* ──────────────────────────────────────────────────────────
   FULLSCREEN PHOTO VIEWER
   ────────────────────────────────────────────────────────── */

.xmuseum-meeting-viewer {
  position: fixed;
  inset: 0;
  z-index: 100100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(
      circle at 50% 44%,
      rgba(33, 48, 89, .26),
      transparent 50%
    ),
    rgba(0, 2, 8, .95);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  animation: xmuseum-viewer-in 160ms ease-out;
}


@keyframes xmuseum-viewer-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


.xmuseum-meeting-viewer-dialog {
  position: relative;

  width: min(1200px, 96vw);
  height: min(860px, 92vh);

  display: grid;
  grid-template-columns:
    62px minmax(0, 1fr) 62px;

  align-items: center;

  padding: 15px;

  border: 1px solid rgba(246, 217, 121, .18);
  border-radius: 20px;

  background:
    linear-gradient(
      180deg,
      rgba(18, 27, 54, .9),
      rgba(5, 9, 22, .96)
    );

  box-shadow:
    0 40px 120px rgba(0, 0, 0, .8),
    0 1px rgba(255, 255, 255, .05) inset;
}


.xmuseum-meeting-viewer figure {
  min-width: 0;
  min-height: 0;
  height: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 12px;

  margin: 0;

  overflow: hidden;
}


.xmuseum-meeting-viewer img {
  display: block;

  min-width: 0;
  min-height: 0;

  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100% - 46px);

  object-fit: contain;

  border-radius: 10px;

  background: #02040b;

  box-shadow:
    0 18px 65px rgba(0, 0, 0, .58),
    0 0 0 1px rgba(255, 255, 255, .07);
}


.xmuseum-meeting-viewer figcaption {
  width: 100%;

  color: #9ba9c7;

  font-size: 11px;
  line-height: 1.4;

  text-align: center;
}


.xmuseum-meeting-viewer button {
  appearance: none;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 13px;

  color: rgba(238, 243, 255, .78);

  background: rgba(255, 255, 255, .045);

  font: inherit;

  cursor: pointer;

  transition:
    transform 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}


.xmuseum-meeting-viewer button:hover {
  color: #fff;

  border-color: rgba(246, 217, 121, .35);

  background: rgba(246, 217, 121, .08);
}


.xmuseum-meeting-viewer-prev,
.xmuseum-meeting-viewer-next {
  width: 48px;
  height: 64px;

  justify-self: center;

  font-size: 29px;
}


.xmuseum-meeting-viewer-prev:hover {
  transform: translateX(-2px);
}


.xmuseum-meeting-viewer-next:hover {
  transform: translateX(2px);
}


.xmuseum-meeting-viewer-close {
  position: absolute;
  z-index: 3;

  top: 13px;
  right: 13px;

  width: 40px;
  height: 40px;

  font-size: 25px;

  box-shadow:
    0 6px 20px rgba(0, 0, 0, .23);
}


/* ──────────────────────────────────────────────────────────
   MOBILE
   ────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .xmuseum-meeting-head {
    gap: 12px;

    margin-bottom: 16px;
    padding-bottom: 15px;
  }


  .xmuseum-meeting-head h2 {
    font-size: 24px;
  }


  .xmuseum-meeting-head strong {
    min-height: 32px;

    padding: 6px 9px;

    font-size: 10px;
  }


  .xmuseum-meeting-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 8px;
  }


  .xmuseum-meeting-card {
    padding: 5px 5px 7px;

    border-radius: 11px;
  }


  .xmuseum-meeting-card > span {
    height: 135px;

    border-radius: 7px;
  }


  .xmuseum-meeting-card::after {
    display: none;
  }


  .xmuseum-meeting-card:hover {
    transform: none;
  }


  .xmuseum-meeting-card:hover img {
    transform: none;
    filter: none;
  }


  .xmuseum-meeting-viewer {
    padding: 0;

    background: #01030a;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }


  .xmuseum-meeting-viewer-dialog {
    width: 100%;
    height: 100%;

    grid-template-columns:
      44px minmax(0, 1fr) 44px;

    padding:
      max(12px, env(safe-area-inset-top))
      5px
      max(12px, env(safe-area-inset-bottom));

    border: 0;
    border-radius: 0;

    background: #01030a;

    box-shadow: none;
  }


  .xmuseum-meeting-viewer-prev,
  .xmuseum-meeting-viewer-next {
    width: 38px;
    height: 54px;

    border-radius: 11px;

    font-size: 24px;
  }


  .xmuseum-meeting-viewer-close {
    top: max(11px, env(safe-area-inset-top));
    right: 11px;

    width: 38px;
    height: 38px;
  }


  .xmuseum-meeting-viewer img {
    max-height: calc(100% - 56px);

    border-radius: 6px;
  }


  .xmuseum-meeting-viewer figcaption {
    padding: 0 6px;

    font-size: 10px;
  }
}


@media (max-width: 390px) {
  .xmuseum-meeting-head {
    flex-direction: column;
  }


  .xmuseum-meeting-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }


  .xmuseum-meeting-card > span {
    height: 116px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .xmuseum-meeting-viewer,
  .xmuseum-meeting-viewer *,
  .xmuseum-meeting-card,
  .xmuseum-meeting-card * {
    animation: none !important;
    transition: none !important;
  }
}
