/*
 * 小行星內兒科親子診所｜首頁樣式（取代 Elementor）
 * 所有數值皆自正式站 computed style 實測取得，非估計值。
 */

/* ---------- 設計 token ---------- */
:root {
	--gc-container: 1200px;
	--gc-gutter: 20px;
	--gc-blue: #054A8D;
	--gc-yellow: #FEED67;
	--gc-text: #777777;
	--gc-dark: #222222;
	--gc-card: #ECF7FB;
	--gc-radius: 16px;
	--gc-section-pad: 64px;
	/* 背景圖網址由範本以 inline style 注入，避免子目錄 staging 指錯站台 */
	--gc-bg-space: none;
	--gc-bg-underspace: none;
	--gc-font: "Lato", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* ---------- 基礎 ---------- */
html {
	background-color: var(--gc-blue);
	scroll-behavior: smooth;
}

body.gc-home {
	margin: 0;
	font-family: var(--gc-font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--gc-text);
	background-image: var(--gc-bg-space);
	background-size: cover;
	background-position: 50% 50%;
	background-repeat: no-repeat;
	overflow-x: hidden;
}

.gc-home img { max-width: 100%; height: auto; }
.gc-home a { color: inherit; }

.gc-container {
	max-width: var(--gc-container);
	margin: 0 auto;
	padding: 0 var(--gc-gutter);
	box-sizing: border-box;
}

.gc-section { padding: var(--gc-section-pad) 0; position: relative; }

/* 原始站的錨點是獨立區段，這裡改用 scroll-margin 讓 id 直接掛在區段上 */
.gc-home [id] { scroll-margin-top: 20px; }

/* ---------- 標題 ---------- */
.gc-h2 {
	margin: 0 0 32px;
	font-size: 32px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 4px;
	color: var(--gc-blue);
	text-align: center;
}

.gc-h2 .gc-hl-sub {
	display: block;
	margin-top: 8px;
	font-size: 18px;
	font-weight: 400;
	letter-spacing: 4px;
	color: var(--gc-blue);
	text-transform: uppercase;
}

/* 深色／太空背景上的區段，英文副標改用黃色（與正式站一致） */
.gc-h2--light .gc-hl-sub { color: var(--gc-yellow); }

/* ---------- 頁首 ---------- */
.gc-header {
	position: relative;
	z-index: 999;
	background: #fff;
}

.gc-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 75px;
}

.gc-header__logo img { display: block; width: 324px; max-width: 100%; height: auto; }

/* ---------- banner 輪播 ---------- */
.gc-banner { position: relative; }

.gc-carousel { position: relative; overflow: hidden; }
.gc-carousel__track { display: flex; transition: transform .45s ease; will-change: transform; }
.gc-carousel__slide { flex: 0 0 100%; min-width: 100%; }
.gc-banner .gc-carousel__slide img { display: block; width: 100%; height: 800px; object-fit: cover; }
.gc-carousel__slide img { display: block; width: 100%; height: auto; }

.gc-carousel__arrow {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
	border: 0; background: transparent; cursor: pointer;
	font-size: 34px; line-height: 1; color: #054A8D;
	z-index: 2;
}
.gc-carousel__arrow:hover { opacity: .7; }
.gc-carousel__arrow--prev { left: 8px; }
.gc-carousel__arrow--next { right: 8px; }

.gc-carousel__dots {
	position: absolute; left: 0; right: 0; bottom: 14px;
	display: flex; justify-content: center; align-items: center; gap: 10px; z-index: 2;
}
.gc-carousel__dot {
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 10px; height: 10px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
	line-height: 0; font-size: 0;
	background: rgba(255,255,255,.55); cursor: pointer;
}
.gc-carousel__dot[aria-current="true"] { background: #fff; }

/* ---------- 主區：時刻表／醫師／燈號 ---------- */
.gc-main-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 40px;
	align-items: start;
}

.gc-timetable img { display: block; margin: 0 auto 24px; }

/* 醫師摺疊：原站是左右兩欄（2+2+1），這裡沿用 */
.gc-doctors { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }

.gc-toggle { background: #fff; border-radius: 8px; overflow: hidden; }

.gc-toggle__title {
	width: 100%; margin: 0; padding: 14px 18px;
	display: flex; align-items: center; gap: 10px;
	border: 0; background: #fff; cursor: pointer;
	font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.4;
	color: var(--gc-blue); text-align: left; word-break: break-word;
}
.gc-toggle__title::before {
	content: ""; flex: 0 0 auto;
	border-style: solid; border-width: 6px 0 6px 9px;
	border-color: transparent transparent transparent currentColor;
	transition: transform .2s ease;
}
.gc-toggle__title[aria-expanded="true"]::before { transform: rotate(90deg); }

.gc-toggle__panel { padding: 0 18px 16px; font-size: 16px; line-height: 1.6; color: var(--gc-dark); }
.gc-toggle__panel[hidden] { display: none; }
.gc-toggle__panel p { margin: 0; }

/* 現場燈號 */
.gc-lights__reg { display: block; text-align: center; margin: 0 0 24px; }
.gc-lights__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.gc-light-card {
	background: #fff; border-radius: var(--gc-radius);
	padding: 24px 16px; text-align: center;
}
.gc-light-card__title {
	margin: 0 0 16px; font-size: 24px; font-weight: 600; line-height: 1.3; color: var(--gc-dark);
}
.gc-btn {
	display: inline-block; padding: 10px 20px; border-radius: 999px;
	background: var(--gc-yellow); color: var(--gc-dark);
	font-size: 15px; font-weight: 600; text-decoration: none;
}
.gc-btn:hover { filter: brightness(.95); }

/* ---------- 診所介紹 ---------- */
.gc-about__text { max-width: 900px; margin: 0 auto 32px; text-align: center; color: var(--gc-dark); }
.gc-about__text p { margin: 0; }

/* 環境照：桌機四欄並排、手機輪播，共用同一份圖片。
   track 在桌機是 grid，JS 偵測到就不寫 transform（見 gc-home.js）。 */
.gc-carousel--gallery .gc-carousel__track {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}
.gc-carousel--gallery .gc-carousel__slide { flex: initial; min-width: 0; }
.gc-carousel--gallery .gc-carousel__arrow { display: none; }
.gc-gallery img { display: block; width: 100%; height: auto; border: 1px solid #E43F61; border-radius: 4px; }

/* ---------- 門診項目 ---------- */
.gc-projects ul {
	margin: 0; padding: 0; list-style: none;
	/* ul 是容器唯一的子元素，用多欄而非 grid 才能把 li 分到兩邊 */
	column-count: 2;
	column-gap: 40px;
}
.gc-projects li {
	display: flex; gap: 10px; padding: 10px 0;
	font-size: 16px; line-height: 1.6; color: var(--gc-dark);
	break-inside: avoid;
}
.gc-projects li::before { content: "▶"; flex: 0 0 auto; color: var(--gc-yellow); font-size: 12px; line-height: 1.8; }

/* ---------- 星空背景帶 ---------- */
.gc-underspace {
	height: 500px;
	background-image: var(--gc-bg-underspace);
	background-size: cover;
	background-position: 50% 50%;
	background-repeat: no-repeat;
}

/* ---------- 頁尾 ---------- */
.gc-footer {
	background-image: linear-gradient(#4D3159 0%, #20276C 100%);
	color: #fff;
	padding: 20px 0;
}
.gc-footer a { color: #fff; text-decoration: none; }
.gc-footer a:hover { text-decoration: underline; }

.gc-footer__inner {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: center;
}
.gc-footer__contact { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 2; }
.gc-footer__social { display: flex; gap: 12px; justify-content: center; }
.gc-footer__social img { width: 52px; height: auto; display: block; }
.gc-footer__meta { text-align: right; font-size: 14px; }
.gc-footer__meta p { margin: 0 0 4px; }

/* ---------- 裝飾圖 ----------
 * 位置皆自正式站實測（視窗 1280）。left 以 1200 容器的左緣為基準，
 * 用 calc(50% - 600px + x) 讓它跟著容器置中，而不是黏在視窗邊。
 * 多張刻意超出左右邊界，靠 body 的 overflow-x:hidden 裁掉。
 */
.gc-deco {
	position: absolute;
	left: calc(50% - 600px + var(--x, 0px));
	top: var(--y, 0px);
	width: var(--w, 200px);
	z-index: 0;
	pointer-events: none;
	user-select: none;
}
.gc-deco img { display: block; width: 100%; height: auto; }

/* 內容一律蓋在裝飾圖之上 */
.gc-section > .gc-container,
.gc-banner .gc-carousel { position: relative; z-index: 1; }

.gc-banner, .gc-underspace { position: relative; }

/* ---------- 桌機 ---------- */
@media (min-width: 768px) {
	/* 正式站實測：左欄 704px、右欄 496px。
	   1.4fr 1fr + gap 40 => 醫師每欄 (1160*1.4/2.4 - 12)/2 = 332px，與正式站相同。 */
	.gc-main-grid { grid-template-columns: 1.4fr 1fr; gap: 40px; }
	.gc-doctors { grid-template-columns: 1fr 1fr; }

	/* 右欄（掛號＋現場燈號）在正式站是垂直置中（該欄 wrap 是
	   display:flex; align-items:center），所以會落在醫師區旁邊而不是擠在最上面。
	   少了這一行，右側醫師區那一塊就會整片留白。 */
	.gc-lights { align-self: center; }
}

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
	.gc-banner .gc-carousel__slide img { height: 400px; }
	.gc-main-grid { gap: 32px; }
}

/* ---------- 手機 ---------- */
@media (max-width: 767px) {
	:root { --gc-gutter: 18.75px; --gc-section-pad: 18.75px; }

	.gc-header__inner { min-height: 80px; }
	.gc-header__logo img { width: 240px; }

	.gc-banner { padding-top: 80px; }
	.gc-banner .gc-carousel__slide img { height: 200px; }

	.gc-projects ul { column-count: 1; }

	/* 環境照回到輪播 */
	.gc-carousel--gallery .gc-carousel__track {
		display: flex;
		grid-template-columns: none;
		gap: 0;
	}
	.gc-carousel--gallery .gc-carousel__slide { flex: 0 0 100%; min-width: 100%; }
	.gc-carousel--gallery .gc-carousel__arrow { display: flex; }
	.gc-lights__grid { grid-template-columns: 1fr; }

	.gc-footer { padding: 20px; }
	.gc-footer__inner { grid-template-columns: 1fr; text-align: center; gap: 16px; }
	.gc-footer__meta { text-align: center; }
	.gc-footer__contact { text-align: left; }

	/* 裝飾圖在手機仍然顯示（正式站手機可見 10 張），但座標與尺寸另一組。
	   手機沒有 1200 容器，所以 left 直接相對區段。 */
	.gc-deco {
		left: var(--mx, 0px);
		top: var(--my, 0px);
		width: var(--mw, 100px);
	}
}
