/*
Theme Name: sato-mokko
Theme URI: https://example.com/
Author: Yuma Watanabe
Description: Custom WordPress theme for Sato Mokko.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: sato-mokko
*/

/*
  CSS MEMO
  ------------------------------------------------------------
  - reset / base / wp / components / utilities を @layer で管理
  - :root に色・余白・文字サイズを集約
  - clamp() でレスポンシブの文字サイズ・余白を自然に調整
  - min() でコンテナ幅を制御
  - WordPress本文・投稿まわりは @layer wp に集約
  - resetでは list-style を消しすぎない。ナビのみ個別に指定
*/

@layer reset, base, wp, components, utilities;

/* ============================================================
  reset
============================================================ */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  img {
    height: auto;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  button {
    cursor: pointer;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

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

  ul,
  ol {
    padding: 0;
  }
}

/* ============================================================
  base
============================================================ */
@layer base {
  :root {
    /* design colors */
    --color-red: #D50800;
    --color-gray: #707070;
    --color-gold: #DDBB2E;
    --color-black: #181818;
    --color-white: #ffffff;
    --color-border: #d8d8d8;
    --color-bg: #ffffff;
    --color-text: var(--color-black);
    --color-muted: var(--color-gray);
    --color-link: var(--color-red);

    /* typography */
    --font-base: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui, sans-serif;
    --font-serif: "Times New Roman", "Yu Mincho", "YuMincho", serif;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-body: 1rem;
    --font-size-lead: clamp(0.95rem, 1.6vw, 1.05rem);
    --font-size-title: clamp(1.35rem, 3vw, 1.75rem);
    --font-size-page-title: clamp(1.4rem, 3.4vw, 2rem);

    /* layout */
    --content-width: 960px;
    --content-width-narrow: 720px;
    --page-padding: clamp(20px, 5vw, 48px);

    /* spacing */
    --space-unit: 8px;
    --space-1: var(--space-unit);
    --space-2: calc(var(--space-unit) * 2);
    --space-3: calc(var(--space-unit) * 3);
    --space-4: calc(var(--space-unit) * 4);
    --space-5: calc(var(--space-unit) * 5);
    --space-6: calc(var(--space-unit) * 6);
    --space-8: calc(var(--space-unit) * 8);
    --space-10: calc(var(--space-unit) * 10);
    --section-gap-sm: clamp(32px, 6vw, 56px);
    --section-gap-md: clamp(48px, 8vw, 84px);
    --section-gap-lg: clamp(64px, 10vw, 110px);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-pill: 999px;
  }

  body {
    font-family: var(--font-base);
    font-size: var(--font-size-body);
    color: var(--color-text);
    background: var(--color-bg);
  }

  body.admin-bar .site-header {
    top: 32px;
  }

  @media (max-width: 782px) {
    body.admin-bar .site-header {
      top: 46px;
    }
  }

  ::selection {
    color: var(--color-white);
    background: var(--color-red);
  }
}

/* ============================================================
  wp
============================================================ */
@layer wp {
  .entry-content {
    line-height: 1.9;
  }

  .entry-content > * + * {
    margin-top: 1.5em;
  }

  .entry-content :is(h2, h3, h4) {
    margin-top: 2.1em;
    line-height: 1.45;
  }

  .entry-content h2 {
    padding-left: 0.7em;
    font-size: 1.25rem;
    border-left: 4px solid var(--color-red);
  }

  .entry-content h3 {
    font-size: 1.1rem;
  }

  .entry-content :is(ul, ol) {
    padding-left: 1.5em;
  }

  .entry-content li + li {
    margin-top: 0.4em;
  }

  .entry-content a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }

  .entry-content img {
    height: auto;
  }

  .wp-block-image {
    margin-block: var(--space-5);
  }
  .wp-block-image img {
    margin: var(--space-4) 0 0;
  }


  .wp-block-quote {
    padding-left: var(--space-3);
    border-left: 4px solid var(--color-gold);
  }

  .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding-inline: 12px;
    margin-inline: 4px;
    color: var(--color-black);
    background: var(--color-gold);
    border-radius: var(--radius-pill);
  }

  .page-numbers.current {
    color: var(--color-white);
    background: var(--color-red);
  }
}

/* ============================================================
  components
============================================================ */
@layer components {
  .container {
    width: min(100% - calc(var(--page-padding) * 2), var(--content-width));
    margin-inline: auto;
  }

  .container--narrow {
    width: min(100% - calc(var(--page-padding) * 2), var(--content-width-narrow));
    margin-inline: auto;
  }

  .section {
    padding-block: var(--section-gap-md);
  }

  .section--compact {
    padding-block: var(--section-gap-sm);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 74px;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgb(0 0 0 / 6%);
  }

  .site-header__inner {
    position: relative;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    height: 100%;
  }

  .site-header__logo {
    justify-self: center;
    width: 176px;
  }

  .site-header__logo img {
    width: 100%;
  }

  .site-header__menu-button,
  .site-header__mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
  }

  .site-header__menu-button {
    background: transparent;
    border: 0;
  }

  .site-header__menu-button img {
    width: 24px;
  }

  .site-header__mail img {
    width: 25px;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    left: var(--page-padding);
    display: none;
    min-width: 220px;
    padding: var(--space-3);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 24px rgb(0 0 0 / 10%);
  }

  .site-header.is-open .site-nav {
    display: block;
  }

  .site-nav ul {
    display: grid;
    gap: var(--space-2);
    list-style: none;
  }

  .site-nav a {
    font-size: var(--font-size-sm);

    &:hover {
      color: var(--color-red);
    }
  }

  .site-main {
    min-height: 70dvh;
  }

  .site-footer {
    border-top: 2px solid var(--color-gold);
    background: var(--color-white);
  }

  .site-footer__upper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: 64px;
  }

  .site-footer__logo {
    width: 160px;
  }

  .social-list {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
  }

  .social-list img {
    width: 20px;
    height: 20px;
    object-fit: contain;
  }

  .site-footer__bar {
    padding-block: 6px;
    font-size: 0.72rem;
    color: var(--color-white);
    background: var(--color-black);
  }
  
  .hero {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #fff;
  }

  .hero__video {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    filter: grayscale(100%) brightness(0.75) contrast(1.05);
  }

  .hero__video iframe,
  #hero-youtube-player {
    position: absolute;
    top: 50%;
    left: 50%;

    width: 177.78vh;
    height: 100vh;
    min-width: 100%;
    min-height: 56.25vw;

    transform: translate(-50%, -50%);
    pointer-events: none;

  }

  .hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.35);
  }

  .hero__logo {
    position: relative;
    z-index: 2;
    margin: 0;
    width: min(56vw, 420px);
  }

  .hero__logo img {
    display: block;
    width: 100%;
    height: auto;
  }

  .hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 32px;
    z-index: 2;
    margin: 0;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .hero__scroll::after {
    content: "↓";
    margin-left: 0.45em;
  }

  .section-heading {
    margin-bottom: var(--space-5);
    text-align: center;
  }

  .section-heading__title {
    font-size: var(--font-size-title);
    line-height: 1.3;
    letter-spacing: 0.04em;
  }

  .section-heading__label {
    display: block;
    margin-top: 2px;
    font-family: var(--font-serif);
    font-size: var(--font-size-sm);
    font-style: italic;
    color: var(--color-gold);
  }

  .about {
    display: grid;
    grid-template-columns: 180px 1fr;
    align-items: center;
    gap: var(--space-5);
    max-width: 720px;
    margin-inline: auto;
  }

  .about__image img {
    width: 100%;
  }

  .about__text {
    font-size: var(--font-size-sm);
    line-height: 2;
  }

  .works {
    display: grid;
    gap: var(--space-4);
  }

  .works__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .works__scroll {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .works__scroll.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
  }
  .works__scroll-item {
    flex: 0 0 clamp(260px, 32vw, 280px);
    scroll-snap-align: start;
  }
  .works__scroll_item img {
    pointer-events: none;
  }
  .scroll-hint {
    font-size: var(--font-size-sm);
    opacity: 0.7;
    padding-bottom: var(--space-2);
  }

  .work-card {
    text-align: center;
  }

  .work-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eee;
  }

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

  .work-card__title {
    margin-top: var(--space-2);
    font-size: 0.95rem;
    font-weight: 700;
  }

  .work-card__text {
    margin-top: var(--space-1);
    font-size: 0.82rem;
    line-height: 1.7;
    text-align: left;
  }

  .works__dots {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
  }

  .works__dots li {
    width: 14px;
    height: 14px;
    background: var(--color-gray);
    border-radius: 50%;
  }

  .works__dots li:first-child {
    background: var(--color-gold);
  }

  .service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    max-width: 900px;
    margin-inline: auto;
  }

  .service-card {
    position: relative;
    min-height: 200px;
    display: grid;
    place-items: end center;
    overflow: hidden;
    color: var(--color-white);
    background: #ddd;
  }

  .service-card:nth-child(4),
  .service-card:nth-child(5) {
    transform: translateX(50%);
  }

  .service-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .service-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgb(0 0 0 / 55%), rgb(0 0 0 / 5%));
  }

  .service-card__title {
    position: relative;
    z-index: 1;
    padding: var(--space-3);
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 1px 4px rgb(0 0 0 / 60%);
  }

  .info-table {
    width: min(100%, 720px);
    margin-inline: auto;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
  }

  .info-table th,
  .info-table td {
    padding: 14px 18px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  .info-table th {
    width: 120px;
    text-align: left;
    border-top-color: var(--color-red);
    border-bottom-color: var(--color-red);
  }

  .post-list {
    display: grid;
    gap: 0;
    width: min(100%, 720px);
    margin-inline: auto;
  }

  .post-list__item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: var(--space-3);
    align-items: center;
    padding-block: var(--space-2);
    border-bottom: 1px solid var(--color-border);
  }

  .post-list__thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eee;
  }

  .post-list__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .post-list__title {
    font-size: var(--font-size-sm);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    &:hover {
      color: var(--color-red);
    }
  }

  .archive-list {
    display: grid;
    gap: var(--space-2);
    width: min(100%, 760px);
    margin-inline: auto;
  }

  .archive-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: var(--space-3);
    align-items: center;
    padding-block: var(--space-2);
    border-bottom: 1px solid var(--color-border);
  }

  .archive-card__thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eee;
  }

  .archive-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .archive-card__title {
    margin-bottom: 4px;
    font-size: var(--font-size-sm);
  }

  .archive-card__excerpt {
    font-size: var(--font-size-xs);
    color: var(--color-muted);
  }

  .single-header {
    margin-bottom: var(--space-5);
  }

  .single-header__image {
    width: min(100%, 760px);
    margin-inline: auto;
    margin-top: var(--space-4);
  }

  .single-header__image img {
    width: 100%;
  }

  .single-title {
    font-size: var(--font-size-page-title);
    text-align: center;
    line-height: 1.4;
  }

  .contact-step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 680px);
    margin-inline: auto;
    margin-bottom: var(--space-4);
    color: var(--color-white);
    font-weight: 700;
    text-align: center;
  }

  .contact-step__item {
    padding-block: 10px;
    background: var(--color-black);
  }

  .contact-step__item.is-current {
    position: relative;
    background: var(--color-red);
  }

  .contact-step__item.is-current::after {
    content: "";
    position: absolute;
    top: 0;
    right: -26px;
    width: 0;
    height: 0;
    border-top: 21px solid transparent;
    border-bottom: 21px solid transparent;
    border-left: 26px solid var(--color-red);
    z-index: 1;
  }

  .contact-lead {
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    line-height: 1.9;
    text-align: center;
  }

  .form {
    display: grid;
    gap: var(--space-3);
    width: min(100%, 680px);
    margin-inline: auto;
  }

  .form__label {
    display: block;
    padding: var(--space-1);
    font-size: var(--font-size-sm);
    font-weight: 700;
  }

  .form__required {
    color: var(--color-red);
  }

  .form br {
    display: none;
  }

  .contact-lead a,
  .form a {
    text-decoration: underline;
  }

  .form input:not(.button,[type="checkbox"]),
  .form textarea,
  .form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-white);
  }

  .form textarea {
    min-height: 180px;
    resize: vertical;
  }

  .form__privacy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-1);
    align-items: center;
    font-size: var(--font-size-sm);
  }

  .form__privacy input {
    width: auto;
  }

  .form__actions {
    text-align: center;
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 54px;
    padding-inline: var(--space-5);
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-red);
    border: 0;
    border-radius: var(--radius-pill);

    &:hover {
      opacity: 0.86;
    }

    &:focus-visible {
      outline: 3px solid rgb(213 8 0 / 28%);
      outline-offset: 3px;
    }
  }

  .button--gold {
    color: var(--color-black);
    background: var(--color-gold);
  }

  .button-row {
    margin-top: var(--space-5);
    text-align: center;
  }

  .privacy-content {
    max-width: 760px;
    margin-inline: auto;
    font-size: var(--font-size-sm);
    line-height: 2;
  }

  .privacy-content h2 {
    margin-top: var(--space-2);
    margin-bottom: var(--space-1)
    font-size: var(--font-size-sm);
  }

  .privacy-content ul {
    padding-left: var(--space-2);
  }

  .fluentform .is-tel-error input[name="your_tel"] {
    border-color: var(--color-red);
    background: var(--color-white);
  }

  .fluentform .is-tel-error input[name="your_tel"]:focus {
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.16);
  }

  .js-tel-error {
    margin-top: var(--space-1);
    color: var(--color-red);
    font-size: var(--font-size-sm);
    line-height: 1.6;
  }

  .form__privacy .js-form-error {
    margin-top: var(--space-1);
  }

  @media (max-width: 768px) {
    .site-header {
      height: 56px;
    }

    .site-header__inner {
      grid-template-columns: 36px 1fr 36px;
    }

    .site-header__logo {
      width: 126px;
    }

    .site-nav {
      top: 56px;
      left: var(--page-padding);
      right: var(--page-padding);
    }

    .hero {
      min-height: 85svh;
      background-position: center;
    }

    .hero__logo {
      width: 190px;
    }

    .about {
      grid-template-columns: 112px 1fr;
      gap: var(--space-3);
    }

    .works__grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: var(--space-3);
    }

    .work-card {
      display: grid;
      grid-template-columns: 112px 1fr;
      gap: var(--space-2);
      align-items: start;
      text-align: left;
    }

    .work-card__title {
      margin-top: 0;
    }

    .service-grid {
      grid-template-columns: 1fr;
    }

    .service-card {
      min-height: 240px;
    }

    .service-card:nth-child(4),
    .service-card:nth-child(5) {
      transform: none;
    }

    .info-table tbody,
    .info-table tr {
      display: block;
      width: 100%;
    }

    .info-table tr {
      display: flex;
      flex-wrap: wrap;
    }

    .info-table th,
    .info-table td {
      box-sizing: border-box;
      width: 30%;
      padding: 10px 0;
      border-bottom-width: 0;
    }
    .info-table th.last,
    .info-table td.last{
      border-bottom-width: 1px;
    }

    .info-table td {
      width: 70%;
    }

    .archive-card {
      grid-template-columns: 82px 1fr;
    }

    .contact-step__item.is-current::after {
      border-top-width: 20px;
      border-bottom-width: 20px;
    }

    .site-footer__upper {
      min-height: 56px;
    }

    .site-footer__logo {
      width: 138px;
    }
  }

  #contact {
    scroll-margin-top: var(--space-4);
  }

  .breadcrumb {
    padding-top: 20px;
    padding-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .breadcrumb::-webkit-scrollbar {
    display: none;
  }

  .breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
  }

  .breadcrumb__item {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
  }

  .breadcrumb__item + .breadcrumb__item::before {
    content: ">";
    margin: 0 0.65em;
    color: #999;
    font-weight: 500;
  }

  .breadcrumb__item--home a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
  }

  .breadcrumb__item[aria-current="page"] {
    font-weight: 700;
  }

  .breadcrumb__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
  }

  @media (max-width: 767px) {
    .breadcrumb {
      position: relative;
      mask-image: linear-gradient(
        to right,
        #000 0,
        #000 calc(100% - 24px),
        transparent 100%
      );
    }
  }

}

/* ============================================================
  utilities
============================================================ */
@layer utilities {
  .u-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .u-text-center {
    text-align: center;
  }

  .u-mt-sm {
    margin-top: var(--space-3);
  }

  .u-mt-md {
    margin-top: var(--space-5);
  }
}
