/* ============================================================
   PORTFOLIO SITE — MAIN STYLESHEET
   参考: aratakubota.net スタイル
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --bg:          #efefed;       /* ニュートラルグレー背景 */
  --text:        #1a1a1a;       /* 本文テキスト */
  --text-sub:    #888888;       /* サブテキスト */
  --border:      #d8d8d5;       /* ボーダー */
  --white:       #ffffff;

  --font-en:     'Barlow Semi Condensed', sans-serif;
  --font-ja:     'Noto Sans JP', sans-serif;

  --header-h:    80px;          /* ヘッダーの高さ */
  --max-w:       1240px;        /* コンテンツ最大幅 */
  --pad-x:       48px;          /* 左右パディング */
  --grid-gap:    28px;          /* グリッド間隔 */

  --trans:       0.3s ease;
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-en);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  display: block;
  width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ブランドブロック */
.header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  text-transform: uppercase;
  transition: opacity var(--trans);
}

.brand-name:hover {
  opacity: 0.5;
}

.brand-title {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text-sub);
  text-transform: uppercase;
}

/* ナビ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-sub);
  text-transform: uppercase;
  transition: color var(--trans);
  position: relative;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--text);
}

/* Instagram など SVG アイコン */
.nav-icon svg {
  display: block;
}

/* ハンバーガー（モバイル） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background-color: var(--text);
  transition: var(--trans);
}

/* ---------- MAIN ---------- */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px var(--pad-x) 100px;
}

/* ---------- WORKS GRID ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

.work-item {
  display: block;
}

.work-link {
  display: block;
}

.work-thumb {
  overflow: hidden;
  background-color: #ddddd9;
}

.work-thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity var(--trans);
  /* プレースホルダー：画像がない場合のダミー高さ */
}

/* 画像が読み込まれていない場合のプレースホルダー */
.work-thumb img[src=""],
.work-thumb img:not([src]) {
  min-height: 240px;
}

.work-link:hover .work-thumb img {
  opacity: 0.75;
}

.work-info {
  margin-top: 12px;
  padding-bottom: 4px;
}

.work-title {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}

.work-meta {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ---------- ABOUT PAGE ---------- */
.page-about {
  padding-top: 72px;
}

.about-text-only {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.about-name-only {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.about-name-ja-small {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-left: 10px;
  vertical-align: middle;
}

.about-line {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-sub);
}

.about-awards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.about-awards li {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ---------- CONTACT PAGE ---------- */
.page-contact {
  padding-top: 80px;
}

.contact-layout {
  max-width: 560px;
}

.contact-intro {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-sub);
  margin-bottom: 40px;
}

.contact-mail-link {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  border-bottom: 1px solid var(--text);
  padding-bottom: 4px;
  transition: opacity var(--trans);
  margin-bottom: 56px;
}

.contact-mail-link:hover {
  opacity: 0.4;
}

.contact-sns {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-sns a {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-sub);
  transition: color var(--trans);
}

.contact-sns a:hover {
  color: var(--text);
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--pad-x);
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.footer-copy {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-sub);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 2 columns */
@media (max-width: 900px) {
  :root {
    --pad-x: 32px;
    --grid-gap: 20px;
    --header-h: 64px;
  }

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

  .about-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-photo {
    position: static;
    max-width: 320px;
  }

  .contact-mail-link {
    font-size: 18px;
  }
}

/* Mobile: 1 column */
@media (max-width: 560px) {
  :root {
    --pad-x: 20px;
    --grid-gap: 16px;
  }

  .brand-title {
    display: none;
  }

  /* ナビをモバイルメニューに切り替え */
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background-color: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    z-index: 99;
    border-top: 1px solid var(--border);
    padding: 8px 0 16px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    font-size: 13px;
    letter-spacing: 0.16em;
    padding: 14px var(--pad-x);
    width: 100%;
  }

  .nav-link.is-active::after {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  /* ハンバーガー → ✕ */
  .nav-toggle.is-open span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.is-open span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  .works-grid {
    grid-template-columns: 1fr;
  }

  .site-main {
    padding-top: 40px;
    padding-bottom: 72px;
  }

  .page-about {
    padding-top: 40px;
  }

  .page-contact {
    padding-top: 48px;
  }

  .about-photo {
    max-width: 100%;
  }

  .contact-mail-link {
    font-size: 15px;
    word-break: break-all;
  }
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background-color: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.lightbox.is-open {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease both;
}

/* 閉じるボタン */
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color var(--trans);
  z-index: 201;
}
.lightbox-close:hover { color: #fff; }

/* 前後ボタン */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 16px 20px;
  transition: color var(--trans);
  z-index: 201;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }

/* 画像が1枚のときは矢印を隠す */
.lightbox.is-single .lightbox-prev,
.lightbox.is-single .lightbox-next {
  display: none;
}

/* 画像 */
.lightbox-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 88vw;
  max-height: 80vh;
  cursor: default;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.lightbox-img.is-loading {
  opacity: 0;
}

/* フッター：タイトル＋カウンター */
.lightbox-footer {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
  cursor: default;
}

.lightbox-caption {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.lightbox-counter {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.25);
}
.site-main,
.site-header {
  animation: fadeIn 0.5s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Works グリッド — 画像プレースホルダー（画像未設定時） */
.work-thumb {
  position: relative;
}

.work-thumb::before {
  content: '';
  display: block;
  padding-top: 70%;  /* デフォルトのアスペクト比 */
  background-color: #ddddd9;
}

.work-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
