/* =========================================================
   TEAM D-MAX PAGE  (teamdmax.css)
   - page scope: .teamdmax-page
   - include: /html/user_data/teamdmax/css/teamdmax.css
========================================================= */

/* ---------- Variables ---------- */
:root{
  --brand: #2f6fa8;
  --text:  #111;
  --muted: #555;
  --line:  #d7dbe0;
  --cta:   #d68021;

  --container: 1000px; /* PC最大幅 */
  --pad-x: 10px;       /* 左右余白（PC/SP共通） */
}

/* ---------- Base / Scope ---------- */
.teamdmax-page *{ box-sizing: border-box; }

.teamdmax-page{
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--text);
  background:#fff;
}

.teamdmax-page a{ color: inherit; }
.teamdmax-page img{ max-width: 100%; height: auto; display:block; }

.teamdmax-container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  width: 100%;
}

/* =========================================================
   PAGE TABS
========================================================= */
.page-tabs{
  display:flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}

.page-tabs a{
  display: flex;
  align-items: center;       /* 上下センター */
  justify-content: center;   /* 左右センター */
  min-width: 220px;
  padding: 10px 14px;
  background: #d9d9d9;
  text-align: center;
  font-weight: 700;
  border-radius: 2px;
  text-decoration: none;
  line-height: 1.2;          /* 2行時の詰まり調整 */
  min-height: 48px;          /* ボタン高さ統一 */
}

.page-tabs a.active{
  background: var(--brand);
  color:#fff;
}

.lead{
  text-align:center;
  font-size: 13px;
  color: #333;
  margin: 8px 0 18px;
}

/* =========================================================
   SECTION COMMON
========================================================= */
.section{ margin: 26px 0; }

.section-title{
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--brand);
  letter-spacing: .02em;
}

.section-note{
  text-align: center;
  font-size: 12px;
  color: #555;
  margin: -6px 0 14px;
}

/* =========================================================
   DRIVER & MACHINE (main)
========================================================= */
.hero-grid{
  display:grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 16px;
  align-items: stretch;
}

/* placeholder */
.ph{
  background: #cfcfcf;
  border-radius: 2px;
}

/* left driver photo */
.hero-photo-img{
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.hero-right{
  display:flex;
  flex-direction: column;
  min-height: 100%;
}

.driver-name{
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
}

.driver-meta{
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 10px;
  color: #222;
}

/* badges */
.driver-badges{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 12px;
}

.driver-badges .badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 30px;
  padding: 2px 4px;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-decoration:none;
}

.driver-badges .badge img{
  height: 30px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  border-radius: 4px;
  display:block;
}

/* wide image */
.hero-wide{
  margin-top: auto;
  height: 300px;
  width: 100%;
  border-radius: 2px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.hero-wide-img{
  margin-top: auto;
  width: 100%;
  height: 300px;     /* PC固定 */
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* =========================================================
   SPECS (read more)
========================================================= */
.specs{
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.specs-content{
  max-height: 260px;
  overflow: hidden;
  transition: max-height .25s ease;
}

.specs.is-open .specs-content{ max-height: 9999px; }

.specs-table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
  line-height: 1.7;
}

.specs-table td{
  border: 1px solid var(--line);
  padding: 10px 10px;
  vertical-align: top;
  word-break: break-word;
}

.specs-table td:first-child{
  width: 160px;
  font-weight: 800;
  background: #f5f6f8;
}

.specs-table a{
  color: #0b5cab;
  text-decoration: underline;
}

.specs-actions{
  margin-top: 10px;
  text-align: center;
}

.specs-btn{
  border: 0;
  background: var(--brand);
  color:#fff;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 2px;
  cursor: pointer;
}

/* =========================================================
   MECHANIC
========================================================= */
.mechanic-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px 24px;
}

.mechanic{
  display:flex;
  gap: 12px;
  align-items: flex-start;
}

.mechanic img{
  width: 110px;
  object-fit: cover;
  border-radius: 4px;
}

.mechanic h3{
  font-size: 14px;
  margin: 0 0 4px;
  font-weight: 800;
}

.mechanic .meta{
  font-size: 11px;
  line-height: 1.6;
  margin: 0 0 10px;
  color: #222;
}

.mechanic .desc{
  font-size: 11px;
  line-height: 1.7;
  margin: 0;
  color: #333;
}

.mechanic .company{
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: #444;
}

.mechanic .company-name{ font-weight: 800; }
.mechanic .company-name a{ font-weight: 800; color: inherit; }
.mechanic .company-name a:hover{ text-decoration: underline; }
.mechanic .company-address{ color: #555; }

/* =========================================================
   EVENT GALLERY
========================================================= */
.year-tabs{
  display:flex;
  gap: 14px;
  margin: 10px 0 14px;
}

.year-tabs button{
  flex: 1;
  border: 0;
  background: #d9d9d9;
  padding: 10px 0;
  font-weight: 800;
  cursor: pointer;
  border-radius: 2px;
}

.year-tabs button.active{
  background: var(--brand);
  color: #fff;
}

.gallery-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gallery-grid a{
  display:block;
  border-radius: 2px;
  overflow:hidden;
  background:#111;
  aspect-ratio: 16 / 9;
  text-decoration:none;
}

.gallery-grid img{
  width:100%;
  height:100%;
  object-fit: cover;
}

.is-hidden{ display:none !important; }

/* =========================================================
   PERSONAL SPONSOR
========================================================= */
.cta{
  text-align:center;
  padding: 16px 0 8px;
}

.cta p{
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.9;
  color: #333;
}

.cta a{
  display:inline-block;
  background: var(--cta);
  color:#fff;
  font-weight: 800;
  padding: 12px 28px;
  border-radius: 2px;
  text-decoration:none;
}

/* =========================================================
   SPONSOR
   - border & radius are applied to images (not anchors)
========================================================= */
.sponsor-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.sponsor-grid a{
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}

.sponsor-grid a img{
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  display: block;

  border: 2px solid #c9c9c9;
  border-radius: 10px;
  background: #fff;
}

.sponsor-grid .empty{
  background: #cfcfcf;
  border: 0;
}

/* =========================================================
   SUPPORT DRIVER (grid 2col PC / 1col SP)
========================================================= */
.support-driver-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* PCは2列 */
  gap: 60px 50px;
  justify-content: start; /* 左詰め */
}

.support-driver-card{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 上段：左写真 / 右情報 */
.support-driver-card .sd-top{
  display: grid;
  grid-template-columns: 160px 1fr; /* 左を固定で小さめ */
  gap: 12px;
  align-items: start;
}

/* ドライバー写真：横100% + 縦auto（＝比率維持） */
.support-driver-card .sd-photo{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* 右側情報 */
.support-driver-card .sd-info{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.support-driver-card .sd-name{
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.support-driver-card .sd-meta{
  margin: 0;
  font-size: 12px;
  color: #222;
  line-height: 1.6;
}

/* SNSアイコン */
.support-driver-card .sd-badges{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.support-driver-card .sd-badges .badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 2px 4px;
  text-decoration: none;
}

.support-driver-card .sd-badges .badge img{
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* 下段：車両画像（横いっぱい） */
.support-driver-card .sd-car{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* SP：1列 */
@media (max-width: 768px){
  .support-driver-grid{
    grid-template-columns: 1fr;
  }

  /* SPは写真を少し大きくしたいなら調整 */
  .support-driver-card .sd-top{
    grid-template-columns: 110px 1fr;
  }
}


/* =========================================================
   Responsive (SP)
========================================================= */
@media (max-width: 768px){
  .page-tabs{
    flex-direction: column;
    align-items: center;
  }

  .page-tabs a{
    width: min(360px, 100%);
    min-width: 0;
  }

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

  .hero-wide-img{
    height: auto;         /* SPは高さ固定しない */
    object-fit: contain;  /* 余白許容で表示崩れ防止 */
  }

  .mechanic-grid{ grid-template-columns: 1fr; }
  .mechanic img{ width: 96px; height: 96px; }

  .gallery-grid{ grid-template-columns: repeat(2, 1fr); }
  .sponsor-grid{ grid-template-columns: repeat(2, 1fr); }

  .year-tabs{ gap: 10px; }

  .specs-table td:first-child{ width: 120px; }


}
