/* スマホ画面でのみ改行する br（PCでは非表示） */
.sp-br { display: none; }

/* PC画面でのみ改行する br（スマホでは非表示）。br はデフォルトで表示されるため、
   PC用の表示指定は不要。下の @media でスマホ時のみ非表示にする。 */

/* モバイル用 下部固定ナビ（PCでは非表示） */
.mobile-bottom-nav { display: none; }

/* ===== Tablet (max-width: 1024px) ===== */
@media (max-width: 1024px) {
  .services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .svc:nth-child(2) { border-right: none; }
  .svc:last-child { border-right: none; }

  /* アーカイブ（grid）は2カラムに */
  .works-archive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* フロントのカルーセル（flex）は2枚表示に */
  .works-grid .work-item {
    flex: 0 0 calc(50% - 4px);
  }
}

/* ===== Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {
  /* スマホ画面でのみ改行を有効化 */
  .sp-br { display: inline; }

  /* PC専用の改行はスマホでは無効化 */
  .pc-br { display: none; }

  /* Nav */
  .nav {
    padding: 16px 20px;
    /* backdrop-filter を持つ要素は子孫の position:fixed の包含ブロックになり、
       オーバーレイメニューが全画面化できなくなるため、モバイルでは無効化する */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .nav-toggle { display: block; }
  .nav-right { gap: 16px; }
  .lang-switch { font-size: 13px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: #080808;
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow-y: auto;
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-close {
    display: block;
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 8px;
  }
  .nav-links ul {
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }
  .nav-links a {
    font-size: 14px;
    letter-spacing: 0.2em;
  }

  /* Hero */
  .hero { height: 60vh; min-height: 300px; }
  .hero-bottom {
    padding: 0 20px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  .hero-copy h1 { font-size: 22px; }

  /* Concept */
  .concept { padding: 40px 20px; }
  .concept-quote { font-size: 22px; }
  .concept-body { font-size: 14px; }

  /* Section rule */
  .sec-rule { padding: 0 20px; }

  /* About */
  .about-text { padding: 28px 20px; }
  .about-en { font-size: 15px; }

  /* Services */
  .services {
    grid-template-columns: 1fr;
  }
  .svc {
    padding: 24px 20px;
    border-right: none;
    border-bottom: 0.5px solid rgba(255,255,255,0.13);
  }
  .svc:last-child { border-bottom: none; }

  /* Works */
  .works-archive-grid {
    grid-template-columns: 1fr;
  }
  /* フロントのカルーセルは1枚+次カードが少し見える幅に */
  .works-grid .work-item {
    flex: 0 0 62%;
  }

  /* News */
  .news-section { padding: 20px 20px; }
  .news-row a {
    flex-wrap: wrap;
    gap: 8px;
  }
  .n-date { min-width: auto; }
  .n-title { flex-basis: 100%; }

  /* Contact */
  .contact {
    grid-template-columns: 1fr;
  }
  .contact-left {
    padding: 28px 20px;
    border-right: none;
    border-bottom: 0.5px solid rgba(255,255,255,0.13);
  }
  .contact-right { padding: 28px 20px; gap: 16px; }
  .contact-logo img { height: 60px; }

  /* Footer */
  .site-footer {
    padding: 16px 20px;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* 下部固定ナビが重ならないよう余白を確保 */
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
  }

  /* モバイル用 下部固定ナビ */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    height: 60px;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mbn-item {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .mbn-item.is-active {
    color: #fff;
  }
  /* 現在表示中のページの上にドットを表示 */
  .mbn-item.is-active::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
  }

  /* Page content */
  .page-content { padding: 40px 20px; }
  /* Contact gets a touch more vertical room than other pages on mobile too. */
  .contact-light .page-content { padding: 64px 20px; }
  .archive-header { padding: 28px 20px 16px; }
  .archive-list { padding: 0 20px; }

  /* Works single */
  .works-single {
    grid-template-columns: 1fr;
  }
  .works-single-left {
    position: relative;
    height: auto;
    padding: 40px 20px 32px;
  }
  .works-single-right {
    padding: 0 20px 40px;
    align-items: center;
    gap: 24px;
  }
  .works-single-media { width: 100%; }
  .works-single-title { font-size: 20px; }

  /* Company */
  .company-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ===== Small Mobile (max-width: 480px) ===== */
@media (max-width: 480px) {
  .hero-copy h1 { font-size: 18px; }
  .hero-copy p { font-size: 12px; }
  .about-en { font-size: 14px; }
  .about-ja { font-size: 11px; }
  .contact-left h2 { font-size: 18px; }
  .page-content h1 { font-size: 18px; }
}
