/*
Theme Name: unihub
Theme URI: https://unihub.jp
Author: unihub編集部
Description: 関関同立の大学情報メディア「unihub」カスタムWordPressテーマ
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: unihub
Tags: blog, news, university, japanese, dark
*/

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans JP", sans-serif; color: #1f2937; background: #f9fafb; }
img { max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* unihub ロゴ */
.unihub-logo { font-family: "Nunito", "Noto Sans JP", sans-serif; font-weight: 900; font-size: 1.4rem; color: #ffffff; letter-spacing: -0.03em; display: inline-flex; align-items: baseline; }
.logo-dot { display: inline-block; width: 5px; height: 5px; background: #3b82f6; border-radius: 50%; margin: 0 0.5px; position: relative; top: -7px; }

/* WordPress カスタムロゴのサイズ固定 */
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo-link img,
img.custom-logo {
  height: 32px !important;
  width: auto !important;
  max-height: 32px !important;
  max-width: 160px !important;
  object-fit: contain;
  display: block;
}
/* フッター内のロゴは少し小さく */
footer .custom-logo-link img,
footer img.custom-logo {
  height: 28px !important;
  max-height: 28px !important;
}

/* ヒーロー全画面 */
.hero-fullscreen { position: relative; width: 100%; height: 100vh; min-height: 600px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 55%, rgba(0,0,0,0.15) 100%); }
.hero-content { position: relative; z-index: 10; padding: 0 2rem 5rem; max-width: 1152px; margin: 0 auto; width: 100%; }
@media (max-width: 640px) { .hero-content { padding: 0 1.25rem 3.5rem; } }

/* ヘッダー — 常に #E9B800 */
#site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: #E9B800; transition: box-shadow 0.3s; }
#site-header.transparent { background: #E9B800; }
#site-header.scrolled { background: rgba(233,184,0,0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
#site-header.solid { background: #E9B800; }

/* ナビリンク: 常にダークテキスト */
.nav-link-dark { color: rgba(0,0,0,0.65); font-size: 0.875rem; font-weight: 500; padding: 0.45rem 0.7rem; border-radius: 0.5rem; transition: color 0.15s, background 0.15s; display: inline-block; }
.nav-link-dark:hover { color: #000; background: rgba(0,0,0,0.07); }

/* joinリンク: 常にダーク強調 */
.join-link { color: #1e1e1e !important; font-weight: 800; }

/* ロゴ: 白のまま表示 */
.site-logo { filter: none; }

body.has-hero main { padding-top: 0; }
body:not(.has-hero) main { padding-top: 69px; } /* logo 45px + padding 12x2 */

/* ===== unihub グラデーション ピンク→オレンジ→イエロー ===== */
:root {
  --uh-color:     #E9B800;
  --uh-grad:      #E9B800;
  --uh-grad-diag: #E9B800;
}

/* 背景に塗る */
.uh-grad-bg { background: var(--uh-grad); }

/* テキストをアクセントカラーにする */
.uh-grad-text {
  color: var(--uh-color);
}

/* グラデーションボタン */
.uh-grad-btn {
  background: var(--uh-color);
  color: #1e1e1e !important; /* 黄色背景なのでダークテキスト */
  font-weight: 800;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 6px 20px rgba(233,184,0,0.30);
}
.uh-grad-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ロゴドットをグラデーション対応に */
.logo-dot-grad {
  display: inline-block; width: 5px; height: 5px;
  background: #E9B800;
  border-radius: 50%; margin: 0 0.5px; position: relative; top: -7px;
}

/* グラデーションアクセントライン */
.uh-grad-line {
  height: 3px;
  border-radius: 9999px;
  background: var(--uh-grad);
}

/* ===== Gutenberg ブロックエディタ対応 ===== */
.entry-content { font-size: 0.9375rem; line-height: 1.9; color: #374151; }
.entry-content h2 { font-size: 1.5rem; font-weight: 800; color: #1e1e1e; margin: 2rem 0 1rem; }
.entry-content h3 { font-size: 1.2rem; font-weight: 700; color: #1f2937; margin: 1.5rem 0 0.75rem; }
.entry-content h4 { font-size: 1rem; font-weight: 700; color: #374151; margin: 1.25rem 0 0.5rem; }
.entry-content p { margin: 0 0 1rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { border-left: 4px solid #E9B800; padding: 1rem 1.25rem; margin: 1.5rem 0; background: #fdf8ff; border-radius: 0 8px 8px 0; }
.entry-content blockquote p { margin: 0; color: #6b7280; }
.entry-content .wp-block-image { margin: 1.5rem 0; }
.entry-content .wp-block-button .wp-block-button__link { background: #E9B800; color: #fff !important; border-radius: 9999px !important; font-weight: 700; padding: 0.7rem 1.5rem; border: none; }
.entry-content .wp-block-separator { border: none; border-top: 2px solid #f0f0f0; margin: 2rem 0; }
.entry-content .wp-block-table table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.entry-content .wp-block-table td, .entry-content .wp-block-table th { border: 1px solid #e5e7eb; padding: 0.6rem 0.875rem; }
.entry-content .wp-block-table th { background: #f9fafb; font-weight: 700; }
.alignwide { max-width: 100%; }
.alignfull { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; }
.wp-block-cover, .wp-block-media-text { border-radius: 16px; overflow: hidden; }

/* ===== モバイル対応 ===== */
@media (max-width: 768px) {
  /* ヘッダーロゴをモバイルサイズに縮小 */
  .site-logo { height: 48px !important; max-width: 180px !important; }
  body:not(.has-hero) main { padding-top: 48px !important; }

  /* インラインスタイルのグリッドをモバイルで1カラムに */
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 授業情報グリッド */
  .tani-grid { grid-template-columns: 1fr !important; }

  /* トップFRESHMEN セクション内カード */
  [style*="align-items:center; justify-content:space-between; flex-wrap:wrap"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* セクションのパディング縮小 */
  [style*="padding:5rem 0"],
  [style*="padding:0 0 6rem"] { padding-top: 3rem !important; padding-bottom: 3rem !important; }

  /* SNS/Contactカード横並び→縦 */
  [style*="grid-template-columns:1fr 1fr; gap:24px"] {
    grid-template-columns: 1fr !important;
  }

  /* 単位情報インフォパネル */
  [style*="grid-template-columns:repeat(3,1fr); gap:12px"],
  [style*="grid-template-columns:repeat(3, 1fr); gap:12px"],
  [style*="grid-template-columns:repeat(3,1fr); gap:4px"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* ヒーローh1 */
  .hero-content h1 { font-size: 2.5rem !important; }
}

/* ===== アニメーション (オーブ) ===== */
@keyframes uh-orb-float {
  0%,100% { transform: translate(0,0) scale(1); }
  35%      { transform: translate(20px,-16px) scale(1.05); }
  70%      { transform: translate(-10px,12px) scale(0.96); }
}
.uh-orb { animation: uh-orb-float 10s ease-in-out infinite; }
