/* MEKULY Design System */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f0f9fb;
  --surface-muted: #f5f7f8;
  --surface-card-back: #f0f9fb;
  --shadow-card-back: 0 4px 18px rgba(37, 32, 32, 0.1);
  --ink: #252020;
  --muted: #64748b;
  --brand: #00afcc;
  --brand-hover: #009ab3;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --line-dark: #94a3b8;
  --radius: 18px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --font-brand: "Be Vietnam Pro", system-ui, sans-serif;
  --header-height: 64px;
  --filter-drawer-header-gap: calc(var(--header-height) * 2);
  --filter-drawer-inset-top: calc(var(--header-height) + var(--filter-drawer-header-gap));
  --filter-ui-font-size: 0.875rem;
  --filter-chip-space: 8px;
  --page-gutter: 20px;
  --layout-max-width: 1440px;
  --layout-edge-inset: max(var(--page-gutter), calc((100vw - var(--layout-max-width)) / 2));
  --shadow-soft: 0 8px 32px rgba(37, 32, 32, 0.08);
  --shadow-tile: 0 2px 10px rgba(37, 32, 32, 0.06);
  --transition-fast: 0.18s ease;
  --transition-nav: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-flip: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding-top: var(--header-height);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover { color: var(--brand-hover); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header / Nav */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: transform var(--transition-nav);
  will-change: transform;
}

.site-header.is-hidden {
  transform: translateY(calc(-100% - env(safe-area-inset-top, 0px)));
}

@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none;
  }
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  height: var(--header-height);
}

.brand {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  line-height: 1;
}

.nav-panel .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

.nav-panel .nav-links a {
  padding: 0;
  color: var(--muted);
  transition: color var(--transition-fast);
}

.nav-panel .nav-links a:hover,
.nav-panel .nav-links a[aria-current="page"] {
  color: var(--ink);
}

.nav-panel .nav-divider { color: var(--line); }

@media (min-width: 901px) {
  .nav-panel {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .nav-panel .nav-links {
    justify-content: flex-end;
    height: 100%;
    margin-top: 0;
    font-size: 1.1rem;
    line-height: 1;
    letter-spacing: 0.04em;
    gap: 20px;
  }

  .nav-panel .nav-links a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    font-weight: 400;
  }

  .nav-panel .nav-divider {
    display: inline-flex;
    align-items: center;
    height: 36px;
    font-weight: 300;
    font-size: 0.85em;
    color: var(--line-strong);
    line-height: 1;
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--filter-chip-space);
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--transition-fast);
}

.nav-toggle-icon::before { top: -7px; }
.nav-toggle-icon::after { top: 7px; }

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  transition: transform 0.18s ease, top 0.18s ease, background 0.18s ease;
}

.nav.is-open .nav-toggle-icon {
  background: transparent;
}

.nav.is-open .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav.is-open .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  top: var(--header-height);
  background: rgba(37, 32, 32, 0.4);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-nav), visibility var(--transition-nav);
}

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 900px) {
  body.nav-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 201;
  }

  .nav-toggle {
    display: block;
    position: relative;
    z-index: 202;
  }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: var(--filter-chip-space);
    flex-shrink: 0;
    position: relative;
    z-index: 202;
  }

  .filter-chip-trigger--mobile {
    font-size: var(--filter-ui-font-size);
    white-space: nowrap;
  }

  .nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    z-index: 200;
    transform: translateX(100%);
    transition: transform var(--transition-nav);
    padding: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 2rem) 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-panel.is-open {
    transform: translateX(0);
  }

  .nav-panel .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 0 24px 24px;
    font-size: 1rem;
    letter-spacing: normal;
  }

  .nav-panel .nav-divider { display: none; }

  .nav-panel .nav-links a {
    display: block;
    width: auto;
    padding: 0;
    height: auto;
  }

  html.nav-open,
  body.nav-open {
    overflow: hidden;
  }

}

/* Hero */
.hero {
  max-width: none;
  margin: 0;
  padding: 32px 0 16px var(--page-gutter);
}

.hero-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: center;
  width: 100%;
  container-type: inline-size;
}

.hero-copy h1 {
  font-size: clamp(1.5rem, 7cqi, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 16px;
  color: var(--ink);
  width: 100%;
  max-width: none;
}

.hero-copy h1 span {
  display: block;
  white-space: nowrap;
}

.hero-copy p,
.hero-copy .hero-lead {
  color: var(--muted);
  font-size: clamp(0.875rem, 3.2cqi, 1rem);
  line-height: 1.6;
  margin: 0;
  width: 100%;
  max-width: 480px;
}

.hero-copy .hero-lead span {
  display: block;
  white-space: nowrap;
}

.hero-visual {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-soft), var(--line));
  overflow: hidden;
}

.hero-carousel {
  width: 100%;
  height: 100%;
}

.hero-slide {
  width: 100%;
  height: 100%;
}

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

.hero-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

/* Articles page — today's recommendations */
.hero-feature--articles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 24px;
}

.hero-feature--articles .hero-copy {
  align-self: center;
}

.articles-featured-meta {
  width: 100%;
  max-width: 480px;
  container-type: inline-size;
}

.articles-featured-eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: none;
}

.articles-featured-headline {
  margin: 0;
  font-size: clamp(1.5rem, 7cqi, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
}

.articles-featured-headline a {
  color: var(--ink);
  text-decoration: none;
}

.articles-featured-headline a:hover {
  color: var(--brand);
}

.articles-featured {
  --articles-featured-card-width: calc(
    (
      min(1180px, 100vw - 2 * var(--page-gutter))
      - 2 * clamp(24px, 4vw, 64px)
      - clamp(28px, 3.5vw, 48px)
    ) / 2
  );
  width: 100%;
  min-width: 0;
}

.articles-featured-rail {
  position: relative;
}

.articles-featured-fade {
  display: none;
}

.articles-featured-carousel {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.articles-featured-carousel::-webkit-scrollbar {
  display: none;
}

.articles-featured-carousel:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.articles-featured-track {
  display: flex;
}

.articles-featured-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.articles-featured-card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.articles-featured-card__media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}

.articles-featured-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.articles-featured-card__title {
  display: none;
  margin: 0;
  padding: 12px 14px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  color: var(--ink);
  background: var(--surface);
}

.articles-featured-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
}

.articles-featured-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d9d9d9;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.articles-featured-dot.is-active {
  background: #111;
  transform: scale(1.05);
}

.articles-featured-dot:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.mekuly-articles-recommended-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.mekuly-articles-recommended-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.mekuly-articles-recommended-row .mekuly-articles-recommended-select {
  min-width: min(100%, 320px);
}

.mekuly-articles-recommended-row .mekuly-articles-image-preview {
  flex: 0 0 100%;
}

@media (min-width: 761px) {
  .hero {
    padding: 32px var(--page-gutter) 16px;
  }

  .hero-feature {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(24px, 4vw, 64px);
    gap: clamp(28px, 3.5vw, 48px);
  }

  .hero-copy {
    padding-inline: clamp(12px, 2vw, 40px) clamp(8px, 1.5vw, 24px);
  }

  .hero-feature--articles {
    display: block;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
    margin-bottom: 24px;
  }

  .hero-feature--articles .hero-copy {
    display: none;
  }

  .hero:has(.hero-feature--articles) {
    padding-inline: 0;
  }

  .hero-feature--articles .articles-featured {
    --articles-featured-fade-width: calc(var(--page-gutter) + 40px);
    position: relative;
    left: 50%;
    width: 100vw;
    max-width: 100vw;
    transform: translateX(-50%);
  }

  .hero-feature--articles .articles-featured-rail {
    position: relative;
  }

  .hero-feature--articles .articles-featured-fade {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--articles-featured-fade-width);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity var(--transition-fast);
  }

  .hero-feature--articles .articles-featured-fade.is-visible {
    opacity: 1;
  }

  .hero-feature--articles .articles-featured-fade--start {
    left: 0;
    background: linear-gradient(
      to right,
      var(--bg) 0%,
      var(--bg) 33%,
      rgba(255, 255, 255, 0.55) 72%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  .hero-feature--articles .articles-featured-fade--end {
    right: 0;
    background: linear-gradient(
      to left,
      var(--bg) 0%,
      var(--bg) 33%,
      rgba(255, 255, 255, 0.55) 72%,
      rgba(255, 255, 255, 0) 100%
    );
  }

  .hero-feature--articles .articles-featured-carousel {
    border-radius: 0;
    background: transparent;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: calc(var(--articles-featured-card-width) * 9 / 16 + 4.5em);
    padding-block: 4px;
    scroll-snap-type: x mandatory;
  }

  .hero-feature--articles .articles-featured-track {
    display: flex;
    gap: 16px;
    align-items: stretch;
    width: max-content;
    padding-inline: max(
      var(--page-gutter),
      calc(50vw - (var(--articles-featured-card-width) / 2))
    );
  }

  .hero-feature--articles .articles-featured-slide {
    flex: 0 0 var(--articles-featured-card-width);
    scroll-snap-align: center;
  }

  .hero-feature--articles .articles-featured-card {
    width: 100%;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .hero-feature--articles .articles-featured-card__media {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .hero-feature--articles .articles-featured-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.1em;
  }

  .hero-feature--articles .articles-featured-dots {
    margin-top: 14px;
    padding-inline: var(--page-gutter);
  }
}

@media (max-width: 760px) {
  .hero {
    padding: 0 0 16px;
  }

  .hero-feature {
    display: block;
    position: relative;
    margin-bottom: 16px;
  }

  .hero-visual {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    position: relative;
  }

  .hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.32) 42%,
      transparent 72%
    );
    pointer-events: none;
    z-index: 1;
  }

  .hero-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hero-carousel::-webkit-scrollbar {
    display: none;
  }

  .hero-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .hero-copy {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    width: 62%;
    max-width: 62%;
    height: 58%;
    max-height: 58%;
    padding: 14px var(--page-gutter) 16px;
    align-items: flex-start;
    justify-content: flex-end;
    pointer-events: none;
  }

  .hero-copy h1 {
    color: #fff;
    max-width: 100%;
    width: 100%;
    margin: 0;
    font-size: clamp(0.85rem, 5.5cqi, 1.35rem);
    line-height: 1.25;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  }

  .hero-copy .hero-lead {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    max-width: 100%;
    width: 100%;
    margin: 6px 0 0;
    font-size: clamp(0.65rem, 3.2cqi, 0.8rem);
    line-height: 1.45;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  }

  .hero-copy .hero-lead span {
    font-size: inherit;
  }

  .hero-feature--articles {
    display: block;
    position: relative;
    margin-bottom: 16px;
  }

  .hero-feature--articles .hero-copy {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 2;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
    padding: 14px var(--page-gutter) 16px;
    align-items: flex-start;
    justify-content: flex-end;
    pointer-events: none;
  }

  .hero-feature--articles .articles-featured-meta {
    max-width: none;
    pointer-events: none;
  }

  .hero-feature--articles .articles-featured-eyebrow {
    color: rgba(255, 255, 255, 0.86);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  }

  .hero-feature--articles .articles-featured-headline {
    font-size: clamp(0.95rem, 4.8cqi, 1.15rem);
    line-height: 1.35;
  }

  .hero-feature--articles .articles-featured-headline a {
    color: #fff;
    pointer-events: auto;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  }

  .hero-feature--articles .articles-featured {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .hero-feature--articles .articles-featured-carousel {
    position: relative;
    width: 100%;
    border-radius: 0;
    scroll-behavior: auto;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .hero-feature--articles .articles-featured-track {
    display: flex;
  }

  .hero-feature--articles .articles-featured-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  .hero-feature--articles .articles-featured-card {
    display: block;
    height: auto;
  }

  .hero-feature--articles .articles-featured-card__media {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    overflow: hidden;
    background: var(--surface-muted);
  }

  .hero-feature--articles .articles-featured-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .hero-feature--articles .articles-featured-carousel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.32) 42%,
      transparent 72%
    );
    pointer-events: none;
    z-index: 1;
  }

  .hero-feature--articles .articles-featured-dots {
    margin-top: 14px;
    padding-inline: var(--page-gutter);
  }

  .hero-feature--articles:has(.articles-featured-dots) .hero-copy {
    bottom: 34px;
  }
}

/* Category picker (custom dropdown) */
.category-picker {
  --category-picker-inset: var(--layout-edge-inset);
  --category-picker-border: #a8bdd8;
  width: 100vw;
  max-width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 var(--category-picker-inset) 10px;
}

@media (max-width: 900px) {
  .category-picker {
    display: flex;
    justify-content: center;
  }
}

.category-picker__dropdown {
  position: relative;
  display: inline-block;
  width: min(100%, 320px);
  max-width: 100%;
}

.category-picker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--category-picker-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 400;
  font-family: var(--font);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.category-picker__trigger:hover {
  border-color: #8faed0;
}

.category-picker__dropdown.is-open .category-picker__trigger {
  border-color: var(--category-picker-border);
  box-shadow: 0 0 0 2px rgba(168, 189, 216, 0.25);
}

.category-picker__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-picker__caret {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #9aa3ad;
  transform: translateY(1px);
  transition: transform var(--transition-fast);
}

.category-picker__dropdown.is-open .category-picker__caret {
  transform: translateY(-1px) rotate(180deg);
}

.category-picker__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(37, 32, 32, 0.12);
  max-height: min(280px, 50vh);
  overflow-y: auto;
}

.category-picker__list[hidden] {
  display: none;
}

.category-picker__option {
  padding: 12px 16px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.4;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.category-picker__option:hover,
.category-picker__option:focus-visible {
  background: #f0f0f0;
  outline: none;
}

@media (min-width: 901px) {
  .category-picker__dropdown {
    width: min(100%, 360px);
  }

  .category-picker__trigger,
  .category-picker__option {
    font-size: 1rem;
  }

  .category-picker__trigger {
    padding: 14px 18px;
    border-radius: 10px;
  }

  .category-picker__list {
    border-radius: 10px;
    padding: 8px 0;
  }

  .category-picker__option {
    padding: 14px 18px;
  }
}

@media (max-width: 760px) {
  .category-picker {
    --category-picker-inset: var(--page-gutter);
    display: block;
  }

  .category-picker__dropdown {
    display: block;
    width: 100%;
    max-width: none;
  }

  .category-picker__trigger,
  .category-picker__option {
    font-size: 0.875rem;
  }

  .category-picker__trigger {
    padding: 10px 14px;
  }

  .category-picker__option {
    padding: 11px 14px;
  }
}

/* Hashtag chips */
.hashtag-chip {
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: 999px;
  background: #f2f2f2;
  color: #333;
  font-weight: 400;
  font-family: var(--font);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hashtag-filter .hashtag-chip {
  flex-shrink: 0;
  padding: var(--hashtag-chip-block-pad) var(--hashtag-chip-inline-pad);
  font-size: var(--hashtag-chip-font);
  line-height: var(--hashtag-chip-line);
  white-space: nowrap;
}

button.hashtag-chip {
  cursor: pointer;
}

.hashtag-chip:hover {
  background: #e0e0e0;
}

.hashtag-chip[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.hashtag-chip[aria-pressed="true"]:hover {
  background: var(--brand-hover);
  color: #fff;
}

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.chip:hover {
  border-color: #bdbdbd;
}

.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.chip[aria-pressed="true"]:hover {
  border-color: var(--brand);
  color: #fff;
}

.filter-chip-trigger.chip {
  padding: 0.45em 0.75em;
  line-height: 1.2;
  height: auto;
}

.filter-chip-trigger.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-chip-trigger.is-active .filter-chip-trigger__text {
  color: #fff;
}

.filter-chip-trigger.is-active:hover,
.filter-chip-trigger.is-active:hover .filter-chip-trigger__text {
  color: #fff;
}

.filter-chip-trigger__text {
  display: block;
  line-height: 1;
}

/* Hashtag filter (2nd row under category picker) */
.hashtag-chips-rail {
  --chips-edge-inset: var(--layout-edge-inset);
  --chips-fade-width: 40px;
  --hashtag-chip-rows: 3;
  --hashtag-chip-block-pad: 2px;
  --hashtag-chip-inline-pad: 7px;
  --hashtag-chip-font: 0.75rem;
  --hashtag-chip-line: 1.2;
  --hashtag-chip-gap-y: 3px;
  --hashtag-chip-gap-x: 3px;
  --hashtag-chips-pad-top: 4px;
  --hashtag-chip-row-height: calc(
    var(--hashtag-chip-block-pad) * 2 + var(--hashtag-chip-font) * var(--hashtag-chip-line)
  );
  --hashtag-chips-max-height: calc(
    var(--hashtag-chips-pad-top)
    + var(--hashtag-chip-rows) * var(--hashtag-chip-row-height)
    + (var(--hashtag-chip-rows) - 1) * var(--hashtag-chip-gap-y)
  );
  position: relative;
  width: 100vw;
  max-width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

@media (min-width: 901px) {
  .hashtag-chips-rail {
    --chips-fade-width: 48px;
    --hashtag-chip-inline-pad: 9px;
  }
}

.hashtag-chips-rail[hidden] {
  display: none;
}

.hashtag-chips-rail__scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-padding-inline: var(--chips-edge-inset);
  padding: 0 var(--chips-edge-inset) 4px;
  scrollbar-width: none;
}

.hashtag-chips-rail__scroll::-webkit-scrollbar {
  display: none;
}

.hashtag-chips-rail__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--chips-fade-width);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.hashtag-chips-rail__fade.is-visible {
  opacity: 1;
}

.hashtag-chips-rail__fade--start {
  left: 0;
  background: linear-gradient(
    to right,
    var(--bg) 0%,
    var(--bg) 55%,
    rgba(255, 255, 255, 0.6) 82%,
    rgba(255, 255, 255, 0) 100%
  );
}

.hashtag-chips-rail__fade--end {
  right: 0;
  background: linear-gradient(
    to left,
    var(--bg) 0%,
    var(--bg) 55%,
    rgba(255, 255, 255, 0.6) 82%,
    rgba(255, 255, 255, 0) 100%
  );
}

.hashtag-chips,
.hashtag-filter {
  display: flex;
  flex-flow: row wrap;
  align-content: flex-start;
  gap: var(--hashtag-chip-gap-y) var(--hashtag-chip-gap-x);
  width: max-content;
  max-width: none;
  max-height: var(--hashtag-chips-max-height);
  padding-top: var(--hashtag-chips-pad-top);
  box-sizing: border-box;
}

.hashtag-filter .hashtag-chip {
  flex: 0 0 auto;
  width: fit-content;
  max-width: none;
  align-self: flex-start;
}

/* Filter chip + drawer */
.filter-chip-flip {
  display: inline-flex;
  align-items: center;
  -webkit-perspective: 1200px;
  perspective: 1200px;
  vertical-align: middle;
}

.filter-chip-flip[hidden] {
  display: none !important;
}

.filter-chip-flip__card {
  display: inline-flex;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  transition: transform var(--transition-flip);
}

.filter-chip-flip.is-visible .filter-chip-flip__card {
  transform: rotateY(0deg);
}

.filter-chip-flip:not(.is-visible) .filter-chip-trigger {
  pointer-events: none;
}

.filter-chip-flip.is-visible .filter-chip-trigger {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .filter-chip-flip__card {
    transition: none;
  }
}

@media (max-width: 900px) {
  .filter-chip-trigger--desktop {
    display: none !important;
  }

  .nav-divider--after-filter {
    display: none;
  }
}

@media (min-width: 901px) {
  .nav-actions {
    display: none;
  }

  .filter-chip-trigger--desktop {
    display: inline-flex;
    align-items: center;
    margin-left: -10px;
    height: 36px;
    padding-block: 0;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: none;
  }

  .filter-chip-trigger--desktop:not(.is-active) {
    color: var(--ink);
  }

  .filter-chip-flip--desktop[hidden] {
    display: none !important;
  }

  .filter-chip-trigger--desktop:hover:not(.is-active) {
    color: var(--ink);
  }

  .filter-chip-flip--desktop[hidden] + .nav-divider--after-filter {
    display: none;
  }
}

.filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 210;
  pointer-events: none;
}

.filter-drawer:not([hidden]) {
  pointer-events: auto;
}

.filter-drawer__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(37, 32, 32, 0.4);
  z-index: 210;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-nav), visibility var(--transition-nav);
}

.filter-drawer__backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.filter-drawer__panel {
  position: fixed;
  z-index: 211;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-nav);
  overflow: hidden;
}

.filter-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.filter-drawer__title {
  margin: 0;
  font-size: var(--filter-ui-font-size);
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.filter-drawer__header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.filter-drawer__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 8px;
  padding-left: 16px;
  border: none;
  border-left: 1px solid #eee;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.filter-drawer__close .nav-toggle-icon {
  background: transparent;
}

.filter-drawer__close .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.filter-drawer__close .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.filter-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}

.filter-drawer__footer {
  flex-shrink: 0;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eee;
  background: var(--surface);
}

.filter-drawer__apply {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}

.filter-drawer__apply:hover {
  background: var(--brand-hover);
}

.filter-drawer__checklist--brands {
  padding: 8px 0;
}

.filter-drawer__header-action {
  padding: 8px 6px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: var(--filter-ui-font-size);
  font-weight: 600;
  font-family: var(--font);
  line-height: 1.2;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.filter-drawer__header-action:hover {
  color: var(--brand);
}

.filter-check-block {
  border-bottom: 1px solid #f0f0f0;
}

.filter-check-block:last-child {
  border-bottom: none;
}

.filter-check-block__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.filter-check-block__checkbox,
.filter-check-item__checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--line-dark);
  border-radius: 3px;
  background-color: var(--surface);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  cursor: pointer;
}

.filter-check-block__checkbox:checked,
.filter-check-item__checkbox:checked {
  background-color: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 2.5 4.5-5'/%3E%3C/svg%3E");
}

.filter-check-block__checkbox:indeterminate,
.filter-check-item__checkbox:indeterminate {
  background-color: var(--brand);
  border-color: var(--brand);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' d='M2.5 6h7'/%3E%3C/svg%3E");
}

.filter-check-block__label,
.filter-check-item__label {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-check-block__toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  cursor: pointer;
}

.filter-check-block__toggle:hover {
  background: #f5f5f5;
}

.filter-check-block__children {
  padding: 0 16px 8px 42px;
}

.filter-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}

.filter-check-item__label {
  font-weight: 500;
  font-size: 0.875rem;
}

.filter-check-block--flat .filter-check-block__header {
  padding-bottom: 12px;
}

/* Travel category: compact region list, multi-column prefectures, generous insets */
.filter-drawer__panel--travel {
  width: min(480px, 94vw);
}

.filter-drawer__panel--travel .filter-drawer__body {
  overflow-y: auto;
  padding: 2px 0;
}

.filter-drawer__panel--travel .filter-drawer__header {
  padding-left: 28px;
  padding-right: 28px;
}

.filter-drawer__panel--travel .filter-drawer__footer {
  padding-left: 28px;
  padding-right: 28px;
}

.filter-drawer__checklist--travel .filter-check-block__header {
  padding: 7px 24px;
  gap: 8px;
}

.filter-drawer__checklist--travel .filter-check-block--flat .filter-check-block__header {
  padding-bottom: 7px;
}

.filter-drawer__checklist--travel .filter-check-block__label {
  font-size: 0.875rem;
  font-weight: 600;
  cursor: default;
}

.filter-drawer__checklist--travel .filter-check-block__label--expandable {
  cursor: pointer;
}

.filter-drawer__checklist--travel .filter-check-block__label--expandable:hover {
  color: var(--brand);
}

.filter-drawer__checklist--travel .filter-check-block__children {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
  padding: 10px 28px 12px 56px;
}

.filter-drawer__checklist--travel .filter-check-block__children .filter-check-item {
  padding: 5px 0;
  gap: 8px;
}

.filter-drawer__checklist--travel .filter-check-item__label {
  font-size: 0.8125rem;
  cursor: default;
}

@media (min-width: 901px) {
  .filter-drawer__panel--travel {
    width: min(520px, 94vw);
  }

  .filter-drawer__panel--travel .filter-drawer__header {
    padding-left: 32px;
    padding-right: 32px;
  }

  .filter-drawer__panel--travel .filter-drawer__footer {
    padding-left: 32px;
    padding-right: 32px;
  }

  .filter-drawer__checklist--travel .filter-check-block__header {
    padding-left: 28px;
    padding-right: 28px;
  }

  .filter-drawer__checklist--travel .filter-check-block__children {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 24px;
    padding: 10px 32px 12px 60px;
  }
}

@media (max-width: 900px) {
  .filter-drawer__panel--travel .filter-drawer__header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .filter-drawer__panel--travel .filter-drawer__footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 901px) {
  .filter-drawer__panel {
    top: 0;
    right: 0;
    width: min(380px, 90vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(100%);
    border-radius: 0;
  }

  .filter-drawer.is-open .filter-drawer__panel {
    transform: translateX(0);
  }

  .filter-drawer__panel.filter-drawer__panel--travel {
    width: min(520px, 94vw);
  }
}

@media (max-width: 900px) {
  .filter-drawer__panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: var(--filter-drawer-inset-top);
    width: 100%;
    height: auto;
    max-height: none;
    transform: translateY(100%);
    border-radius: 20px 20px 0 0;
  }

  .filter-drawer.is-open .filter-drawer__panel {
    transform: translateY(0);
  }

  body.filter-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 212;
  }

  html.filter-open,
  body.filter-open {
    overflow: hidden;
  }
}

/* Waterfall */
.page-shell {
  max-width: 100%;
  padding: 0 var(--page-gutter) 60px;
}

.waterfall {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  transition: opacity var(--transition-fast);
}

.waterfall.is-transitioning { opacity: 0.4; }

.waterfall.is-loading,
.article-index-grid.is-loading {
  min-height: 240px;
  position: relative;
}

.waterfall.is-loading::after,
.article-index-grid.is-loading::after {
  content: '読み込み中…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #666);
  font-size: 0.95rem;
}

.mekuly-empty-state {
  width: 100%;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted, #666);
  line-height: 1.7;
}

.waterfall-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Tiles */
.tile {
  width: 100%;
  -webkit-perspective: 1200px;
  perspective: 1200px;
  animation: tileEnter 0.5s ease both;
  animation-delay: var(--enter-delay, 0ms);
}

@keyframes tileEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tile-card {
  position: relative;
  width: 100%;
  min-height: 260px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform var(--transition-flip);
  border-radius: var(--radius);
}

.tile.is-open .tile-card {
  transform: rotateY(180deg);
}

.tile-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
}

.tile-cover {
  display: block;
  padding: 0;
  border: none;
  cursor: pointer;
  background: transparent;
  transform: rotateY(0deg) translate3d(0, 0, 1px);
  box-shadow: var(--shadow-tile);
  overflow: visible;
}

.tile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.tile-detail {
  position: relative;
  transform: rotateY(180deg) translate3d(0, 0, 1px);
  background: var(--surface-card-back);
  border: 2px solid var(--brand);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow: var(--shadow-card-back);
  overflow: hidden;
  --detail-text-muted: var(--muted);
}

.tile-detail-body {
  --detail-inset: 12px;
  --detail-content-inset: 12px;
  --detail-hero-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 2px 8px rgba(0, 0, 0, 0.45);
  padding: 0 0 var(--detail-inset);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  background: transparent;
}

.detail-header {
  flex-shrink: 0;
  min-width: 0;
}

.detail-thumb {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  border-bottom: 1px solid var(--line-strong);
  overflow: hidden;
  background: #d8dee6;
}

.detail-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.08) 35%,
    rgba(0, 0, 0, 0.55) 72%,
    rgba(0, 0, 0, 0.82) 100%
  );
  pointer-events: none;
  z-index: 1;
}

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

.detail-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  padding: 8px var(--detail-content-inset) 10px;
}

/* Tile height variants — aspect ratio on card so both faces share the same box */
.tile-size-0 .tile-card { aspect-ratio: 3/4; }
.tile-size-1 .tile-card { aspect-ratio: 4/5; }
.tile-size-2 .tile-card { aspect-ratio: 1/1; }
.tile-size-3 .tile-card { aspect-ratio: 5/4; }
.tile-size-4 .tile-card { aspect-ratio: 4/3; }
.tile-size-5 .tile-card { aspect-ratio: 3/2; }
.tile-size-6 .tile-card { aspect-ratio: 16/9; }
.tile-size-7 .tile-card { aspect-ratio: 2/1; }
.tile-size-8 .tile-card { aspect-ratio: 3/5; }

.detail-brand {
  font-size: 0.72rem;
  color: #fff;
  margin: 0;
  line-height: 1.4;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  text-shadow: var(--detail-hero-text-shadow);
}

.detail-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.35;
  color: #fff;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  text-shadow: var(--detail-hero-text-shadow);
}

.detail-price {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
  flex-shrink: 0;
  padding: 0 var(--detail-content-inset);
}

.detail-summary {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--detail-text-muted, var(--muted));
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  padding: 0 var(--detail-content-inset);
}

.detail-summary.is-clamped-empty {
  display: none;
}

.detail-tags {
  flex: 0 1 auto;
  min-height: 0;
  min-width: 0;
  margin: 0;
  padding: 0 var(--detail-content-inset);
  overflow: hidden;
}

.detail-tags.is-clamped-empty {
  display: none;
}

.detail-tags__text {
  margin: 0;
  font-size: 0.625rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--detail-text-muted, var(--muted));
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  -webkit-box-orient: vertical;
}

.detail-tags__text.is-clamped-empty {
  display: none;
}

.detail-tags[hidden] {
  display: none;
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  flex-shrink: 0;
  padding: 0 var(--detail-content-inset);
}

.buy-link {
  display: block;
  text-align: center;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff !important;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.buy-link:hover {
  background: var(--brand-hover);
  color: #fff !important;
}

@media (max-width: 760px) {
  .tile-card {
    min-height: 250px;
  }

  .tile-card[data-size-locked="1"] {
    height: var(--tile-lock-height);
    min-height: var(--tile-lock-height);
    aspect-ratio: auto;
  }

  .tile-size-5 .tile-card,
  .tile-size-6 .tile-card,
  .tile-size-7 .tile-card {
    aspect-ratio: 4 / 5;
  }

  .tile-detail-body {
    --detail-inset: 10px;
  }

  .detail-name {
    font-size: 0.92rem;
  }

  .detail-summary {
    font-size: 0.78rem;
  }

  .detail-price {
    font-size: 0.9rem;
  }

  .buy-link {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* Service / Static Pages */
.service-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px var(--page-gutter) 80px;
}

.service-hero {
  margin-bottom: 40px;
}

.service-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 8px;
}

.service-hero p {
  color: var(--muted);
  margin: 0;
}

.service-section {
  margin-bottom: 48px;
}

.service-section h2 {
  font-size: 1.2rem;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.service-section p,
.service-section li {
  color: var(--muted);
  line-height: 1.8;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.about-card {
  background: var(--surface-soft);
  border-radius: var(--radius);
  padding: 24px;
}

.about-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.about-card p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* Article Page (Note-style) */
.article-page {
  --article-column-width: min(720px, calc(100vw - 2 * var(--page-gutter)));
  padding-top: 32px;
}

.article-layout {
  width: 100%;
  max-width: var(--article-column-width);
  margin-inline: auto;
}

.article-eye-catch {
  aspect-ratio: 16 / 9;
  margin: 0 0 28px;
  overflow: hidden;
  background: var(--surface-muted);
}

.article-eye-catch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-column {
  width: 100%;
}

.article-eyebrow {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.article-title {
  margin: 0 0 20px;
  font-size: clamp(1.375rem, 4.2vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.article-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.article-byline-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.article-author {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
}

.article-date {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.article-body {
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 2;
}

.article-body > *:first-child {
  margin-top: 0;
}

.article-body > * + * {
  margin-top: 1.75em;
}

.article-body h2,
.article-body .wp-block-heading {
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.55;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
}

.article-body h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.55;
}

.article-body p {
  margin: 0;
}

/* 段落間の空行（line-height: 2 と合わせて1行分） */
.article-body .wp-block-paragraph + .wp-block-paragraph,
.article-body > p + p {
  margin-top: 2em;
}

.article-body ul,
.article-body ol {
  margin: 0;
  padding-left: 1.4em;
}

.article-body li + li {
  margin-top: 0.35em;
}

.article-body blockquote {
  margin: 0;
  padding: 16px 20px;
  border-left: 3px solid var(--line-strong);
  background: var(--surface-muted);
  color: var(--muted);
}

.article-body figure,
.article-body .wp-block-image {
  margin: 2em 0;
}

.article-body figure.wp-block-image:has(+ p.mekuly-image-caption),
.article-body > figure.wp-block-image:not(.wp-block-gallery *):has(+ p.mekuly-image-caption) {
  margin-bottom: 0;
}

.article-body figure.wp-block-image + p.mekuly-image-caption {
  margin-top: 0.15em;
}

.article-body > .wp-block-image,
.article-body > figure.wp-block-image:not(.wp-block-gallery *) {
  aspect-ratio: unset;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.article-body figure img,
.article-body .wp-block-image img {
  width: 100%;
  object-fit: cover;
  margin-inline: auto;
}

.article-body > figure.wp-block-image:not(.wp-block-gallery *) img,
.article-body > .wp-block-image:not(.wp-block-gallery *) img {
  display: block;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.article-body figcaption {
  margin-top: 0.65em;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.article-body figcaption.mekuly-image-caption,
.article-body p.mekuly-image-caption,
.article-body .wp-block-paragraph.mekuly-image-caption,
.article-body .wp-block-gallery figcaption.mekuly-image-caption {
  display: block;
  margin: 0.15em 0 1em;
  font-size: 0.6875rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.45;
  letter-spacing: 0.03em;
}

.article-body .wp-block-gallery {
  margin: 2em 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.article-body .wp-block-gallery.has-nested-images {
  /* WP core の flex + 50% 幅を打ち消し、テーマの grid を優先 */
  display: grid !important;
  flex-wrap: unset !important;
}

.article-body .wp-block-gallery .wp-block-image,
.article-body .wp-block-gallery.has-nested-images figure.wp-block-image {
  margin: 0;
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: unset;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.article-body .wp-block-gallery .wp-block-image img,
.article-body .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  margin-inline: 0;
  display: block;
  border-radius: 8px;
  background: var(--surface-muted);
}

.article-body .wp-block-gallery figcaption.mekuly-image-caption {
  margin-top: 0.35em;
  margin-bottom: 0.15em;
}

@media (max-width: 760px) {
  .article-body .wp-block-gallery,
  .article-body .wp-block-gallery.has-nested-images {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.article-body .alignwide,
.article-body .alignfull {
  max-width: 100%;
  margin-inline: auto;
}

/* Article tables — simple rows, no vertical borders */
.article-body .wp-block-table {
  margin: 2em 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body .wp-block-table table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.75;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.article-body .wp-block-table th,
.article-body .wp-block-table td {
  padding: 1rem 0.75rem;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  text-align: left;
  vertical-align: top;
}

.article-body .wp-block-table tr:last-child th,
.article-body .wp-block-table tr:last-child td {
  border-bottom: none;
}

.article-body .wp-block-table thead th {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.article-body .wp-block-table tbody th,
.article-body .wp-block-table tbody td:first-child {
  font-weight: 700;
  color: var(--ink);
}

.article-body .wp-block-table tbody td {
  color: var(--muted);
}

.article-body .wp-block-table tbody th {
  white-space: nowrap;
  padding-right: 1.25rem;
}

.article-body .wp-block-table tbody td:first-child {
  padding-right: 1.25rem;
}

@media (max-width: 640px) {
  .article-body .wp-block-table th,
  .article-body .wp-block-table td {
    padding: 0.85rem 0.5rem;
    font-size: 0.875rem;
  }

  .article-body .wp-block-table tbody th {
    white-space: normal;
  }
}

.article-body .wp-block-buttons:has(.mekuly-btn-brand) {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.article-body .wp-block-button.mekuly-btn-brand .wp-block-button__link {
  background-color: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.article-body .wp-block-button.mekuly-btn-brand .wp-block-button__link:hover {
  background-color: var(--brand-hover);
  color: #fff;
}

.article-related {
  max-width: var(--article-column-width);
  margin: 56px auto 0;
}

.article-related-heading {
  margin: 0 0 20px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.article-related-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
}

.article-related-card {
  display: block;
  color: inherit;
}

.article-related-card:hover .article-related-title {
  color: var(--brand);
}

.article-related-thumb {
  margin: 0 0 12px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}

.article-related-thumb img,
.article-related-thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-related-thumb-placeholder {
  display: block;
  background: var(--surface-soft);
}

.article-related-title {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

.article-related-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.article-related-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.article-related-author {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-related-time {
  flex-shrink: 0;
  white-space: nowrap;
}

.article-related-time::before {
  content: "·";
  margin-right: 8px;
}

@media (max-width: 760px) {
  .article-page {
    padding-top: 0;
    padding-inline: 0;
  }

  .article-layout {
    max-width: none;
  }

  .article-eye-catch {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 24px;
  }

  .article-column {
    padding-inline: var(--page-gutter);
  }

  .article-related {
    padding-inline: var(--page-gutter);
  }

  .article-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
}

/* Article Index */
.article-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-index-grid.is-transitioning {
  opacity: 0.55;
  transition: opacity var(--transition-fast);
}

.article-index-card__link {
  display: block;
  color: inherit;
}

.article-index-card__link:hover .article-index-title {
  color: var(--brand);
}

.article-index-thumb {
  margin: 0 0 12px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-muted);
}

.article-index-thumb img,
.article-index-thumb__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-index-thumb__placeholder {
  background: var(--surface-soft);
}

.article-index-brand {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.article-index-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
}

@media (min-width: 760px) {
  .article-index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .article-index-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .article-index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }
}

/* Article List */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-list-item a {
  display: flex;
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: box-shadow var(--transition-fast);
  color: inherit;
}

.article-list-item a:hover {
  box-shadow: var(--shadow-soft);
}

.article-thumb {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-meta h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.article-meta p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px var(--page-gutter);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Pagination */
.pagination .nav-links,
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-numbers {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.page-numbers.current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Scroll to top */
.scroll-top {
  position: fixed;
  right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 85;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #d9d9d9;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast),
    visibility var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.scroll-top:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.scroll-top__label {
  display: block;
}

@media (max-width: 760px) {
  .scroll-top {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top {
    transition: none;
  }
}
