/*
Theme Name:   n_studio Portfolio
Theme URI:    https://note.com/n_studio
Author:       n.tsukuda
Author URI:   https://note.com/n_studio
Description:  フリーランス向けポートフォリオテーマ。制作実績カスタム投稿タイプ・note RSS連携対応。
Version:      1.0.0
License:      GPL-2.0-or-later
Text Domain:  nstudio
*/

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

:root {
  --bg:          #f5f5f2;
  --bg-alt:      #eceee9;
  --white:       #fff;
  --text:        #1e1c19;
  --text-mid:    #4a4840;
  --text-light:  #868a82;
  --brown:       #6b8a85;
  --brown-light: #82a39d;
  --brown-pale:  rgba(107,138,133,0.08);
  --border:      #d6dbd6;
  --serif:       'Cormorant Garamond', serif;
  --sans:        'Noto Sans JP', sans-serif;
  --mono:        'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }


/* ============================================================
   Layout
   ============================================================ */
.l-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 32px;
  padding-right: 32px;
}


/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--brown);
}

.site-header .l-wrap {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-name {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.5px;
}

.site-name a { color: #fff; }
.site-name em { font-style: normal; color: #fff; }

.site-name small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  margin-top: -2px;
}

/* WP nav menu reset */
.header-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
}

.header-nav a {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.header-nav a:hover { color: #fff; }


/* ============================================================
   Divider
   ============================================================ */
.c-divider {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

.c-divider hr {
  border: none;
  border-top: 1px solid var(--border);
}


/* ============================================================
   Section Common
   ============================================================ */
.c-sec { padding: 72px 0; }

.c-sec__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
}

.c-sec__num {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 400;
  color: var(--border);
  line-height: 1;
}

.c-sec__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
}


/* ============================================================
   Hero
   ============================================================ */
.p-hero {
  padding-top: 130px;
  padding-bottom: 72px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

.p-hero__main { padding-top: 24px; }

.p-hero__title {
  font-family: var(--sans);
  font-size: 50px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 1px;
  margin-bottom: 28px;
}

.p-hero__title strong { font-weight: 900; color: var(--brown); font-style: normal; }

.p-hero__desc {
  font-size: 16px;
  color: var(--text-mid);
  max-width: 440px;
  line-height: 2;
  margin-bottom: 32px;
}

.p-hero__meta {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.p-hero__meta dt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.p-hero__meta dd {
  font-size: 15px;
  color: var(--text);
}

.p-hero__meta dd a {
  color: var(--brown);
}

/* Hero image */
.p-hero__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
}

.p-hero__photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border-radius: 4px;
}


/* ============================================================
   Skills Section（アクセントカラー背景）
   ============================================================ */
.p-skills-section {
  background: var(--brown);
}

.p-skills-section .c-sec__num {
  color: rgba(255,255,255,0.2);
}

.p-skills-section .c-sec__title {
  color: #fff;
}

/* ============================================================
   Skills Table
   ============================================================ */
.p-skills { width: 100%; border-collapse: collapse; }
.p-skills tr { border-bottom: 1px solid rgba(255,255,255,0.15); }
.p-skills tr:first-child { border-top: 1px solid rgba(255,255,255,0.15); }
.p-skills td { padding: 24px 0; vertical-align: top; }

.p-skills__name {
  width: 200px;
  font-size: 17px;
  font-weight: 600;
  padding-right: 24px;
  color: #fff;
}

.p-skills__desc {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  padding-right: 32px;
  line-height: 1.8;
}

.p-skills__tech { width: 240px; text-align: left; padding-top: 2px; }

.c-tech-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 3px;
  margin: 2px 4px 2px 0;
}


/* ============================================================
   Works More Link
   ============================================================ */
.p-works-more {
  margin-top: 28px;
  text-align: right;
}

.p-works-more a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brown);
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.p-works-more a:hover { opacity: 0.7; }


/* ============================================================
   Works List（実績一覧アーカイブページ用）
   ============================================================ */
.p-works-list { display: flex; flex-direction: column; }

.p-works__item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  align-items: start;
  transition: background 0.2s;
  color: inherit;
  text-decoration: none;
}

.p-works__item:first-child { border-top: 1px solid var(--border); }
.p-works__item:hover { background: rgba(107,138,133,0.03); }

.p-works__thumb {
  width: 220px;
  height: 150px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.p-works__item:hover .p-works__thumb { border-color: var(--brown-light); }

.p-works__thumb img { width: 100%; height: 100%; object-fit: cover; }

.p-works__thumb--empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.p-works__header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 4px; }

.p-works__body { min-width: 0; overflow: hidden; }

.p-works__num { font-family: var(--serif); font-size: 22px; color: var(--border); }

.p-works__cat {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brown);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.p-works__title { font-size: 18px; font-weight: 600; line-height: 1.5; margin-bottom: 6px; overflow-wrap: break-word; }

.p-works__desc { font-size: 15px; color: var(--text-mid); line-height: 1.8; margin-bottom: 10px; overflow-wrap: break-word; }

.p-works__tags { display: flex; flex-wrap: wrap; gap: 4px; }

.p-works__tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 2px;
}


/* ============================================================
   note Blog Section
   ============================================================ */
.p-note-sec { background: var(--bg-alt); }

.p-note__intro {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 32px;
  max-width: 560px;
  line-height: 2;
}

.p-note__intro a {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.p-note__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.p-note__card {
  background: var(--white);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.2s;
}

.p-note__card:hover { background: #fdfcfa; }

.p-note__thumb {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: var(--bg);
}

.p-note__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.p-note__card:hover .p-note__thumb img { transform: scale(1.03); }

.p-note__body {
  padding: 20px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.p-note__date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}

.p-note__card h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 6px;
  flex: 1;
}

.p-note__card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
}

.p-note__more {
  margin-top: 28px;
  text-align: right;
}

.p-note__more a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brown);
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.p-note__more a:hover { opacity: 0.7; }


/* ============================================================
   Contact
   ============================================================ */
.p-contact {
  padding: 80px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.p-contact__heading {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 20px;
}

.p-contact__text {
  font-size: 16px;
  color: var(--text-mid);
  line-height: 2;
}

.p-contact__links { display: flex; flex-direction: column; padding-top: 12px; }

.p-contact__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.p-contact__link:first-child { border-top: 1px solid var(--border); }
.p-contact__link:hover { color: var(--brown); }

.p-contact__link span { font-size: 16px; font-weight: 500; }

.p-contact__link em {
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
  color: var(--text-light);
}


/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
}

.site-footer .l-wrap {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  justify-content: space-between;
}

.site-footer small {
  font-size: 13px;
  color: var(--text-light);
}


/* ============================================================
   Single Works (個別実績ページ)
   ============================================================ */
.p-single-work {
  padding-top: 120px;
  padding-bottom: 80px;
}

.p-single-work__header { margin-bottom: 40px; }

.p-single-work__cat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brown);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.p-single-work__title {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.p-single-work__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.p-single-work__featured {
  margin-bottom: 40px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.p-single-work__featured img {
  width: 100%;
  height: auto;
}

.p-single-work__body {
  font-size: 17px;
  line-height: 2;
  color: var(--text-mid);
  max-width: 720px;
}

.p-single-work__body p { margin-bottom: 1.5em; }

.p-single-work__link {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.p-single-work__link a {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--brown);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.p-single-work__back {
  margin-top: 48px;
}

.p-single-work__back a {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.2s;
}

.p-single-work__back a:hover { color: var(--brown); }


/* ============================================================
   Works Archive Page（実績一覧）
   ============================================================ */
.p-archive-works {
  padding-top: 120px;
  padding-bottom: 80px;
}

.p-archive-works__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brown);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.p-archive-works__title {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 48px;
}

.p-archive-works__back {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.p-archive-works__back a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-light);
  transition: color 0.2s;
}

.p-archive-works__back a:hover { color: var(--brown); }

/* レスポンシブ対応 */
@media (max-width: 900px) {
  .p-works-slider { margin: 0 -20px; padding: 0 20px; }
}


/* ============================================================
   Generic Page
   ============================================================ */
.p-page {
  padding-top: 120px;
  padding-bottom: 80px;
}

.p-page__title {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 40px;
}

.p-page__body {
  font-size: 17px;
  line-height: 2;
  color: var(--text-mid);
  max-width: 720px;
}

.p-page__body p { margin-bottom: 1.5em; }
.p-page__body h2 { font-size: 22px; font-weight: 600; margin: 2em 0 1em; color: var(--text); }
.p-page__body h3 { font-size: 19px; font-weight: 600; margin: 1.5em 0 0.8em; color: var(--text); }
.p-page__body ul, .p-page__body ol { padding-left: 1.5em; margin-bottom: 1.5em; }


/* ============================================================
   Contact Page
   ============================================================ */
.p-contact-page {
  padding-top: 120px;
  padding-bottom: 80px;
  max-width: 640px;
}

.p-contact-page__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brown);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.p-contact-page__title {
  font-family: var(--sans);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 20px;
}

.p-contact-page__lead {
  font-size: 15px;
  color: var(--text-mid);
  line-height: 2;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.p-contact-page__back {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.p-contact-page__back a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-light);
  transition: color 0.2s;
}

.p-contact-page__back a:hover { color: var(--brown); }


/* ============================================================
   Contact Form 7
   ============================================================ */
.wpcf7 { margin-top: 0; }

.wpcf7 p { margin-bottom: 24px; }

.wpcf7 label {
  display: block;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--white);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}

.wpcf7 textarea {
  resize: vertical;
  min-height: 160px;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 textarea:focus {
  border-color: var(--brown);
}

.wpcf7 input[type="submit"] {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  padding: 14px 52px;
  background: var(--brown);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.wpcf7 input[type="submit"]:hover { background: var(--brown-light); }

.wpcf7 .wpcf7-not-valid-tip {
  font-size: 12px;
  color: #c0392b;
  margin-top: 4px;
  display: block;
}

.wpcf7 .wpcf7-not-valid { border-color: #c0392b !important; }

.wpcf7 .wpcf7-response-output {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 14px;
  border: none;
}

.wpcf7 .wpcf7-mail-sent-ok {
  background: rgba(107,138,133,0.1);
  color: var(--brown);
}

.wpcf7 .wpcf7-mail-sent-ng,
.wpcf7 .wpcf7-spam-blocked {
  background: rgba(192,57,43,0.08);
  color: #c0392b;
}

.wpcf7 abbr[title] {
  color: var(--brown);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 4px;
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .l-wrap { padding-left: 20px; padding-right: 20px; }

  .header-nav { display: none; }

  .p-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 100px;
  }
  .p-hero__photo { order: -1; }
  .p-hero__photo img,
  .p-hero__photo-placeholder { aspect-ratio: 16 / 9; }
  .p-hero__title { font-size: 36px; }

  .p-works__item { grid-template-columns: 1fr; gap: 16px; }
  .p-works__thumb { width: 100%; height: 180px; }

  .p-skills td { display: block; padding-right: 0; }
  .p-skills__name { width: auto; padding-bottom: 0; }
  .p-skills__tech { width: auto; text-align: left; padding-top: 8px; }

  .p-note__grid { grid-template-columns: 1fr; }

  .p-contact { grid-template-columns: 1fr; gap: 40px; }

  .site-footer .l-wrap { flex-direction: column; gap: 4px; }
}
