/* ==========================================================================
   Rokkaku HP - Main Stylesheet
   Based on Figma Design "6kaku.net"
   ========================================================================== */

:root {
  --color-sky-gradient: linear-gradient(180deg, #008be7 0%, #cb7d3d 100%);
  --color-text: #000000;
  --color-text-sub: #555555;
  --color-text-light: #777777;
  --color-white: #ffffff;
  --color-yellow: #f9f480;
  --color-gray-placeholder: #d9d9d9;
  --color-border: rgba(0, 0, 0, 0.12);
  --color-circle-bg: rgba(255, 255, 255, 0.25);
  
  --font-en-serif: 'Caprasimo', serif;
  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --radius-card: 20px;
  --radius-badge: 9999px;
  --radius-btn: 12px;
  
  --bottom-nav-height: 64px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
  /* Reserve scrollbar gutter so the centred layout never shifts when pages
     with/without a vertical scrollbar switch. */
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The overall page: gradient fills left & right, white panel in center.
   Pinned to the viewport via fixed pseudo-element so the gradient is never
   stretched by content length or moved by scroll position, and works reliably
   across all browsers including Safari/WebKit. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-sky-gradient);
  z-index: -1;
  pointer-events: none;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ==========================================================================
   Page Layout Structure (PC: 3 Columns / SP: 1 Column + Bottom Nav)
   ========================================================================== */

/* The overall page: gradient fills left & right, white panel in center.
   Pinned to the viewport via body::before above.
   Sidebars shrink fluidly between 1314–1511px so no horizontal overflow occurs
   in PC mode; below 1314px the mobile layout takes over. */
.site-wrapper {
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
  position: relative;
}

/* Left Sidebar (PC) - Figma: left area 0-339px, logo x72 y120 195x67, menu x88 y228 w163.
   flex-shrink:1 lets the sidebar give up space proportionally when the viewport
   is between 1314px and 1511px; the content is centred via margin:auto overrides
   in the fluid-range media query below. */
.site-sidebar-left {
  width: 339px;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  padding: 120px 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

.site-logo {
  display: block;
  width: 195px;
  margin-left: 72px;
}

.site-nav-pc {
  margin: 41px 0 0 88px;
}

.site-nav-pc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 163px;
  align-items: center;
}

.site-nav-pc a {
  font-family: var(--font-en-serif);
  font-size: 16px;
  letter-spacing: 0.05em;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 163px;
  height: 24px;
  padding: 0;
  line-height: 1;
  position: relative;
  transition: opacity 0.2s ease;
}

.site-nav-pc a:hover {
  opacity: 1;
}

.site-nav-pc .nav-text {
  display: block;
  width: 163px;
  height: 18px;
  line-height: 18px;
  margin-top: 3px;
  text-align: center;
  transition: transform 0.2s ease;
}

/* Hover state (Figma menu=z variant): text moves UP 3px (y3->y0),
   5x4 white triangle fades in BELOW text centered */
.site-nav-pc a .nav-indicator {
  width: 5px;
  height: 4px;
  margin-top: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-nav-pc a:not(.active):hover .nav-text {
  transform: translateY(-3px);
}

.site-nav-pc a:not(.active):hover .nav-indicator {
  opacity: 1;
}

/* Selected state (prototype): 88px horizontal white line to the RIGHT, item middle */
.site-nav-pc a .nav-line {
  display: none;
  position: absolute;
  left: 163px;
  top: 12px;
  width: 88px;
  height: 1px;
  background: #fff;
}

.site-nav-pc a.active .nav-line {
  display: block;
}

.site-nav-pc a.active .nav-indicator {
  display: none;
}

/* Figma: mark x98 y477 22x27, text x117 y472 105x32, detail x103 y493 11x10,
   QR x120 y514 99x114. Nav ends y349 (measured incl. 1px rounding) -> margin 128. */
.site-sns-box {
  margin: 128px 0 0 98px;
  display: flex;
  flex-direction: column;
  color: var(--color-white);
}

.site-sns-box a.instagram-link {
  position: relative;
  display: block;
  width: 124px;
  height: 28px;
  font-family: var(--font-en-serif);
  font-size: 16px;
  line-height: 1;
  color: var(--color-white);
}

.site-sns-box a.instagram-link .insta-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 27px;
  /* Figma nodes 14:1408/14:1407: rotation 3.00083rad = 171.935deg
     (180deg flip + -8.065deg tilt, same tilt as the text) around node center */
  transform: rotate(171.935deg);
}

.site-sns-box a.instagram-link .insta-detail {
  position: absolute;
  left: 5px;
  top: 16px;
  width: 10px;
  height: 11px;
  transform: rotate(171.935deg);
}

.site-sns-box a.instagram-link span {
  position: absolute;
  left: 19px;
  top: 4px;
  width: 105px;
  height: 32px;
  /* Figma node 14:1402: lineHeightPx 18.35, vertical TOP */
  line-height: 18.35px;
  text-align: center;
  /* Figma node 14:1402: rotation -0.14076rad = -8.065deg around node center */
  transform: rotate(-8.065deg);
}

.site-sns-box .qr-code {
  width: 99px;
  height: 114px;
  display: block;
  margin: 9px 0 0 22px;
}

.site-sns-box .qr-code img {
  width: 99px;
  height: 114px;
  object-fit: cover;
}

/* Center Main Area - Figma: x339 w834 white flat panel, NO radius NO shadow NO margin.
   No internal scroller (min-height only; the page scrolls). overflow-x:clip cuts
   positioned children exactly at the panel edge (e.g. ABOUT works circle bleed);
   unlike hidden it never creates a scrollbar. Old browsers ignore it and show
   the bleed instead (graceful degradation). */
.main-card {
  width: 834px;
  flex-shrink: 0;
  background: var(--color-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible;
  overflow-x: clip;
  position: relative;
  z-index: 5;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.main-content-inner {
  padding: 48px 48px 32px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Right Sidebar - Figma: right area 1173-1512 (w339), contact x1223 y215 240x240.
   flex-shrink:1 mirrors the left sidebar's fluid behaviour. */
.site-sidebar-right {
  width: 339px;
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
}

/* Figma Group2: 240x240 #F9F480 rx10, no shadow. Hover variant: rgba(249,244,128,0.9).
   Children are absolutely positioned at exact Figma coords (x/y from 86:637). */
.contact-card-btn {
  display: block;
  background: #F9F480;
  padding: 0;
  border-radius: 10px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  width: 240px;
  height: 240px;
  margin: 230px 0 0 50px;
  transition: background 0.3s ease;
  color: #000;
}

.contact-card-btn:hover {
  background: rgba(249, 244, 128, 0.9);
  opacity: 1;
  transform: none;
  box-shadow: none;
}

/* white circle decoration: Figma Mask group circle cx120 cy-74 r146 white 0.4
   -> left:120-146=-26, top:-74-146=-220, d=292.
   Hover (86:639): same 292 circle shifted down 50px (cy-24, visible cap 72->122). */
.contact-card-btn::before {
  content: "";
  position: absolute;
  left: -26px;
  top: -220px;
  width: 292px;
  height: 292px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transition: transform 0.3s ease;
}

.contact-card-btn:hover::before {
  transform: translateY(50px);
}

.contact-card-btn .contact-title {
  font-family: var(--font-en-serif);
  font-size: 32px;
  line-height: 37px;
  position: absolute;
  left: 37px;
  top: 33px;
  width: 167px;
  text-align: center;
  z-index: 1;
}

.contact-card-btn .contact-subtitle {
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  position: absolute;
  left: 37px;
  top: 70px;
  width: 167px;
  text-align: center;
  z-index: 1;
}

.contact-card-btn .contact-illust {
  position: absolute;
  left: 105px;
  top: 102px;
  width: 32px;
  height: 26px;
  z-index: 1;
  transition: transform 0.3s ease;
  display: block;
}

/* Figma hover (86:639): Group rotates 15deg (rotation:0.261799rad) about its
   center. The 31.75x25.76 -> 37.33x33.1 size change is just the rotation's
   bounding box (verified mathematically) — no scaling involved. */
.contact-card-btn:hover .contact-illust {
  transform: rotate(15deg);
}

.contact-card-btn .contact-desc {
  font-size: 12px;
  line-height: 21px;
  text-align: center;
  position: absolute;
  left: 23px;
  top: 139px;
  width: 194px;
  white-space: pre-line;
  z-index: 1;
  color: #000;
}

.contact-card-btn .contact-arrow {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 18px;
  height: 16px;
  z-index: 1;
}

.right-since-text {
  font-family: var(--font-en-serif);
  font-size: 16px;
  color: var(--color-white);
  text-align: center;
  margin: auto 0 16px;
}

/* Mobile Header (SP only) */
.site-header-mobile {
  display: none;
}

/* Bottom Navigation (SP only) */
.mobile-bottom-nav {
  display: none;
}

/* Card Footer (Copyright) */
.card-footer {
  padding: 24px 0 16px;
  text-align: center;
  margin-top: auto;
}

.copyright-text {
  font-size: 0.75rem;
  color: var(--color-text-sub);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Page: TOP (front-page.php)
   ========================================================================== */

.top-hero-section {
  position: relative;
  /* Keep the white panel behind the full-bleed slider (top 393px + 360px). */
  height: 753px;
}

.top-circle-nav-group {
  position: absolute;
  inset: 0;
}

.top-circle-nav-group .about-btn {
  position: absolute;
  left: 206px;
  top: 4px;
}

.top-circle-nav-group .works-btn {
  position: absolute;
  left: 395px;
  top: 107px;
}

/* Round Badge Buttons - Figma Group4/Group3: fill rgba(255,255,255,0.2), stroke #000 1px, no blur no shadow */
.circle-btn {
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid #000;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  transition: background 0.3s ease;
  color: var(--color-text);
  box-shadow: none;
  backdrop-filter: none;
}

.circle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  transform: none;
}

/* Figma prototype: on hover only the INNER content (logo + text + arrow) tilts
   left together as a group. The button (outer circle) never rotates or scales.
   Inner layout follows exact Figma coords (top-biased, not centered):
   about logo y46 / text y121 / arrow y156; works text y49 / arrow y101. */
.circle-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  height: 100%;
  transition: transform 0.35s ease;
}

.circle-btn:hover .circle-inner {
  transform: rotate(-10deg);
}

.circle-btn.about-btn {
  width: 191px;
  height: 191px;
}

.circle-btn.about-btn .circle-inner {
  padding-top: 46px;
}

.circle-btn.about-btn .circle-logo {
  width: 81px;
  height: 70px;
  margin-bottom: 5px;
}

.circle-btn.about-btn .circle-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6em;
  margin-bottom: 11px;
}

.circle-btn.about-btn .circle-arrow {
  width: 12px;
}

.circle-btn.works-btn {
  width: 136px;
  height: 136px;
  align-self: flex-end;
}

.circle-btn.works-btn .circle-inner {
  padding-top: 49px;
}

.circle-btn.works-btn .circle-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3em;
  margin-bottom: 14px;
}

.circle-btn.works-btn .circle-arrow {
  width: 12px;
}

.top-catchphrase {
  position: absolute;
  left: 109px;
  top: 267px;
  width: 520px;
  height: 86px;
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  line-height: 2.1;
  margin: 0;
  color: var(--color-text);
}

/* Works slider: full-bleed desktop tiles 270x360 (gap 24).
   Two identical sets loop seamlessly via translateX(-50%). */
.top-slider-banner {
  position: absolute;
  top: 393px;
  left: -48px;
  width: calc(100% + 96px);
  height: 360px;
  margin: 0;
}

.top-slider-banner > img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.top-slider-track {
  display: flex;
  width: max-content;
  animation: top-slider-scroll 45s linear infinite;
}

.top-slider-banner:hover .top-slider-track,
.top-slider-banner:focus-within .top-slider-track {
  animation-play-state: paused;
}

.top-slider-set {
  display: flex;
  gap: 24px;
  padding-right: 24px;
}

.top-slider-item {
  display: block;
  width: 270px;
  height: 360px;
  flex-shrink: 0;
  background: #D9D9D9;
  overflow: hidden;
}

.top-slider-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-slider-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #888;
  font-size: 0.75rem;
}

@keyframes top-slider-scroll {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-slider-track {
    animation: none;
  }
}

/* ==========================================================================
   Page: ABOUT (page-about.php)
   ========================================================================== */

.page-title-en {
  font-family: var(--font-en-serif);
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.page-title-wrap {
  position: relative;
  /* Figma: title text bottom-aligned in 144px box from panel top -> text at ~y97 */
  padding-top: 49px;
}

.page-title-wrap .page-title-en {
  /* Figma: title box bottom y144 -> content y184 = 40px gap */
  margin-bottom: 40px;
}

/* Works circle: exact Figma panel coords x717 y48, 136x136. The 19px bleed past
   the panel edge is cut by .main-card's overflow-x:clip (blue area stays clean). */
.about-works-float {
  position: absolute;
  right: -67px;
  top: 0;
}

.about-works-float .circle-btn.works-btn {
  align-self: auto;
}

.about-lead-text {
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  line-height: 2.1;
  max-width: 563px;
  margin: 0 auto 40px;
}

.about-lead-text-mobile {
  display: none;
}

/* Service Cards - Figma: 774x112 white, shadow 0 0 20px rgba(0,0,0,0.1), NO radius NO border.
   Layout: title 240 | gradient divider 1x27 | desc 438 | illust 109x112 right. 
   Panel coords: x=30 y=355, 774px width (gap 16, list bottom 80).
   main-content-inner padding=48 → cards at x=30 need margin: 0 -18px. */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 -18px 80px;
}

.service-card {
  display: flex;
  align-items: center;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
  padding: 0;
  min-height: 112px;
  gap: 0;
  position: relative;
  transition: none;
}

.service-card:hover {
  transform: none;
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
}

.service-title-col {
  width: 240px;
  flex-shrink: 0;
  text-align: center;
  padding: 20px 0;
  position: relative;
}

/* Figma divider: 1x27 gradient line, vertically centered */
.service-title-col::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  margin-top: -13.5px;
  width: 1px;
  height: 27px;
  background: linear-gradient(180deg, #008BE7 0%, #CB7D3D 100%);
}

.service-title-en {
  font-family: var(--font-en-serif);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
}

.service-title-ja {
  font-size: 16px;
  line-height: 1em;
  color: var(--color-text);
  margin-top: 6px;
}

.service-desc-col {
  flex-grow: 1;
  font-size: 13px;
  line-height: 1.7em;
  color: #000;
  padding: 20px 20px 20px 41px;
  position: relative;
  z-index: 1;
}

/* Figma Mask-group line illustration, 109x112 flush right */
.service-illust {
  position: absolute;
  right: 0;
  top: 0;
  width: 109px;
  height: 112px;
  pointer-events: none;
}

/* Profile Section - Figma: image x96 240x260, bio x360 w378 14px/2.1 left.
   main-content-inner padding=48 → image needs 48px left margin to reach x96. */
.profile-section {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 56px;
  margin-left: 48px;
}

.profile-image-wrap {
  width: 240px;
  flex-shrink: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.profile-image-wrap img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.profile-body {
  flex-grow: 1;
}

.profile-bio {
  font-size: 14px;
  font-weight: 300;
  line-height: 2.1;
  margin-bottom: 32px;
  color: #000;
}

/* Figma: 65x1 gradient line above career, years 57px + 8px gap, 12px/1.8 */
.profile-career {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  line-height: 1.8;
  padding-top: 18px;
  position: relative;
  color: #000;
}

.profile-career::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 65px;
  height: 1px;
  background: linear-gradient(90deg, #008BE7 0%, #CB7D3D 100%);
}

.career-item {
  display: flex;
  gap: 8px;
}

.career-year {
  width: 57px;
  flex-shrink: 0;
  font-weight: 500;
}

.career-text {
  color: #000;
}

.invoice-note {
  text-align: center;
  font-size: 12px;
  line-height: 2.4;
  color: #000;
  max-width: 305px;
  margin: 0 auto;
}

/* ==========================================================================
   Page: WORKS (archive-works.php)
   ========================================================================== */

/* Figma Works component 81:358: 413x550 #F9F9F9 card, caption texts at y517
   OVERLAID on the image bottom (33px strip, transparent, black text).
   Grid full-bleed: cols at x0/x421 (gap 8). */
.works-grid {
  display: grid;
  grid-template-columns: 413px 413px;
  gap: 8px;
  justify-content: center;
  margin: 0 -48px 32px;
}

.works-empty-state {
  grid-column: 1 / -1;
  min-height: 240px;
  display: grid;
  place-items: center;
  background: #F9F9F9;
  font-size: 14px;
  font-weight: 300;
  text-align: center;
}

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

.work-card {
  width: 413px;
  height: 550px;
  position: relative;
  transition: none;
}

.work-card:hover {
  transform: none;
  opacity: 1;
}

.work-thumb-wrap {
  width: 413px;
  height: 550px;
  background: #F9F9F9;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

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

/* Caption legibility: subtle white gradient from image bottom */
.work-thumb-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 100%);
  pointer-events: none;
}

.work-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  height: 33px;
  font-size: 14px;
  color: #000;
}

.work-client-tag {
  width: 80px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-en-serif);
  font-size: 14px;
}

.work-client-name {
  flex-grow: 1;
  font-size: 14px;
  font-weight: 200;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-year {
  width: 85px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-en-serif);
  font-size: 14px;
}

/* Works pagination: compact editorial controls rather than browser-default links. */
.works-archive-container .navigation.pagination {
  margin: 56px 0 8px;
}

.works-archive-container .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.works-archive-container .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #000;
  font-family: var(--font-en-serif);
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}

.works-archive-container a.page-numbers:not(.prev):not(.next):hover,
.works-archive-container a.page-numbers:not(.prev):not(.next):focus-visible {
  border-color: #000;
  background: var(--color-yellow);
  color: #000;
  transform: translateY(-3px);
}

.works-archive-container .page-numbers.current {
  background: #000;
  color: #fff;
}

.works-archive-container .page-numbers.dots {
  min-width: 20px;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
}

.works-archive-container .page-numbers.prev,
.works-archive-container .page-numbers.next {
  gap: 10px;
  min-width: 104px;
  padding: 0 16px;
  border-color: #000;
  border-radius: 999px;
  font-family: var(--font-en-serif);
  font-size: 12px;
  letter-spacing: .12em;
}

.works-archive-container .page-numbers.prev:hover,
.works-archive-container .page-numbers.next:hover,
.works-archive-container .page-numbers.prev:focus-visible,
.works-archive-container .page-numbers.next:focus-visible {
  background: #000;
  color: #fff;
  transform: translateY(-3px);
}

.pagination-arrow {
  position: relative;
  width: 18px;
  height: 1px;
  background: currentColor;
}

.pagination-arrow::after {
  content: "";
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.pagination-arrow-next::after {
  right: 0;
  transform: rotate(45deg);
}

.pagination-arrow-prev::after {
  left: 0;
  transform: rotate(-135deg);
}

/* ==========================================================================
   Page: SINGLE WORK (single-works.php)
   ========================================================================== */

/* Figma 詳細_PC: title 144-box / back-link x105 y144 h40 / main 300x400 x105 y184 /
   subs 155x207 x429/x594 y184 / meta y415 / link rules y510+y589 / arrow x711. */
.single-work-container .page-title-wrap .page-title-en {
  margin-bottom: 0;
}

/* Panel is 834px with 48px inner padding; the detail column is inset 57px on
   BOTH sides so the whitespace in the white panel reads even (105 / 105). */
.single-work-content {
  margin-left: 57px;
  margin-right: 57px;
}

.single-work-header {
  margin-bottom: 0;
}

.back-to-list-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text);
}

.back-to-list-link img,
.back-to-list-link svg {
  width: 14px;
}

/* Figma: main 300px + 24 gap + details 320px. minmax(0, …) lets the pair
   shrink proportionally instead of overflowing the symmetric inset column
   (834 panel - 2x48 padding - 2x57 inset = 624, i.e. 20px short of 644). */
.single-work-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 320px);
  gap: 24px;
  align-items: flex-start;
}

.single-work-gallery-main {
  width: 100%;
  max-width: 300px;
  height: 400px;
  border-radius: 0;
  overflow: hidden;
  background: #D9D9D9;
}

.single-work-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.single-work-details {
  display: flex;
  flex-direction: column;
}

.single-work-sub-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 155px));
  gap: 10px;
}

.single-work-sub-gallery img {
  width: 100%;
  max-width: 155px;
  height: 207px;
  border-radius: 0;
  object-fit: cover;
  background: #D9D9D9;
  display: block;
}

.single-work-meta-line {
  display: flex;
  align-items: center;
  min-height: 17px;
  margin-top: 24px;
  font-size: 14px;
  color: #000;
}

/* Figma's meta line is [year 62][tag 80]. Both boxes shrink to their content so
   the ／ margins alone control its spacing; the tag's 20.5px right margin is
   the slack the old 80px centered box used to put between "client" and the
   client name. */
.single-work-meta-line .work-year {
  width: auto;
  text-align: left;
}

.single-work-meta-line .work-sep {
  margin: 0 14px;
}

.single-work-meta-line .work-client-tag {
  width: auto;
  margin-right: 20.5px;
  text-align: left;
}

/* Archive captions truncate; single meta wraps instead of cutting off */
.single-work-details .work-client-name,
.single-work-flow .work-client-name {
  white-space: normal;
  overflow: visible;
}

.single-work-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 79px;
  margin-top: 78px;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  font-size: 14px;
  color: #000;
  text-align: center;
  padding: 6px 48px;
}

.single-work-link img {
  position: absolute;
  right: 24px;
  top: 50%;
  margin-top: -7px;
  width: 14px;
}

.single-work-desc {
  margin-top: 24px;
  font-size: 14px;
  line-height: 1.8;
  color: #000;
  overflow-wrap: break-word;
}

/* Block-built works detail (rokkaku/* blocks): free vertical flow.
   Consecutive subs tile horizontally (155px + 10px gap, 4 fit in 681px).

   Vertical rhythm mirrors Figma 詳細_PC: 24px between blocks (subs bottom
   y391 → meta y415) and 78px above the ruled link box (meta bottom y432 →
   top rule y510). Every block is a flex line, so the row gap comes from
   `gap` alone and nothing depends on margin collapsing or floats. */
.single-work-flow {
  --flow-gap: 24px;
  --flow-gap-sub: 10px;
  --flow-gap-rule: 78px;
}

.single-work-flow,
.single-work-flow .wp-block-column,
.single-work-flow .wp-block-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  /* Columns are stretched by the columns row, so pin the lines to the top:
     without this the leftover height is spread between the flex lines and
     the 24px rhythm drifts. */
  align-content: flex-start;
  gap: var(--flow-gap) var(--flow-gap-sub);
}

/* One block per line… */
.single-work-flow > :not(.flow-sub),
.single-work-flow .wp-block-column > :not(.flow-sub),
.single-work-flow .wp-block-group > :not(.flow-sub) {
  flex: 0 0 100%;
  min-width: 0;
}

/* …except the subs, which tile side by side. */
.flow-sub {
  flex: 0 0 auto;
  width: 155px;
  max-width: calc(50% - 5px);
}

/* Legacy `.single-work-meta-line { margin-top: 24px }` must not add on top of
   the row gap — flex margins never collapse. */
.single-work-flow .single-work-meta-line {
  margin-top: 0;
}

/* Flex margins never collapse, so the row gap counts toward the total:
   24 (gap) + 54 (margin) = Figma's 78px above the rules. */
.single-work-flow .single-work-link {
  margin-top: calc(var(--flow-gap-rule) - var(--flow-gap));
}

.flow-main {
  width: 100%;
}

.flow-main img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #D9D9D9;
}

.flow-sub img {
  width: 100%;
  height: auto;
  aspect-ratio: 155 / 207;
  object-fit: cover;
  display: block;
  background: #D9D9D9;
}

.flow-text {
  font-size: 14px;
  line-height: 1.8;
  color: #000;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Page: CONTACT (page-contact.php)
   ========================================================================== */

.contact-under-construction {
  text-align: center;
  padding: 40px 16px;
  max-width: 600px;
  margin: 0 auto;
}

.contact-status-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.contact-instagram-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-yellow);
  color: #000;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.contact-message-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
  font-size: 0.88rem;
  line-height: 1.8;
}

.contact-section-title {
  font-family: var(--font-en-serif);
  font-size: 1.25rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 12px;
}

.contact-privacy-lead {
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.contact-privacy-box {
  border: 1px solid rgba(0, 0, 0, 0.15);
  padding: 20px 24px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.8;
  margin-bottom: 16px;
  background: #fff;
}

.contact-privacy-box h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 16px 0 4px;
}

.contact-privacy-box h3:first-child {
  margin-top: 0;
}

.contact-privacy-box p {
  margin: 0 0 8px;
}

.contact-consent {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 32px;
}

.contact-consent input {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 6px;
  accent-color: #000;
}

.contact-form {
  max-width: 640px;
  margin: 0 auto;
}

.contact-form.is-disabled {
  opacity: 0.45;
}

.contact-field {
  margin-bottom: 20px;
}

.contact-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.required-badge {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: 1px;
}

.contact-field input[type="text"],
.contact-field input[type="email"],
.contact-field input[type="tel"],
.contact-field input[type="url"],
.contact-field select,
.contact-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 0;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #000;
}

.contact-field textarea {
  resize: vertical;
}

.contact-field input:disabled,
.contact-field select:disabled,
.contact-field textarea:disabled {
  background: rgba(0, 0, 0, 0.04);
  cursor: not-allowed;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-submit {
  text-align: center;
  margin-top: 28px;
}

.contact-submit button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-yellow);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.contact-submit button:disabled {
  cursor: not-allowed;
}

.contact-submit button:not(:disabled):hover {
  opacity: 0.85;
}

/* Server-side status messages only (?status=input-error / send-error).
   Client-side validation shows its reason under each field instead. */
.contact-error {
  background: rgba(179, 38, 30, 0.06);
  border: 1px solid rgba(179, 38, 30, 0.25);
  color: #b3261e;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.9;
  text-align: center;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.contact-field .is-invalid,
.contact-field input.is-invalid,
.contact-field select.is-invalid,
.contact-field textarea.is-invalid {
  border-color: #b3261e;
  outline: 1px solid #b3261e;
  outline-offset: -1px;
}

.contact-field-error {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.7;
  color: #b3261e;
}

.contact-field-error[hidden] {
  display: none;
}

/* Confirmation step (shown after 確認画面へ進む, before the real submit) */
.contact-confirm {
  max-width: 640px;
  margin: 0 auto;
  scroll-margin-top: 24px;
}

.contact-confirm:focus {
  outline: none;
}

.contact-confirm-title {
  font-family: var(--font-en-serif);
  font-size: 1.25rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 12px;
}

.contact-confirm-lead {
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.contact-confirm-list {
  margin: 0 0 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  background: #fff;
}

.contact-confirm-row {
  display: flex;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 0.88rem;
  line-height: 1.8;
}

.contact-confirm-row dt {
  flex: 0 0 132px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.6);
}

.contact-confirm-row dd {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: #000;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.contact-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 0;
}

.contact-confirm-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-yellow);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.contact-confirm-send:not(:disabled):hover {
  opacity: 0.85;
}

.contact-confirm-send:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.contact-confirm-back {
  background: #fff;
  color: #000;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.contact-confirm-back:hover {
  background: rgba(0, 0, 0, 0.05);
}

.contact-result-box {
  text-align: center;
  padding: 48px 16px;
  font-size: 0.95rem;
  line-height: 2;
}

.contact-result-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Breakpoints)
   ========================================================================== */

/* Fluid sidebar range (1314px–1511px)
   Sidebars shrink proportionally (flex-shrink:1) while the 834px main card
   stays fixed. Content inside each sidebar is centred with margin:auto so it
   never clips at any width in this range.
   At exactly 1512px the sidebars are 339px and the centred positions land on
   the exact Figma coords (logo/nav margin auto = 72/88px — identical to Figma). */
@media screen and (min-width: 1314px) and (max-width: 1511px) {
  /* Centre left sidebar content */
  .site-logo {
    margin-left: auto;
    margin-right: auto;
  }

  .site-nav-pc {
    margin-left: auto;
    margin-right: auto;
  }

  .site-sns-box {
    margin-left: auto;
    margin-right: auto;
    align-self: flex-start; /* prevent stretch; auto margins do the centring */
    width: fit-content;
  }

  /* Centre right sidebar content */
  .contact-card-btn {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile / Tablet (< 1314px)
   Sidebars reach their minimum (240px each) at 1314px; below that width the
   gradient columns would be too narrow for any useful content so we switch to
   the single-column mobile layout instead. */
@media screen and (max-width: 1313px) {
  html {
    scrollbar-gutter: auto;
  }

  .site-wrapper {
    flex-direction: column;
    align-items: stretch;
    min-height: calc(100vh - 64px);
    position: relative;
  }

  .site-sidebar-left,
  .site-sidebar-right {
    display: none;
  }

  .hide-on-mobile {
    display: none !important;
  }

  /* Mobile: white content area fills full screen, gradient shows as header bg */
  .main-card {
    width: 100%;
    min-height: calc(100vh - 64px);
    border-radius: 0;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 16px);
  }

  /* Show Mobile Header - fixed to top-left, logo left-aligned.
     Compact (49px + safe-area): logo 96px wide (~33px tall) + 8px padding. */
  .site-header-mobile {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 8px 0 8px 16px;
    padding-top: calc(8px + env(safe-area-inset-top));
    background: transparent;
    z-index: 9000;
    pointer-events: none;
  }

  .site-header-mobile .mobile-logo {
    width: 96px;
    pointer-events: auto;
  }

  /* logo.svg is white for the PC sidebar; render it black on mobile only */
  .site-header-mobile .mobile-logo img {
    filter: brightness(0);
  }

  /* Mobile: no blue/gradient background, plain white.
     Offset page content so the fixed header never overlaps it. */
  body::before {
    display: none;
  }

  body {
    background: #fff;
    padding-top: calc(49px + env(safe-area-inset-top));
  }

  .main-content-inner {
    padding: 28px 20px 24px;
  }

  /* TOP hero: switch from PC absolute-positioned layout to normal flow for mobile */
  .top-hero-section {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px 0;
    gap: 24px;
  }

  .top-circle-nav-group {
    position: static;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 48px;
  }

  .top-circle-nav-group .about-btn,
  .top-circle-nav-group .works-btn {
    position: static;
  }

  .top-circle-nav-group .works-btn {
    margin-bottom: -48px;
  }

  .top-catchphrase {
    position: static;
    width: 100%;
    height: auto;
    text-align: center;
    margin: 0;
  }

  .top-slider-banner {
    position: static;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    height: 180px;
  }

  .top-slider-item {
    width: 135px;
    height: 180px;
  }

  .card-footer {
    padding: 20px 16px 24px;
  }

  /* Show Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    padding: 0 10px env(safe-area-inset-bottom);
    background: linear-gradient(90deg, #CB7D3D 0%, #008BE7 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: none;
    z-index: 9999;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 82px;
    height: 50px;
    color: #fff;
    font-size: 10px;
    font-family: var(--font-en-serif);
    gap: 4px;
    transition: color 0.2s ease, transform 0.15s ease;
  }

  .mobile-nav-item.active,
  .mobile-nav-item:hover {
    color: #fff;
    opacity: 1;
  }

  .mobile-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-item .nav-icon img {
    display: block;
    max-width: none;
  }

  .mobile-nav-item.contact-item {
    color: #fff;
  }

  .mobile-nav-item.contact-item .nav-icon {
    background: none;
    border-radius: 0;
    padding: 0;
  }
}

/* Smartphone Portrait (< 640px) */
@media screen and (max-width: 640px) {
  .main-content-inner {
    padding: 12px 16px 20px;
  }

  /* TOP hero: tighten spacing and adjust margins for small screens */
  .top-hero-section {
    padding: 24px 16px 0;
    gap: 20px;
  }

  .top-catchphrase {
    font-size: 0.88rem;
    line-height: 1.8;
  }

  .top-slider-banner {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
  }

  .page-title-en {
    font-size: 2rem;
  }

  .page-title-wrap {
    padding-top: 0;
  }

  .page-title-wrap .page-title-en {
    margin-bottom: 24px;
  }

  .about-lead-text-desktop {
    display: none;
  }

  .about-lead-text-mobile {
    display: block;
    line-height: 25px;
    margin-bottom: 33px;
  }

  .about-page-container .services-list {
    gap: 18px;
    margin: 0 0 80px;
  }

  .about-page-container .service-card {
    display: block;
    width: 100%;
    min-height: 130px;
    height: 130px;
    padding: 0;
  }

  .about-page-container .service-title-col {
    width: 100%;
    display: block;
    padding: 14px 0 0;
    text-align: center;
  }

  .about-page-container .service-title-col::after {
    display: none;
  }

  .about-page-container .service-title-en {
    font-size: 22px;
    line-height: 26px;
  }

  .about-page-container .service-title-ja {
    font-size: 14px;
    line-height: 17px;
    margin-top: 5px;
  }

  .about-page-container .service-desc-col {
    position: absolute;
    top: 76px;
    left: 16px;
    right: 16px;
    width: auto;
    padding: 0;
    font-size: 12px;
    line-height: 20px;
  }

  .about-page-container .service-illust {
    display: block;
    top: 0;
    right: 2px;
    width: 52px;
    height: 52px;
    object-fit: cover;
    object-position: top right;
  }

  .about-page-container .desktop-only-break {
    display: none;
  }

  .service-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }

  .service-title-col {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .service-title-col::after,
  .service-illust {
    display: none;
  }

  .service-desc-col {
    padding: 0;
  }

  .profile-section {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-left: 0;
  }

  .profile-image-wrap {
    width: 180px;
  }

  .works-grid {
    grid-template-columns: minmax(0, 413px);
    margin: 0 0 24px;
  }

  .works-archive-container .navigation.pagination {
    margin-top: 40px;
  }

  .works-archive-container .nav-links {
    gap: 4px;
  }

  .works-archive-container .page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
  }

  .works-archive-container .page-numbers.prev,
  .works-archive-container .page-numbers.next {
    min-width: 88px;
    padding: 0 10px;
    gap: 7px;
    font-size: 11px;
  }

  .work-card,
  .work-thumb-wrap {
    width: 100%;
  }

  .work-card {
    max-width: 413px;
    margin: 0 auto;
    height: auto;
  }

  .work-thumb-wrap {
    height: auto;
    aspect-ratio: 413 / 550;
  }

  .single-work-content {
    margin-left: 0;
    margin-right: 0;
  }

  /* Block flow needs no mobile overrides: flex-wrap already keeps the 24px row
   gap and subs stay two per row. They just grow to half the width here. */
  .single-work-flow,
  .single-work-flow .wp-block-column,
  .single-work-flow .wp-block-group {
    width: 100%;
  }

  .single-work-flow .flow-sub {
    width: calc(50% - 5px);
  }

  .single-work-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .single-work-gallery-main {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .single-work-sub-gallery {
    grid-template-columns: 1fr 1fr;
  }

.single-work-sub-gallery > div,
  .single-work-sub-gallery img {
    width: 100%;
    height: auto;
    aspect-ratio: 155 / 207;
  }

  .contact-confirm-row {
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
  }

  .contact-confirm-row dt {
    flex: none;
  }

  .contact-confirm-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-confirm-send,
  .contact-confirm-back {
    justify-content: center;
    width: 100%;
  }
}
