/* Mobile responsive styles extracted from styles.css */

@media (max-width: 480px) {
  .role-tag {
    font-size: 0.65rem;
    padding: 4px 10px;
  }
}

/* ======================= */
/* ニュース詳細ページのレスポンシブ対応 */
/* ======================= */

@media (max-width: 768px) {
  .news-detail-page {
    --news-detail-page-top-pad: 96px;
    --news-detail-page-side-pad: 20px;
    padding: var(--news-detail-page-top-pad) var(--news-detail-page-side-pad) 0;
    gap: 28px;
    min-height: calc(var(--news-detail-viewport-height) - var(--news-detail-page-top-pad));
  }

  .news-detail-breadcrumb,
  .news-detail-hero,
  .news-detail-main {
    width: 100%;
  }

  .news-detail-back-link {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .news-detail-hero {
    padding: 28px 24px;
  }

  .news-detail-article {
    padding: 28px 24px;
  }

  .news-detail-meta {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .news-detail-page {
    --news-detail-page-top-pad: 88px;
    --news-detail-page-side-pad: 16px;
    padding: var(--news-detail-page-top-pad) var(--news-detail-page-side-pad) 0;
    min-height: calc(var(--news-detail-viewport-height) - var(--news-detail-page-top-pad));
  }

  .news-detail-hero {
    border-radius: 20px;
    padding: 24px 20px;
    background-position: center top;
  }

  .news-detail-article {
    border-radius: 20px;
  }

  .news-detail-category {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
  }

  .news-detail-title {
    font-size: clamp(1.65rem, 8.5vw, 2.1rem);
    line-height: 1.35;
    letter-spacing: 0.02em;
  }

  .news-detail-lede {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  .news-detail-back-link {
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

/* ======================= */
/* レスポンシブ対応 768px 以下用 */
/* ======================= */
@media (max-width: 768px) {

  .background-wrapper {
    background-image: url('assets/images/backgrounds/headerbackground-mobile.png');
    background-size: cover; /* ← contain → cover に変更 */
    background-repeat: no-repeat;
    background-position: center top;
  }

  .background-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('assets/images/backgrounds/newbackground-mobile.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  body.news-detail-page .background-wrapper {
    background-image: url('assets/images/backgrounds/newbackground-mobile.png');
  }

  body.news-detail-page .background-wrapper::after {
    background-image: url('assets/images/backgrounds/newbackground-mobile.png');
    opacity: 1;
  }

  body.bg-scrolled .background-wrapper::after {
    opacity: 1;
  }

  header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000; /* ← 必ず dropdown より上に */
  height: 60px; /* 元のヘッダー高さに戻す */
  transition: height 0.3s ease;
  display: flex;
  align-items: center;
  }

  #top-image {
    margin-bottom: -150px ; /* ← 余白を縮める */
  }

  .carousel-row.top {
    top: 17%;
  }

  .carousel-row.bottom {
    bottom: 20%;
  }

  .carousel-track img,
  .slide-track img {
    width: auto;
    height: 170px; /* アスペクト比を保ったまま縮小 */
    object-fit: cover;
    border-radius: 12px;
  }

  .carousel-track {
    gap: 16px; /* 間隔を縮めて2枚表示を狙う */
  }

  .centered-logo {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    transform: scale(1.6);
    transform-origin: center;
  }

  .text-container {
    top: 45%; /* ← 中央よりやや上に */
    transform: translate(-50%, -50%);
  }

  .text-container h1,
  .centered-text {
    font-size: 2.5rem;
  }

  .centered-logo {
  opacity: 0;
  animation: fadeZoomIn 1.2s ease-out 0.5s forwards;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    padding: 8px;
  }

  .dropdown-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    color: #fff;
    padding: 130px 20px 20px; /* header高さ110px + 余白20px */
    display: none;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
    transition: background 0.5s ease;
    z-index: -1; /* ヘッダーより背面で背景を途切れさせない */
  }

  .dropdown-menu.visible {
    display: flex;
  }

  .dropdown-menu li {
    margin-bottom: 20px;
  }

  .dropdown-menu li a {
    font-size: 1.4rem;
    color: #fff;
    text-align: left;
  }

  .dropdown-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .dropdown-menu li a:visited,
  .dropdown-menu li a:active {
    color: #fff;
  }

  .menu-icon {
    position: relative; /* 必須：z-index を効かせるため */
    z-index: 10001;     /* dropdown-menu(-1)より上に */
  }

  .menu-icon {
    position: relative; /* 必須：z-index を効かせるため */
    z-index: 10001;     /* dropdown-menu（9999）より上に！ */
  }

  .business-container {
    flex-direction: column;
  }

  .business-item {
    position: relative;
  }

  .business-image {
    width: 100%;
    aspect-ratio: 2200 / 840;
    object-fit: cover;
    margin: 0;
  }

  .business-description {
    position: static;
    width: 100%;
    max-width: none;
    padding: 15px;
    background: #f9f9f9;
    color: #333;
    border-radius: 0 0 8px 8px;
  }

  .business-description h3 {
    color: #4169e1;
  }

  .business-description p {
    color: #333;
    overflow-wrap: anywhere;
  }

  .link-hub {
    margin: 32px auto 48px;
    padding: 24px 12px 28px;
    border-radius: 16px;
  }

  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
  }

  .link-card {
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(230, 239, 255, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  }

  .link-card-media {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: auto;
    border-radius: 0;
    overflow: hidden;
  }

  .link-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .link-card-number {
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    font-size: 0.68rem;
    box-shadow: 0 8px 16px rgba(10, 12, 40, 0.12);
  }

  .link-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px 8px 12px;
    padding-right: 8px;
    min-height: unset;
    justify-content: flex-start;
    gap: 3px;
  }

  .link-card-eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.05em;
  }

  .link-card-title {
    font-size: 0.84rem;
    line-height: 1.25;
    margin: 1px 0 1px;
  }

  .link-card-description {
    font-size: 0.68rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .link-card-footer {
    align-self: auto;
    margin-top: 4px;
    justify-content: space-between;
    align-items: center;
  }

  .link-card-action {
    font-size: 0.72rem;
  }

  .link-card-arrow {
    font-size: 0.96rem;
  }
  
  /* 社員カードを2列に並べるグリッド設定 */
  .employee-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2列表示を維持しつつ列幅を最大化 */
    gap: 14px; /* 基本の縦間隔をキープ */
    column-gap: 12px; /* カード同士の横方向の余白を広げて間隔を確保 */
    padding: 6px; /* 画面端にわずかに余白を戻して窮屈さを解消 */
    margin: 0;
  }

  /* 個々の社員カードサイズ調整 */
  .employee-card {
    width: 100%;
    max-width: none;
    margin: 0;
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid #000;
    background-color: #0d0d0d;
    backdrop-filter: blur(6px);
  }

  /* 画像が正方形になるように比率を固定 */
  .employee-card .image-wrapper {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5; /* やや縦長にしてカードを大きく */
    border-radius: inherit;
    overflow: hidden;
  }

  /* 役職タグを縮小 */
  .employee-card .role-tag {
    font-size: 0.5rem;
    padding: 2px 6px;
  }

  /* 名前やMBTIなどの情報位置とサイズ調整 */
  .employee-card .employee-info {
    bottom: 22px;
    left: 8px;
  }

  .employee-card .employee-name-overlay {
    padding: 3px 6px;
  }

  .employee-card .employee-name {
    font-size: 0.6rem;
  }

  .employee-card .employee-info .mbti-label {
    font-size: 0.6rem;
    padding: 3px 6px;
  }

  /* 入社日ラベルを縮小 */
  .employee-card .join-date {
    bottom: 8px;
    left: 8px;
    font-size: 0.5rem;
  }

  /* 詳細リンクを縮小 */
  .employee-card .detail-link {
    bottom: 8px;
    right: 8px;
    font-size: 0.6rem;
  }

  #load-more-btn {
    display: block;
    margin: 20px auto;
  }

  .info-card {
    width: 90%;
    bottom: -80px;
  }

  h2 {
    font-size: 2rem;
  }

  #purpose h2, #mission h2 {
    font-size: clamp(2rem, 8vw, 4rem);
  }

  #purpose h3, #purpose h4, #mission h3 {
    font-size: 1.5rem;
    text-shadow:
      0 0 4px rgba(255, 255, 255, 0.3),
      0 0 8px rgba(255, 255, 255, 0.2),
      0 0 12px rgba(255, 255, 255, 0.15);
  }

  #purpose p, #mission p {
    font-size: 0.9rem;
    line-height: 1.8;
    padding: 15px;
    word-break: break-word;
  }

  /* Purpose/Mission セクションを画像とテキストが一体となるように背景で包む */
  #purpose,
  #mission {
    background: radial-gradient(circle at top, #1a1a1a 0%, #000 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    margin: 40px 0;
    padding: 0;
  }

  #purpose p,
  #mission p {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
  }

  #news {
    position: relative;
    margin: 0;
    padding: 52px 0 56px;
    border-radius: 0;
    box-shadow: none;
    background:
      radial-gradient(120% 120% at 0% 0%, rgba(65, 105, 225, 0.32), transparent 70%),
      radial-gradient(140% 140% at 100% 0%, rgba(255, 105, 180, 0.28), transparent 72%),
      rgba(5, 6, 15, 0.92);
    overflow: hidden;
  }

  #news::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 14, 40, 0.85), rgba(20, 8, 40, 0.75));
    mix-blend-mode: screen;
    opacity: 0.55;
    pointer-events: none;
  }

  #news > * {
    position: relative;
    z-index: 1;
  }

  #news .section-hero-intro,
  #news .filter-container,
  #news #news-list {
    width: min(92vw, 520px);
    margin-left: auto;
    margin-right: auto;
  }

  #news .section-hero-intro {
    padding: 0;
    margin-bottom: clamp(28px, 8vw, 44px);
  }

  #news .section-hero-card {
    width: 100%;
    border-radius: 22px;
    background: rgba(14, 10, 36, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  #news .filter-container {
    justify-content: flex-start;
    gap: 12px;
    padding: 0 6px;
  }

  #news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
  }

  .overlay-text h3 {
    font-size: 2.5rem !important;
  }

  .overlay-text h4 {
    font-size: 2rem;
    white-space: nowrap;
  }

  .overlay-text {
    top: 33%; /* モバイルではもう少し上に調整 */
  }

  .mission-text {
    top: 34%; /* ← MISSIONの見出し位置を少し上に調整 */
  }

  .mission-text h3 {
    font-size: 2rem !important; /* 拡大してメッセージを強調 */
  }

  #news-list li {
    border-radius: 16px;
    padding: 18px 16px 20px;
  }

  #news-list li a.news-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #news-list li a.news-link span:first-child {
    min-width: auto;
    font-size: 0.88rem;
  }

  #news-list li a.news-link span:last-child {
    font-size: 1rem;
  }

  #news-list li {
    font-size: 0.95em;
    padding: 18px 16px 20px;
  }

.site-footer {
    margin-top: 48px;
    padding: 28px 18px 36px;
    border-radius: 0;
  }

  .site-footer__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px 20px;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }

  .site-footer__nav,
  .site-footer__links {
    width: 100%;
  }

  .site-footer__logo-wrap {
    padding: 10px 16px;
    border-radius: 14px;
    flex-shrink: 0;
  }

  .site-footer__logo {
    width: clamp(88px, 30vw, 110px);
  }

  .site-footer__copy {
    margin: 0;
  }

  .site-footer__column-title {
    font-size: 0.95rem;
  }

  .site-footer__list {
    gap: 10px;
  }

  .site-footer__list a {
    font-size: 0.95rem;
  }
}

@keyframes headerBangGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}