/*
Theme Name: GMD Portfolio
Theme URI: https://example.com/
Author: Codex
Description: Minimal portfolio theme for works and profile pages.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: gmd-portfolio
*/

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #6c6c6c;
  --line: #dddddd;
  --accent: #6FB8CE;
  --max-width: 1040px;
  --gutter: 28px;
  --header-height: 88px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", "Noto Sans JP", sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  padding-top: var(--header-height);
}

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

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

a:hover {
  opacity: 0.7;
}

a[target="_blank"]:not(.social-icon-link),
.entry-content a,
.about-section-content a:not(.social-icon-link) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-main,
.site-footer {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  width: min(calc(100% - 48px), calc(var(--max-width) * 0.98));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 32px;
  height: var(--header-height);
  padding: 0;
  background: transparent;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 100vw;
  background: rgba(245, 243, 239, 0.94);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  z-index: -1;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100vw;
  height: 1px;
  background: rgba(28, 28, 28, 0.12);
  transform: translateX(-50%);
}

.site-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.site-title a {
  color: var(--accent);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.site-nav a.is-current {
  color: var(--accent);
}

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

.section-heading,
.page-title,
.entry-title {
  margin: 0 0 24px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.page-intro,
.entry-intro,
.about-copy,
.entry-content {
  max-width: 720px;
}

.page-intro,
.entry-intro {
  margin-bottom: 40px;
  color: var(--muted);
}

.taxonomy-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 16px;
}

.works-filter {
  margin-bottom: 32px;
}

.works-grid-container {
  transition: opacity 0.2s ease;
}

.works-grid-container.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

.works-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.works-filter-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(111, 184, 206, 0.35);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.works-filter-link:hover {
  opacity: 1;
  border-color: var(--accent);
  background: var(--bg);
  color: var(--accent);
}

.works-filter-link.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.work-card {
  display: block;
}

.work-thumb {
  position: relative;
  aspect-ratio: 4 / 2.7;
  overflow: hidden;
  background: #ece8e1;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.work-thumb-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(111, 184, 206, 0.22), rgba(111, 184, 206, 0.04)),
    #ece8e1;
}

.work-card:hover .work-thumb img {
  transform: scale(1.02);
}

.work-card-body {
  padding-top: 10px;
}

.work-card-header {
  display: grid;
  gap: 4px;
}

.work-card-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 500;
}

.work-genre-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(111, 184, 206, 0.35);
  border-radius: 999px;
  background: var(--bg);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.work-genre-pill-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(111, 184, 206, 0.35);
  background: var(--bg);
  color: var(--accent);
  font-size: 0.9rem;
}

.work-group-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(28, 28, 28, 0.25);
  border-radius: 999px;
  background: var(--bg);
  color: #7f7f7f;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.work-group-pill-overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(28, 28, 28, 0.25);
  background: var(--bg);
  font-size: 0.9rem;
}

.work-card-meta,
.work-meta,
.entry-meta,
.site-footer {
  color: var(--muted);
}

.work-card-meta,
.work-meta {
  margin: 0;
  font-size: 0.84rem;
}

.portfolio-empty {
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.about-profile {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 8px 0 24px;
}

.about-portrait {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ece8e1;
}

.about-portrait-placeholder {
  width: 100%;
  height: 100%;
  background: #ece8e1;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-profile-body {
  display: grid;
  gap: 22px;
  align-content: start;
}

.about-name {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
}

.about-copy {
  max-width: none;
}

.about-copy > *:first-child,
.about-section-content > *:first-child {
  margin-top: 0;
}

.about-section.is-centered .about-section-content {
  text-align: center;
}

.about-section.is-hanging-indent .about-section-content p {
  padding-left: 3.3em;
  text-indent: -3.3em;
}

.about-section.is-centered .about-section-content figure {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 8px;
  vertical-align: top;
}

.about-section.is-centered .about-section-content figure img {
  display: block;
  width: calc(4 * 1.6 * 0.75rem);
  height: calc(4 * 1.6 * 0.75rem);
  object-fit: contain;
  border-radius: 18px;
}

.about-section.is-centered .about-section-content figcaption {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  max-width: calc(4 * 1.6 * 0.75rem);
}

.entry-content h2,
.entry-content h3,
.about-section-content h2,
.about-section-content h3,
.about-copy h2,
.about-copy h3 {
  font-weight: 500;
}

.about-copy > *:last-child,
.about-section-content > *:last-child {
  margin-bottom: 0;
}

.about-section {
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
}

.about-section-title {
  margin: 0 0 22px;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.about-section-content {
  max-width: 760px;
  margin: 0 auto;
}

.social-icon-list {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease;
}

.social-icon-link:hover {
  opacity: 1;
  transform: translateY(-1px);
  color: var(--accent);
  border-color: rgba(111, 184, 206, 0.65);
  background: rgba(255, 255, 255, 0.92);
}

.social-icon-link svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-icon-link .social-icon-dot {
  fill: currentColor;
  stroke: none;
}

.social-icon-link[aria-label="X"] svg,
.social-icon-link[aria-label="note"] svg {
  fill: currentColor;
  stroke: none;
}

.social-icon-link[aria-label="X"] svg {
  width: 18px;
  height: 18px;
}

.contact-copy {
  margin-top: 18px;
  text-align: center;
}

.work-page-nav {
  width: min(80%, 820px);
  margin: 35px auto 32px;
}

.work-page-nav-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.work-page-nav-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 0.82rem;
  font-weight: 550;
  letter-spacing: 0.06em;
  color: var(--text);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.work-page-nav-card:hover {
  border-color: var(--accent);
  color: var(--text);
  opacity: 1;
}


.single-work {
  display: grid;
  gap: 22px;
  width: min(80%, 820px);
  margin: 0 auto;
}

.single-work-hero {
  background: var(--surface);
}

.single-work-image {
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.single-work-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-work-summary {
  display: grid;
  gap: 10px;
}

.single-work-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.single-work-year {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--text);
}

.single-work-title {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
}

.single-work-intro {
  margin-bottom: 0;
}

.single-work-content {
  max-width: 100%;
  margin-top: 36px;
}

.single-work .about-section-content {
  text-align: center;
}

.single-work-link {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.related-works {
  display: grid;
  gap: 14px;
  margin-top: 52px;
}

.related-works-heading {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.related-works-list {
  display: grid;
  gap: 18px;
  padding: 26px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.related-work-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.related-work-thumb {
  background: #ece8e1;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.related-work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-work-body {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-top: 12px;
}

.related-work-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.related-work-name {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.05;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.back-link {
  display: inline-block;
  margin-top: 32px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: max(calc((100% - min(80%, 820px)) / 2 - 60px), 12px);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, border-color 0.18s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--accent);
  opacity: 0.85;
}

.site-footer {
  padding: 0 0 40px;
  font-size: 0.82rem;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .works-grid,
  .about-profile {
    grid-template-columns: 1fr 1fr;
  }

  .related-work-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .related-work-body {
    padding-top: 0;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-main,
  .site-footer {
    width: min(calc(100% - 32px), var(--max-width));
  }

  .site-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    min-height: var(--header-height);
    gap: 10px;
    padding: 16px 0;
  }

  .site-nav ul {
    flex-wrap: wrap;
    gap: 12px 16px;
  }

  .works-filter-list {
    gap: 10px;
  }

  .works-filter-link {
    min-height: 36px;
    padding: 0 15px;
    font-size: 0.92rem;
  }

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

  .single-work,
  .work-page-nav {
    width: 100%;
  }

  .related-works {
    padding: 20px;
  }
}
