/*
Theme Name: TATA Portfolio Block
Theme URI: https://example.com
Author: TATA
Description: WordPressのサイトエディターから編集できるポートフォリオテーマ
Version: 1.0.0
Requires at least: 6.6
Text Domain: tata-block
*/

/* ========================================
   WORKS Cards
======================================== */

#works .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    padding: 0;
}

#works .wp-block-post-template > li {
    min-width: 0;
}

#works .wp-block-post-template > li > .wp-block-group {
    height: 100%;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}

#works .wp-block-post-template > li > .wp-block-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 60px #263b3512;
}

#works .wp-block-post-featured-image {
    margin: 0;
    background: #dbe9e1;
}

#works .wp-block-post-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

#works .wp-block-post-title a {
    color: #263b35;
    text-decoration: none;
}

#works .wp-block-post-title a:hover {
    color: #368a76;
}

#works .wp-block-post-excerpt {
    color: #697c73;
    line-height: 1.8;
}

@media (max-width: 800px) {
    #works .wp-block-post-template {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #works .wp-block-post-template > li > .wp-block-group {
        transition: none;
    }

    #works .wp-block-post-template > li > .wp-block-group:hover {
        transform: none;
    }
}

/* HOME & ABOUT */
#home.tata-hero {
    padding-top: 110px;
    padding-bottom: 110px;
}

#home h1 {
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.35;
    letter-spacing: -0.03em;
}

#home .wp-block-buttons {
    margin-top: 28px;
}

.tata-hero-visual {
    min-height: 320px;
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.tata-hero-visual h3 {
    color: #368a76;
    letter-spacing: 0.08em;
}

#about.tata-about {
    padding-top: 80px;
    padding-bottom: 100px;
}

.tata-about-visual {
    min-height: 280px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.tata-about-visual p {
    color: #368a76;
    font-weight: 700;
    line-height: 2;
    letter-spacing: 0.08em;
}

@media (max-width: 781px) {
    #home.tata-hero {
        padding-top: 65px;
        padding-bottom: 65px;
    }

    .tata-hero-visual {
        min-height: 200px;
    }

    #about.tata-about {
        padding-top: 55px;
        padding-bottom: 65px;
    }

    .tata-about-visual {
        min-height: 180px;
    }
}

/* CREATIVE CARD FIX */
.tata-creative-card {
    border-radius: 20px;
    padding: 100px 24px 28px;
    min-height: 260px;
    box-sizing: border-box;
}

.tata-creative-card h3 {
    overflow-wrap: anywhere;
}

@media (max-width: 781px) {
    .tata-creative-card {
        min-height: 200px;
        padding-top: 65px;
    }
}

/* SKILLS CARD FIX */
.tata-skill-card {
    border-radius: 20px;
    padding: 28px;
    min-height: 220px;
    box-sizing: border-box;
    height: 100%;
}

.tata-skill-card h3 {
    overflow-wrap: anywhere;
    font-size: clamp(18px, 2vw, 22px);
}

#skills .wp-block-columns {
    align-items: stretch;
}

#skills .wp-block-column {
    min-width: 0;
}

@media (max-width: 781px) {
    .tata-skill-card {
        min-height: 180px;
    }
}

/* CONTACT CARD FIX */
.tata-contact-card {
    background-color: #dfece3;
    border-radius: 30px;
    padding: 65px 32px;
    box-sizing: border-box;
}

.tata-contact-card .wp-block-buttons {
    justify-content: center;
}

@media (max-width: 781px) {
    .tata-contact-card {
        padding: 44px 24px;
    }
}

/* HOME original illustration */
.tata-original-hero-art {
    height: 440px;
    position: relative;
    display: grid;
    place-items: center;
}

.tata-orbit {
    width: 330px;
    height: 330px;
    border: 1px solid #8abbaa;
    border-radius: 50%;
    transform: rotate(-24deg);
    position: absolute;
}

.tata-orbit::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: #368a76;
    border: 8px solid #f7f3eb;
    border-radius: 50%;
    top: 29px;
    right: 48px;
}

.tata-art-card {
    width: 270px;
    height: 300px;
    border-radius: 130px 130px 38px 38px;
    background: linear-gradient(155deg, #dcece0, #b9d6c5);
    box-shadow: 0 15px 35px rgba(30, 60, 45, .08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    transform: rotate(7deg);
    position: relative;
}

.tata-art-card svg {
    width: 130px;
}

.tata-art-card span {
    font-family: "M PLUS Rounded 1c", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    color: #3d806b;
}

.tata-art-spark {
    position: absolute;
    border-radius: 50%;
    background: #f2d7a8;
}

.tata-art-spark.one {
    width: 45px;
    height: 45px;
    top: 40px;
    left: 35px;
}

.tata-art-spark.two {
    width: 18px;
    height: 18px;
    bottom: 50px;
    right: 30px;
}

@media (max-width: 768px) {
    .tata-original-hero-art {
        height: 280px;
    }

    .tata-orbit {
        width: 230px;
        height: 230px;
    }

    .tata-art-card {
        width: 185px;
        height: 205px;
    }

    .tata-art-card svg {
        width: 90px;
    }
}

/* ABOUT original design */
#about.tata-about-original {
    padding-top: 96px;
    padding-bottom: 96px;
}

.tata-about-eyebrow {
    color: #368a76;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    margin-bottom: 12px;
}

#about .tata-about-title {
    font-size: clamp(36px, 3.3vw, 40px);
    line-height: 1.5;
    margin-bottom: 40px;
}

#about .tata-about-columns {
    gap: 80px;
    align-items: flex-start;
}

.tata-about-illustration {
    min-height: 330px;
    border-radius: 30px;
    background: linear-gradient(140deg, #dceae0, #e8e2cf);
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.tata-about-illustration::before {
    content: "";
    width: 190px;
    height: 190px;
    border: 32px solid #78b09a;
    border-radius: 50%;
    transform: rotate(-25deg);
    box-sizing: content-box;
}

.tata-about-illustration::after {
    content: "";
    width: 50px;
    height: 50px;
    background: #f2d4a1;
    border-radius: 50%;
    position: absolute;
    top: 65px;
    right: 72px;
}

.tata-about-description {
    color: #68736e;
    line-height: 1.9;
}

.tata-journey {
    margin-top: 34px;
    border-left: 1px solid #b5d4c3;
    padding-left: 24px;
    display: grid;
    gap: 20px;
}

.tata-journey-item {
    position: relative;
}

.tata-journey-item::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 7px;
    width: 11px;
    height: 11px;
    background: #368a76;
    border: 4px solid #f7f3eb;
    border-radius: 50%;
}

.tata-journey-item h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 5px;
}

.tata-journey-item p {
    font-size: 13px;
    color: #68736e;
    margin: 0;
}

@media (max-width: 768px) {
    #about.tata-about-original {
        padding-top: 62px;
        padding-bottom: 62px;
    }

    #about .tata-about-columns {
        gap: 30px;
    }

    .tata-about-illustration {
        min-height: 220px;
    }
}

/* HOME & ABOUT layout refinement */
@media (min-width: 782px) {
    #home.tata-hero {
        min-height: 680px;
        padding-top: 90px;
        padding-bottom: 90px;
    }

    #home .wp-block-columns {
        gap: 64px;
    }

    #home h1 {
        font-size: clamp(48px, 4.5vw, 56px);
        line-height: 1.35;
        letter-spacing: -0.04em;
    }

    #about .tata-about-title {
        font-size: 40px;
        line-height: 1.5;
    }
}

@media (max-width: 781px) {
    #home.tata-hero {
        padding-top: 60px;
        padding-bottom: 70px;
    }

    #home h1 {
        font-size: clamp(30px, 7vw, 36px);
    }

    #about .tata-about-title {
        font-size: clamp(28px, 7vw, 32px);
    }
}

/* ABOUT timeline alignment fix */
#about .tata-journey {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#about .tata-journey-item {
    position: relative;
    margin: 0;
    padding: 0;
}

#about .tata-journey-item::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 5px;
    width: 11px;
    height: 11px;
    box-sizing: border-box;
    border: 0;
    border-radius: 50%;
    background: #368a76;
}

#about .tata-journey-item h4 {
    margin: 0 0 5px;
    padding: 0;
    line-height: 1.5;
}

#about .tata-journey-item p {
    margin: 0;
    padding: 0;
    line-height: 1.7;
}


/* ABOUT timeline: reset WordPress block spacing */
#about .tata-journey > .tata-journey-item {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100%;
    box-sizing: border-box;
}

#about .tata-journey > .tata-journey-item:first-child {
    margin-left: 0 !important;
}

#about .tata-journey-item::before {
    left: -30px;
    top: 5px;
}


/* ABOUT timeline: consistent alignment */
#about .tata-journey {
    align-items: stretch;
}

#about .tata-journey > .tata-journey-item {
    align-self: stretch !important;
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#about .tata-journey-item > h4,
#about .tata-journey-item > p {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: none !important;
}


/* ABOUT timeline: fix constrained layout alignment */
.tata-journey.wp-block-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
}

.tata-journey.wp-block-group > .tata-journey-item.wp-block-group {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
    margin-block: 0 !important;
    padding: 0 !important;
    align-self: stretch !important;
}

.tata-journey-item.wp-block-group > .wp-block-heading,
.tata-journey-item.wp-block-group > p {
    max-width: none !important;
    margin-inline: 0 !important;
}

.tata-journey-item.wp-block-group {
    position: relative;
}

.tata-journey-item.wp-block-group::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 5px;
    width: 11px;
    height: 11px;
    border: 0;
    border-radius: 50%;
    background: #368a76;
}

/* Original WORKS logo */
.tata-header-logo {
    display: inline-flex;
    align-items: center;
    color: #263d35;
    font-family: "M PLUS Rounded 1c", sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.075em;
    text-decoration: none;
    white-space: nowrap;
}

.tata-header-logo:hover {
    color: #263d35;
}

.tata-header-logo svg {
    width: 22px;
    height: 24px;
    margin: 0 1px;
    flex-shrink: 0;
}

.tata-logo-period {
    color: #368a76;
}

/* WORKS section */
#works .tata-works-eyebrow,
.tata-works-eyebrow {
    color: #368a76;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    margin-bottom: 12px;
}

#works .tata-works-title,
.tata-works-title {
    color: #263d35;
    font-size: clamp(32px, 4vw, 40px);
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 14px;
}

#works .tata-works-description,
.tata-works-description {
    color: #687a72;
    font-size: 14px;
    line-height: 1.9;
    margin-top: 0;
    margin-bottom: 32px;
}

/* WORKS category filters */
.tata-work-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 32px;
}

.tata-work-filter {
    padding: 10px 18px;
    border: 1px solid #dce6dd;
    border-radius: 999px;
    background: transparent;
    color: #263d35;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.tata-work-filter:hover,
.tata-work-filter.active {
    background: #368a76;
    border-color: #368a76;
    color: #fff;
}

.tata-work-card[hidden],
.wp-block-post[hidden] {
    display: none !important;
}

/* WORKS empty state */
.tata-work-empty {
    padding: 32px;
    text-align: center;
    color: #687a72;
    font-size: 14px;
}

.tata-work-empty[hidden] {
    display: none !important;
}

/* WORKS filter layout */
@media (min-width: 1100px) {
  .tata-work-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .tata-work-filter {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
    padding: 10px 13px;
  }
}

/* WORKS project link */
.tata-work-link {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  color: #278b76;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.tata-work-link:hover {
  text-decoration: underline;
}


/* ===== PROJECT DETAIL ===== */

.tata-project-detail {
  padding: 90px 24px 120px;
}

.tata-project-container {
  max-width: 900px;
  margin: 0 auto;
}

.tata-project-back a {
  color: #278b76;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-decoration: none;
}

.tata-project-back a:hover {
  text-decoration: underline;
}

.tata-project-eyebrow {
  margin-top: 48px;
  color: #278b76;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

.tata-project-title {
  margin: 16px 0 24px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.tata-project-meta {
  display: flex;
  gap: 20px;
  color: #777;
  font-size: 13px;
}

.tata-project-meta a {
  color: #278b76;
  text-decoration: none;
}

.tata-project-image {
  margin: 40px 0 60px;
  overflow: hidden;
  border-radius: 22px;
}

.tata-project-image img {
  border-radius: 22px;
}

.tata-project-overview {
  padding: 32px;
  margin-bottom: 56px;
  border: 1px solid #dce6dd;
  border-radius: 20px;
  background: #f7faf6;
}

.tata-project-overview h2 {
  margin-top: 0;
  color: #278b76;
  font-size: 16px;
  letter-spacing: .08em;
}

.tata-project-overview p {
  font-size: 15px;
  line-height: 1.9;
}

.tata-project-body {
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 2;
}

.tata-project-body h2 {
  margin-top: 56px;
  font-size: 28px;
}

.tata-project-body h3 {
  margin-top: 36px;
  font-size: 21px;
}

.tata-project-body img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}

.tata-project-back-bottom {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid #dce6dd;
}

@media (max-width: 767px) {
  .tata-project-detail {
    padding: 48px 18px 80px;
  }

  .tata-project-overview {
    padding: 22px;
  }

  .tata-project-image {
    margin: 28px 0 40px;
  }
}

/* ========================================
   OLD DESIGN RESTORATION
======================================== */

/* Header */
header.wp-block-template-part {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 243, 235, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

header.wp-block-template-part > .wp-block-group {
    min-height: 86px;
    box-sizing: border-box;
}

.tata-header-logo {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.075em;
}

.wp-block-navigation-item__content {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 12px;
    letter-spacing: 0.07em;
}

/* Hero */
#home.tata-hero {
    min-height: calc(92vh - 86px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    padding-top: 70px;
    padding-bottom: 70px;
}

#home.tata-hero > .wp-block-columns {
    width: 100%;
    gap: 60px;
}

#home h1 {
    font-size: clamp(48px, 4.4vw, 56px);
    line-height: 1.35;
    letter-spacing: -0.035em;
}

/* Section anchor positions */
#home,
#about,
#works,
#skills,
#creative,
#contact {
    scroll-margin-top: 100px;
}

/* Mobile */
@media (max-width: 800px) {
    header.wp-block-template-part > .wp-block-group {
        min-height: 74px;
    }

    #home.tata-hero {
        min-height: auto;
        padding-top: 45px;
        padding-bottom: 65px;
    }

    #home.tata-hero > .wp-block-columns {
        gap: 20px;
    }

    #home h1 {
        font-size: clamp(30px, 7.4vw, 36px);
    }

    .tata-header-logo {
        font-size: 23px;
    }

    #home,
    #about,
    #works,
    #skills,
    #creative,
    #contact {
        scroll-margin-top: 85px;
    }
}


/* Header sticky fix */
.wp-site-blocks > header,
.wp-site-blocks > .wp-block-template-part:first-child {
    position: sticky !important;
    top: 0;
    z-index: 1000;
    background: rgba(247, 243, 235, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


/* ========================================
   WordPress Admin Bar Fix
======================================== */

/* ログイン時は管理バーの下にヘッダーを配置 */
body.admin-bar .wp-site-blocks > header,
body.admin-bar .wp-site-blocks > .wp-block-template-part:first-child {
    top: 32px !important;
}

/* スマホの管理バーは高さ46px */
@media (max-width: 782px) {
    body.admin-bar .wp-site-blocks > header,
    body.admin-bar .wp-site-blocks > .wp-block-template-part:first-child {
        top: 46px !important;
    }
}


/* ========================================
   TATA Portfolio Layout Refinement
======================================== */

/* コンテンツ最大幅 */
.wp-site-blocks .alignwide {
    max-width: 1120px;
    width: calc(100% - 64px);
    margin-left: auto;
    margin-right: auto;
}

/* セクション間の余白 */
#about,
#works,
#skills,
#creative,
#contact {
    padding-top: 96px;
    padding-bottom: 96px;
    margin-top: 0;
    margin-bottom: 0;
}

/* セクション間に不要な余白を作らない */
.wp-site-blocks main > .wp-block-group {
    margin-block-start: 0;
}

/* HOME */
#home.tata-hero {
    min-height: calc(92vh - 86px);
    padding-top: 70px;
    padding-bottom: 70px;
}

/* ABOUT */
#about .wp-block-columns {
    gap: 80px;
}

/* WORKS */
#works .wp-block-post-template {
    gap: 24px;
}

/* SKILLS */
#skills .wp-block-columns {
    gap: 20px;
}

/* CREATIVE */
#creative .wp-block-columns {
    gap: 20px;
}

/* CONTACT */
#contact {
    padding-top: 80px;
    padding-bottom: 80px;
}

/* モバイル */
@media (max-width: 800px) {

    .wp-site-blocks .alignwide {
        width: calc(100% - 40px);
    }

    #about,
    #works,
    #skills,
    #creative,
    #contact {
        padding-top: 62px;
        padding-bottom: 62px;
    }

    #home.tata-hero {
        min-height: auto;
        padding-top: 50px;
        padding-bottom: 65px;
    }

    #about .wp-block-columns {
        gap: 30px;
    }

    #contact {
        padding-top: 62px;
        padding-bottom: 62px;
    }
}


/* ========================================
   WORKS DETAIL — OLD SITE DESIGN
======================================== */

/* 詳細ページ全体 */
body.single-works {
    background: #f7f3eb;
    color: #263b35;
}

/* メイン領域 */
body.single-works .tata-project-detail {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* コンテンツ幅 */
body.single-works .tata-project-container {
    width: min(1120px, calc(100% - 64px)) !important;
    max-width: 1120px !important;
    margin: 0 auto !important;
    padding: 74px 0 110px !important;
}

/* 戻るリンク */
body.single-works .tata-project-back {
    margin: 0 !important;
}

body.single-works .tata-project-back a {
    color: #368a76 !important;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    text-decoration: none;
}

/* タイトル上のラベル */
body.single-works .tata-project-eyebrow {
    margin: 32px 0 16px !important;
    color: #368a76 !important;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
}

/* タイトル */
body.single-works .tata-project-title {
    margin: 16px 0 !important;
    color: #263b35;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: clamp(34px, 4vw, 54px) !important;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -.035em;
}

/* 制作日・カテゴリー */
body.single-works .tata-project-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 14px 0 32px !important;
    color: #52665b;
    font-size: 13px;
}

body.single-works .tata-project-meta .wp-block-post-date {
    font-weight: 600;
}

/* メイン画像 */
body.single-works .tata-project-image {
    width: 100%;
    margin: 36px 0 0 !important;
    border-radius: 30px;
    overflow: hidden;
}

body.single-works .tata-project-image img {
    width: 100%;
    height: auto;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    display: block;
}

/* 概要と本文 */
body.single-works .tata-project-overview,
body.single-works .tata-project-body {
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.single-works .tata-project-overview {
    margin-top: 65px !important;
}

body.single-works .tata-project-body {
    margin-top: 32px !important;
}

/* 本文見出し */
body.single-works .tata-project-body h2,
body.single-works .tata-project-overview h2 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-size: 26px;
    font-weight: 500;
    color: #263b35;
    margin: 45px 0 20px;
}

/* 本文 */
body.single-works .tata-project-body p,
body.single-works .tata-project-body li,
body.single-works .tata-project-overview p {
    color: #697c73;
    line-height: 1.9;
}

/* 下部の戻るリンク */
body.single-works .tata-project-back-bottom {
    margin-top: 65px !important;
}

/* スマホ */
@media (max-width: 800px) {
    body.single-works .tata-project-container {
        width: min(600px, calc(100% - 40px)) !important;
        padding: 45px 0 70px !important;
    }

    body.single-works .tata-project-title {
        font-size: clamp(30px, 7.4vw, 36px) !important;
    }

    body.single-works .tata-project-image {
        border-radius: 20px;
    }

    body.single-works .tata-project-overview {
        margin-top: 45px !important;
    }
}

/* トップページ：キャッチコピーのフェード切り替え */
.tata-hero-rotating {
    display: inline-grid;
    vertical-align: baseline;
}

.tata-hero-rotating > span {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.8s ease-in-out,
        visibility 0.8s ease-in-out;
}

.tata-hero-rotating > span.is-active {
    opacity: 1;
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero-rotating > span {
        transition: none;
    }
}


/* 切り替え中の見出しの幅を安定させる */
.tata-hero-rotating {
    white-space: nowrap;
    align-items: baseline;
}

.tata-hero-rotating > span {
    transition:
        opacity 0.8s ease-in-out,
        visibility 0.8s ease-in-out;
}


/* ヒーロー見出し：改行と表示の修正 */
.tata-hero .wp-block-heading {
    white-space: nowrap;
}

.tata-hero-rotating {
    display: inline-grid;
    vertical-align: baseline;
    white-space: nowrap;
}

.tata-hero-rotating > span {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.tata-hero-rotating > span.is-active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .tata-hero .wp-block-heading {
        white-space: normal;
    }
}


/* ヒーロー文字切り替え：最終レイアウト調整 */
.tata-hero .tata-hero-rotating {
    display: inline-grid;
    grid-template-columns: max-content;
    vertical-align: baseline;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: inherit;
}

.tata-hero .tata-hero-rotating > span {
    grid-area: 1 / 1;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.tata-hero .tata-hero-rotating + .tata-hero-accent {
    margin-left: 0 !important;
}


/* ヒーロー見出し：文字間の余白を解消 */
.tata-hero .tata-hero-rotating {
    display: inline-block !important;
    position: relative;
    width: auto;
    vertical-align: baseline;
    white-space: nowrap;
}

.tata-hero .tata-hero-rotating > span {
    display: none;
    position: static;
    opacity: 0;
    visibility: hidden;
}

.tata-hero .tata-hero-rotating > span.is-active {
    display: inline;
    opacity: 1;
    visibility: visible;
}


/* ヒーロー文字切り替え：フェード */
.tata-hero .tata-hero-rotating {
    opacity: 1;
    transition: opacity 0.8s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero .tata-hero-rotating {
        transition: none;
    }
}


/* ヒーロー見出し：控えめなキラキラ */
.tata-hero .wp-block-heading {
    position: relative;
}

.tata-hero .tata-sparkle {
    position: absolute;
    color: #78bba2;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    animation: tata-sparkle-glow 4.5s ease-in-out infinite;
}

.tata-hero .tata-sparkle:nth-of-type(1) {
    top: -16px;
    left: 8%;
    animation-delay: 0.3s;
}

.tata-hero .tata-sparkle:nth-of-type(2) {
    top: -12px;
    right: 8%;
    color: #d4ad67;
    animation-delay: 1.5s;
}

.tata-hero .tata-sparkle:nth-of-type(3) {
    bottom: -18px;
    left: 40%;
    font-size: 13px;
    animation-delay: 2.7s;
}

.tata-hero .tata-sparkle:nth-of-type(4) {
    bottom: 2px;
    right: -8px;
    font-size: 12px;
    animation-delay: 3.6s;
}

@keyframes tata-sparkle-glow {
    0%, 100% {
        opacity: 0;
        transform: scale(0.4) rotate(-15deg);
    }
    25% {
        opacity: 0.85;
        transform: scale(1.15) rotate(8deg);
    }
    50% {
        opacity: 0;
        transform: scale(0.7) rotate(25deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero .tata-sparkle {
        animation: none;
        opacity: 0;
    }
}

/* ヒーロー見出し：文字が波のように消える */
.tata-hero .tata-hero-rotating {
    opacity: 1 !important;
    transition: none !important;
}

.tata-hero .tata-hero-rotating > span.is-active {
    display: inline;
    animation: tata-wave-reveal 0.85s ease-out both;
}

.tata-hero .tata-hero-rotating > span.is-leaving {
    display: inline;
    animation: tata-wave-disappear 0.85s ease-in-out both;
}

@keyframes tata-wave-disappear {
    0% {
        -webkit-mask-image: linear-gradient(to right, #000 0%, #000 100%);
        mask-image: linear-gradient(to right, #000 0%, #000 100%);
        opacity: 1;
    }
    100% {
        -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, transparent 100%);
        opacity: 0;
    }
}

@keyframes tata-wave-reveal {
    0% {
        opacity: 0;
        transform: translateY(4px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero .tata-hero-rotating > span {
        animation: none !important;
    }
}

/* =====================================
   Hero Text - Ethereal Dissolve
   左から右へ、霧のように消える
===================================== */

.tata-hero .tata-hero-rotating > span.is-leaving {
    display: inline-block;
    opacity: 1;
    animation: tata-ethereal-out 1.6s ease-in-out forwards !important;
}

.tata-hero .tata-hero-rotating > span.is-active {
    display: inline;
    opacity: 1;
    animation: tata-ethereal-in 1.1s ease-out both !important;
}

/* 左から右へ、ぼかしを伴って消える */
@keyframes tata-ethereal-out {
    0% {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 0%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 0%
        );
        -webkit-mask-size: 220% 100%;
        mask-size: 220% 100%;
        -webkit-mask-position: 100% 0;
        mask-position: 100% 0;
        opacity: 1;
        filter: blur(0);
    }

    70% {
        opacity: 0.95;
        filter: blur(0.3px);
    }

    100% {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 42%,
            #000 58%
        );
        mask-image: linear-gradient(
            to right,
            transparent 42%,
            #000 58%
        );
        -webkit-mask-size: 220% 100%;
        mask-size: 220% 100%;
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
        opacity: 0;
        filter: blur(1.5px);
    }
}

/* 次の文字が静かに現れる */
@keyframes tata-ethereal-in {
    0% {
        opacity: 0;
        filter: blur(3px);
        transform: translateY(3px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero .tata-hero-rotating > span {
        animation: none !important;
        filter: none !important;
    }
}


/* =====================================
   Hero Text - Slow Dissolve
   2.5秒かけて左から右へ溶ける
===================================== */

.tata-hero .tata-hero-rotating > span.is-leaving {
    display: inline-block;
    opacity: 1 !important;
    visibility: visible !important;
    animation: tata-slow-dissolve 2.5s linear forwards !important;
}

.tata-hero .tata-hero-rotating > span.is-active {
    display: inline;
    opacity: 1;
    visibility: visible;
    animation: tata-soft-appear 1.3s ease-out both !important;
}

@keyframes tata-slow-dissolve {
    0% {
        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 20%,
            #000 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0%,
            #000 20%,
            #000 100%
        );
        -webkit-mask-size: 250% 100%;
        mask-size: 250% 100%;
        -webkit-mask-position: 100% 0;
        mask-position: 100% 0;
        filter: blur(0);
    }

    100% {
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
        filter: blur(0.7px);
    }
}

@keyframes tata-soft-appear {
    0% {
        opacity: 0;
        filter: blur(2px);
        transform: translateY(2px);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tata-hero .tata-hero-rotating > span {
        animation: none !important;
    }
}


/* =========================================
   CREATIVE PAGES - MOBILE CONTENT SPACING
   Photography / Design / Ideas
========================================= */

@media (max-width: 700px) {

    body.page-id-87 .wp-block-group.container,
    body.page-id-117 .wp-block-group.container,
    body.page-id-119 .wp-block-group.container {
        box-sizing: border-box;
        width: calc(100% - 40px) !important;
        max-width: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

}

/* =========================================
   MOBILE HEADER NAVIGATION FIX
========================================= */

@media (max-width: 800px) {

    /* ヘッダーの配置 */
    .wp-site-blocks > header {
        z-index: 9999 !important;
    }

    /* メニューを画面全体に表示 */
    .wp-block-navigation__responsive-container.is-menu-open {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        box-sizing: border-box !important;
        padding: 80px 24px 32px !important;
        overflow-y: auto !important;
        background: #f7f3eb !important;
        z-index: 10000 !important;
    }

    /* メニュー項目 */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__container {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 24px !important;
    }

    /* タップしやすいリンク */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
        display: block !important;
        padding: 8px 0 !important;
        font-size: 18px !important;
    }

    /* 閉じるボタン */
    .wp-block-navigation__responsive-container-close {
        position: absolute !important;
        top: 24px !important;
        right: 24px !important;
        z-index: 10001 !important;
    }
}

/* =========================================
   MOBILE GLASS MENU - RIGHT ALIGN
========================================= */

@media (max-width: 800px) {

    .wp-block-navigation__responsive-container.is-menu-open {
        inset: 82px 16px auto auto !important;

        width: min(260px, calc(100vw - 32px)) !important;
        max-width: calc(100vw - 32px) !important;

        height: auto !important;
        max-height: calc(100dvh - 110px) !important;

        margin: 0 !important;
        padding: 22px 20px !important;

        background: rgba(247, 243, 235, 0.72) !important;

        backdrop-filter: blur(20px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(150%) !important;

        border: 1px solid rgba(255, 255, 255, 0.7) !important;
        border-radius: 20px !important;

        box-shadow: 0 12px 36px rgba(38, 59, 53, 0.12) !important;
    }

    /* 閉じるボタンのスペース */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-content {
        padding-top: 28px !important;
    }

    /* メニューの文字 */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
        font-size: 15px !important;
    }
}

/* =========================================
   MOBILE GLASS MENU - COMPACT FIX
========================================= */

@media (max-width: 800px) {

    /* メニューをコンパクトに */
    .wp-block-navigation__responsive-container.is-menu-open {
        position: fixed !important;
        inset: 82px 12px auto auto !important;

        width: min(200px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        height: auto !important;
        max-height: calc(100dvh - 100px) !important;

        margin: 0 !important;
        padding: 16px !important;

        background: rgba(247, 243, 235, 0.68) !important;
        backdrop-filter: blur(20px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(150%) !important;

        border: 1px solid rgba(255, 255, 255, 0.7) !important;
        border-radius: 18px !important;
        box-shadow: 0 12px 36px rgba(38, 59, 53, 0.12) !important;

        overflow-y: auto !important;
    }

    /* ×ボタン専用のスペースを確保 */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-content {
        padding-top: 48px !important;
    }

    /* ×ボタンを右上に固定 */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-close {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        margin: 0 !important;
    }

    /* メニュー項目の間隔 */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__container {
        gap: 6px !important;
    }

    /* タップしやすいリンク */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
        font-size: 14px !important;
        padding: 8px 0 !important;
    }

    /* メニュー表示中もページのスクロールを許可 */
    html.has-modal-open,
    html.has-modal-open body,
    body.has-modal-open {
        overflow: auto !important;
        height: auto !important;
    }

    /* WordPressのモーダル背景による操作制限を解除 */
    .wp-block-navigation__responsive-container.is-menu-open::before {
        pointer-events: none !important;
    }
}

/* =========================================
   MOBILE HEADER - FIXED & NARROW MENU
========================================= */

@media (max-width: 800px) {

    /* ヘッダーを画面上部に固定 */
    .wp-site-blocks > header,
    .wp-site-blocks > .wp-block-template-part:first-child {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        box-sizing: border-box !important;
    }

    /* 固定ヘッダー分のスペースを確保 */
    .wp-site-blocks {
        padding-top: 74px !important;
    }

    /* メニューをさらに細くする */
    .wp-block-navigation__responsive-container.is-menu-open {
        position: fixed !important;
        inset: 82px 12px auto auto !important;

        width: min(170px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;

        height: auto !important;
        max-height: calc(100dvh - 100px) !important;

        padding: 14px !important;
        margin: 0 !important;

        background: rgba(247, 243, 235, 0.68) !important;
        backdrop-filter: blur(20px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(150%) !important;

        border-radius: 18px !important;
        z-index: 10000 !important;
    }

    /* ×ボタンとHOMEが重ならないように */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-content {
        padding-top: 48px !important;
    }

    /* メニューのリンク */
    .wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
        font-size: 13px !important;
        padding: 7px 0 !important;
    }

    /* 開いたまま背景をスクロールできるようにする */
    html.has-modal-open,
    html.has-modal-open body {
        overflow: auto !important;
        height: auto !important;
    }

    /* WordPress管理バーがある場合 */
    body.admin-bar .wp-site-blocks > header,
    body.admin-bar .wp-site-blocks > .wp-block-template-part:first-child {
        top: 46px !important;
    }
}

/* スマホのアンカーリンク位置調整 */
@media (max-width: 800px) {
    #home,
    #about,
    #works,
    #skills,
    #creative,
    #contact {
        scroll-margin-top: 85px;
    }
}

/* MOBILE GLASS MENU - FINAL SIZE */
@media (max-width: 800px) {
    .wp-block-navigation__responsive-container.is-menu-open {
        width: min(150px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;

        inset: 86px 12px auto auto !important;
        margin: 0 !important;
    }
}

/* =========================================
   SMOOTH SECTION SCROLL
========================================= */

html {
    scroll-behavior: smooth;
}

/* 固定ヘッダーに見出しが隠れないように */
#home,
#about,
#works,
#skills,
#creative,
#contact {
    scroll-margin-top: 90px;
}

/* 動きを減らす設定を使用している場合 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* WORKS一覧：抜粋を最大2行に制限 */
#works .wp-block-post-excerpt__excerpt {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
    overflow: hidden !important;
    text-overflow: ellipsis;
}
