/* =====================================================
   activity.css | Design 2: activity gallery
   ===================================================== */

:root {
  --gallery-green: #009471;
  --gallery-green-dark: #006e54;
  --gallery-green-soft: #e7f6f2;
  --gallery-red: #b64242;
  --gallery-red-soft: #fbebeb;
  --gallery-blue: #116ea8;
  --gallery-blue-soft: #eaf3fb;
  --gallery-orange: #d6a51f;
  --gallery-orange-soft: #fff7d8;
  --gallery-dark: #505961;
  --gallery-uribo-bg: #87919a;
  --gallery-dark-soft: #eef1f3;
  --gallery-ink: #263238;
  --gallery-sub: #66737d;
  --gallery-line: #dce3e8;
  --gallery-bg: #f4f8f7;
}

.editor-styles-wrapper.activity-gallery-page {
  color: var(--gallery-ink);
}

.editor-styles-wrapper:not(.activity-gallery-ready) > h3[id],
.editor-styles-wrapper:not(.activity-gallery-ready) > h3[id] ~ p,
.editor-styles-wrapper:not(.activity-gallery-ready) > h3[id] ~ img {
  display: none;
}

.activity-gallery-tools {
  position: sticky;
  top: var(--header-height, 80px);
  z-index: 20;
  margin-top: 30px;
  padding: 0;
  border: 0;
  border-bottom: 4px solid var(--gallery-green);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 10px 22px rgba(21, 44, 56, 0.08);
}

.activity-gallery-tools::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
  background: #fff;
}

.activity-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.activity-filter-btn {
  min-height: 34px;
  padding: 9px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #555;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: background .18s, color .18s;
}

.activity-filter-btn + .activity-filter-btn {
  border-left: 1px solid #e4e8eb;
}

.activity-filter-btn:hover {
  background: #f5f6f8;
  color: var(--gallery-ink);
}

.activity-filter-btn.is-active {
  background: var(--gallery-green);
  color: #fff;
  box-shadow: none;
}

.activity-filter-pg {
  --filter-color: var(--gallery-green);
  --filter-soft: var(--gallery-green-soft);
}

.activity-filter-rt {
  --filter-color: var(--gallery-red);
  --filter-soft: var(--gallery-red-soft);
}

.activity-filter-sy {
  --filter-color: var(--gallery-blue);
  --filter-soft: var(--gallery-blue-soft);
}

.activity-filter-ot {
  --filter-color: var(--gallery-orange);
  --filter-soft: var(--gallery-orange-soft);
}

.activity-category-summary {
  --cat-color: var(--gallery-dark);
  --cat-soft: var(--gallery-dark-soft);
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0;
  padding: 12px 10px 14px;
  border: 0;
  background: #fff;
  box-shadow: 0 14px 22px rgba(21, 44, 56, .06);
}

.activity-category-summary::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 3px;
  background: #fff;
}

.activity-category-summary-pg {
  --cat-color: var(--gallery-green);
  --cat-soft: var(--gallery-green-soft);
}

.activity-category-summary-rt {
  --cat-color: var(--gallery-red);
  --cat-soft: var(--gallery-red-soft);
}

.activity-category-summary-sy {
  --cat-color: var(--gallery-blue);
  --cat-soft: var(--gallery-blue-soft);
}

.activity-category-summary-ot {
  --cat-color: var(--gallery-orange);
  --cat-soft: var(--gallery-orange-soft);
}

.activity-category-icon {
  --uribo-cube-size: 32px;
  --uribo-cube-depth: 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  top: -1px;
  margin-bottom: 0;
  padding: 0;
  box-sizing: border-box;
  perspective: 180px;
  background: transparent;
}

.activity-category-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 5px;
  width: 31px;
  height: 11px;
  border-radius: 50%;
  background: rgba(38, 50, 56, .22);
  filter: blur(5px);
  transform: rotate(-12deg);
  pointer-events: none;
}

.activity-uribo-cube {
  position: relative;
  z-index: 1;
  width: var(--uribo-cube-size);
  height: var(--uribo-cube-size);
  margin-left: 4px;
  transform-style: preserve-3d;
  transform: rotateX(-14deg) rotateY(28deg);
  animation: uriboCubeSpin 12s ease-in-out infinite;
}

.activity-uribo-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(70, 82, 92, .42);
  border-radius: 3px;
  background: linear-gradient(135deg, #98a1a9 0%, var(--gallery-uribo-bg) 100%);
  box-shadow: inset 0 0 8px rgba(70, 82, 92, .08);
  backface-visibility: hidden;
}

.activity-uribo-face-front {
  background: linear-gradient(135deg, #aab2b9 0%, var(--gallery-uribo-bg) 100%);
  transform: translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face-back {
  background: linear-gradient(135deg, #aab2b9 0%, var(--gallery-uribo-bg) 100%);
  transform: rotateY(180deg) translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face-right {
  background: linear-gradient(135deg, #10a982 0%, var(--gallery-green) 100%);
  transform: rotateY(90deg) translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face-left {
  background: linear-gradient(135deg, #c65353 0%, var(--gallery-red) 100%);
  transform: rotateY(-90deg) translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face-top {
  background: linear-gradient(135deg, #2389c3 0%, var(--gallery-blue) 100%);
  transform: rotateX(90deg) translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face-bottom {
  background: linear-gradient(135deg, #e0b83c 0%, var(--gallery-orange) 100%);
  transform: rotateX(-90deg) translateZ(var(--uribo-cube-depth));
}

.activity-uribo-face img {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .12));
}

.activity-uribo-face img.activity-cube-logo {
  width: 33px;
  height: 33px;
}

.activity-cube-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  height: 13px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--gallery-blue);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14);
}

.activity-uribo-face-bottom .activity-cube-text {
  color: var(--gallery-orange);
}

@keyframes uriboCubeSpin {
  0% {
    transform: rotateX(-38deg) rotateY(32deg) rotateZ(-8deg);
  }
  35% {
    transform: rotateX(36deg) rotateY(166deg) rotateZ(9deg);
  }
  70% {
    transform: rotateX(-44deg) rotateY(310deg) rotateZ(-10deg);
  }
  100% {
    transform: rotateX(-38deg) rotateY(392deg) rotateZ(-8deg);
  }
}

.activity-category-text {
  min-width: 0;
}

.activity-sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 16px 0 12px;
}

.activity-sort-label {
  margin-right: 2px;
  font-size: 12px;
  color: var(--gallery-sub);
  font-weight: 600;
}

.activity-sort-btn {
  padding: 5px 16px;
  border-radius: 20px;
  border: 1px solid var(--gallery-line);
  background: #fff;
  color: var(--gallery-sub);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .06);
}

.activity-sort-btn:hover {
  background: #f5f6f8;
  color: var(--gallery-ink);
}

.activity-sort-btn.is-active {
  background: #333;
  color: #fff;
  border-color: #333;
}

.activity-sort-btn:focus-visible,
.activity-filter-btn:focus-visible {
  outline: 2px solid var(--gallery-green-dark);
  outline-offset: 3px;
}

.activity-category-text h3 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--gallery-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  background: transparent;
}

.activity-category-text p {
  margin: 2px 0 0;
  color: var(--gallery-sub);
  font-size: 13px;
  line-height: 1.45;
}

.activity-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.activity-gallery-footer {
  display: flex;
  justify-content: flex-end;
  min-height: 58px;
  padding: 12px 8px 0;
}

.activity-card {
  --cat-color: var(--gallery-orange);
  --cat-soft: var(--gallery-orange-soft);
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--gallery-line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(21, 44, 56, .08);
  cursor: pointer;
  transition: transform .24s ease, box-shadow .24s ease, opacity .18s;
}

.activity-card-pg {
  --cat-color: var(--gallery-green);
  --cat-soft: var(--gallery-green-soft);
}

.activity-card-rt {
  --cat-color: var(--gallery-red);
  --cat-soft: var(--gallery-red-soft);
}

.activity-card-sy {
  --cat-color: var(--gallery-blue);
  --cat-soft: var(--gallery-blue-soft);
}

.activity-card-ot {
  --cat-color: var(--gallery-orange);
  --cat-soft: var(--gallery-orange-soft);
}

.activity-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(21, 44, 56, .15);
}

.activity-card:focus-visible {
  outline: 3px solid var(--cat-color);
  outline-offset: 4px;
}

.activity-card.is-hidden {
  display: none;
}

.activity-card.is-highlighted {
  animation: galleryPulse 1.4s ease;
}

@keyframes galleryPulse {
  0% { box-shadow: 0 0 0 5px rgba(0, 148, 113, .28), 0 16px 34px rgba(21, 44, 56, .13); }
  100% { box-shadow: 0 10px 26px rgba(21, 44, 56, .08); }
}

.activity-card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gallery-bg);
}

.activity-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

.activity-card:hover .activity-card-cover img {
  transform: scale(1.05);
}

.activity-card-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(0deg, rgba(0,0,0,.32), rgba(0,0,0,0));
}

.editor-styles-wrapper .activity-card h3 {
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--gallery-line);
  background: linear-gradient(180deg, #f7f9fa 0%, #eef2f4 100%);
  color: var(--gallery-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.55;
}

/* 回数バッジ表示: JSでh3のidから取得したイベント番号(data-card-no)を表示する。
.activity-card h3::before {
  content: attr(data-card-no);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 24px;
  margin-right: 8px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--cat-color);
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: 2px;
}
*/

.activity-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 18px 0;
}

.activity-card-cat,
.activity-card-date {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.activity-card-cat {
  background: var(--cat-soft);
  color: var(--cat-color);
}

.activity-card-date {
  gap: 6px;
  border: none;
  color: var(--gallery-sub);
}

.activity-card-date img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex: 0 0 15px;
}

.activity-card-body {
  position: relative;
  margin-top: 12px;
  padding: 0 18px;
  max-height: 7.2em;
  overflow: hidden;
}

.activity-card-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(0deg, #fff 20%, rgba(255,255,255,0));
  pointer-events: none;
}

.activity-card p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.85;
  text-align: justify;
  text-justify: inter-character;
}

.activity-card .report-detail {
  margin-top: 0;
  color: var(--gallery-ink);
}

.editor-styles-wrapper.activity-gallery-page a[target="_blank"]:not(.noicon)::after,
.editor-styles-wrapper.activity-gallery-page a[href^="http"]:not(.noicon)::after,
.activity-modal a[target="_blank"]:not(.noicon)::after,
.activity-modal a[href^="http"]:not(.noicon)::after {
  content: "\f35d";
  display: inline-block;
  margin-left: .2em;
  color: inherit;
  font-family: "Font Awesome 6 Free";
  font-weight: 900 !important;
  text-decoration: none !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.activity-card .iconuse {
  padding: 11px 13px;
  border: 1px solid var(--gallery-line);
  background: var(--gallery-bg);
  color: var(--gallery-sub);
  text-align: left;
}

.activity-card p:empty {
  display: none;
}

.activity-card a {
  color: var(--gallery-green-dark);
  font-weight: 700;
  text-decoration: underline;
}

.activity-card-toggle {
  margin: auto 18px 18px;
  min-height: 38px;
  border: 1px solid var(--cat-color);
  border-radius: 999px;
  background: #fff;
  color: var(--cat-color);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.activity-card-toggle:hover {
  background: var(--cat-color);
  color: #fff;
}

.activity-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 40px;
  overflow-y: auto;
  background: rgba(20, 28, 50, .58);
  backdrop-filter: blur(4px);
}

.activity-modal.is-open {
  display: flex;
}

.activity-modal-box {
  --cat-color: var(--gallery-orange);
  --cat-soft: var(--gallery-orange-soft);
  position: relative;
  width: 100%;
  max-width: 980px;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.24);
  animation: galleryModalIn .22s ease;
}

.activity-modal[data-category="pg"] .activity-modal-box {
  --cat-color: var(--gallery-green);
  --cat-soft: var(--gallery-green-soft);
}

.activity-modal[data-category="rt"] .activity-modal-box {
  --cat-color: var(--gallery-red);
  --cat-soft: var(--gallery-red-soft);
}

.activity-modal[data-category="sy"] .activity-modal-box {
  --cat-color: var(--gallery-blue);
  --cat-soft: var(--gallery-blue-soft);
}

.activity-modal[data-category="ot"] .activity-modal-box {
  --cat-color: var(--gallery-orange);
  --cat-soft: var(--gallery-orange-soft);
}

@keyframes galleryModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.activity-modal-top {
  height: 6px;
  background: #2f8f74;
}

.activity-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.activity-modal-close:hover {
  background: rgba(255,255,255,.24);
}

.activity-modal-content {
  padding: 0 30px 30px;
}

.activity-modal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -30px;
  min-height: 64px;
  padding: 12px 78px 12px 30px;
  background: #2f8f74;
}

.activity-modal-meta .activity-card-cat {
  border: 1px solid var(--cat-color);
  background: #fff;
  color: var(--cat-color);
}

.activity-modal-meta .activity-card-date {
  color: rgba(255,255,255,.9);
}

.activity-modal-meta .activity-card-date img {
  filter: brightness(0) invert(1);
  opacity: .92;
}

.activity-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 16px;
  padding: 0;
  background: transparent;
  flex-wrap: wrap;
}

.activity-modal h3 {
  flex: 1 1 0;
  margin: 0;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.activity-guide-link {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 0.65em 2.2em 0.65em 1.4em;
  border-radius: 3em;
  border: 0;
  background: linear-gradient(90deg, #009471 0%, #49b78b 50%, #019bff 100%);
  background-size: 300% 100%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-position 0.6s cubic-bezier(0.33,0.11,0.02,0.99),
              box-shadow 0.6s cubic-bezier(0.33,0.11,0.02,0.99),
              transform 0.6s cubic-bezier(0.33,0.11,0.02,0.99);
}

.activity-guide-link:hover {
  background-position: 100% 0;
  color: #fff;
  box-shadow: 0 4px 4px rgba(0,0,0,.1), 0 8px 8px rgba(0,0,0,.1);
  transform: scale(1.03) translateY(-2px);
}

.activity-guide-link .ext-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  object-fit: contain;
  filter: none;
}

.activity-modal-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: contain;
  margin: 0 0 18px;
  border: 1px solid var(--gallery-line);
  background: var(--gallery-bg);
}

.activity-modal-body p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.9;
  text-align: justify;
  text-justify: inter-character;
}

.activity-modal-body .report-detail {
  color: var(--gallery-ink);
}

.activity-modal-body .iconuse {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
  padding: 13px 15px;
  border: 1px solid var(--gallery-line);
  background: var(--gallery-bg);
  color: var(--gallery-sub);
}

.activity-modal-body a {
  color: var(--cat-color);
  font-weight: 700;
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .activity-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .activity-gallery-tools {
    top: var(--header-height, 50px);
    padding: 0;
  }

  .activity-gallery {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .activity-category-summary {
    margin-top: 0;
    padding: 10px 8px 12px;
  }

  .activity-gallery-footer {
    min-height: 50px;
    padding: 10px 4px 0;
  }

  .activity-category-icon {
    --uribo-cube-size: 28px;
    --uribo-cube-depth: 14px;
    width: 40px;
    height: 40px;
    margin-bottom: 0;
  }

  .activity-uribo-face img {
    width: 20px;
    height: 20px;
  }

  .activity-uribo-face img.activity-cube-logo {
    width: 24px;
    height: 24px;
  }

  .activity-cube-text {
    min-width: 23px;
    height: 10px;
    padding: 0 4px;
    font-size: 9px;
  }

  .activity-category-text h3 {
    font-size: 17px;
  }

  .activity-category-text p {
    line-height: 1.45;
  }

  .activity-filter {
    padding: 0 8px;
  }

  .activity-filter-btn {
    min-height: 32px;
    padding: 8px 13px;
    font-size: 13px;
  }

  .editor-styles-wrapper .activity-card h3 {
    padding-left: 16px;
    padding-right: 16px;
    font-size: 17px;
  }

  .activity-card-meta,
  .activity-card-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .activity-card-toggle {
    margin-left: 16px;
    margin-right: 16px;
  }

  .activity-modal-head {
    display: block;
    margin-right: 0;
  }

  .activity-guide-link {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
  }

  .activity-modal {
    padding-top: 24px;
  }

  .activity-modal-content {
    padding: 22px 16px 24px;
  }

  .activity-modal h3 {
    margin-right: 0;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-uribo-cube {
    animation: none;
  }
}

.announcement-status-badge {
  display: inline-block; padding: 4px 9px; border-radius: 4px;
  background: #b3290c; color: #fff; font-size: 13px; font-weight: 700;
}
.announcement-status-badge.is-ended { background: #555; }
.activity-announcement-notice { padding: 8px 12px; background: #fff5d9; color: #573c13; }
.is-announcement-ended .activity-announcement-notice { background: #eef0f2; color: #454d55; }

/* Enlarge the complete footer cube, including its faces and shadow. */
.activity-gallery-footer .activity-category-icon {
  transform: scale(1.3);
  transform-origin: right bottom;
}

/* Keep the enlarged cube clear of the cards above it. */
.activity-gallery-footer {
  padding-top: 26.4px;
}

.contents-row .contents-main:has(.activity-gallery-page) {
  padding-bottom: clamp(7.5px, 2.5vw, 20px);
}

@media (max-width: 640px) {
  .activity-gallery-footer {
    padding-top: 22px;
  }
}

/* Static dotted ribbons: no animation loop or extra JavaScript work. */
.activity-gallery-footer { position: relative; }
.editor-styles-wrapper .activity-gallery-footer > .activity-footer-waves {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - 67px);
  max-width: none;
  height: 60px;
  margin: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.activity-gallery-footer .activity-category-icon { flex-shrink: 0; z-index: 1; }
@media (max-width: 640px) {
  .editor-styles-wrapper .activity-gallery-footer > .activity-footer-waves {
    width: calc(100% - 54px);
    height: 48px;
  }
}
