/*
Theme Name: FDM 3D School
Theme URI: https://fdm3dschool.com/
Author: FDM 3D School
Description: 分齡 FDM 3D 列印教學網站主題，教學為主、商城為輔，支援 WordPress + WooCommerce 學購一體首頁。
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: fdm3dschool
*/

:root {
  --bg: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #dce5e8;
  --soft: #f6f9fb;
  --kids: #4db7e5;
  --kids-soft: #eaf7fd;
  --adult: #0f6d88;
  --adult-dark: #123044;
  --teal: #009a9a;
  --orange: #ff6a2a;
  --yellow: #f2b84b;
  --shadow: 0 20px 50px rgba(15, 45, 61, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.62;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  height: auto;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 76px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(220, 229, 232, 0.88);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 2px solid var(--ink);
  color: var(--orange);
  font-weight: 950;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 21px;
  color: #2f3a45;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.main-nav a {
  padding-block: 8px;
}

.main-nav a:hover,
.nav-highlight {
  color: var(--orange);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
}

.search-box {
  display: flex;
  align-items: center;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.search-box span {
  padding-inline: 12px 8px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  font: inherit;
}

.login-link,
.cart-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.split-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: calc(100vh - 76px);
  border-bottom: 1px solid var(--line);
}

.hero-panel {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 620px;
  padding: clamp(38px, 6vw, 86px);
  overflow: hidden;
}

.kids-panel {
  background:
    radial-gradient(circle at 86% 18%, rgba(77, 183, 229, 0.3), transparent 24%),
    linear-gradient(135deg, #f7fcff 0%, #eaf7fd 100%);
}

.adult-panel {
  background:
    linear-gradient(135deg, rgba(18, 48, 68, 0.95), rgba(15, 109, 136, 0.92)),
    var(--adult-dark);
  color: #fff;
}

.panel-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.age-note {
  display: block;
  margin-bottom: 18px;
  color: var(--teal);
  font-size: 15px;
  font-weight: 900;
}

.adult-panel .age-note {
  color: #86edf2;
}

.split-hero h1,
.split-hero h2 {
  margin: 0 0 22px;
  font-size: clamp(40px, 5vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

.split-hero p {
  max-width: 540px;
  margin: 0 0 34px;
  color: #45515d;
  font-size: 20px;
}

.adult-panel p {
  color: rgba(255, 255, 255, 0.82);
}

.button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover,
.wp-block-button__link:hover {
  transform: translateY(-2px);
}

.kids-button {
  background: var(--kids);
  color: #fff;
  box-shadow: 0 16px 34px rgba(77, 183, 229, 0.28);
}

.adult-button,
.slicer-button,
.shop-button {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 16px 34px rgba(255, 106, 42, 0.28);
}

.panel-art {
  position: absolute;
  inset: auto 7% 8% auto;
  z-index: 1;
}

.model {
  position: absolute;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.cube {
  width: 126px;
  height: 126px;
  right: 150px;
  bottom: 36px;
  background: linear-gradient(135deg, #fff, #bcecff);
  transform: rotate(12deg);
}

.rocket {
  width: 92px;
  height: 160px;
  right: 28px;
  bottom: 92px;
  border-radius: 50% 50% 14px 14px;
  background: linear-gradient(160deg, #fff, #ffd98a);
}

.star {
  width: 78px;
  height: 78px;
  right: 250px;
  bottom: 190px;
  background: var(--orange);
  clip-path: polygon(50% 0%, 62% 34%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 34%);
}

.adult-art {
  display: grid;
  gap: 14px;
  width: 210px;
}

.data-card {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.advantage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.advantage-strip article {
  min-height: 190px;
  padding: 32px;
  border-right: 1px solid var(--line);
}

.advantage-strip span {
  color: var(--teal);
  font-size: 28px;
  font-weight: 950;
}

.advantage-strip h3 {
  margin: 14px 0 8px;
  font-size: 22px;
}

.advantage-strip p {
  margin: 0;
  color: var(--muted);
}

.section {
  padding: 86px clamp(24px, 6vw, 96px);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 36px;
}

.section-heading.centered {
  max-width: 840px;
  margin-inline: auto;
  text-align: center;
}

.section-label {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 950;
}

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-heading p:not(.section-label) {
  color: var(--muted);
  font-size: 18px;
}

.learning-section,
.shop-section,
.tutorials-section {
  background: var(--soft);
}

.learning-grid,
.shop-columns,
.slicer-board,
.works-grid,
.article-list,
.resource-list,
.machine-grid {
  display: grid;
  gap: 20px;
}

.learning-grid,
.shop-columns,
.slicer-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.learning-card,
.shop-column,
.works-grid article,
.article-list article,
.resource-list a,
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.learning-card {
  padding: 34px;
}

.kids-card {
  border-top: 5px solid var(--kids);
}

.adult-card {
  border-top: 5px solid var(--adult);
}

.card-topline {
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 15px;
  font-weight: 950;
}

.learning-card h3 {
  max-width: 620px;
  margin: 0 0 22px;
  font-size: 28px;
  line-height: 1.2;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tag-row span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.lesson-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.lesson-links li {
  padding: 12px;
  background: var(--soft);
  color: #344054;
  font-weight: 800;
}

.learning-card a {
  color: var(--orange);
  font-weight: 950;
}

.slicer-section {
  background:
    linear-gradient(135deg, rgba(18, 48, 68, 0.96), rgba(10, 78, 98, 0.94)),
    var(--adult-dark);
  color: #fff;
  text-align: center;
}

.slicer-section .section-label {
  color: #86edf2;
}

.slicer-section .section-heading p {
  color: rgba(255, 255, 255, 0.72);
}

.slicer-board {
  max-width: 980px;
  margin: 0 auto 32px;
  text-align: left;
}

.slicer-board article {
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.slicer-board h3 {
  margin: 0 0 18px;
  font-size: 25px;
}

.slicer-board ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.slicer-board li {
  padding: 12px 14px;
  border-left: 4px solid var(--orange);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.machine-section {
  background: #fff;
}

.machine-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.machine-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 45, 61, 0.06);
}

.machine-card h3 {
  margin: 12px 0 12px;
  font-size: 25px;
  line-height: 1.12;
}

.machine-group {
  color: var(--teal);
  font-size: 13px;
  font-weight: 950;
}

.price-line {
  min-height: 86px;
  margin: 0 0 18px;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.machine-card ul {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.machine-card li {
  padding-left: 12px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  font-size: 14px;
}

.machine-card strong {
  margin-top: auto;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.45;
}

.kids-machine {
  border-top: 5px solid var(--kids);
}

.student-machine {
  border-top: 5px solid var(--yellow);
}

.adult-machine {
  border-top: 5px solid var(--adult);
}

.pro-machine {
  border-top: 5px solid var(--orange);
}

.flagship-machine {
  border-top: 5px solid var(--adult-dark);
}

.shop-column {
  padding: 28px;
}

.shop-column h3 {
  margin: 0 0 20px;
  font-size: 28px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-height: 134px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.product-card span {
  color: var(--muted);
  font-size: 14px;
}

.shop-button {
  margin-top: 26px;
}

.works-section {
  background: #fff;
}

.works-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.works-grid article {
  overflow: hidden;
}

.work-preview {
  display: grid;
  height: 190px;
  place-items: center;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
}

.soft-blue {
  background: linear-gradient(135deg, #aee8ff, #4db7e5);
}

.soft-yellow {
  background: linear-gradient(135deg, #ffe6a3, #f2b84b);
}

.graphite {
  background: linear-gradient(135deg, #394556, #101828);
}

.teal {
  background: linear-gradient(135deg, #56d5d0, #0f6d88);
}

.works-grid h3,
.works-grid p {
  padding-inline: 20px;
}

.works-grid h3 {
  margin: 18px 0 8px;
}

.works-grid p {
  margin: 0;
  padding-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.article-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.article-list article {
  padding: 24px;
}

.post-tag {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.kids-tag {
  background: var(--kids);
}

.adult-tag {
  background: var(--adult);
}

.article-list h3 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.26;
}

.article-list p {
  margin: 0;
  color: var(--muted);
}

.faq-section,
.resources-section {
  background: #fff;
}

.faq-list {
  display: grid;
  max-width: 920px;
  margin-inline: auto;
  gap: 12px;
}

.faq-list details {
  padding: 18px 22px;
}

.faq-list summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.faq-list p {
  margin: 12px 0 0;
  color: var(--muted);
}

.resource-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.resource-list a {
  min-height: 100px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: #24313e;
  font-weight: 900;
}

.resource-list a:hover {
  border-color: var(--teal);
  background: #edfafa;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 38px clamp(24px, 6vw, 96px);
  background: #101828;
  color: rgba(255, 255, 255, 0.76);
}

.site-footer strong {
  display: block;
  color: #fff;
  font-size: 20px;
}

.site-footer p {
  margin: 6px 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-content: start;
  font-weight: 800;
}

.site-footer a:hover {
  color: #fff;
}

.page-shell,
.woocommerce-page .site-main {
  max-width: 1180px;
  margin-inline: auto;
  padding: 64px 24px;
}

.page-shell h1,
.woocommerce-page h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
}

.page-shell > article {
  max-width: 980px;
  margin-inline: auto;
}

.page-shell article > p,
.page-shell article li,
.page-shell article td,
.page-shell article th {
  font-size: 17px;
}

.page-shell article h2 {
  margin: 42px 0 14px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.18;
}

.page-shell article p {
  color: #344054;
}

.page-shell article ul,
.page-shell article ol {
  display: grid;
  gap: 10px;
  padding-left: 24px;
}

.wp-block-table {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wp-block-table table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.wp-block-table th:first-child,
.wp-block-table td:first-child {
  border-left: 0;
}

.wp-block-table tr:last-child td {
  border-bottom: 0;
}

.wp-block-table th {
  background: var(--soft);
  color: #1f2937;
  font-weight: 950;
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  padding-inline: 16px;
  font-weight: 900;
}

.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button {
  margin-left: 16px;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding: 16px 22px;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .search-box {
    min-width: 180px;
  }

  .split-hero,
  .advantage-strip,
  .works-grid,
  .resource-list,
  .machine-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    min-height: 560px;
  }
}

@media (max-width: 800px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .header-tools {
    width: 100%;
    overflow-x: auto;
  }

  .search-box {
    flex: 1;
    min-width: 200px;
  }

  .split-hero,
  .advantage-strip,
  .learning-grid,
  .shop-columns,
  .slicer-board,
  .works-grid,
  .article-list,
  .resource-list,
  .machine-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
    padding: 52px 22px 130px;
  }

  .split-hero h1,
  .split-hero h2 {
    font-size: 39px;
  }

  .split-hero p {
    font-size: 17px;
  }

  .section {
    padding: 58px 20px;
  }

  .lesson-links,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .panel-art {
    opacity: 0.6;
    transform: scale(0.78);
  }

  .site-footer {
    flex-direction: column;
  }
}
