.sakurairo-gallery-page.blog-custom-gallery-content {
  position: relative;
  left: 50%;
  width: calc(100vw - 40px);
  max-width: none;
  transform: translateX(-50%);
}

.sakurairo-gallery-page .blog-custom-gallery-main {
  padding: 50px 0 80px;
}

.sakurairo-gallery-page .blog-custom-gallery-card {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 18px;
  box-sizing: border-box;
  color: var(--theme-skin, #505050);
  background: rgba(255, 255, 255, var(--homepage_widget_transparency, 0.92));
  border: 1px solid rgba(235, 235, 235, 0.9);
  border-radius: 14px;
  box-shadow: 0 1px 30px -4px rgba(160, 160, 160, 0.35);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}

.sakurairo-gallery-page .blog-custom-gallery-albums,
.sakurairo-gallery-page .blog-custom-gallery-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}

.sakurairo-gallery-page .blog-custom-gallery-album,
.sakurairo-gallery-page .blog-custom-gallery-photo {
  min-width: 0;
  margin: 0;
}

.sakurairo-gallery-page .blog-custom-gallery-album-link {
  position: relative;
  display: block;
  min-height: 145px;
  overflow: hidden;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 16px rgba(40, 40, 40, 0.16);
  cursor: pointer;
  transform: translateY(0);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.sakurairo-gallery-page .blog-custom-gallery-album-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.sakurairo-gallery-page .blog-custom-gallery-album-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02) 25%, rgba(0, 0, 0, 0.82) 100%);
}

.sakurairo-gallery-page .blog-custom-gallery-album-info {
  position: absolute;
  right: 12px;
  bottom: 11px;
  left: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.sakurairo-gallery-page .blog-custom-gallery-album-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sakurairo-gallery-page .blog-custom-gallery-album-description {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.9;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sakurairo-gallery-page .blog-custom-gallery-album-count {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.82;
}

.sakurairo-gallery-page .blog-custom-gallery-album-link:hover,
.sakurairo-gallery-page .blog-custom-gallery-album-link:focus-visible {
  color: #fff;
  box-shadow: 0 8px 20px rgba(40, 40, 40, 0.23);
  transform: translateY(-2px);
}

.sakurairo-gallery-page .blog-custom-gallery-album-link:hover .blog-custom-gallery-album-image,
.sakurairo-gallery-page .blog-custom-gallery-album-link:focus-visible .blog-custom-gallery-album-image {
  transform: scale(1.04);
}

.sakurairo-gallery-page .blog-custom-gallery-album-link:focus-visible,
.sakurairo-gallery-page .blog-custom-gallery-photo-link:focus-visible,
.sakurairo-gallery-page .blog-custom-gallery-photo-image[role="button"]:focus-visible,
.sakurairo-gallery-page .blog-custom-gallery-back:focus-visible {
  outline: 2px solid var(--article-theme-highlight, var(--theme-skin-matching, var(--theme-skin, #69c3c9)));
  outline-offset: 3px;
}

.sakurairo-gallery-page .blog-custom-gallery-detail-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 16px;
}

.sakurairo-gallery-page .blog-custom-gallery-detail-header > div {
  min-width: 0;
}

.sakurairo-gallery-page .blog-custom-gallery-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 7px 12px;
  color: var(--theme-skin, #666);
  background: rgba(245, 245, 245, 0.85);
  border: 1px solid rgba(225, 225, 225, 0.9);
  border-radius: 18px;
  font-size: 13px;
  line-height: 1.4;
  gap: 6px;
}

.sakurairo-gallery-page .blog-custom-gallery-back:hover {
  color: var(--article-theme-highlight, var(--theme-skin-matching, var(--theme-skin, #69c3c9)));
  border-color: currentColor;
}

.sakurairo-gallery-page .blog-custom-gallery-detail-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.sakurairo-gallery-page .blog-custom-gallery-detail-description {
  margin: 5px 0 0;
  color: #888;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sakurairo-gallery-page .blog-custom-gallery-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(235, 235, 235, 0.65);
}

.sakurairo-gallery-page .blog-custom-gallery-photo-link,
.sakurairo-gallery-page .blog-custom-gallery-photo-image {
  display: block;
  width: 100%;
  height: 100%;
}

.sakurairo-gallery-page .blog-custom-gallery-photo-link {
  cursor: zoom-in;
}

.sakurairo-gallery-page .blog-custom-gallery-detail-grid .blog-custom-gallery-photo-image {
  object-fit: cover;
  box-sizing: border-box;
  background: transparent;
  cursor: zoom-in;
  transition: transform 180ms ease, opacity 180ms ease;
}

.sakurairo-gallery-page .blog-custom-gallery-photo:hover .blog-custom-gallery-photo-image,
.sakurairo-gallery-page .blog-custom-gallery-photo:focus-within .blog-custom-gallery-photo-image {
  opacity: 0.94;
  transform: scale(1.025);
}

.sakurairo-gallery-page .blog-custom-gallery-empty {
  margin: 0;
  padding: 42px 16px;
  color: #888;
  text-align: center;
}

.sakurairo-gallery-page .blog-custom-gallery-empty p {
  margin: 0 0 18px;
}

.sakurairo-gallery-page.blog-custom-gallery-lightbox[hidden] {
  display: none;
}

.sakurairo-gallery-page.blog-custom-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(15, 18, 24, 0.78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

html.blog-custom-gallery-lightbox-open,
body.blog-custom-gallery-lightbox-open {
  overflow: hidden;
}

.sakurairo-gallery-page.blog-custom-gallery-lightbox button {
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(20, 20, 20, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  cursor: pointer;
}

.sakurairo-gallery-page.blog-custom-gallery-lightbox button:hover,
.sakurairo-gallery-page.blog-custom-gallery-lightbox button:focus-visible {
  background: rgba(80, 80, 80, 0.7);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-prev,
.sakurairo-gallery-page .blog-custom-gallery-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-prev {
  left: 18px;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-next {
  right: 18px;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  max-width: 90vw;
  max-height: 94vh;
  margin: 0;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.38);
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-figure figcaption {
  max-width: min(80vw, 720px);
  margin-top: 8px;
  padding: 5px 10px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(20, 22, 28, 0.56);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
}

.sakurairo-gallery-page .blog-custom-gallery-lightbox-figure figcaption[hidden] {
  display: none;
}

body.dark .sakurairo-gallery-page .blog-custom-gallery-card {
  color: var(--dark-text-primary);
  background: var(--dark-bg-secondary);
  border-color: var(--dark-border-color);
  box-shadow: var(--dark-shadow-normal);
}

body.dark .sakurairo-gallery-page .blog-custom-gallery-back {
  color: var(--dark-text-primary);
  background: var(--dark-bg-primary);
  border-color: var(--dark-border-color);
}

body.dark .sakurairo-gallery-page .blog-custom-gallery-detail-description,
body.dark .sakurairo-gallery-page .blog-custom-gallery-empty {
  color: var(--dark-text-secondary);
}

body.dark .sakurairo-gallery-page .blog-custom-gallery-photo {
  background: var(--dark-bg-primary);
}

@media (max-width: 860px) {
  .sakurairo-gallery-page.blog-custom-gallery-content {
    width: calc(100vw - 24px);
  }

  .sakurairo-gallery-page .blog-custom-gallery-main {
    padding: 32px 0 56px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-card {
    padding: 12px;
    border-radius: 12px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-albums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-album-link {
    min-height: 140px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-detail-title {
    font-size: 21px;
  }
}

@media (max-width: 560px) {
  .sakurairo-gallery-page .blog-custom-gallery-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-album-link {
    min-height: 125px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-album-info {
    right: 9px;
    bottom: 8px;
    left: 9px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-detail-header {
    gap: 10px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-back {
    padding: 6px 9px;
    font-size: 12px;
  }

  .sakurairo-gallery-page.blog-custom-gallery-lightbox {
    padding: 12px;
  }

  .sakurairo-gallery-page.blog-custom-gallery-lightbox button {
    width: 38px;
    height: 38px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-lightbox-close {
    top: 10px;
    right: 10px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-lightbox-prev {
    left: 8px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-lightbox-next {
    right: 8px;
  }

  .sakurairo-gallery-page .blog-custom-gallery-lightbox-figure img {
    max-width: 92vw;
    max-height: 84vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sakurairo-gallery-page .blog-custom-gallery-album-link,
  .sakurairo-gallery-page .blog-custom-gallery-album-image,
  .sakurairo-gallery-page .blog-custom-gallery-photo-image {
    transition: none;
  }

  .sakurairo-gallery-page .blog-custom-gallery-album-link:hover,
  .sakurairo-gallery-page .blog-custom-gallery-album-link:focus-visible,
  .sakurairo-gallery-page .blog-custom-gallery-album-link:hover .blog-custom-gallery-album-image,
  .sakurairo-gallery-page .blog-custom-gallery-album-link:focus-visible .blog-custom-gallery-album-image,
  .sakurairo-gallery-page .blog-custom-gallery-photo:hover .blog-custom-gallery-photo-image,
  .sakurairo-gallery-page .blog-custom-gallery-photo:focus-within .blog-custom-gallery-photo-image {
    transform: none;
  }
}
