/*
Theme Name: 大中文教
Description: 大中文教官方網站佈景主題。
Version: 1.3.1
Text Domain: dachung-final
*/

:root {
  --ink: #142033;
  --text: #344054;
  --muted: #667085;
  --line: #d9e2ea;
  --paper: #ffffff;
  --soft: #f5f8fb;
  --blue: #164f8f;
  --blue-dark: #0c2d58;
  --green: #16806d;
  --red: #d94032;
  --yellow: #f2c94c;
  --shadow: 0 14px 36px rgba(20, 32, 51, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html,
body {
  min-height: 100%;
  overflow-y: auto;
}
body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.7;
  background: var(--paper);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3 { margin: 0; }

.site-header {
  position: relative;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(20, 32, 51, .06);
}
.brand-row {
  display: flex;
  align-items: center;
  max-width: 1180px;
  min-height: 118px;
  margin: 0 auto;
  padding: 18px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  width: min(360px, 82vw);
}
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 48px;
  padding: 0 18px;
  color: var(--paper);
  font-size: 16px;
  font-weight: 900;
  background: var(--blue-dark);
  overflow: visible;
}
.site-nav .primary-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav > a,
.site-nav li > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  color: var(--paper);
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 0;
}
.site-nav > a:hover,
.site-nav li > a:hover {
  background: var(--blue);
}

.school-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(18px, 5vw, 72px);
  color: var(--paper);
  background: var(--blue-dark);
}
.school-strip strong { color: var(--yellow); }
.school-strip a {
  padding: 6px 13px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
  background: var(--yellow);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(360px, 1.2fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(42px, 6vw, 80px) clamp(18px, 5vw, 72px);
  background: var(--soft);
}
.intro-panel h1 {
  color: var(--ink);
  font-size: clamp(48px, 7vw, 92px);
  line-height: 1.05;
}
.intro-panel .lead {
  max-width: 650px;
  margin-top: 20px;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
}
.intro-panel img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}
.section {
  padding: clamp(56px, 7vw, 92px) clamp(18px, 5vw, 72px);
}
.section.compact { padding-top: clamp(42px, 6vw, 72px); }
.section.soft { background: var(--soft); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.section-heading h2 {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
}
.text-link {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--blue);
  font-weight: 900;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.news-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(20, 32, 51, .05);
}
.news-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.news-item div { padding: 16px; }
.news-item time {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
.news-item h3 {
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.35;
}
.news-item p { margin-top: 9px; color: var(--muted); font-size: 15px; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.video-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 8px 20px rgba(20, 32, 51, .05);
}
.video-card a {
  display: grid;
  height: 100%;
  color: var(--ink);
}
.video-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--soft);
}
.video-card span {
  padding: 14px 16px 4px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.45;
}
.video-card time {
  padding: 0 16px 16px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
.video-fallback {
  min-height: 120px;
}
.video-fallback a {
  align-content: center;
  text-align: center;
}
.content-grid,
.course-columns,
.enrollment-cards,
.platform-grid {
  display: grid;
  gap: 16px;
}
.content-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.content-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.about-grid { align-items: stretch; }
.content-grid article,
.contact-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.content-grid h3,
.course-card h3,
.contact-card h3 {
  color: var(--ink);
  font-size: 25px;
  line-height: 1.25;
}
.content-grid p,
.course-card p,
.contact-card p {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}
.content-grid img {
  width: 100%;
  max-height: 360px;
  margin-top: 14px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--soft);
}
.about-grid img {
  aspect-ratio: 16 / 9;
  max-height: none;
  object-fit: cover;
  border: 1px solid var(--line);
}

.course-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.enrollment-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.course-card {
  overflow: hidden;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(20, 32, 51, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20, 32, 51, .1);
}
.course-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}
.course-card-body {
  padding: 18px;
}
.course-card p {
  line-height: 1.6;
}
.course-card-blue { border-top-color: var(--blue); }
.course-card-green { border-top-color: var(--green); }
.course-card-red { border-top-color: var(--red); }
.course-card-yellow { border-top-color: var(--yellow); }

.platform-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.platform-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(20, 32, 51, .05);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.platform-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 79, 143, .35);
  box-shadow: 0 14px 30px rgba(20, 32, 51, .1);
}
.platform-card::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}
.platform-card::after {
  content: "";
  position: absolute;
  top: 26px;
  right: 24px;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: .35;
}
.platform-card strong {
  padding-right: 24px;
  font-size: 22px;
  line-height: 1.28;
}
.platform-label {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
.platform-note {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}
.platform-facebook::before,
.platform-cloud::before { background: var(--blue); }
.platform-instagram::before,
.platform-ai::before { background: var(--red); }
.platform-youtube::before,
.platform-line::before { background: var(--green); }

.map-embed {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}
.map-embed iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 0;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(240px, .45fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: start;
}
.contact-section h2 {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 48px);
}
.contact-card a { color: var(--blue); text-decoration: underline; }

.post-page,
.archive-page {
  background: var(--paper);
}
.single-article {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(46px, 7vw, 92px) clamp(18px, 5vw, 72px);
}
.post-hero h1,
.archive-page h1 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.18;
}
.post-meta {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 900;
}
.post-meta a { color: var(--blue); }
.post-featured-image {
  margin: 28px 0 0;
}
.post-featured-image img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--soft);
}
.post-content {
  margin-top: 30px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.9;
}
.post-content p,
.post-content ul,
.post-content ol,
.post-content figure {
  margin: 0 0 1.35em;
}
.post-content a {
  color: var(--blue);
  text-decoration: underline;
}
.archive-list {
  display: grid;
  gap: 16px;
}
.archive-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.archive-card-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 8px;
  background: var(--soft);
}
.archive-card time {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}
.archive-card h2 {
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.35;
}
.archive-card p {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}
.pagination {
  margin-top: 28px;
  font-weight: 900;
}
.pagination a,
.pagination span {
  display: inline-flex;
  margin-right: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 40px clamp(18px, 5vw, 72px);
  color: rgba(255,255,255,.84);
  background: var(--ink);
}
.site-footer img {
  width: min(310px, 74vw);
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--paper);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px 24px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .brand-row {
    min-height: 96px;
    justify-content: center;
  }
  .site-nav {
    justify-content: flex-start;
  }
  .site-nav .primary-menu {
    justify-content: flex-start;
  }
  .news-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .course-columns, .enrollment-cards, .platform-grid, .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .school-strip,
  .intro-panel,
  .content-grid.two,
  .content-grid.three,
  .course-columns,
  .enrollment-cards,
  .platform-grid,
  .video-grid,
  .contact-section,
  .news-list {
    grid-template-columns: 1fr;
  }
  .intro-panel,
  .section,
  .school-strip { padding-left: 18px; padding-right: 18px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .brand-row { min-height: 82px; padding: 12px 18px; }
  .site-nav {
    min-height: 44px;
    justify-content: flex-start;
    padding: 0 8px;
    font-size: 15px;
  }
  .site-nav .primary-menu { justify-content: flex-start; }
  .site-nav > a,
  .site-nav li > a { min-height: 44px; padding: 8px 13px; }
  .intro-panel h1 { font-size: clamp(44px, 15vw, 64px); }
  .archive-card {
    grid-template-columns: 1fr;
  }
  .site-footer { flex-direction: column; }
  .site-footer nav { justify-content: flex-start; }
}
