@charset 'utf-8';

html {
  font-size: 100%;
}
body {
  background-color: #121212;
  color: #EAEAEA;
  font-family: "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}
a {
  color: #ff6944;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.wrapper {
  max-width: 600px;
  width: 100%;
}

/* プロフィール */
aside {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 0;
}
aside .header-img {
  width: 100%;
  height: 200px;
  background-image: url("header.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
aside .profile {
  width: calc(100% - 32px);
  padding: 0 16px;
  position: absolute;
  top: 100px;
  line-height: 1.2;
}
aside img {
  width: 160px;
  height: 160px;
  border: 5px solid #121212; 
  border-radius: 50%;
}

aside h1 {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
aside h1 span.name {
  font-size: 1.5rem;
  font-weight: bold;
  display: block;
  padding-bottom: 8px;
}
aside h1 span.name-id {
  font-size: 0.85rem;
  font-weight: normal;
  color: #AAAAAA;
  display: block;
  margin-top: 2px;
}
aside .profile p {
  margin: 12px 0;
}
aside p.profile-text {
  margin-top: 28px;
}

.others {
  display: flex;
  gap: 20px;
}
.location, .website {
  font-size: 1rem;
  color: #aaa;
}
.location::before {
  font-family: 'Material Symbols Outlined';
  content: "location_on";
  font-size: 1rem;
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  margin-right: 0.4rem;
}
.website::before {
  font-family: 'Material Symbols Outlined';
  content: "link";
  font-size: 1rem;
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  margin-right: 0.4rem;
}
.tab {
  border-bottom: 1px solid #2E2E2E;
  margin: 16px 0 20px;
  padding: 0 0 8px;
}
.tab-text {
  border-bottom: 3px solid #ff6944;
  padding: 8px 20px;
}

/* 投稿表示 */
main {
  width: 100%;
  padding: 20px 0;
  margin: 0;
}
.post {
  border-bottom: 1px solid #2E2E2E;
  padding: 16px 8px;
  display: flex;
  gap: 12px;
}
.avatar {
  flex-shrink: 0;
}
.avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}
.content {
  flex: 1;
}
.header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.username {
  font-weight: bold;
  color: #fff;
}
.date {
  color: #AAAAAA;
  font-size: 0.9em;
}
.comment {
  font-family: "Noto Sans JP", "Noto Sans", sans-serif;
  line-height: 1.3;
  margin: 1rem 0;
}

/* 画像表示 */
.image {
  margin-top: 1rem;
  display: grid;
  gap: 1px;
  border-radius: 12px;
  overflow: hidden;
  background: #121212;
}
.image a {
  position: relative;
  display: block;
  overflow: hidden;
  border: none;
  background: #121212;       /* ローディング中の背景 */
}
.image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .2s ease;
}
.image a:hover img {
  transform: scale(1.02);
}
/* 1枚：横長比率（16:9相当） */
.image.count-1 {
  grid-template-columns: 1fr;
}
.image.count-1 a {
  aspect-ratio: auto;
}
/* 2枚：左右2カラム */
.image.count-2 {
  grid-template-columns: 1fr 1fr;
}
.image.count-2 a {
  aspect-ratio: 1 / 1;
}
/* 3枚：左に大、右に縦2枚（旧Twitterっぽい） */
.image.count-3 {
  grid-template-columns: 2fr 1.4fr;  /* 左を大きめに */
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "a b"
    "a c";
}
.image.count-3 a:nth-child(1) { grid-area: a; aspect-ratio: auto; min-height: 100%; object-fit: cover; }
.image.count-3 a:nth-child(2) { grid-area: b; aspect-ratio: 1 / 1; object-fit: cover; }
.image.count-3 a:nth-child(3) { grid-area: c; aspect-ratio: 1 / 1; object-fit: cover; }
/* 4枚：2×2 */
.image.count-4 {
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
}
.image.count-4 a {
  aspect-ratio: 1 / 1;       /* 正方形でそろえる */
}

/* ページ送り */
.pagination-nav {
  text-align: center;
  margin: 20px 0;
}
.pagination {
  list-style: none;
  padding: 0;
  display: inline-flex;
  gap: 6px;
}
.pagination a {
  display: block;
  padding: 6px 12px;
  background-color: #1E1E1E;
  color: #EAEAEA;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #2E2E2E;
  transition: background 0.2s;
}
.pagination a:hover {
  background-color: #2E2E2E;
}

/* ライトボックス */
#lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.lightbox-content {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  pointer-events: none;
}
#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.close {
  position: fixed;
  top: 16px;
  right: 16px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
}
.nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  pointer-events: none;
}
.nav button {
  pointer-events: auto;
  background: rgba(100, 100, 100, .5);
  border: none;
  font-size: 20px;
  color: #fff;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 4px;
  opacity: .3;
}
.nav button:hover {
  opacity: 1;
}

@media (max-width: 720px) {
  .nav button {
    font-size: 12px;
  }
  #lightbox-img {
    max-width: 100%;
    max-height: 100%;
  }
}

/* スマホ表示 */
@media (max-width: 480px) {
  aside .header-img {
    height: 160px;
  }
  aside .profile {
    padding: 0 16px;
    top: 80px;
  }
  aside img {
    width: 120px;
    height: 120px;
  }
  aside .profile p {
    margin: 6px 0;
  }
  aside p.profile-text {
    margin-top: 30px;
  }
  .others {
    flex-direction: column;
    gap: 0;
  }
  main {
    padding: 8px 0;
  }
  .tab {
    margin: 0 0 8px;
  }
  .post {
    padding: 16px 24px 16px 4px;
    gap: 4px;
  }
  .avatar img {
    width: 20px;
    height: 20px;
  }
}