/* 主色調微調，讓網站更有個人風格 */
:root {
  --md-primary-fg-color: #0f766e;
  --md-primary-fg-color--light: #14b8a6;
  --md-primary-fg-color--dark: #115e59;
  --md-accent-fg-color: #f59e0b;
}

/* Header and tabs with image background */
.md-header,
.md-tabs {
  background-image:
    linear-gradient(135deg, rgba(15, 23, 42, 0.68), rgba(30, 58, 138, 0.52)),
    url("images/hero.jpg");
  background-size: cover;
  background-position: center top;
}

/* 首頁 Hero 區塊（可搭配大背景圖） */
.hero {
  position: relative;
  padding: 3.5rem 1.8rem;
  border-radius: 1.5rem;
  /* 第一層是漸層遮罩，第二層是背景圖 */
  background-image:
    linear-gradient(135deg, rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0.24)),
    url("images/hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #f9fafb;
  margin-bottom: 2.2rem;
  min-height: 260px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
  overflow: hidden;
}

.hero-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  border-radius: 0;
  min-height: 72vh;
  padding: 0;
  box-shadow: none;
  display: flex;
  align-items: flex-end;
  background-position: center center;
}

/* Home page full-bleed layout: remove sidebar/grid constraints only when hero-full exists */
.md-main__inner:has(.hero-full) {
  display: block;
  max-width: none;
}

.md-main__inner:has(.hero-full) .md-sidebar--primary {
  display: none;
}

.md-main__inner:has(.hero-full) .md-content {
  margin-left: 0;
  max-width: 100%;
}

.md-main__inner:has(.hero-full) .md-content__inner {
  margin: 0;
  padding: 0;
}

.md-main__inner:has(.hero-full) .md-content__inner::before {
  display: none;
}

.hero-inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.9;
  max-width: 760px;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid rgba(249, 250, 251, 0.3);
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.hero-button.primary {
  background: #f59e0b;
  color: #0f172a;
  box-shadow: 0 12px 25px rgba(245, 158, 11, 0.4);
}

.hero-button.primary:hover {
  background: #fbbf24;
  transform: translateY(-1px);
}

.hero-button.secondary {
  background: rgba(15, 23, 42, 0.5);
  color: #e5e7eb;
}

.hero-button.secondary:hover {
  background: rgba(15, 23, 42, 0.8);
  transform: translateY(-1px);
}

/* 卡片網格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(20, 184, 166, 0.75);
  background: rgba(15, 23, 42, 0.04);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.3rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0.15rem 0 0.6rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.card a {
  font-size: 0.88rem;
  text-decoration: none;
  font-weight: 500;
}

/* 小標題強調 */
.md-typeset h2 {
  border-bottom: 1px solid rgba(148, 163, 184, 0.5);
  padding-bottom: 0.2rem;
  margin-bottom: 0.9rem;
}

/* 讓首頁 section 與一般文章稍微區隔 */
.md-typeset .homepage-section {
  margin-top: 2.5rem;
}

/* 調整文章內 code 區塊外觀 */
.md-typeset code {
  border-radius: 0.35rem;
  padding: 0.08rem 0.3rem;
}

.md-typeset pre > code {
  border-radius: 0.75rem;
}

@media (max-width: 900px) {
  .hero-full {
    min-height: 58vh;
  }

  .hero-inner {
    padding: 5.5rem 1.2rem 2.4rem;
  }

  .hero h1 {
    font-size: 1.95rem;
  }
}

