/* =========================
初心者向け設定エリア
ここだけ変えると全体の印象が変わります
========================= */

:root{

  --color-primary:#003c8f;
  --color-accent:#2e7dff;
  --color-bg:#f5f7fb;
  --color-surface:#ffffff;

  --color-text:#222222;
  --color-muted:#666666;
  --color-white:#ffffff;

  --site-width:1120px;

  --radius:16px;
  --shadow:0 8px 24px rgba(0,0,0,.08);

  --title-font:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "Meiryo",
    sans-serif;

  --body-font:
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

/* =========================
共通設定
========================= */

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:var(--body-font);
  background:var(--color-bg);
  color:var(--color-text);
  line-height:1.8;
}

img{
  max-width:100%;
  display:block;
}

a{
  color:var(--color-primary);
  text-decoration:none;
}

a:hover{
  text-decoration:underline;
}

.container{
  width:min(var(--site-width), calc(100% - 32px));
  margin:0 auto;
}

.section{
  padding:56px 0;
}

.center{
  text-align:center;
}

/* =========================
ヘッダー
========================= */

.site-header{
  position:sticky;
  top:0;
  z-index:100;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
  border-bottom:1px solid #e8e8e8;
}

.header-inner{
  min-height:78px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo-mark{
  width:46px;
  height:46px;
  border-radius:14px;
  background:linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color:var(--color-white);
  display:grid;
  place-items:center;
  font-weight:bold;
}

.brand-text{
  min-width:0;
}

.site-title{
  margin:0;
  font-size:1.12rem;
  font-family:var(--title-font);
  line-height:1.4;
}

.site-sub{
  margin:0;
  color:var(--color-muted);
  font-size:.9rem;
}

.menu-wrap{
  position:relative;
}

.menu-btn{
  display:none;
  border:none;
  background:var(--color-primary);
  color:var(--color-white);
  padding:10px 12px;
  border-radius:10px;
  font-size:1rem;
  cursor:pointer;
}

.menu{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  gap:4px;
}

.menu li{
  margin:0;
}

.menu a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  color:var(--color-text);
  font-size:.95rem;
}

.menu a:hover,
.menu a.current{
  background:#eef4ff;
  color:var(--color-primary);
  text-decoration:none;
}

.lang-link{
  white-space:nowrap;
  color:var(--color-primary);
  font-weight:bold;
}

/* =========================
トップエリア
========================= */

.hero{
  padding:36px 0 20px;
  background:linear-gradient(180deg, #eef4ff 0%, transparent 100%);
}

.hero-grid{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:24px;
  align-items:center;
}

.hero-card{
  background:var(--color-surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:30px;
}

.badge{
  display:inline-block;
  margin-bottom:12px;
  padding:4px 10px;
  border-radius:999px;
  background:#eef4ff;
  color:var(--color-primary);
  font-size:.85rem;
  font-weight:bold;
}

.hero-title{
  margin:0 0 18px 0;
  font-family:var(--title-font);
  font-size:clamp(1.9rem, 3.8vw, 3rem);
  line-height:1.25;
}

.hero-text{
  margin:0 0 18px 0;
  font-size:1rem;
  color:var(--color-text);
}

.hero-media img{
  width:100%;
  height:420px;
  object-fit:cover;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* =========================
パネル共通
========================= */

.panel{
  background:var(--color-surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
}

.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
}

.section-title{
  margin:0 0 20px 0;
  font-size:1.5rem;
  font-family:var(--title-font);
}

.news-list{
  list-style:none;
  margin:0;
  padding:0;
}

.news-list li{
  padding:14px 0;
  border-bottom:1px solid #ececec;
}

.news-list li:last-child{
  border-bottom:none;
}

.news-date{
  display:inline-block;
  min-width:110px;
  color:var(--color-muted);
  font-variant-numeric:tabular-nums;
}

.info-text{
  margin:0 0 16px 0;
}

/* =========================
カード
========================= */

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

.card{
  background:var(--color-surface);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
}

/* =========================
カード画像
========================= */

.card img{
  width:100%;
  height:auto;
  object-fit:cover;
  border-radius:10px;
  margin-bottom:10px;
}

.card-title{
  margin:0 0 12px 0;
  font-size:1.15rem;
  font-family:var(--title-font);
}

.card-text{
  margin:0;
}

/* =========================
フッター
大学研究室サイト向け
========================= */

.footer{
  margin-top:40px;
  background:#0f2f66;
  color:var(--color-white);
}

.footer-lab{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:32px;
  padding:40px 20px;
}

.footer-block{
  min-width:0;
}

.footer-title{
  margin:0 0 16px 0;
  font-size:1.4rem;
  line-height:1.5;
  font-family:var(--title-font);
}

.footer-heading{
  margin:0 0 12px 0;
  font-size:1rem;
  padding-bottom:6px;
  border-bottom:1px solid rgba(255,255,255,0.3);
}

.footer-text{
  margin:0 0 10px 0;
  color:rgba(255,255,255,0.92);
  font-size:.95rem;
  line-height:1.8;
}

.footer-bottom{
  border-top:1px solid rgba(255,255,255,0.2);
  text-align:center;
  padding:16px 20px;
}

.footer-bottom p{
  margin:0;
  font-size:.9rem;
  color:rgba(255,255,255,0.85);
}

/* =========================
スマホ対応
========================= */

@media (max-width:900px){

  .hero-grid,
  .grid-2,
  .footer-lab,
  .card-grid{
    grid-template-columns:1fr;
  }

  .hero-media img{
    height:300px;
  }
}

@media (max-width:768px){

  .menu-btn{
    display:block;
  }

  .menu{
    display:none;
    position:absolute;
    right:0;
    top:54px;
    width:220px;
    flex-direction:column;
    align-items:stretch;
    background:var(--color-white);
    border:1px solid #e5e5e5;
    border-radius:14px;
    box-shadow:var(--shadow);
    padding:8px;
  }

  .menu.open{
    display:flex;
  }

  .lang-link{
    display:none;
  }

  .section{
    padding:40px 0;
  }

  .hero{
    padding:24px 0 12px;
  }

  .hero-card{
    padding:22px;
  }

  .hero-media img{
    height:240px;
  }

  .footer-lab{
    padding:30px 20px;
    gap:24px;
  }
}


/* ==================================================
   Safari / ローカル表示 安定化のための補足設定
   既存の見た目はできるだけそのままにしています
================================================== */

/* site-subtitle というクラス名でも同じ見た目になるようにしています */
.site-sub,
.site-subtitle{
  margin:0;
  color:var(--color-muted);
  font-size:.9rem;
}

/* Safariでヘッダーが見えなくなるケースを避けるため、
   透明度やぼかしに依存しすぎない設定にしています */
.site-header{
  position:relative;
  background:#ffffff;
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
}

/* 画像は画面幅に合わせて自然に縮むようにしています */
.hero-media{
  width:100%;
}

.hero-media img{
  width:100%;
  max-width:100%;
  height:auto;
  object-fit:cover;
}

/* フッターの研究室名が折り返しで見えにくくならないよう調整 */
.footer-title{
  word-break:keep-all;
}

/* 画面幅が狭いときに要素がはみ出さないように調整 */
.brand,
.footer-block,
.panel,
.card{
  min-width:0;
}

/* Safari でもメニュー表示が安定するように調整 */
.menu{
  flex-wrap:wrap;
}

@media (max-width:900px){

  .header-inner{
    align-items:flex-start;
  }

  .hero-grid,
  .grid-2,
  .card-grid,
  .footer-lab{
    grid-template-columns:1fr;
  }

  .hero-media img{
    width:100%;
    height:auto;
  }
}

@media (max-width:768px){

  .menu{
    display:none;
  }

  .menu.open{
    display:flex;
  }

  .nav-area,
  .menu-wrap{
    width:100%;
  }

  .lang-link{
    display:none;
  }
}
