* { box-sizing: border-box; }

:root{
  --bg: #52B7B3;
  --text: rgba(255,255,255,0.86);
  --muted: rgba(255,255,255,0.55);
  --card: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.18);
  --btn: rgba(255,255,255,0.14);
}

html, body { height: 100%; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, -apple-system, "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

a{
  color: rgba(255,255,255,0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container{
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 26px 0 64px;
}

.sitebar{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  margin-bottom: 14px;
}

.sitebar .home{
  font-weight: 900;
  text-decoration: none;
}

.sitebar .crumb{
  color: var(--muted);
  text-decoration: none;
}

.page-title{
  margin: 10px 0 10px;
  font-size: 28px;
  font-weight: 900;
}

.note{
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

/* 一覧グリッド（新しい順に上から並ぶ） */
.grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 920px){ .grid{ grid-template-columns: repeat(3а 1fr); } } /* ←誤字防止のため下で上書き */
@media (max-width: 900px){ .grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px){ .grid{ grid-template-columns: repeat(2, 1fr); } }

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

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

.card .meta{
  padding: 10px 12px 12px;
}

.card .name{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
}

.card .sub{
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* 詳細ページ */
.work{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.work img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
   max-height: 70vh;        /* ← 上限：画面の70% */
  min-height: 320px;       /* ← 下限：小さくなりすぎ防止 */
  width: auto;             /* 縦基準にする */
  max-width: 100%;
  object-fit: contain;     /* 全体を収める */
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.work h1{
  margin: 14px 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.work .info{
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.work .desc{
  margin: 0;
  font-size: 14px;
}

.actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn{
  display: inline-block;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--btn);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 900;
}

.btn:hover{
  filter: brightness(1.08);
}

.navline{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.navline a{
  color: var(--muted);
}