/* =========================================================
   KIMAMA STAGE 10A
   Editorial category archives
   Targets only:
   - category/stay
   - category/gear
   - category/memory-of-the-trip
   ========================================================= */

:root {
  --kimama-paper: #f3efe6;
  --kimama-paper-deep: #ebe4d8;
  --kimama-ink: #171717;
  --kimama-muted: #746f67;
  --kimama-gold: #a78354;
  --kimama-line: rgba(23, 23, 23, 0.14);
}

/* ---------- Page canvas ---------- */

body.category-stay,
body.category-gear,
body.category-memory-of-the-trip {
  background: var(--kimama-paper);
  color: var(--kimama-ink);
}

body.category-stay #content,
body.category-gear #content,
body.category-memory-of-the-trip #content {
  margin-top: 0;
}

body.category-stay .content-in,
body.category-gear .content-in,
body.category-memory-of-the-trip .content-in {
  max-width: 1500px;
  margin-inline: auto;
  padding: clamp(54px, 6vw, 104px) clamp(28px, 5.2vw, 80px) clamp(90px, 10vw, 150px);
}

body.category-stay .main,
body.category-gear .main,
body.category-memory-of-the-trip .main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* ---------- Category chapter heading ---------- */

body.category-stay .archive-title,
body.category-gear .archive-title,
body.category-memory-of-the-trip .archive-title {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  margin: 0 0 clamp(56px, 7vw, 100px);
  padding: 0 0 clamp(28px, 3vw, 42px);
  border: 0;
  border-bottom: 1px solid var(--kimama-line);
  background: transparent;
  color: var(--kimama-ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: clamp(46px, 5.6vw, 86px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

body.category-stay .archive-title::before,
body.category-gear .archive-title::before,
body.category-memory-of-the-trip .archive-title::before {
  display: block;
  margin-bottom: 16px;
  color: var(--kimama-gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.22em;
}

body.category-stay .archive-title::before {
  content: "STAY / PLACES TO REMEMBER";
}

body.category-gear .archive-title::before {
  content: "GEAR / TRAVEL ESSENTIALS";
}

body.category-memory-of-the-trip .archive-title::before {
  content: "TRAVEL STORIES / JOURNEY NOTES";
}

/* Cocoon's folder icon belongs to the old visual language. */
body.category-stay .archive-title svg,
body.category-stay .archive-title .fa,
body.category-stay .archive-title .fas,
body.category-stay .archive-title .far,
body.category-gear .archive-title svg,
body.category-gear .archive-title .fa,
body.category-gear .archive-title .fas,
body.category-gear .archive-title .far,
body.category-memory-of-the-trip .archive-title svg,
body.category-memory-of-the-trip .archive-title .fa,
body.category-memory-of-the-trip .archive-title .fas,
body.category-memory-of-the-trip .archive-title .far {
  display: none !important;
}

/* ---------- Editorial article list ---------- */

body.category-stay .list,
body.category-gear .list,
body.category-memory-of-the-trip .list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

body.category-stay .entry-card-wrap,
body.category-gear .entry-card-wrap,
body.category-memory-of-the-trip .entry-card-wrap {
  display: block;
  margin: 0;
  padding: clamp(34px, 4.2vw, 62px) 0;
  border: 0;
  border-bottom: 1px solid var(--kimama-line);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}

body.category-stay .entry-card-wrap:first-child,
body.category-gear .entry-card-wrap:first-child,
body.category-memory-of-the-trip .entry-card-wrap:first-child {
  padding-top: 0;
}

body.category-stay .entry-card,
body.category-gear .entry-card,
body.category-memory-of-the-trip .entry-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(34px, 5vw, 76px);
  align-items: center;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Alternate the editorial rhythm without changing HTML. */
body.category-stay .entry-card-wrap:nth-child(even) .entry-card,
body.category-gear .entry-card-wrap:nth-child(even) .entry-card,
body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card {
  grid-template-columns: minmax(300px, 0.65fr) minmax(0, 1.35fr);
}

body.category-stay .entry-card-wrap:nth-child(even) .entry-card-thumb,
body.category-gear .entry-card-wrap:nth-child(even) .entry-card-thumb,
body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card-thumb {
  grid-column: 2;
  grid-row: 1;
}

body.category-stay .entry-card-wrap:nth-child(even) .entry-card-content,
body.category-gear .entry-card-wrap:nth-child(even) .entry-card-content,
body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card-content {
  grid-column: 1;
  grid-row: 1;
}

body.category-stay .entry-card-thumb,
body.category-gear .entry-card-thumb,
body.category-memory-of-the-trip .entry-card-thumb {
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: var(--kimama-paper-deep);
}

body.category-stay .entry-card-thumb img,
body.category-gear .entry-card-thumb img,
body.category-memory-of-the-trip .entry-card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 700ms cubic-bezier(.18,.72,.2,1);
}

@media (hover: hover) and (pointer: fine) {
  body.category-stay .entry-card-wrap:hover .entry-card-thumb img,
  body.category-gear .entry-card-wrap:hover .entry-card-thumb img,
  body.category-memory-of-the-trip .entry-card-wrap:hover .entry-card-thumb img {
    transform: scale(1.018);
  }
}

body.category-stay .entry-card-content,
body.category-gear .entry-card-content,
body.category-memory-of-the-trip .entry-card-content {
  min-width: 0;
  padding: 0;
}

body.category-stay .entry-card-title,
body.category-gear .entry-card-title,
body.category-memory-of-the-trip .entry-card-title {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--kimama-ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: clamp(25px, 2.15vw, 37px);
  font-weight: 400;
  line-height: 1.52;
  letter-spacing: -0.025em;
}

body.category-stay .entry-card-snippet,
body.category-gear .entry-card-snippet,
body.category-memory-of-the-trip .entry-card-snippet {
  margin: 0;
  color: var(--kimama-muted);
  font-size: 14px;
  line-height: 2;
}

body.category-stay .entry-card-meta,
body.category-gear .entry-card-meta,
body.category-memory-of-the-trip .entry-card-meta {
  margin-top: 22px;
  color: var(--kimama-muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  letter-spacing: 0.12em;
}

/* Category chip over images: quieter, editorial label. */
body.category-stay .cat-label,
body.category-gear .cat-label,
body.category-memory-of-the-trip .cat-label {
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(243, 239, 230, 0.36);
  border-radius: 0;
  background: rgba(8, 10, 12, 0.74);
  color: #f5f0e7;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.12em;
  backdrop-filter: blur(6px);
}

/* Remove Cocoon hover-card chrome. */
body.category-stay .entry-card-wrap:hover,
body.category-gear .entry-card-wrap:hover,
body.category-memory-of-the-trip .entry-card-wrap:hover {
  background: transparent;
  color: inherit;
  transform: none;
}

/* ---------- Pagination ---------- */

body.category-stay .pagination,
body.category-gear .pagination,
body.category-memory-of-the-trip .pagination {
  margin-top: clamp(48px, 6vw, 82px);
}

body.category-stay .pagination .page-numbers,
body.category-gear .pagination .page-numbers,
body.category-memory-of-the-trip .pagination .page-numbers {
  border: 1px solid var(--kimama-line);
  border-radius: 0;
  background: transparent;
  color: var(--kimama-ink);
  box-shadow: none;
}

body.category-stay .pagination .current,
body.category-gear .pagination .current,
body.category-memory-of-the-trip .pagination .current {
  border-color: var(--kimama-ink);
  background: var(--kimama-ink);
  color: var(--kimama-paper);
}

/* ---------- Mobile ---------- */

@media screen and (max-width: 834px) {
  body.category-stay .content-in,
  body.category-gear .content-in,
  body.category-memory-of-the-trip .content-in {
    padding: 44px 20px 84px;
  }

  body.category-stay .archive-title,
  body.category-gear .archive-title,
  body.category-memory-of-the-trip .archive-title {
    margin-bottom: 42px;
    padding-bottom: 22px;
    font-size: clamp(40px, 12vw, 58px);
  }

  body.category-stay .archive-title::before,
  body.category-gear .archive-title::before,
  body.category-memory-of-the-trip .archive-title::before {
    margin-bottom: 12px;
    font-size: 8px;
  }

  body.category-stay .entry-card,
  body.category-gear .entry-card,
  body.category-memory-of-the-trip .entry-card,
  body.category-stay .entry-card-wrap:nth-child(even) .entry-card,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  body.category-stay .entry-card-wrap:nth-child(even) .entry-card-thumb,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card-thumb,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card-thumb,
  body.category-stay .entry-card-wrap:nth-child(even) .entry-card-content,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card-content,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card-content {
    grid-column: 1;
    grid-row: auto;
  }

  body.category-stay .entry-card-wrap,
  body.category-gear .entry-card-wrap,
  body.category-memory-of-the-trip .entry-card-wrap {
    padding: 34px 0;
  }

  body.category-stay .entry-card-title,
  body.category-gear .entry-card-title,
  body.category-memory-of-the-trip .entry-card-title {
    margin-bottom: 12px;
    font-size: clamp(24px, 7vw, 31px);
    line-height: 1.55;
  }

  body.category-stay .entry-card-snippet,
  body.category-gear .entry-card-snippet,
  body.category-memory-of-the-trip .entry-card-snippet {
    font-size: 13px;
    line-height: 1.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.category-stay .entry-card-thumb img,
  body.category-gear .entry-card-thumb img,
  body.category-memory-of-the-trip .entry-card-thumb img {
    transition: none;
  }
}


/* =========================================================
   KIMAMA STAGE 10A.1
   Cocoon entry-card structural reset
   ========================================================= */

/* Cocoon's default archive cards use floats, fixed thumb widths and
   absolutely positioned metadata. Reset those mechanics before applying
   the editorial grid above. */

body.category-stay .entry-card,
body.category-gear .entry-card,
body.category-memory-of-the-trip .entry-card {
  float: none !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.category-stay .entry-card-thumb,
body.category-gear .entry-card-thumb,
body.category-memory-of-the-trip .entry-card-thumb {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  align-self: start;
}

body.category-stay .entry-card-content,
body.category-gear .entry-card-content,
body.category-memory-of-the-trip .entry-card-content {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  align-self: center;
  overflow: visible !important;
}

/* Restore normal title/snippet flow regardless of Cocoon card mode. */
body.category-stay .entry-card-title,
body.category-gear .entry-card-title,
body.category-memory-of-the-trip .entry-card-title {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
}

body.category-stay .entry-card-snippet,
body.category-gear .entry-card-snippet,
body.category-memory-of-the-trip .entry-card-snippet {
  display: block !important;
  max-height: none !important;
  overflow: visible !important;
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: initial !important;
}

/* Metadata belongs on the photograph, not in a squeezed side column. */
body.category-stay .entry-card-meta,
body.category-gear .entry-card-meta,
body.category-memory-of-the-trip .entry-card-meta {
  position: absolute !important;
  right: 14px !important;
  bottom: 12px !important;
  left: auto !important;
  width: auto !important;
  max-width: calc(100% - 28px);
  margin: 0 !important;
  padding: 6px 8px !important;
  background: rgba(7, 9, 11, 0.62) !important;
  color: rgba(247, 243, 235, 0.86) !important;
  text-align: right !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  font-size: 8px !important;
  letter-spacing: 0.08em;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Cocoon's administrator-only PV counters are useful in the dashboard,
   but visually noisy inside an editorial archive. */
body.category-stay .admin-pv,
body.category-gear .admin-pv,
body.category-memory-of-the-trip .admin-pv,
body.category-stay .entry-card-pv,
body.category-gear .entry-card-pv,
body.category-memory-of-the-trip .entry-card-pv {
  display: none !important;
}

/* Keep category chip and metadata from colliding with one another. */
body.category-stay .entry-card-thumb .cat-label,
body.category-gear .entry-card-thumb .cat-label,
body.category-memory-of-the-trip .entry-card-thumb .cat-label {
  z-index: 3;
}

body.category-stay .entry-card-meta,
body.category-gear .entry-card-meta,
body.category-memory-of-the-trip .entry-card-meta {
  z-index: 3;
}

/* Link wrapper must not inherit a constrained Cocoon width/card mode. */
body.category-stay .entry-card-wrap.a-wrap,
body.category-gear .entry-card-wrap.a-wrap,
body.category-memory-of-the-trip .entry-card-wrap.a-wrap {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}

/* A little more breathing room in the text column. */
@media screen and (min-width: 835px) {
  body.category-stay .entry-card-content,
  body.category-gear .entry-card-content,
  body.category-memory-of-the-trip .entry-card-content {
    padding-inline: clamp(4px, 0.6vw, 10px) !important;
  }
}

/* Mobile: metadata remains compact and the source image stays landscape. */
@media screen and (max-width: 834px) {
  body.category-stay .entry-card-content,
  body.category-gear .entry-card-content,
  body.category-memory-of-the-trip .entry-card-content {
    padding: 0 !important;
  }

  body.category-stay .entry-card-meta,
  body.category-gear .entry-card-meta,
  body.category-memory-of-the-trip .entry-card-meta {
    right: 10px !important;
    bottom: 10px !important;
    max-width: calc(100% - 20px);
    font-size: 7px !important;
  }
}


/* =========================================================
   KIMAMA STAGE 10A.2
   Editorial proportion polish
   - wider text column
   - calmer article titles
   - tighter chapter-to-list handoff
   ========================================================= */

@media screen and (min-width: 835px) {
  /* Bring the first story closer to the category chapter heading. */
  body.category-stay .archive-title,
  body.category-gear .archive-title,
  body.category-memory-of-the-trip .archive-title {
    margin-bottom: clamp(40px, 4.5vw, 68px);
  }

  /* Give long Japanese titles enough horizontal room.
     The photography stays dominant, but no longer overwhelms the copy. */
  body.category-stay .entry-card,
  body.category-gear .entry-card,
  body.category-memory-of-the-trip .entry-card {
    grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.82fr);
    gap: clamp(38px, 4.2vw, 64px);
  }

  body.category-stay .entry-card-wrap:nth-child(even) .entry-card,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card {
    grid-template-columns: minmax(390px, 0.82fr) minmax(0, 1.18fr);
  }

  body.category-stay .entry-card-title,
  body.category-gear .entry-card-title,
  body.category-memory-of-the-trip .entry-card-title {
    margin-bottom: 15px;
    font-size: clamp(24px, 1.72vw, 32px);
    line-height: 1.48;
    letter-spacing: -0.02em;
    overflow-wrap: normal;
    word-break: auto-phrase;
  }

  body.category-stay .entry-card-snippet,
  body.category-gear .entry-card-snippet,
  body.category-memory-of-the-trip .entry-card-snippet {
    max-width: 46em;
    font-size: 14px;
    line-height: 1.92;
  }

  /* Slightly reduce vertical card spacing now that the layout is calmer. */
  body.category-stay .entry-card-wrap,
  body.category-gear .entry-card-wrap,
  body.category-memory-of-the-trip .entry-card-wrap {
    padding-top: clamp(30px, 3.5vw, 52px);
    padding-bottom: clamp(30px, 3.5vw, 52px);
  }

  body.category-stay .entry-card-wrap:first-child,
  body.category-gear .entry-card-wrap:first-child,
  body.category-memory-of-the-trip .entry-card-wrap:first-child {
    padding-top: 0;
  }
}

/* Keep narrower tablets from forcing the text column into awkward wraps. */
@media screen and (min-width: 835px) and (max-width: 1100px) {
  body.category-stay .entry-card,
  body.category-gear .entry-card,
  body.category-memory-of-the-trip .entry-card,
  body.category-stay .entry-card-wrap:nth-child(even) .entry-card,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card {
    grid-template-columns: 1fr 1fr;
    gap: 34px;
  }

  body.category-stay .entry-card-title,
  body.category-gear .entry-card-title,
  body.category-memory-of-the-trip .entry-card-title {
    font-size: clamp(23px, 2.6vw, 29px);
  }
}


/* =========================================================
   KIMAMA STAGE 10A.3
   Quiet article metadata
   - remove floating dark date badge
   - place date naturally beneath the excerpt
   ========================================================= */

body.category-stay .entry-card-meta,
body.category-gear .entry-card-meta,
body.category-memory-of-the-trip .entry-card-meta {
  position: static !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto !important;
  max-width: none !important;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--kimama-gold) !important;
  text-align: left !important;
  white-space: normal !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px !important;
  line-height: 1.4 !important;
  letter-spacing: 0.16em;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Keep any small metadata icons restrained. */
body.category-stay .entry-card-meta .fa,
body.category-stay .entry-card-meta .fas,
body.category-stay .entry-card-meta .far,
body.category-stay .entry-card-meta svg,
body.category-gear .entry-card-meta .fa,
body.category-gear .entry-card-meta .fas,
body.category-gear .entry-card-meta .far,
body.category-gear .entry-card-meta svg,
body.category-memory-of-the-trip .entry-card-meta .fa,
body.category-memory-of-the-trip .entry-card-meta .fas,
body.category-memory-of-the-trip .entry-card-meta .far,
body.category-memory-of-the-trip .entry-card-meta svg {
  width: 10px;
  height: 10px;
  color: currentColor;
  opacity: 0.72;
}

/* Remove any box-like styling inherited from Cocoon metadata children. */
body.category-stay .entry-card-meta > *,
body.category-gear .entry-card-meta > *,
body.category-memory-of-the-trip .entry-card-meta > * {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

/* On mobile, keep the date close to the excerpt rather than floating. */
@media screen and (max-width: 834px) {
  body.category-stay .entry-card-meta,
  body.category-gear .entry-card-meta,
  body.category-memory-of-the-trip .entry-card-meta {
    margin-top: 14px !important;
    font-size: 7.5px !important;
    letter-spacing: 0.14em;
  }
}


/* =========================================================
   KIMAMA STAGE 10A.4
   Remove redundant category labels from archive thumbnails
   ========================================================= */

body.category-stay .entry-card-thumb .cat-label,
body.category-gear .entry-card-thumb .cat-label,
body.category-memory-of-the-trip .entry-card-thumb .cat-label {
  display: none !important;
}


/* =========================================================
   KIMAMA STAGE 10A.6
   Mobile category finishing
   ========================================================= */

@media screen and (max-width: 834px) {
  /* Slightly tighter handoff from the chapter title to the first story. */
  body.category-stay .archive-title,
  body.category-gear .archive-title,
  body.category-memory-of-the-trip .archive-title {
    margin-bottom: 34px;
  }

  /* Keep photography cinematic, but reduce the amount of one-screen takeover. */
  body.category-stay .entry-card-thumb img,
  body.category-gear .entry-card-thumb img,
  body.category-memory-of-the-trip .entry-card-thumb img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
  }

  body.category-stay .entry-card,
  body.category-gear .entry-card,
  body.category-memory-of-the-trip .entry-card,
  body.category-stay .entry-card-wrap:nth-child(even) .entry-card,
  body.category-gear .entry-card-wrap:nth-child(even) .entry-card,
  body.category-memory-of-the-trip .entry-card-wrap:nth-child(even) .entry-card {
    gap: 18px;
  }

  /* Long Japanese headlines remain editorial, but wrap a little more calmly. */
  body.category-stay .entry-card-title,
  body.category-gear .entry-card-title,
  body.category-memory-of-the-trip .entry-card-title {
    margin-bottom: 10px;
    font-size: clamp(23px, 6.6vw, 29px);
    line-height: 1.52;
    letter-spacing: -0.02em;
  }

  body.category-stay .entry-card-snippet,
  body.category-gear .entry-card-snippet,
  body.category-memory-of-the-trip .entry-card-snippet {
    font-size: 13px;
    line-height: 1.85;
  }

  body.category-stay .entry-card-wrap,
  body.category-gear .entry-card-wrap,
  body.category-memory-of-the-trip .entry-card-wrap {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  body.category-stay .entry-card-meta,
  body.category-gear .entry-card-meta,
  body.category-memory-of-the-trip .entry-card-meta {
    margin-top: 12px !important;
  }
}
