/*
Theme Name: Atelier Hatch
Theme URI: https://atelier-hatch.com/
Author: Atelier Hatch LLC.
Description: アトリエ・ハッチ合同会社の公式ホームページ専用テーマ
Version: 2.3.8
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: atelier-hatch
*/

/* WordPress管理バー表示中も固定ヘッダーが重ならないようにする */
.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* ログイン中の編集リンクなど、WordPress固有要素の最低限の体裁 */
.basic-page {
  width: min(100% - 44px, 960px);
  min-height: 70vh;
  margin: 0 auto;
  padding: 140px 0 80px;
}

.basic-page h1 {
  margin: 0 0 32px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: clamp(32px, 5vw, 56px);
}

/* OUR WORKS見出しの最終調整 */
.works-opening h2 {
  transform: translateX(clamp(-42px, -2.7vw, -22px));
}

.works-opening h2 span:last-child {
  font-size: 1.1em;
  line-height: 1.24;
}

@media screen and (max-width: 640px) {
  .works-opening h2 {
    transform: translateX(-10px);
  }
}

/* Responsive final pass — phones and touch devices */
html {
  width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  overflow-x: clip;
}

.site-shell,
.recruit-page {
  width: 100%;
  max-width: 100%;
}

.company-meta,
.footer,
.recruit-link-panel,
.contact,
.works-chapter-header,
.works-past-copy,
.works-focus-copy {
  overflow-wrap: anywhere;
}

@media (hover: none), (pointer: coarse) {
  .works-past-media {
    overflow: visible;
    aspect-ratio: auto;
    background: transparent;
  }

  .works-past-media > .works-past-image {
    aspect-ratio: 3 / 2;
    height: auto;
  }

  .works-past-overlay {
    position: static;
    padding: 18px 20px;
    border: 1px solid #dde0dc;
    border-top: 0;
    background: #fff;
    opacity: 1;
    transform: none;
  }

  .works-past-card:is(:hover, :focus, :focus-within) .works-past-image {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .works-past-copy > span {
    display: none;
  }
}

@media (max-width: 900px) {
  :target {
    scroll-margin-top: calc(76px + env(safe-area-inset-top));
  }

  .site-header {
    height: calc(64px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .desktop-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .brand {
    width: min(190px, 56vw);
  }

  .mobile-nav summary {
    display: flex;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: flex-end;
    margin-right: -4px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav nav {
    top: calc(64px + env(safe-area-inset-top));
    max-height: calc(100svh - 64px - env(safe-area-inset-top));
    gap: 0;
    overflow-y: auto;
    padding: 10px max(20px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  .mobile-nav nav a {
    display: flex;
    min-height: 48px;
    align-items: center;
    border-bottom: 1px solid rgb(23 23 23 / 8%);
  }

  .mobile-nav nav a:last-child {
    border-bottom: 0;
  }

  .page-panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
    padding-top: calc(92px + env(safe-area-inset-top));
    padding-bottom: max(42px, env(safe-area-inset-bottom));
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero h1 {
    font-size: clamp(32px, 9.4vw, 44px);
    line-height: 1.46;
    line-break: strict;
  }

  .hero-lead {
    max-width: 38em;
    font-size: 14px;
    line-height: 1.9;
  }

  .hero-services {
    row-gap: 10px;
    font-size: 9px;
  }

  .hero-visual {
    width: calc(100% + 40px);
    height: clamp(260px, 43svh, 410px);
    min-height: 0;
    margin-right: -20px;
    margin-left: -20px;
  }

  .hero-image-window {
    inset: 0 -8% 0 2%;
  }

  .hero-image-window img {
    width: 132%;
  }

  .visual-caption {
    right: 12px;
    bottom: 6%;
  }

  .scroll-cue {
    display: none;
  }

  .profile {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: calc(94px + env(safe-area-inset-top));
  }

  .section-index {
    top: calc(76px + env(safe-area-inset-top));
    right: 20px;
  }

  .profile-photo-wrap {
    position: relative;
    top: auto;
    width: min(92%, 480px);
  }

  .profile h2 {
    font-size: clamp(31px, 8.8vw, 43px);
    line-height: 1.44;
  }

  .profile .name-lockup {
    margin-top: 24px;
    padding-top: 19px;
  }

  .name-line {
    gap: 5px 12px;
  }

  .profile .name-line h3 {
    font-size: 27px;
  }

  .profile-credentials,
  .profile-bio p,
  .profile-bio .profile-bio-lead {
    font-size: 13px;
  }

  .works {
    padding-top: calc(82px + env(safe-area-inset-top));
  }

  .works-opening {
    display: grid;
    gap: 18px;
    align-items: start;
    padding: 30px 0 48px;
  }

  .works-label {
    margin: 0;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .works-opening h2 {
    font-size: clamp(34px, 8vw, 48px);
    line-height: 1.44;
    transform: none;
  }

  .works-opening h2 span:last-child {
    margin-left: 0;
  }

  .works-chapter {
    margin-right: -20px;
    margin-left: -20px;
    padding: 52px 20px 62px;
  }

  .works-chapter-header > p {
    font-size: 14px;
    line-height: 1.95;
  }

  .works-chapter-header,
  .works-future .works-chapter-header {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .works-future .works-chapter-title h4 {
    white-space: normal;
  }

  .works-past-grid,
  .works-focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .works-past-card:last-child,
  .works-focus-card:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 9px);
  }

  .works-past-copy,
  .works-focus-copy {
    padding-right: 20px;
    padding-left: 20px;
  }

  .works-past-copy h4,
  .works-focus-copy h4 {
    font-size: clamp(21px, 4.8vw, 25px);
  }

  .contact {
    grid-template-columns: 1fr;
    margin-right: -20px;
    margin-left: -20px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(42px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .contact-button,
  .recruit-link-button {
    min-height: 56px;
    touch-action: manipulation;
  }

  .recruit-link-panel {
    grid-template-columns: 1fr;
    margin-right: -20px;
    margin-left: -20px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .footer.footer-detailed {
    grid-template-columns: 1fr;
    margin-right: -20px;
    margin-left: -20px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(34px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .footer.footer-detailed > img {
    width: min(250px, 78vw);
  }
}

@media (max-width: 640px) {
  .works-opening h2 {
    font-size: clamp(29px, 8.45vw, 38px);
  }

  .works-past-grid,
  .works-focus-grid {
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .works-past-media > .works-past-image {
    aspect-ratio: 3 / 2;
    height: auto;
  }

  .works-past-card:last-child,
  .works-focus-card:last-child {
    grid-column: auto;
    width: auto;
  }

  .works-past-copy {
    min-height: 0;
    padding-bottom: 22px;
  }

  .works-past-copy > p:nth-of-type(2) {
    font-size: 12px;
  }

  .works-focus-image {
    aspect-ratio: 3 / 2;
  }

  .works-focus-copy > p:last-child {
    font-size: 13px;
  }
}

@media (max-width: 430px) {
  .site-header {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .brand {
    width: min(174px, 55vw);
  }

  .page-panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero {
    padding-top: calc(88px + env(safe-area-inset-top));
  }

  .hero h1 {
    font-size: clamp(29px, 8.65vw, 36px);
    line-height: 1.5;
    letter-spacing: -0.045em;
  }

  .hero-emphasis::after {
    height: 8px;
  }

  .hero-lead {
    font-size: 13px;
  }

  .hero-visual {
    width: calc(100% + 36px);
    height: clamp(245px, 39svh, 330px);
    margin-right: -18px;
    margin-left: -18px;
  }

  .brush-green {
    left: -72px;
  }

  .profile {
    padding-right: 18px;
    padding-left: 18px;
  }

  .profile-photo-wrap {
    width: 96%;
    padding-left: 26px;
  }

  .profile h2 {
    font-size: clamp(29px, 8.5vw, 36px);
  }

  .profile .career-history-compact .career-entry {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 19px;
  }

  .profile .career-history-compact .career-entry::before {
    left: 87px;
  }

  .profile .career-history-compact .career-entry::after {
    left: 91px;
  }

  .works-opening h2 {
    font-size: clamp(28px, 8.15vw, 35px);
  }

  .works-chapter {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .works-chapter-title h4,
  .works-future .works-chapter-title h4 {
    font-size: clamp(26px, 7.5vw, 32px);
  }

  .works-past-overlay dl > div {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
  }

  .contact,
  .recruit-link-panel,
  .footer.footer-detailed {
    margin-right: -18px;
    margin-left: -18px;
  }

  .contact h2 {
    font-size: 28px;
  }

  .recruit-link-panel h2 {
    font-size: 25px;
    line-height: 1.55;
  }

  .contact-button,
  .recruit-link-button {
    padding: 17px 18px;
    font-size: 13px;
  }

  .company-meta p,
  .company-meta a {
    line-height: 1.75;
  }
}

@media (max-width: 350px) {
  .brand {
    width: 158px;
  }

  .mobile-nav summary span {
    font-size: 8px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .works-opening h2 {
    font-size: 27px;
  }
}

/* Responsive final pass — recruitment page */
.recruit-page {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.recruit-header a,
.recruit-job-nav a,
.recruit-contact .contact-button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 800px) {
  .recruit-page .recruit-header {
    height: calc(68px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .recruit-brand {
    min-width: 0;
    width: min(205px, 60vw);
  }

  .recruit-header nav a {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: flex-end;
  }

  .recruit-title-area {
    margin-top: calc(68px + env(safe-area-inset-top));
    padding-top: 42px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
  }

  .recruit-title-lead {
    max-width: 34em;
  }

  .recruit-job-nav a {
    min-height: 62px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .recruit-opening {
    padding-top: 88px;
    margin-top: -88px;
  }

  .recruit-opening + .recruit-opening {
    padding-top: 88px;
  }

  .recruit-detail-section dd {
    overflow-wrap: anywhere;
  }

  .recruit-contact .contact-button {
    min-height: 56px;
    padding: 17px 18px;
  }

  .recruit-footer-simple {
    padding-right: max(20px, env(safe-area-inset-right));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
  }
}

@media (max-width: 480px) {
  .recruit-page .recruit-header {
    padding-right: max(14px, env(safe-area-inset-right));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .recruit-brand {
    width: min(180px, 57vw);
  }

  .recruit-brand span {
    letter-spacing: 0.14em;
  }

  .recruit-header nav {
    font-size: 9px;
  }

  .recruit-title-area {
    padding: 38px 18px 38px;
  }

  .recruit-title-area h1 {
    font-size: 32px;
  }

  .recruit-title-lead {
    font-size: 13px;
    line-height: 1.85;
  }

  .recruit-content {
    width: calc(100% - 32px);
    padding-bottom: 54px;
  }

  .recruit-job-nav {
    margin-bottom: 36px;
  }

  .recruit-job-nav a {
    gap: 12px;
    font-size: 12px;
  }

  .recruit-opening-header h2 {
    font-size: 23px;
  }

  .recruit-common {
    margin-right: -4px;
    margin-left: -4px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .recruit-detail-section dl > div {
    padding: 16px 0;
  }

  .recruit-detail-section dd {
    font-size: 12px;
    line-height: 1.85;
  }

  .recruit-contact {
    gap: 24px;
    padding: 30px 18px;
  }

  .recruit-contact h2 {
    font-size: 22px;
  }

  .recruit-contact .contact-button {
    gap: 16px;
    font-size: 12px;
  }

  .recruit-footer-simple {
    padding-right: max(16px, env(safe-area-inset-right));
    padding-left: max(16px, env(safe-area-inset-left));
  }

  .recruit-footer-simple > a {
    width: min(230px, 72vw);
  }
}

@media (max-width: 350px) {
  .recruit-brand {
    width: 160px;
  }

  .recruit-title-area h1 {
    font-size: 30px;
  }

  .recruit-content {
    width: calc(100% - 28px);
  }
}

/* スマホではタイムライン装飾をなくし、年号を欠けずに表示する */
@media (max-width: 900px) {
  .profile .career-history-compact .career-entry {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 4px;
    padding-bottom: 22px;
  }

  .profile .career-history-compact .career-period,
  .profile .career-history-compact .career-entry-body {
    grid-column: 1;
    min-width: 0;
  }

  .profile .career-history-compact .career-period { grid-row: 1; }
  .profile .career-history-compact .career-entry-body { grid-row: 2; }

  .profile .career-history-compact .career-entry::before,
  .profile .career-history-compact .career-entry::after {
    content: none !important;
    display: none !important;
  }
}

/* News and policy PDF links. Scoped to preserve existing page sections. */
.hatch-news {
  margin-top: clamp(64px, 7vw, 108px);
  padding: clamp(28px, 4vw, 48px) 0 0;
  border-top: 1px solid #cfd2ce;
  color: #1b1d1d;
  scroll-margin-top: 110px;
}
.hatch-news-heading { margin-bottom: 28px; }
.hatch-news-heading > p {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
}
.hatch-news-heading > h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.5;
}
.hatch-news-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-top: 1px solid #e2e4e0;
}
.hatch-news-item > time {
  padding-top: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.hatch-news-body { min-width: 0; }
.hatch-news-body > h3 {
  margin: 0 0 12px;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.hatch-news-body > p {
  max-width: 780px;
  margin: 0;
  font-size: 14px;
  line-height: 2;
  overflow-wrap: anywhere;
}
.hatch-policy-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  min-height: 48px;
  margin-top: 20px;
  padding: 10px 0;
  border-bottom: 1px solid currentColor;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.hatch-policy-link > span { flex-shrink: 0; font-size: 20px; }
.hatch-footer-policy a { text-decoration: underline; text-underline-offset: 3px; }
.hatch-link-note { font-size: .9em; }
.hatch-policy-link:focus-visible,
.hatch-footer-policy a:focus-visible { outline: 2px solid #1b1d1d; outline-offset: 5px; }
@media (max-width: 900px) {
  .hatch-news { margin-top: 56px; scroll-margin-top: 90px; }
  .hatch-news-item { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .hatch-news-item > time { padding: 0; }
  .hatch-news-body > h3 { font-size: 15px; }
  .hatch-news-body > p { font-size: 13px; line-height: 1.95; }
  .hatch-policy-link { font-size: 12px; gap: 10px; }
}
