/* ============================================
   PAGES
   トップページ + 下層ページ、それぞれの
   ページ固有レイアウトをまとめたファイル。
   common.css を読み込んだ上で、このファイルも読み込む。

   【単位ルール】
   - font-size / 文字まわりのmargin・padding・gap → rem
   - border-radius / border-width / box-shadowの数値 → px
   - アイコン・画像など「固定サイズの物」の width/height → px
     (それに紐づくtop/left/right/bottom等の位置指定もpx)
   - vw / % はレイアウト上意図的に使っている箇所なので対象外
============================================ */

/* ------------------------------
   TOP
------------------------------ */

/* ------------------------------
   kv
------------------------------ */

main.top {
    position: relative;
}

.kv-bg {
    position: fixed;
    top: var(--header-height);
    left: 1.5rem;
    width: calc(100% - 3rem);
    height: calc(100vh - 7.75rem);
    z-index: 0;
    border-radius: 10px;
    overflow: hidden;
}

.kv-bg__layer {
    position: absolute;
    inset: 0;
    background-image: url(../images/texture.jpg), var(--gradient-brand);
    background-repeat: no-repeat;
    background-size: cover;
    background-blend-mode: color-burn;
}

.top-kv {
    position: relative;
    z-index: 2;
    color: #fff;
    /* JS(common.js)がscrollに応じてこの値を書き換える。初期値は不透明(1) */
    --logo-opacity: 1;
}

.top-kv:before {
    content: "";
    display: block;
    width: 80vw;
    height: 13vw;
    background: url(../images/logo-l-w.svg) no-repeat center;
    background-size: contain;
    position: fixed;
    left: 20vw;
    top: 28vw;
    opacity: var(--logo-opacity);
    transition: opacity 0.2s ease-out;
}

.top-kv-inner {
    width: 85vw;
    margin: 0 auto;
    padding-top: 17vw;
    position: relative;
    z-index: 10;
}

.top-kv-title {
    margin-bottom: 17vw;
}

.top-kv-title img {
    width: 35vw;
    height: auto;
}

.top-kv-text {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.top-kv p {
    font-size: clamp(0.875rem, 1.53vw, 1.375rem);
    line-height: 2.8;
    letter-spacing: 0.05vw;
    font-weight: 500;
}

.top-kv a {
    font-size: clamp(0.75rem, 1.25vw, 1.125rem);
    letter-spacing: 0.05vw;
    display: flex;
    align-items: center;
    gap: 0.75vw;
}

.kv-reveal-spacer {
    height: 20vw;
    position: relative;
}

.kv-reveal-spacer:before,
.kv-reveal-spacer:after {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    position: absolute;
    bottom: 0;
    background-size: cover;
}

.kv-reveal-spacer:before {
    left: 0;
    background: url(../images/corner-round-left.svg) no-repeat;
}

.kv-reveal-spacer:after {
    right: 0;
    background: url(../images/corner-round-right.svg) no-repeat;
}

@media (max-width: 768px) {
    .kv-bg {
        left: 0.75rem;
        width: calc(100% - 2.25rem);
        height: calc(100vh - 7.75rem);
    }

    .top-kv:before {
        /* 修正前: left(20vw) + width(95vw) = 115vw で画面右にはみ出し、
           これがSPで横スクロール(パカパカ)する原因になっていた。
           95vwの大きさは活かしつつ、100vw以内に収まるようlengthを調整 */
        width: 90vw;
        height: 15vw;
        position: fixed;
        left: 5vw;
        top: 54vw;
        opacity: var(--logo-opacity);
    }

    .top-kv-inner {
        width: 80vw;
        padding-top: 13vw;
    }

    .top-kv-title {
        margin-bottom: 33vw;
    }

    .top-kv-title img {
        width: 65vw;
        height: auto;
    }

    .top-kv-text {
        display: block;
    }

    .top-kv p {
        font-size: 0.8125rem;
        letter-spacing: 0.1vw;
        padding-bottom: 2rem;
    }

    .top-kv a {
        font-size: 0.8125rem;
        letter-spacing: 0.05vw;
        gap: 1.75vw;
        justify-content: flex-end;
    }

    .top-kv a img {
        /* アイコンの固定サイズなのでpx */
        width: 20px;
    }

    .kv-reveal-spacer {
        height: 15vw;
    }

}

/* ------------------------------
   project
------------------------------ */
.top #project {
    margin: 0 -1.5rem;
}

.top #project .project-card {
    padding: 0 0.8vw;
}

@media (max-width: 768px) {
    .top #project .project-card {
        padding: 0 0.75rem;
    }
}


/* ------------------------------
   PAGE TITLE (下層ページ共通のタイトルエリア)
   .page-title
     ├ .page-title__inner   ... 見出し(ABOUT US / MiKUMARiについて)
     ├ .page-title__logo    ... 背景の大きいロゴ(右にはみ出す)
     └ .page-title__anchors ... ページ内アンカーリンク一覧
------------------------------ */
.page-title {
    position: relative;
    overflow: hidden;
    background: var(--color-white);
    color: #8d8d8d;
}

.page-title__inner {
    position: relative;
    z-index: 2;
    max-width: 72rem;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
}

.page-title__en {
    font-family: "Quicksand", sans-serif;
    font-weight: 500;
    font-size: 3rem;
    letter-spacing: 0.04em;
    margin: 0 0 1rem;
}

.page-title__ja {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

/* 背景のでっかいロゴ。右にはみ出させて、テキストの後ろに配置 */
.page-title__logo {
    position: absolute;
    top: 50%;
    right: 0%;
    z-index: 1;
    width: 50%;
    /* 画像の固定上限サイズなのでpx */
    max-width: 900px;
    transform: translateY(-70%);
    pointer-events: none;
    opacity: 0.2;
}

.page-title__logo img {
    display: block;
    width: 100%;
    height: auto;
}

.page-title__anchors {
    position: relative;
    z-index: 2;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.page-title__anchors ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-title__anchors a {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.page-title__anchors a:hover,
.page-title__anchors a:focus-visible {
    color: var(--color-primary-dark);
}

.page-title__anchor-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    /* 丸アイコン自体の固定サイズなのでpx */
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 0.75rem;
    line-height: 1;
    transition: background-color var(--transition-fast);
}

.page-title__anchors a:hover .page-title__anchor-icon,
.page-title__anchors a:focus-visible .page-title__anchor-icon {
    background: var(--color-primary-dark);
}

@media (max-width: 768px) {
    .page-title__inner {
        padding: 1rem 1rem 2.5rem;
    }

    .page-title__en {
        font-size: 2rem;
        margin-bottom: 0.625rem;
    }

    .page-title__ja {
        font-size: 0.8125rem;
    }

    /* スマホでは背景ロゴを下寄せ・大きめにして雰囲気だけ残す */
    .page-title__logo {
        top: 25%;
        right: -10%;
        width: 75%;
        transform: none;
    }
    
    .page-title.include-nav .page-title__logo {
        top: 11vw;
    }

    .page-title__anchors {
        padding: 0 1rem 2.5rem;
    }

    .page-title__anchors ul {
        flex-direction: column;
        gap: 1rem;
    }

    .page-title__anchors a {
        font-size: 0.875rem;
    }
}

/* ------------------------------
   ABOUT / 数字で見るMiKUMARi
------------------------------ */
.stat-grid-section {
    padding: 3rem 1.5rem;
}

.stat-grid {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.stat-card {
    background: var(--color-white);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.stat-card__label {
    font-weight: 500;
    line-height: 1.6;
    margin: 0 0 1.25rem;
    min-height: 3.2em;
    /* 2行分の高さを常に確保 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card__icon {
    display: block;
    /* アイコン画像の固定サイズなのでpx */
    width: 120px;
    height: 120px;
    margin: 0 auto 1.25rem;
    object-fit: contain;
}

.stat-card__number {
    margin: 0;
    line-height: 1;
}

.stat-card__value {
    font-family: "Quicksand", sans-serif;
    font-weight: 700;
    font-size: 2.625rem;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.stat-card__unit {
    display: block;
    margin-top: 0.375rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-primary);
}

@media (max-width: 1023px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .stat-grid-section {
        padding: 2rem 1rem;
    }

    .stat-card {
        padding: 1.75rem 1rem;
    }

    .stat-card__icon {
        width: 56px;
        height: 56px;
        margin-bottom: 0.875rem;
    }

    .stat-card__label {
        font-size: 0.8125rem;
        margin-bottom: 0.875rem;
    }

    .stat-card__value {
        font-size: 1.25rem;
    }

    .stat-card__unit {
        font-size: 0.75rem;
    }
}

/*==========================
history
==========================*/

.history {
    position: relative;
}

.history-inner {
    position: relative;
    max-width: 64rem;
    margin: 0 auto;
}

.history-year {
    position: relative;
    display: grid;
    grid-template-columns: 6.875rem 1fr;
    column-gap: 3.5rem;
    margin-bottom: 2rem;
}

.history-year::after {
    content: "";
    position: absolute;
    left: 10.875rem;
    top: 1.75rem;
    bottom: -3rem;
    /* 線の太さはborder的な値なのでpx */
    width: 2px;
    background: var(--color-primary);
    transform-origin: top;
    transform: scaleY(0);
    transition: transform .9s ease;
}

.history-year.is-visible::after {
    transform: scaleY(1);
}

.history-year.is-visible .history-item__dot {
    transform: scale(1);
    opacity: 1;
}

.history-year__text {
    text-align: right;
    color: var(--color-primary);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1;
}

.history-item {
    position: relative;
    display: grid;
    grid-template-columns: 3.125rem 3.125rem 1fr;
    margin-bottom: 3rem;
}

.history-item__month {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1;
}

.history-item__month small,
.history-year__year small {}


.history-item__dot {
    /* 丸ポチ自体は装飾用の固定サイズなのでpx */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #bfe8f3;
    border: 5px solid #eaf9fd;
    transform: scale(.4);
    opacity: 0;
    transition: .35s;
    box-shadow: 0 0 0 8px #fff;
}


.history-item.is-visible .history-item__dot {
    transform: scale(1);
    opacity: 1;
}

.history-item__space {
    /* 上のdotとサイズを揃える(空のダミー要素)のでpx */
    width: 18px;
    height: 18px;
}

.history-item__content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    margin-top: -0.25rem;
}

.history-item__content p {
    line-height: 2;
}

/*==========================
future
==========================*/

.about-future {
    position: relative;
    text-align: center;
    max-width: 68rem;
    margin: 0 auto 0;
}

.about-future h2 {
    margin-bottom: 2rem;
}

.about-future p {
    line-height: 2;
}

.about-future-photo {
    position: absolute;
    left: 0;
    /* 写真画像そのものの固定サイズ・位置なのでpx */
    top: -60px;
    width: 260px;
}

.about-future-character {
    position: absolute;
    right: 0;
    /* キャラクター画像そのものの固定サイズ・位置なのでpx */
    bottom: -40px;
    width: 200px;
}

@media (max-width: 768px) {

    /* ---- history ---- */
    .history-year {
        grid-template-columns: 4rem 1fr;
        column-gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .history-year::after {
        left: 5.4rem;
        top: 1.375rem;
        bottom: -2.25rem;
    }

    .history-year__text {
        font-size: 1rem;
    }

    .history-item {
        grid-template-columns: 1.375rem 2.25rem 1fr;
        margin-bottom: 2rem;
    }

    .history-item__month {
        font-size: 1rem;
    }

    .history-item__dot,
    .history-item__space {
        width: 14px;
        height: 14px;
    }

    .history-item__dot {
        box-shadow: 0 0 0 6px #fff;
    }

    .history-item__content {
        padding-right: 1rem;
    }

    .history-item__content h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .history-item__content p {
        line-height: 1.8;
    }

    /* ---- future ----
       PCは写真・キャラを左右に大きくはみ出す配置にしてるが、
       SPだと幅が足りず本文と重なってしまうため、
       画像を小さくして隅に収める形に調整 */
    .about-future {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }

    .about-future h2 {
        margin-bottom: 1rem;
    }

    .about-future h2 img {
        width: 12.5rem;
        height: auto;
    }

    .about-future-photo {
        top: -3.25rem;
        left: -0.5rem;
        width: 135px;
    }

    .about-future-character {
        bottom: -0.5rem;
        right: -0.5rem;
        width: 84px;
    }
}


/*==========================
   service
==========================*/
.service-block__content {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "photos"
        "body";
    gap: 2rem;
}

.service-block__title {
    grid-area: title;
}

.service-block__photos {
    grid-area: photos;
}

.service-block__body {
    grid-area: body;
}

@media (min-width: 768px) {
    .service-block__content {
        grid-template-columns: 1fr 1fr;
        column-gap: 3rem;
        row-gap: 2.5rem;
        align-items: flex-end;
        grid-template-areas:
            "title  photos"
            "body   photos";
    }

    .service-block__content--reverse {
        grid-template-areas:
            "photos title"
            "photos body";
    }
}

/* =========================================================
   Contact
========================================================= */

/* Lead text
--------------------------------------------------------- */

.contact-content .reservation-lead {
    margin: 0 0 2.5rem;
    font-size: 0.95rem;
    line-height: 2;
}

.contact-content .reservation-lead.contact-confirm {
    padding: 1.25rem 1.5rem;
    background: #f7f7f7;
    border-radius: 8px;
}

/* Form table
--------------------------------------------------------- */

.contact-content .form-table {
    width: 100%;
    border-top: 1px solid #ddd;
}

.mw_wp_form_confirm .form-table-tr.contact-confirm,
.contact-content .form-table-tr {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    border-bottom: 1px solid #ddd;
}

.contact-content .form-table-th {
    padding: 1.5rem;
    background: #f7f7f7;
    font-weight: 500;
    line-height: 1.7;
}

.contact-content .form-table-td {
    min-width: 0;
    padding: 1.5rem;
    line-height: 1.7;
}

.mw_wp_form_input .contact-confirm,
.mw_wp_form_input .form-table-tr.contact-confirm {
    display: none;
}

.mw_wp_form .horizontal-item + .horizontal-item {
    margin-left: 0 !important;
}

.mw_wp_form_confirm .contact-input {
    display: none;
}

.mw_wp_form_confirm .contact-confirm {
    display: block;
}

.mw_wp_form .horizontal-item + .horizontal-item {
    margin-left: 0px !important;
}

/* Required label
--------------------------------------------------------- */

.contact-content .form-table-th .contact-input {
    display: inline-block;
    margin-left: 0.6rem;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    background: #ff6666;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.4;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

/* Inputs
--------------------------------------------------------- */

.contact-content .input-text,
.contact-content .input-textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font: inherit;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.contact-content .input-text {
    height: 48px;
    padding: 0 1rem;
}

.contact-content .input-textarea {
    min-height: 160px;
    padding: 0.9rem 1rem;
    resize: vertical;
}

.contact-content .input-text::placeholder,
.contact-content .input-textarea::placeholder {
    color: #aaa;
}

.contact-content .input-text:focus,
.contact-content .input-textarea:focus {
    outline: none;
    border-color: #777;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Radio / checkbox
--------------------------------------------------------- */

.contact-content .form-table-category {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.contact-content .mwform-radio-field,
.contact-content .mwform-checkbox-field {
    margin: 0;
}

.contact-content .mwform-radio-field label,
.contact-content .mwform-checkbox-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    line-height: 1.7;
}

.contact-content input[type="radio"],
.contact-content input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

/* Privacy
--------------------------------------------------------- */

.contact-content .form-privacy {
    margin-top: 2rem;
    text-align: center;
}

.contact-content .form-privacy-check {
    display: inline-block;
}

.contact-content .form-privacy a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Button
--------------------------------------------------------- */

.contact-content .btn-wrap {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.contact-content .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 230px;
    min-height: 56px;
    padding: 0.9rem 2.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.contact-content .btn:hover {
    opacity: 0.7;
}

.contact-content .btn:active {
    transform: translateY(1px);
}

/* MW WP Form errors
--------------------------------------------------------- */

.contact-content .error {
    margin-top: 0.4rem;
    color: #c44;
    font-size: 0.85rem;
}

/* Empty p generated by MW WP Form
--------------------------------------------------------- */

.contact-content .form-table-tr > p:empty,
.contact-content .form-privacy > p:empty {
    display: none;
}

@media (max-width: 767px) {

    .contact-content .reservation-lead {
        margin-bottom: 2rem;
        font-size: 0.875rem;
        line-height: 1.9;
    }

    .mw_wp_form_confirm .form-table-tr.contact-confirm,
    .contact-content .form-table-tr {
        display: block;
    }

    .contact-content .form-table-th {
        padding: 1rem 1rem 0.75rem;
        font-size: 0.9rem;
    }

    .contact-content .form-table-td {
        padding: 0.75rem 1rem 1.25rem;
    }

    .contact-content .input-text {
        height: 46px;
    }

    .contact-content .input-textarea {
        min-height: 140px;
    }

    .contact-content .form-table-category {
        gap: 0.7rem;
    }

    .contact-content .mwform-radio-field label,
    .contact-content .mwform-checkbox-field label {
        font-size: 0.875rem;
    }

    .contact-content .form-privacy {
        margin-top: 1.5rem;
        text-align: left;
    }

    .contact-content .btn-wrap {
        margin-top: 2rem;
    }

    .contact-content .btn {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        padding: 0.8rem 1.5rem;
    }
}

/* ------------------------------
topics contents
------------------------------ */
.post-content p + p {
    padding-top: 2rem;
}

.post-content p a {
    color: var(--color-primary);
    text-decoration: underline;
}

.post-content p img {
    width: 80%;
    height: auto;
}

@media (max-width: 767px) {
    .post-content p + p {
        padding-top: 1rem;
    }


    .post-content p img {
        width: 100%;
        height: auto;
    }
}


/* ------------------------------
topics pagination
------------------------------ */

.topics-pagination {
    margin-top: 3rem;
}

.topics-pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.topics-pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

.topics-pagination .page-numbers a,
.topics-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 3rem;
    height: 3rem;

    background: #fff;
    border: 1px solid #e5e7eb;

    color: #333;
    text-decoration: none;

    font-size: 0.875rem;
    line-height: 1;

    transition: .3s;

    border-radius: 4px;
}

.topics-pagination .page-numbers a:hover {
    opacity: 0.6;
}

/* 現在のページ */
.topics-pagination .page-numbers .current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* 前へ・次へ */
.topics-pagination .page-numbers .prev,
.topics-pagination .page-numbers .next {
    width: auto;
    min-width: 3rem;
    padding: 0 1rem;
    white-space: nowrap;
}


/* SP */
@media (max-width: 768px) {

    .topics-pagination {
        margin-top: 2.5rem;
    }

    .topics-pagination .page-numbers {
        gap: 0.35rem;
    }

    .topics-pagination .page-numbers a,
    .topics-pagination .page-numbers span {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 0.8125rem;
    }

    .topics-pagination .page-numbers .prev,
    .topics-pagination .page-numbers .next {
        min-width: auto;
        padding: 0 0.75rem;
    }

}
