.graphic-archive {
  padding-top: 120px;
  padding-bottom: 80px;
}

.graphic-archive__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

.graphic-archive__title {
  text-align: center;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
}

/* ナビ */
.graphic-archive__nav {
  margin-bottom: 2.5rem;
}

.graphic-nav__dropdown {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.graphic-nav__section {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.graphic-nav__section-label {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.1em;
  white-space: nowrap;
  margin: 0 !important;
  flex-shrink: 0;
}

.graphic-nav__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.graphic-nav__divider {
  display: none;
}

.graphic-nav-item {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  color: #888;
  cursor: pointer;
  padding: 0 0 0.5em;
  margin-right: 2rem;
}

.graphic-nav-item.active {
  color: #111;
  font-weight: 500;
  border-bottom: 2px solid #111;
}

.graphic-nav-item:not(.active):hover {
  color: #111;
  transform: scale(1.15);
  transition: transform 0.2s ease;
}

/* Masonryグリッド */
.graphic-archive__masonry {
  /* Masonry.jsが制御するのでcolumnsは使わない */
}

/* カード幅: 4列 */
.graphic-card {
  width: calc(25% - 12px);
  margin-bottom: 16px;
  box-sizing: border-box;
}

.graphic-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.graphic-card__img {
  width: 100%;
  background: #f5f5f5;
  overflow: hidden;
  border-radius: 4px;
}

/* 横長比率 */
.graphic-card--landscape .graphic-card__img {
  aspect-ratio: 1.414 / 1;
}

/* 縦長比率 */
.graphic-card--portrait .graphic-card__img {
  aspect-ratio: 1 / 1.414;
}

.graphic-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.graphic-card__info {
  padding: 8px 4px 0;
}

.graphic-card__name {
  font-size: 13px;
  font-weight: 500;
  color: #111;
}

.graphic-card__cat {
  font-size: 11px;
  color: #999;
}

.graphic-card__name,
.graphic-card__cat {
  margin-bottom: 0 !important;
  line-height: 1.5em !important;
  margin-top: 0 !important;
}

.graphic-hamburger {
  display: none;
}

/* タブレット: 3列 */
@media (max-width: 1023px) {
  .graphic-card {
    width: calc(33.333% - 11px);
  }
}

/* スマホ: 2列 */
@media (max-width: 767px) {
  .graphic-archive {
    padding-top: 80px;
  }
  .graphic-archive__inner {
    padding: 0 20px;
  }

  .graphic-card {
    width: calc(50% - 6px);
    margin-bottom: 12px;
  }

  /* ナビ */
  .graphic-archive__nav {
    position: relative;
    margin-bottom: 1.5rem;
  }

  .graphic-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #111;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    flex-shrink: 0;
  }

  .graphic-hamburger__bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
  }

  .graphic-hamburger.open .graphic-hamburger__bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  .graphic-hamburger.open .graphic-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .graphic-hamburger.open .graphic-hamburger__bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .graphic-nav__dropdown {
    position: absolute;
    top: 54px;
    left: 0;
    background: #fff;
    border: 0.5px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px 0 8px;
    z-index: 100;
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    flex-direction: column;
  }

  .graphic-nav__dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .graphic-nav__section {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
    padding: 0 16px 8px;
  }

  .graphic-nav__section-label {
    font-size: 10px;
    margin-bottom: 4px !important;
  }

  .graphic-nav__row {
    flex-direction: column;
    width: 100%;
  }

  .graphic-nav__divider {
    display: block;
    height: 2px;
    background: #e0e0e0;
    margin: 8px 0;
  }

  .graphic-nav-item {
    border-bottom: none;
    padding: 8px 0;
    text-align: left;
    font-size: 13px;
    margin-right: 0;
  }

  .graphic-nav-item.active {
    border-bottom: none;
    color: #111;
    font-weight: 500;
  }

  .graphic-nav-item:not(.active):hover {
    transform: none;
    background: #f5f5f5;
  }
}
