/* Shared Community Gallery; cards follow community order on both devices. */
.community-gallery {
  --gallery-gap: round(nearest, 1.25vw, 1px);
  position: relative;
  z-index: 2;
  width: 100%;
  padding: round(nearest, 2.4vw, 1px) round(nearest, 6vw, 1px) round(nearest, 3vw, 1px);
  color: #252424;
  font-family: 'SourceHanSansVF', Arial, sans-serif;
  scroll-margin-top: calc(round(nearest, 3.6vw, 1px) + 16px);
}
.gallery-heading { text-align: center; }
.gallery-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: round(nearest, 1.1vw, 1px);
  font-family: 'eryamianhuatang', 'Arial Black', sans-serif;
  font-size: clamp(24px, round(nearest, 3.2vw, 1px), 80px);
  font-weight: normal;
  line-height: 1.2;
}
.gallery-title .gallery-title-icon {
  width: 4.32vw; height: 4.32vw; min-width: 32px; min-height: 32px;
  padding: 0; object-fit: contain; flex: 0 0 auto;
}
.gallery-subtitle { margin-top: round(nearest, .7vw, 1px); font-size: clamp(13px, round(nearest, 1.28vw, 1px), 30px); color: #000; font-weight: 500; }
.gallery-toolbar { position: relative; z-index: 5; display: flex; margin: round(nearest, 1.6vw, 1px) 0 round(nearest, 1.1vw, 1px); }
.gallery-month-picker { position: relative; max-width: 100%; }
.gallery-month-control > .gallery-month-chevron { width: 18px; height: 18px; margin-right: 12px; transition: transform .18s ease; }
.gallery-month-control[aria-expanded='true'] .gallery-month-chevron { transform: rotate(180deg); }
.gallery-month-control { cursor: pointer; max-width: 100%; }
.gallery-month-options { position: absolute; top: calc(100% + 10px); left: 0; width: 100%; padding: 6px; max-height: 300px; overflow-y: auto; border: 3px solid #df910b; border-radius: 20px; background: #fffaf0; box-shadow: 0 5px 0 #a9610033; }
.gallery-month-options[hidden] { display: none; }
.gallery-month-option { display: block; width: 100%; border: 0; border-radius: 12px; padding: 12px 8px; background: transparent; color: #252424; text-align: left; font: normal clamp(12px, round(nearest, 1.05vw, 1px), 25px)/1.3 'eryamianhuatang', sans-serif; cursor: pointer; }
.gallery-month-option[aria-selected='true'] { background: #f8aa1f; color: #000; }
.gallery-month-option:hover, .gallery-month-option:focus-visible { background: #ffdf8a; color: #252424; outline: 2px solid #df910b; outline-offset: -2px; }
.community-gallery[data-layout='desktop'] .gallery-viewport[data-fade-right='true'] { -webkit-mask-image: linear-gradient(to right, #000 95%, transparent); mask-image: linear-gradient(to right, #000 95%, transparent); }
.community-gallery[data-layout='desktop'] .gallery-viewport[data-fade-left='true'] { -webkit-mask-image: linear-gradient(to right, transparent, #000 5%); mask-image: linear-gradient(to right, transparent, #000 5%); }
.community-gallery[data-layout='desktop'] .gallery-viewport[data-fade-left='true'][data-fade-right='true'] { -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.gallery-month-control {
  --month-stroke: 2px;
  display: inline-flex;
  align-items: center;
  padding-left: 12px;
  border: round(nearest, 0.24vw, 1px) solid #df910b;
  border-radius: 30px;
  background: url('../img/event-texture.webp') center/cover, linear-gradient(to bottom, #ffc83b, #ffba00);
  background-blend-mode: soft-light;
  color: #000;
  transition: transform .18s ease;
  outline: none;
}
.gallery-month-control > .gallery-icon { width: 21px; height: 21px; }
.gallery-month-icon { width: clamp(22px, 1.8vw, 40px); height: clamp(22px, 1.8vw, 40px); object-fit: contain; flex: 0 0 auto; }
.gallery-month-icon { filter: none; }
.gallery-month-chevron path { stroke: none; fill: #fff36a; }
.gallery-month {
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: inherit;
  outline: none;
  font: normal clamp(14px, round(nearest, 1.28vw, 1px), 25px)/1.3 'eryamianhuatang', 'Arial Black', sans-serif;
  letter-spacing: round(nearest, .01em, 1px);
  text-shadow: none;
  -webkit-text-stroke: var(--month-stroke) #CF7419;
  paint-order: stroke fill;
  padding: 10px 12px 10px 8px;
  min-height: 42px;
  max-width: 100%;
  cursor: pointer;
}
.gallery-month option { background: #fffaf0; color: #26231e; }
.gallery-icon { display: inline-flex; width: 24px; height: 24px; flex: 0 0 auto; }
.gallery-icon svg { width: 100%; height: 100%; }
.gallery-viewport { overflow: hidden; padding: 3px 3px 7px; margin: -3px -3px -7px; touch-action: pan-y pinch-zoom; }
.gallery-track {
  display: grid;
  width: 100%;
  grid-auto-columns: calc((100% - 4 * var(--gallery-gap)) / 4.5);
  gap: var(--gallery-gap);
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
.gallery-viewport { cursor:grab; }
.gallery-viewport.gallery-dragging, .gallery-dragging .gallery-card { cursor:grabbing;user-select:none; }
.gallery-card {
  --card-radius: round(nearest, max(18px, 1.48vw), 1px);
  min-width: 0;
  display: block;
  overflow: hidden;
  border: 3px solid #90a510;
  border-radius: var(--card-radius);
  background: #d9eb78;
  box-shadow: 0 4px 0 #627b0d;
  transition: border-color .18s ease, box-shadow .18s ease;
  color: #242321;
  text-decoration: none;
}
.gallery-cover { position: relative; aspect-ratio: 1; overflow: hidden; background: #f5f4e7; border: 8px solid #d9eb78; border-bottom: 0; border-radius: calc(var(--card-radius) - 3px) calc(var(--card-radius) - 3px) 0 0; }
.gallery-cover-image { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-preview-missing {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 36px 10px 12px;
  color: #827457;
  text-align: center;
  font-size: clamp(11px, round(nearest, .95vw, 1px), 22px);
}
.gallery-preview-missing[hidden] { display: none; }
.gallery-preview-missing > .gallery-icon { width: 34px; height: 34px; margin-bottom: 4px; }
.gallery-preview-missing small { font-size: round(nearest, .8em, 1px); }
.gallery-platform {
  position: absolute;
  top: 7px; left: 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 14px);
  padding: 4px 6px;
  border-radius: 5px;
  background: #252424;
  color: #fff;
  font: 700 clamp(9px, round(nearest, .74vw, 1px), 18px)/1.2 Arial, sans-serif;
  white-space: nowrap;
}
.gallery-platform .gallery-icon { width: 1.25em; height: 1.25em; }
.gallery-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28%; aspect-ratio: 1;
  border: 2px solid white;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #121212b8; color: white;
}
.gallery-play .gallery-icon { width: 65%; height: 65%; }
.gallery-likes { position: absolute; bottom: 8px; right: 8px; padding: 3px 7px; border-radius: 4px; background: #151515bd; color: white; font-size: 12px; }
.gallery-author { display: flex; align-items: center; gap: 8px; min-height: 49px; padding: 8px; border-top: 1px solid #e4e8c7; margin: 0 8px 8px; border-radius: 0 0 calc(var(--card-radius) - 11px) calc(var(--card-radius) - 11px); background: #fffef8; }
.gallery-avatar {
  position: relative; display: grid; place-items: center;
  width: clamp(27px, 2.2vw, 52px); aspect-ratio: 1;
  flex: 0 0 auto; border: 1px solid #af9c71;
  border-radius: 50%; background: #f5df9f;
  overflow: hidden; font-size: 14px; font-weight: 800;
}
.gallery-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-handle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11px, round(nearest, .9vw, 1px), 23px); font-weight: 700; }
.gallery-controls { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: round(nearest, 1.6vw, 1px); }
.gallery-arrow {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: 0 0 auto;
  border: 0; border-radius: 50%;
  color: #f8aa1f; background: transparent url('../img/gallery-arrow.svg') center/contain no-repeat;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.gallery-arrow:first-child { rotate: 180deg; }
.community-gallery[data-layout='desktop'] .gallery-arrow { width:3.44vw;height:3.44vw; }
.community-gallery[data-layout='desktop'] .gallery-month { min-height:32px;padding-top:5px;padding-bottom:5px; }
.community-gallery[data-layout='desktop'] .gallery-month-control { border-width:round(nearest, .12vw, 1px); }
.community-gallery[data-layout='desktop'] .gallery-dot { width:round(nearest, 2.5vw, 1px);height:round(nearest, 3.125vw, 1px); }
.community-gallery[data-layout='desktop'] .gallery-dot::after { width:round(nearest, 1.016vw, 1px);height:round(nearest, 1.016vw, 1px); }
.community-gallery[data-layout='desktop'] .gallery-dot[aria-current='true']::after { width:round(nearest, 1.797vw, 1px);height:round(nearest, 1.797vw, 1px); }
.gallery-arrow .gallery-icon { visibility: hidden; }
.gallery-arrow:is(:focus-visible, :active):not(:disabled) { background-image: url('../img/gallery-arrow-active.svg'); }
.event-nav-btn img, .m-events-nav-btn img { content: url('../img/gallery-arrow.svg'); }
.m-events-nav-btn#m-prev img { transform: rotate(180deg); }
.event-nav-btn:is(:focus-visible, :active):not(:disabled) img,
.m-events-nav-btn:is(:focus-visible, :active):not(:disabled) img { content: url('../img/gallery-arrow-active.svg'); }
@media (hover: hover) {
  .gallery-arrow:hover:not(:disabled) { background-image: url('../img/gallery-arrow-active.svg'); }
  .event-nav-btn:hover:not(:disabled) img { content: url('../img/gallery-arrow-active.svg'); }
}
/* Vector contours keep a uniform stroke without stacked raster shadows. */
.gallery-arrow:disabled { opacity: 1; cursor: default; box-shadow: none; }
.gallery-dots { display: flex; align-items: center; }
.gallery-dot { display: grid; place-items: center; width: 32px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.gallery-dot::after { content: ''; width: 13px; height: 13px; background: url('../img/gallery-dot.svg') center/contain no-repeat; transition: transform .2s ease; }
.gallery-dot[aria-current='true']::after { width: 23px; height: 23px; background-image: url('../img/gallery-star.svg'); transform:scale(1.2); }
.gallery-card :is(a,button):focus-visible, .gallery-viewport:focus-visible, .gallery-arrow:focus-visible, .gallery-dot:focus-visible { outline: 3px solid #915000; outline-offset: -3px; }
.gallery-month-control:focus-visible { box-shadow: inset 0 0 0 2px #915000; }
@media (hover: hover) {
  .gallery-card:hover { border-color: #b0c829; box-shadow: 0 4px 0 #627b0d, 0 5px 14px #6d7f1720; }
  .gallery-card:hover .gallery-cover-image { transform: scale(1.035); }
  .gallery-arrow:hover:not(:disabled) { transform: scale(1.06); }
  .gallery-month-control:hover { transform: translateY(-1px); }
}
.gallery-loading { margin: 30px auto; text-align: center; }
.gallery-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.community-gallery[data-layout='mobile'] { --gallery-gap: round(nearest, 2.67vw, 1px); padding: round(nearest, 10.67vw, 1px) round(nearest, 6vw, 1px) round(nearest, 13.33vw, 1px); scroll-margin-top: calc(round(nearest, 11.73vw, 1px) + 14px); }
/* Reuse the original mobile cloud art at the new post-hero boundary. */
.community-gallery[data-device='mobile'] { isolation: isolate; }
.community-gallery[data-device='mobile']::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  top: -13.33vw; bottom: 0; left: -20.4vw; width: 140.8vw;
  background: url('../img/m-about-deco.webp') top center/100% auto no-repeat;
}
.community-gallery[data-layout='mobile'] .gallery-title { display: grid; grid-template-areas: 'community' 'name'; grid-template-columns: max-content; font-size: round(nearest, 9.07vw, 1px); line-height: 1.1; color: #000; row-gap: round(nearest, 1.6vw, 1px); }
.community-gallery[data-layout='mobile'] .gallery-title-community { grid-area: community; font-size: inherit; line-height: inherit; }
.community-gallery[data-layout='mobile'] .gallery-title-name { grid-area: name; }
.community-gallery[data-layout='mobile'] .gallery-title-icon { display: none; }
.community-gallery[data-layout='mobile'] .gallery-title-icon { width: 9.87vw; height: 9.87vw; padding: 0; }
.community-gallery[data-layout='mobile'] .gallery-dot::after { width: 2.665vw; height: 2.665vw; }
.community-gallery[data-layout='mobile'] .gallery-subtitle { font-size: round(nearest, clamp(14px, 3.2vw, 24px), 1px); margin-top: round(nearest, 2.67vw, 1px); }
.community-gallery[data-layout='mobile'] .gallery-month { font-size: round(nearest, clamp(14px, 3.2vw, 24px), 1px); }
.community-gallery[data-layout='mobile'] .gallery-month-control { border-width: round(nearest, .8vw, 1px); }
.community-gallery[data-layout='mobile'] .gallery-month-icon { width: clamp(24px, 4.53vw, 40px); height: clamp(24px, 4.53vw, 40px); }
.community-gallery[data-layout='mobile'] .gallery-month-option { font-size: round(nearest, clamp(14px, 3.2vw, 24px), 1px); }
.community-gallery[data-layout='mobile'] .gallery-toolbar { justify-content: center; margin: round(nearest, 4vw, 1px) 0 round(nearest, 5.33vw, 1px); }
.community-gallery[data-layout='mobile'] .gallery-track { grid-auto-columns: calc((100% - var(--gallery-gap)) / 2); }
.community-gallery[data-layout='mobile'] .gallery-cover { aspect-ratio: 1; }
.community-gallery[data-layout='mobile'] .gallery-card { --card-radius: round(nearest, max(18px, 4vw), 1px); }
.community-gallery[data-layout='mobile'] .gallery-month-control { --month-stroke: 2px; }
.community-gallery[data-layout='mobile'] .gallery-avatar { width: clamp(30px, 6.4vw, 48px); font-size: round(nearest, clamp(14px, 3.2vw, 24px), 1px); }
.community-gallery[data-layout='mobile'] .gallery-platform { font-size: round(nearest, clamp(11px, 2.67vw, 20px), 1px); top: 5px; left: 5px; padding: 4px; }
.community-gallery[data-layout='mobile'] .gallery-preview-missing { font-size: round(nearest, clamp(14px, 3.2vw, 24px), 1px); color: #706344; }
.community-gallery[data-layout='mobile'] .gallery-preview-missing small { font-size: round(nearest, clamp(12px, 2.67vw, 20px), 1px); }
.community-gallery[data-layout='mobile'] .gallery-preview-missing > .gallery-icon { width: clamp(34px, 6.4vw, 48px); height: clamp(34px, 6.4vw, 48px); }
.community-gallery[data-layout='mobile'] .gallery-controls { margin-top: round(nearest, 4vw, 1px); }
.community-gallery[data-layout='mobile'] .gallery-dot { width: 5.33vw; height: 5.33vw; }
.community-gallery[data-layout='mobile'] .gallery-track { transition-duration: .35s; transition-timing-function: ease; }
.gallery-enter { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.gallery-enter-visible { opacity: 1; transform: translateY(0); }
@media (max-width: 480px) {
  .community-gallery[data-layout='mobile'] .gallery-preview-missing { padding: 32px 6px 8px; gap: 4px; line-height: 1.35; }
  .community-gallery[data-layout='mobile'] .gallery-preview-missing > .gallery-icon { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-track, .gallery-cover-image, .gallery-enter, .gallery-arrow, .gallery-month-control { transition: none; }
  .gallery-enter { opacity: 1; transform: none; }
}

/* Keep the existing KV proportions; Gallery replaces the old post-hero gap. */
#page > .page-bg { height: 100%; object-fit: fill; }
.community-gallery + .about { margin-top: round(nearest, 2vw, 1px); }
.community-gallery + .m-about { padding-top: round(nearest, 13.33vw, 1px); }
.community-gallery + .m-about .m-about-deco { top: 0; }
.tab-gallery-icon { display: block; width: 1.76vw; height: 1.76vw; background: #fff; mask: url('../img/icon-gallery.png') center/contain no-repeat; -webkit-mask: url('../img/icon-gallery.png') center/contain no-repeat; }
.tab-gallery-icon svg { display: none; }
.tab-active .tab-gallery-icon { background: #ffdc67; }
.community-gallery[data-layout='desktop'] .gallery-platform { font-size: max(11px, round(nearest, .74vw, 1px)); }
.community-gallery[data-layout='desktop'] .gallery-preview-missing small { font-size: max(12px, round(nearest, .76vw, 1px)); }
.community-gallery[data-layout='mobile'] .gallery-dot { width: 44px; height: 44px; }
.community-gallery[data-layout='mobile'] .gallery-controls { gap: 12px; }
.community-gallery[data-layout='mobile'] .gallery-dots { gap: 4px; }
.community-gallery[data-layout='mobile'] .gallery-handle { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; line-height: 1.35; }
.tab-gallery-icon svg { width: 100%; height: 100%; }

/* Cover and author both link to the original work. */
.gallery-card > .gallery-cover { display:block;width:100%;padding:0;text-align:inherit;font:inherit;color:inherit;background:transparent; }
.gallery-author { color:inherit;text-decoration:none; }
