/* works 固有設定 01 */
/* Shared fixed footer and harmonized typography: TOP / WORKS */
body.top-page,body.works-page{padding-bottom:128px!important}
body.top-page .site-footer,body.works-page .site-footer{
 position:fixed!important;left:0;right:0;bottom:0;z-index:1000;
 box-sizing:border-box;display:flex!important;flex-wrap:wrap!important;
 justify-content:space-between!important;align-items:center!important;
 gap:9px 24px!important;padding:11px clamp(18px,4vw,60px)!important;
 background:#293b3e!important;color:#f5f4ee!important;
 border-top:1px solid #607078!important;
 box-shadow:0 -4px 18px rgba(25,35,40,.08);
 font-family:'Yu Mincho','Hiragino Mincho ProN','Noto Serif JP',serif!important;
}
body.top-page .site-footer a,body.works-page .site-footer a{color:#f5f4ee!important}
body.top-page .site-footer .footer-brand,body.works-page .site-footer .footer-brand{font-size:11px!important;gap:10px!important}
body.top-page .site-footer .footer-logo-img,body.works-page .site-footer .footer-logo-img{width:32px!important;height:32px!important}
body.top-page .site-footer .footer-links,body.works-page .site-footer .footer-links{gap:14px!important}
body.top-page .site-footer .footer-links a,body.works-page .site-footer .footer-links a{font-size:10px!important}
body.top-page .site-footer small,body.works-page .site-footer small{font-size:9px!important;color:#d6e0df!important}
body.top-page .site-footer .top-footer-contact,body.works-page .site-footer .top-footer-contact{
 width:100%!important;margin:0!important;padding:6px 0 0!important;
 border-top:1px solid rgba(255,255,255,.22)!important;
 display:flex!important;justify-content:center!important;gap:15px!important;
 color:#e2e8e7!important;font-size:10px!important;line-height:1.5!important;
}
body.top-page .site-footer .top-footer-contact strong,body.works-page .site-footer .top-footer-contact strong{color:#e2e8e7!important}
/* Serif-led TOP typography matched to WORKS text scale */
body.top-page .top-intro p{font-size:clamp(15px,1.35vw,18px)!important}
body.top-page .top-service-item{font-size:clamp(15px,1.4vw,18px)!important}
body.top-page .top-section-title{font-size:clamp(21px,2.15vw,27px)!important}
body.top-page .top-profile-name{font-size:clamp(24px,2.6vw,34px)!important}
body.top-page .top-profile-role{font-size:clamp(15px,1.4vw,18px)!important}
body.top-page .top-kicker{font-family:'Yu Mincho','Hiragino Mincho ProN','Noto Serif JP',serif!important}
@media(max-width:768px){
 body.top-page,body.works-page{padding-bottom:120px!important}
 body.top-page .site-footer,body.works-page .site-footer{padding:10px 14px!important;gap:6px 10px!important;justify-content:center!important}
 body.top-page .site-footer .footer-links,body.works-page .site-footer .footer-links{display:none!important}
 body.top-page .site-footer .footer-brand,body.works-page .site-footer .footer-brand{font-size:10px!important}
 body.top-page .site-footer .footer-logo-img,body.works-page .site-footer .footer-logo-img{width:25px!important;height:25px!important}
 body.top-page .site-footer .top-footer-contact,body.works-page .site-footer .top-footer-contact{display:block!important;text-align:center!important;font-size:9px!important;line-height:1.45!important}
 body.top-page .site-footer .top-footer-contact strong,body.works-page .site-footer .top-footer-contact strong{display:none!important}
 body.top-page .top-intro p{font-size:15px!important}
}

/* works 固有設定 02 */
/* TOP: typography directly on the image; no text plate. */
body.top-page .top-hero-content{
 background:transparent!important;border:0!important;box-shadow:none!important;
 border-radius:0!important;padding:24px 20px!important;
 max-width:min(94%,980px)!important;
}
body.top-page .top-hero-content p{
 color:#fff!important;text-shadow:0 2px 12px rgba(0,0,0,.48),0 1px 2px rgba(0,0,0,.38)!important;
}
/* A light, full-image veil, not a rectangular panel. */
body.top-page .top-hero-image:after{
 content:'';position:absolute;inset:0;
 background:linear-gradient(180deg,rgba(0,0,0,.18),rgba(0,0,0,.28));
 pointer-events:none;
}
body.top-page .top-hero-image{position:absolute!important;inset:0!important}
body.top-page .top-hero-image img{width:100%!important;height:100%!important;object-fit:cover!important}
body.top-page .top-profile-copy{padding-top:0!important}
@media(max-width:768px){
 body.top-page .top-hero-content{padding:16px 10px!important;max-width:100%!important}
 body.top-page .top-hero-content p{line-height:1.9!important}
}

/* works 固有設定 03 */
/* Navigation always available on both screen sizes. */
body.top-page .site-footer .footer-links,body.works-page .site-footer .footer-links{
 display:flex!important;align-items:center!important;justify-content:center!important;
 flex-wrap:wrap!important;gap:8px 18px!important;
}
body.top-page .site-footer .footer-links a,body.works-page .site-footer .footer-links a{
 display:inline-block!important;white-space:nowrap!important;font-size:clamp(11px,1.1vw,13px)!important;
}
body.top-page,body.works-page{padding-bottom:160px!important}
@media(max-width:768px){
 body.top-page .site-footer,body.works-page .site-footer{gap:5px 8px!important;padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important}
 body.top-page .site-footer .footer-links,body.works-page .site-footer .footer-links{display:flex!important;order:0;width:100%;gap:5px 14px!important}
 body.top-page .site-footer .footer-brand,body.works-page .site-footer .footer-brand{order:1}
 body.top-page .site-footer .top-footer-contact,body.works-page .site-footer .top-footer-contact{order:2;padding-top:4px!important}
 body.top-page .site-footer small,body.works-page .site-footer small{display:none!important}
 body.top-page,body.works-page{padding-bottom:170px!important}
}
/* Keep WORKS tabs above the entries, with the same desktop/mobile styling. */
body.works-page .works-tab-nav{z-index:950!important}
body.works-page .works-tab-nav.is-fixed-tabs{
 position:fixed!important;top:0!important;left:var(--tabs-left,0px)!important;
 width:var(--tabs-width,100%)!important;box-sizing:border-box!important;
 margin:0!important;z-index:950!important;
}
body.works-page .works-tab-placeholder{display:none;height:0}
body.works-page .works-tab-placeholder.is-active{display:block}

/* works 固有設定 04 / header-fixed-corrected */
/* Corrected: navigation stays at TOP, footer stays in document flow. */
:root{--fixed-header-height:94px}
html{scroll-padding-top:calc(var(--fixed-header-height) + 18px)!important;scroll-padding-bottom:0!important}
body.works-page,body.top-page{padding-top:var(--fixed-header-height)!important;padding-bottom:0!important}
body.works-page > header.site-header,body.top-page > header.site-header{
 position:fixed!important;top:0!important;left:0!important;right:0!important;width:100%!important;
 z-index:2000!important;box-sizing:border-box!important;background:#fff!important;
}
body.works-page > footer.site-footer,body.top-page > footer.site-footer{
 position:relative!important;inset:auto!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;
 transform:none!important;translate:none!important;width:100%!important;z-index:auto!important;
 box-shadow:none!important;
}
body.works-page .works-tab-nav.is-fixed-tabs{
 top:var(--fixed-header-height)!important;z-index:1900!important;
}
body.works-page .works-tab-nav{scroll-margin-top:calc(var(--fixed-header-height) + 12px)}
@media(max-width:768px){
 body.works-page,body.top-page{padding-bottom:0!important}
 body.works-page > footer.site-footer .footer-brand,body.top-page > footer.site-footer .footer-brand,
 body.works-page > footer.site-footer .top-footer-contact,body.top-page > footer.site-footer .top-footer-contact,
 body.works-page > footer.site-footer small,body.top-page > footer.site-footer small{display:initial!important}
}

/* works 固有設定 05 / works-illustration-scale-and-stable-category-numbers */
/* Scale down the WORKS introduction illustration without cropping it. */
body.works-page .works-original-hero{width:90%!important;max-width:960px!important;margin-left:auto!important;margin-right:auto!important;}
body.works-page .works-original-hero-title{font-size:clamp(13px,3.25vw,46px)!important;}
/* Keep the smaller 4:3 project photographs consistent. */
body.works-page .works-category-section .works-entry.has-photo .work-photo-slot[data-photo],
body.works-page .works-category-section .works-group-photos.has-photo .work-photo-slot[data-photo]{width:190px!important;}
/* Explicit stable category numbers, independent of filtering and hidden sections. */
body.works-page .works-category-section[data-category="ceremony"] .works-category-heading::before{content:"01"!important;}
body.works-page .works-category-section[data-category="expo"] .works-category-heading::before{content:"02"!important;}
body.works-page .works-category-section[data-category="public"] .works-category-heading::before{content:"03"!important;}
body.works-page .works-category-section[data-category="video"] .works-category-heading::before{content:"04"!important;}
@media(max-width:768px){
 body.works-page .works-original-hero{width:94%!important;}
 body.works-page .works-original-hero-title{font-size:clamp(10px,3.7vw,27px)!important;}
 body.works-page .works-category-section .works-entry.has-photo .work-photo-slot[data-photo],
 body.works-page .works-category-section .works-group-photos.has-photo .work-photo-slot[data-photo]{width:min(190px,100%)!important;}
}

/* works 固有設定 06 / smooth-scroll-preserved */
html{scroll-behavior:smooth!important;}
body.top-page #about,body.top-page #service{scroll-margin-top:calc(var(--fixed-header-height,94px) + 18px)}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}

/* works 固有設定 07 / consistent-left-alignment-20261113 */
/* Restore the natural text start: no additional 3em indent. */
body.top-page .top-intro .top-container > p,
body.top-page .top-profile-copy,
body.top-page .top-services .top-section-title {padding-left:0!important;text-align:left!important;}
body.works-page .works-intro-copy,
body.works-page .works-category-heading,
body.works-page .works-subheading,
body.works-page .works-entry-text,
body.works-page .works-more-note,
body.works-page .works-credit-expo {padding-left:0!important;text-align:left!important;}
/* Category numbers (01–05) and labels share the same left edge. */
body.works-page .works-category-heading {justify-content:flex-start!important;margin-left:0!important;}
/* Mobile: retain an even outer gutter, not a separate text-only indent. */
@media(max-width:700px){
 body.works-page .works-list-new {padding-left:6%!important;padding-right:6%!important;}
 body.works-page .works-intro-new {padding-left:6%!important;padding-right:6%!important;}
 body.works-page .works-category-heading,
 body.works-page .works-subheading,
 body.works-page .works-entry-text {text-align:left!important;}
}

/* works 固有設定 08 / mobile-readable-wrap-20261113 */
/* Keep the same text start for photographed and unphotographed project rows. */
body.works-page .works-category-section .works-entry .works-entry-text {min-width:0;text-align:left!important;}
body.works-page .works-category-section .works-entry .works-entry-title {text-align:left!important;margin-left:0!important;}
@media(max-width:768px){
 body.works-page .works-category-section[data-category="ceremony"] .works-entry.has-photo .works-entry-text {width:100%!important;align-self:stretch!important;justify-self:start!important;margin-left:0!important;padding-left:0!important;}
 body.works-page .works-category-section[data-category="ceremony"] .works-entry.has-photo .works-entry-title {width:100%!important;text-align:left!important;margin-left:0!important;padding-left:19px!important;box-sizing:border-box!important;}
 body.works-page .works-credit-inline {display:inline-block!important;white-space:nowrap!important;vertical-align:baseline;}
 body.top-page .top-intro .philosophy-frame p,body.top-page .top-profile-role,
 body.works-page .works-entry-title,body.works-page .works-subheading {overflow-wrap:anywhere;word-break:normal;}
}

/* works 固有設定 09 / works-title-logo-center-final */
/* Center the WORKS title beneath the lettering inside the original illustration.
   Move down another 0.7em while retaining horizontal centering. */
body.works-page .works-original-hero-title{
  left:50.5%!important;
  transform:translate(-50%, calc(-50% - 0.3em))!important;
  text-align:center!important;
}
@media(max-width:768px){
  body.works-page .works-original-hero-title{
    left:50.5%!important;
    transform:translate(-50%, calc(-50% - 0.3em))!important;
  }
}

/* works 固有設定 10 / works-hero-title-white-shadow */
/* Subtle white halo behind the illustration headline, without changing its position. */
body.works-page .works-original-hero-title{
  text-shadow: 0 0 3px rgba(255,255,255,.98),
               0 0 8px rgba(255,255,255,.88),
               0 0 15px rgba(255,255,255,.65)!important;
}


/* 2026-11-16: Footer contact alignment fix.
   This file is loaded AFTER common.css; override legacy footer rules here. */
body.works-page > footer.site-footer.site-footer--organized {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  gap: 0 !important;
  padding: 48px 6% 80px !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-brand {
  display: flex !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  order: 0 !important;
  justify-self: stretch !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .65fr) !important;
  gap: 36px !important;
  width: 100% !important;
  margin: 28px 0 0 !important;
  padding: 26px 0 30px !important;
  border-top: 1px solid #e1e5e8 !important;
  border-bottom: 1px solid #e1e5e8 !important;
  box-sizing: border-box !important;
  order: 1 !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout > .top-footer-contact {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  justify-self: start !important;
  align-self: start !important;
  gap: 0 !important;
  order: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  text-align: left !important;
  color: #e2e8e7 !important;
  line-height: normal !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout > .top-footer-contact::before,
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout > .top-footer-contact::after {
  content: none !important;
  display: none !important;
}
body.works-page > footer.site-footer.site-footer--organized .top-footer-contact > strong {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1.75 !important;
  font-weight: 600 !important;
  text-align: left !important;
  color: #e2e8e7 !important;
}
body.works-page > footer.site-footer.site-footer--organized .top-footer-contact > .footer-contact-details {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  gap: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}
body.works-page > footer.site-footer.site-footer--organized .footer-contact-details > div {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.75 !important;
  text-align: left !important;
  text-indent: 0 !important;
  color: #e2e8e7 !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout > .footer-links {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 13px !important;
  order: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
body.works-page > footer.site-footer.site-footer--organized > .footer-copyright {
  display: block !important;
  order: 2 !important;
  margin: 0 !important;
  padding: 22px 0 0 !important;
  border-top: 0 !important;
  width: 100% !important;
}
@media (max-width: 640px) {
  body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 25px !important;
  }
  body.works-page > footer.site-footer.site-footer--organized .footer-contact-details > div {
    font-size: 15px !important;
  }
}

/* iPad縦向き専用の改行 */
body.works-page .ipad-portrait-break {
  display: none !important;
}

@media screen and (min-width: 700px) and (max-width: 900px) and (orientation: portrait) {
  body.works-page .ipad-portrait-break {
    display: inline !important;
  }
}

/* iPad縦向き：最後の文章の折り返し調整 */
@media screen and (min-width: 700px) and (max-width: 900px) and (orientation: portrait) {
  body.works-page .works-closing p {
    font-size: 15px !important;
  }
}


/* 第31回国民文化祭：デスクトップのみ、写真2枚の横並びを維持して文字を調整 */
@media screen and (min-width: 901px) {
  body.works-page .works-category-section .works-entry.bunkasai-layout .works-entry-title {
    font-size: 14px !important;
    letter-spacing: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

/* 長良川うかいミュージアム：Macのブラウザ表示のみ */
@media screen and (min-width: 901px) {
  body.works-page .nagaragawa-caption {
    font-size: 11px !important;
    letter-spacing: -0.3px !important;
    white-space: nowrap !important;
  }
}

/* WORKS：Macのみ写真全体を見せる */
@media screen and (min-width: 901px) {
  body.works-page .works-category-section
  .work-photo-slot[data-photo] > img {
    object-fit: contain !important;
  }
}
/* WORKS photos: show the entire image on desktop, iPad, and smartphone.
   Keep the existing frame sizes and the photo/text layout unchanged. */
body.works-page .works-category-section .work-photo-slot[data-photo] > img {
  object-fit: contain !important;
  object-position: center center !important;
}


/* WORKS only — consolidated photo galleries, 2026-11 */
body.works-page .works-entry {grid-template-columns:minmax(0,1fr)!important;}
body.works-page .works-photo-final {
  display:flex!important;flex-wrap:wrap;justify-content:flex-end;align-items:flex-start;
  gap:12px!important;width:100%;margin:0 0 0 auto;padding:18px 0 18px;
  border-bottom:1px solid #e0e4df;
}
body.works-page .works-photo-final .work-photo-slot {
  display:block!important;flex:0 1 190px;min-width:0;width:190px!important;max-width:190px!important;
  overflow:visible!important;
}
body.works-page .works-photo-final .work-photo-slot img {
  display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:contain!important;
}
body.works-page .works-photo-final .work-photo-caption {
  max-width:100%;overflow-wrap:anywhere;
}
/* The last entry already supplies the separator ABOVE the photographs. */
body.works-page .works-more-with-photos {
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  border-bottom:1px solid #e0e4df;margin-top:22px;padding-bottom:18px;
}
body.works-page .works-more-with-photos > .works-more-note {
  flex:0 0 auto;margin:0!important;padding-top:4px;
}
body.works-page .works-more-with-photos > .works-photo-final {
  flex:1 1 auto;width:auto!important;min-width:0;margin:0!important;padding:0!important;border:0!important;
}
/* Keep the original caption and image dimensions, but allow a 4-photo row. */
@media(max-width:900px){
 body.works-page .works-photo-final {gap:10px!important;}
 body.works-page .works-photo-final .work-photo-slot {flex-basis:clamp(110px,22vw,190px);width:clamp(110px,22vw,190px)!important;max-width:190px!important;}
}
@media(max-width:600px){
 body.works-page .works-photo-final .work-photo-slot {flex:0 1 calc((100% - 10px)/2);width:calc((100% - 10px)/2)!important;max-width:190px!important;}
 body.works-page .works-more-with-photos {gap:10px;}
 body.works-page .works-more-with-photos > .works-more-note {flex:0 0 30px;}
 body.works-page .works-more-with-photos > .works-photo-final .work-photo-slot {flex:0 1 calc((100% - 10px)/2);width:calc((100% - 10px)/2)!important;}
}
/* Shorter closing panel and larger message. */
body.works-page .works-closing {padding-top:30px!important;padding-bottom:30px!important;}
body.works-page .works-closing p {font-size:clamp(20px,2.05vw,27px)!important;line-height:1.8!important;}
@media(max-width:768px){
 body.works-page .works-closing {padding-top:22px!important;padding-bottom:22px!important;}
 body.works-page .works-closing p {font-size:clamp(18px,4.1vw,23px)!important;line-height:1.75!important;}
}
/* Footer after removing the brand block; do not touch TOP. */
body.works-page > footer.site-footer.site-footer--organized {padding-top:28px!important;}
body.works-page > footer.site-footer.site-footer--organized > .footer-info-layout {margin-top:0!important;}
body.works-page .mobile-address-break {display:none;}
@media screen and (max-width:1024px){body.works-page .mobile-address-break {display:inline;}}


/* 2026-11 WORKS gallery refinement v2 */
/* A single divider BETWEEN the last project and its gallery, not below the gallery. */
body.works-page .works-subgroup > .works-photo-final {
  border-top:1px solid #e0e4df!important;
  border-bottom:0!important;
  margin-top:0!important;
  padding-top:18px!important;
  padding-bottom:18px!important;
}
/* Avoid double divider where the last entry already has a bottom border. */
body.works-page .works-subgroup > .works-entry:has(+ .works-photo-final) {
  border-bottom:0!important;
}
/* Four pictures must remain in a single row on desktop, with narrow gaps. */
@media (min-width:901px) {
  body.works-page .works-photo-final {gap:4px!important;flex-wrap:nowrap!important;}
  body.works-page .works-photo-final .work-photo-slot {
    flex:0 1 190px!important;
    width:min(190px,calc((100% - 12px)/4))!important;
    min-width:0!important;
  }
  body.works-page .works-more-with-photos > .works-photo-final {
    justify-content:flex-end!important;
  }
  body.works-page .works-category-section[data-category="expo"] .expo-anniversary-title {
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    font-size:clamp(11px,1.15vw,16px)!important;
    letter-spacing:-.035em!important;
  }
}
/* On tablets and phones, retain legible photos and permit wrapping as needed. */
@media (max-width:900px) {
  body.works-page .works-photo-final {gap:5px!important;}
}

/* WORKS v3: 2016 cultural festival heading stays on one line on Mac. */
@media screen and (min-width:901px) {
  body.works-page .works-category-section .works-entry .works-entry-title.bunkasai-2016-title {
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    font-size:clamp(10px,1.05vw,14px)!important;
    letter-spacing:-.04em!important;
  }
}


/* WORKS v4: reduce every project title with a leading square marker by exactly 1pt.
   The "ほか" notes, headings, descriptions and photo captions are unchanged. */
body.works-page .works-category-section .works-entry .works-entry-title {
  font-size:calc(clamp(16px, 1.55vw, 20px) - 1pt)!important;
}
@media (max-width:768px) {
  body.works-page .works-category-section .works-entry .works-entry-title {
    font-size:calc(16px - 1pt)!important;
  }
}
/* Preserve the special one-line desktop headings, each also reduced by 1pt. */
@media (min-width:901px) {
  body.works-page .works-category-section[data-category="expo"] .works-entry .works-entry-title.expo-anniversary-title {
    font-size: clamp(14px, 1.4vw, 18px) !important;
  }
  body.works-page .works-category-section .works-entry .works-entry-title.bunkasai-2016-title {
    font-size:calc(clamp(10px, 1.05vw, 14px) - 1pt)!important;
  }
}


/* WORKS v5: keep the 'ほか' label visible in the video/public galleries. */
body.works-page .works-category-section .works-more-with-photos > .works-more-note {
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  transform:none!important;
  position:relative!important;
  flex:0 0 auto!important;
  white-space:nowrap!important;
}

/* Prevent a single photograph from expanding to full gallery width.
   Target data-photo explicitly to override shared common.css photo rules. */
body.works-page .works-category-section .works-photo-final > .work-photo-slot[data-photo] {
  flex:0 1 190px!important;
  width:190px!important;
  max-width:190px!important;
  min-width:0!important;
}
body.works-page .works-category-section .works-photo-final[data-photo-count="1"] > .work-photo-slot[data-photo] {
  flex:0 0 min(190px,100%)!important;
  width:min(190px,100%)!important;
  max-width:190px!important;
}
@media (min-width:901px) {
  body.works-page .works-category-section .works-photo-final[data-photo-count="4"] > .work-photo-slot[data-photo] {
    flex:0 1 min(190px,calc((100% - 12px)/4))!important;
    width:min(190px,calc((100% - 12px)/4))!important;
    max-width:190px!important;
  }
}
@media (max-width:600px) {
  body.works-page .works-category-section .works-photo-final[data-photo-count="4"] > .work-photo-slot[data-photo] {
    flex:0 1 calc((100% - 5px)/2)!important;
    width:calc((100% - 5px)/2)!important;
    max-width:190px!important;
  }
}

/* WORKS v6: one consistent photo frame for all 13 gallery images. */
body.works-page .works-category-section .works-photo-final {
  --works-photo-size: 190px;
  gap: 4px !important;
  align-items: flex-start !important;
}
body.works-page .works-category-section .works-photo-final > .work-photo-slot[data-photo] {
  box-sizing: border-box !important;
  flex: 0 0 var(--works-photo-size) !important;
  width: var(--works-photo-size) !important;
  min-width: 0 !important;
  max-width: var(--works-photo-size) !important;
}
body.works-page .works-category-section .works-photo-final > .work-photo-slot[data-photo] > img {
  display: block !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: contain !important;
  object-position: center center !important;
}
/* Four-image galleries shrink all four frames equally when space is limited. */
body.works-page .works-category-section .works-photo-final[data-photo-count="4"] {
  --works-photo-size: min(190px, (100% - 12px) / 4);
}
@media (min-width: 601px) {
  body.works-page .works-category-section .works-photo-final[data-photo-count="4"] {
    flex-wrap: nowrap !important;
  }
}
@media (max-width: 600px) {
  body.works-page .works-category-section .works-photo-final {
    --works-photo-size: min(190px, (100% - 4px) / 2);
    flex-wrap: wrap !important;
  }
  body.works-page .works-category-section .works-photo-final[data-photo-count="4"] {
    --works-photo-size: min(190px, (100% - 4px) / 2);
    flex-wrap: wrap !important;
  }
}

/* v7: Fill the same 4:3 frame uniformly instead of letterboxing portrait/wide images. */
body.works-page .works-category-section .works-photo-final > .work-photo-slot[data-photo] > img {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* v8: repair the Expo 10th/20th project divider and desktop line break.
   The HTML nesting is corrected in works.html; retain the existing photo rules. */
body.works-page .works-category-section[data-category="expo"] .works-subgroup .works-entry {
  border-bottom: 1px solid #e0e4df !important;
}
body.works-page .works-category-section[data-category="expo"] .works-subgroup > .works-entry:has(+ .works-photo-final) {
  border-bottom: 0 !important;
}
@media screen and (min-width: 901px) {
  body.works-page .works-category-section[data-category="expo"] .aichi-expo-break {
    display: none !important;
  }
  body.works-page .works-category-section[data-category="expo"] .works-entry-title.expo-anniversary-title {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: clamp(14px, 1.4vw, 18px) !important;
    letter-spacing: -.035em !important;
  }
}

/* v9: 第31回国民文化祭の文字サイズをほかの実績と統一。
   デスクトップでも／の手前で改行し、1行固定を解除します。 */
@media screen and (min-width: 901px) {
  body.works-page .works-category-section .works-entry .works-entry-title.bunkasai-2016-title {
    font-size: calc(clamp(16px, 1.55vw, 20px) - 1pt) !important;
    letter-spacing: normal !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
  body.works-page .bunkasai-2016-title .ipad-portrait-break {
    display: inline !important;
  }
}


/* v10: Smartphone only — first WORKS category tab spans both columns.
   Preserve the remaining four tabs in a 2 x 2 grid; no change to iPad/desktop. */
@media screen and (max-width: 600px) {
  body.works-page .works-tab-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 16px !important;
  }
  body.works-page .works-tab-nav > .works-filter:first-child {
    grid-column: 1 / -1 !important;
  }
  body.works-page .works-tab-nav > .works-filter {
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* v11: Keep the complete WORKS category navigation visible below the actual
   fixed header on desktop, iPad and iPhone while the list is being scrolled. */
body.works-page .works-tab-nav.is-fixed-tabs {
  top: var(--works-tabs-top, var(--fixed-header-height, 94px)) !important;
  left: var(--tabs-left, 0px) !important;
  width: var(--tabs-width, 100%) !important;
  max-height: calc(100dvh - var(--works-tabs-top, 94px) - 8px) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-sizing: border-box !important;
  z-index: 1900 !important;
}
body.works-page .works-tab-placeholder.is-active {
  display: block !important;
}

/* v12: The fixed navigation uses an in-flow anchor; do not clip its rows. */
body.works-page .works-tab-placeholder.is-active { display:block !important; }
body.works-page .works-tab-nav.is-fixed-tabs {
  position: fixed !important;
  top: var(--works-tabs-top, 94px) !important;
  left: var(--tabs-left, 0px) !important;
  width: var(--tabs-width, 100%) !important;
  margin: 0 !important;
  z-index: 1900 !important;
}

/* v13: Pin the actual WORKS category filter buttons below the header. */
body.works-page .works-tab-nav.is-fixed-tabs {
  position: fixed !important;
  top: var(--works-tabs-top, 94px) !important;
  left: var(--tabs-left, 0px) !important;
  width: var(--tabs-width, 100%) !important;
  margin: 0 !important;
  z-index: 1990 !important;
  max-height: calc(100dvh - var(--works-tabs-top, 94px) - 4px) !important;
  overflow-y: auto !important;
  background: #fff !important;
}
body.works-page .works-tab-placeholder {display:block !important; height:0;}


/* v14: Keep all five WORKS category buttons visible below the fixed header.
   CSS-only sticky positioning: independent of works-04.js. */
body.works-page .works-list-new {
  overflow: visible !important;
}
body.works-page .works-tab-nav {
  position: sticky !important;
  top: var(--fixed-header-height, 94px) !important;
  left: auto !important;
  width: auto !important;
  z-index: 1900 !important;
  max-height: none !important;
  overflow: visible !important;
  background: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* Preserve the 1 + 2 + 2 smartphone grid while showing every row. */
@media screen and (max-width: 600px) {
  body.works-page .works-tab-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 16px !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.works-page .works-tab-nav > .works-filter:first-child {
    grid-column: 1 / -1 !important;
  }
}


/* v16 diagnostic: remove the animated selection panel only.
   Preserve tab dimensions, sticky position, category layout, and all WORKS content. */
body.works-page .works-tab-nav > .works-filter::after,
body.works-page .works-tab-nav > .works-filter.is-active::after {
  transition: none !important;
  transform: none !important;
}
body.works-page .works-tab-nav > .works-filter {
  transition: none !important;
}

/* 愛・地球博20周年：広いPC画面だけタイトルを大きくする */
@media screen and (min-width: 1200px) {
  body.works-page .works-category-section
  .works-entry .works-entry-title.expo-anniversary-title {
    font-size: 18px !important;
  }
}