@import url("../styles/company-typography.css");

/* Retain the original IMD layout while making its content editable. */
#loader { display: none !important; }
section#top { height: 100dvh; min-height: 480px; }
section#top #top-logo-right { z-index: 2; opacity: 1 !important; }
section#top #swiper-container-top { height: 100%; }
section#message, section#selecter-pc, section#selecter-sp, section#projects .projects-item { opacity: 1 !important; }
#swiper-container-top .swiper-slide, .projects-item-img { background-image: none !important; overflow: hidden; }
.imd-background-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
section#projects .projects-item #projects-photo-niigata-award { height: clamp(220px,31.25vw,600px); }
#projects-photo-niigata-award .imd-background-photo { object-position: 50% 55%; }
/* Perspective is baked into this asset, including the editing preview. */
section#projects .projects-item #projects-item-5.kenpoku-perspective-corrected {
  position: relative;
  height: clamp(220px, 31.25vw, 600px);
}
#projects-item-5.kenpoku-perspective-corrected .imd-background-photo {
  width: 100%;
  height: 100%;
  object-position: 50% 60%;
}
section#projects .projects-item .wrap a.jp > .imd-project-title,
section#projects .projects-item .wrap a.jp > [data-company-paragraph] { font: inherit; letter-spacing: inherit; padding: 0; }
.imd-section-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px 32px; padding: 28px 5%; background: #fff; font-size: 16px; }
.imd-section-links a { color: #222; text-decoration: none; line-height: 1.8; }
.imd-section-links a:hover { text-decoration: underline; text-underline-offset: 5px; }
.imd-section-links > [data-company-paragraph] { display: contents; }
.imd-services, .imd-project-updates { padding: 64px 0; color: #222; background: #fff; }
.imd-project-updates { background: #f5f4ef; }
.imd-services h2, .imd-project-updates h2 { font-size: 34px; font-weight: 400; margin: 0 0 28px; }
.imd-services .jp, .imd-project-updates .jp { font-size: 17px; line-height: 2.2; }
.imd-services-copy { max-width: 860px; margin: 32px 0; }
.imd-services-copy section { height: auto; padding: 0; margin: 0; }
.imd-services-copy .grey { color: #707070; }
.imd-services-copy ul { padding-left: 1.3em; list-style: disc; }
.imd-contact-link a, .imd-history-link a { color: #333; text-decoration: underline; text-underline-offset: 6px; }
.imd-project-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 32px 56px; }
.imd-project-grid article { border-top: 1px solid #ccc; padding-top: 24px; }
.imd-project-grid h3 { font-size: 25px; font-weight: 400; margin: 0 0 14px; }
#accordion-pc-profile p.jp, #accordion-sp-profile p.jp { margin-bottom: 28px; }
#accordion-pc-position table td, #accordion-sp-position table td { vertical-align: top; line-height: 2; padding: 8px 0; }
#accordion-pc-position table td:first-child, #accordion-sp-position table td:first-child { min-width: 120px; padding-right: 28px; }
body:has([data-company-edit]) :is(#accordion-pc-profile,#accordion-pc-position,#accordion-pc-publications,#accordion-sp-profile,#accordion-sp-position,#accordion-sp-publications) { height: auto !important; }
body:has([data-company-edit]) .swiper-wrapper { transform: none !important; }
@media (max-width: 767px) {
  section#top { height: 100dvh; min-height: 400px; }
  .imd-section-links { justify-content: flex-start; gap: 14px 24px; font-size: 14px; }
  .imd-services, .imd-project-updates { padding: 42px 0; }
  .imd-services h2, .imd-project-updates h2 { font-size: 27px; }
  .imd-services .jp, .imd-project-updates .jp { font-size: 16px; }
  .imd-project-grid { grid-template-columns: 1fr; gap: 28px; }
  .imd-project-grid h3 { font-size: 23px; }
}

/* Override the old 10–14px type throughout the reading content. */
body#lng-ja {
  font-family: var(--company-serif);
  -webkit-font-smoothing: antialiased;
}
body#lng-ja #imd-content :is(#message, #services, #new-projects, #accordion-pc, #selecter-sp, #projects) :is(p, li, td, th),
body#lng-ja #imd-content #services .imd-services-copy,
body#lng-ja #imd-content #message :is(#message-l, #contact-sp) a {
  font: 400 var(--company-body-size)/var(--company-body-leading) var(--company-serif);
  letter-spacing: var(--company-body-tracking);
  font-feature-settings: normal;
}
body#lng-ja #imd-content :is(#message, #services, #new-projects, #accordion-pc, #selecter-sp, #projects) :is(p, li, td, th) :is(span, a, strong, em, small) {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  font-feature-settings: inherit;
}
body#lng-ja #imd-content :is(#accordion-pc-position, #accordion-sp-position) table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
body#lng-ja #imd-content :is(#accordion-pc-position, #accordion-sp-position) td {
  overflow-wrap: anywhere;
}
body#lng-ja #imd-content :is(#accordion-pc-position, #accordion-sp-position) td:first-child {
  width: 8em;
  min-width: 0;
  padding-right: 1em;
}
@media (max-width: 760px) {
  body#lng-ja #imd-content :is(#accordion-pc-position, #accordion-sp-position) td:first-child { width: 6em; }
}

[data-imd-project] { scroll-margin-top: 90px; }

/* Let the message and signature finish before the next section begins. */
section#message { padding-bottom: 120px; box-sizing: border-box; }
@media (max-width:767px) { section#message { padding-bottom: 60px; } }

/* Keep every project photo and text group in a consistent, non-collapsing flow. */
section#projects .projects-item { display: flow-root; height: auto !important; }
section#projects .projects-item > .wrap {
  height: auto !important; min-height: 0 !important;
  margin-top: 0 !important; margin-bottom: 0 !important;
  padding-top: 80px; padding-bottom: 64px; box-sizing: border-box;
}
section#projects .projects-item > .wrap > a.jp { display: block; line-height: 1.65; }
section#projects .projects-item > .wrap > p.jp { margin: 24px 0 0; }
section#projects .projects-item > .wrap > .deg { top: 80px; }
section#projects .projects-item > a { display: block; line-height: 0; }
@media(max-width:767px) {
  section#projects .projects-item > .wrap { padding-top: 40px; padding-bottom: 32px; }
  section#projects .projects-item > .wrap > p.jp { margin-top: 18px; }
  section#projects .projects-item > .wrap > .deg { top: 40px; }
}

/* Legacy photo reveal translations must not overlap the following project. */
section#projects .projects-item .projects-item-img { transform: none !important; transition: none !important; animation: none !important; }

/* Give the IWASA footer room and let its content determine its height. */
body.iwasa-standalone > footer {
  height: auto; min-height: 0; padding: 80px 0 88px; box-sizing: border-box;
}
body.iwasa-standalone > footer > .wrap {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) 44px;
  column-gap: 48px; align-items: start; height: auto; top: auto;
}
body.iwasa-standalone > footer > .wrap > span {
  position: static; top: auto; left: auto; line-height: 2;
}
body.iwasa-standalone > footer > .wrap > div {
  position: static; top: auto; left: auto; min-width: 0; line-height: 2;
}
body.iwasa-standalone > footer > .wrap > div a {
  font-size: inherit; line-height: inherit;
}
body.iwasa-standalone > footer > .wrap > img {
  position: static; top: auto; right: auto; justify-self: end; margin-top: 4px;
}
@media (max-width: 767px) {
  body.iwasa-standalone > footer { padding: 56px 0 60px; }
  body.iwasa-standalone > footer > .wrap {
    width: calc(100% - 50px);
    grid-template-columns: minmax(0, 1fr) 32px; column-gap: 24px; row-gap: 18px;
  }
  body.iwasa-standalone > footer > .wrap > span { grid-column: 1; grid-row: 1; }
  body.iwasa-standalone > footer > .wrap > div { grid-column: 1; grid-row: 2; line-height: 2.4; }
  body.iwasa-standalone > footer > .wrap > img { grid-column: 2; grid-row: 1; }
}
