/*
Theme Name: Flatsome Child – ST Alucon
Description: Child theme for ST Alucon (เอสที อลูคอน) built on Flatsome. Architectural line-drawing design, glass-green accent.
Author: ST Alucon
Template: flatsome
Version: 1.0.0
Text Domain: flatsome-child-stalucon
*/

/* ---------- Tokens ---------- */
:root {
	--sta-ink: #15191C;
	--sta-muted: #4F5B62;
	--sta-ground: #EEF0EE;
	--sta-tone: #E2E6E4;
	--sta-paper: #F8F9F7;
	--sta-dark: #1B2226;
	--sta-dtext: #EEF1F1;
	--sta-dmuted: #AEB8BE;
	--sta-green: #1F6B5A;
	--sta-green-d: #17574A;
	--sta-green-l: #8FD0BC;
	--sta-line: #56636B;
	--sta-rule: #B9C2C0;
	--sta-pad: clamp(56px, 6vw, 84px);
	--sta-ease: cubic-bezier(.2, 0, 0, 1);
	--sta-ease-in: cubic-bezier(.05, .7, .1, 1);
}

/* ---------- Base (overrides Flatsome defaults) ---------- */
body {
	font-family: 'IBM Plex Sans Thai', sans-serif;
	color: var(--sta-ink);
	background: var(--sta-ground);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .heading-font, .nav > li > a, .button, button, input, textarea, select {
	font-family: 'IBM Plex Sans Thai', sans-serif;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -.015em; color: inherit; }
a { color: var(--sta-green); }
a:hover { color: var(--sta-green-d); }
.sta-btn, .sta-link, .sta-tile, .sta-proj, .sta-cat, .sta-ask, .sta-footer a, .sta-hero__contact a, .sta-info a { text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus, textarea:focus { outline: 3px solid var(--sta-green); outline-offset: 2px; }

/* Section helpers used in UX Builder (set as "class" on [section]) */
.sta-ground { background: var(--sta-ground) !important; }
.sta-tone { background: var(--sta-tone) !important; }
.sta-darkfield { background: var(--sta-dark) !important; color: var(--sta-dtext); }
.sta-darkfield p { color: var(--sta-dmuted); }
.sta-darkfield h1, .sta-darkfield h2, .sta-darkfield h3 { color: var(--sta-dtext); }
.sta-greenfield { background: var(--sta-green) !important; color: #fff; }
.sta-greenfield h2 { color: #fff; }
.sta-greenfield p { color: #E4F2EC; }
.sta-sec { padding-top: var(--sta-pad) !important; padding-bottom: var(--sta-pad) !important; }

.sta-h1 { font-size: clamp(34px, 3.6vw, 50px); line-height: 1.15; margin: 0; }
.sta-h2 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.08; margin: 0; }
.sta-h1-page { font-size: clamp(44px, 6vw, 76px); line-height: 1; margin: 0; }
.sta-lead { font-size: 18px; line-height: 1.65; color: var(--sta-muted); max-width: 620px; margin: 18px 0 0; }
.sta-darkfield .sta-lead { color: var(--sta-dmuted); }
.sta-statement { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.45; max-width: 1000px; color: var(--sta-dtext) !important; margin: 0; }
.sta-note { color: var(--sta-muted); font-size: 15px; line-height: 1.7; }

/* ---------- Buttons ---------- */
.sta-btn {
	display: inline-flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 26px;
	background: var(--sta-green); color: #fff !important; font-weight: 600; border: 0; border-radius: 0;
	text-transform: none; letter-spacing: 0; line-height: 1; cursor: pointer;
	transition: background .2s, transform .15s var(--sta-ease);
}
.sta-btn:hover { background: var(--sta-green-d); }
.sta-btn:active { transform: scale(.98); }
.sta-btn svg { transition: transform .3s var(--sta-ease); }
.sta-btn:hover svg { transform: translateX(4px); }
.sta-btn--line { background: transparent; color: inherit !important; box-shadow: inset 0 0 0 2px currentColor; }
.sta-btn--line:hover { background: rgba(127, 140, 140, .16); }
.sta-btn--white { background: #fff; color: var(--sta-green) !important; }
.sta-btn--white:hover { background: #E4F2EC; }
.sta-btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* Flatsome's own buttons, restyled to match */
.button.primary, .button.alt, .button.checkout { background-color: var(--sta-green) !important; border-radius: 0 !important; text-transform: none; letter-spacing: 0; }

/* ---------- Header (Flatsome header builder) ---------- */
.header-main { background: var(--sta-ground) !important; }
.header-nav-main > li > a { color: var(--sta-ink) !important; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 16px; position: relative; }
.header-nav-main > li > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--sta-green); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--sta-ease); }
.header-nav-main > li > a:hover::after, .header-nav-main > li.active > a::after, .header-nav-main > li.current-menu-item > a::after { transform: scaleX(1); }

/* ---------- Footer ---------- */
.sta-footer { background: var(--sta-dark); color: var(--sta-dtext); padding: var(--sta-pad) clamp(20px, 4vw, 56px) 32px; }
.sta-footer__grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 40px; }
.sta-footer h3 { font-size: 18px; color: var(--sta-dtext); margin: 0 0 8px; }
.sta-footer p { color: var(--sta-dmuted); line-height: 1.9; margin: 0; }
.sta-footer a { color: var(--sta-dmuted); }
.sta-footer a:hover { color: #fff; }
.sta-footer__copy { max-width: 1280px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid #2F3B41; color: var(--sta-dmuted); font-size: 14px; }
.absolute-footer { display: none; }

/* ---------- Drawings ---------- */
.sta-draw svg { display: block; width: 100%; height: auto; }
.sta-ln { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: sta-dr 1.9s cubic-bezier(.4, 0, .2, 1) forwards; }
.sta-l2 { animation-delay: .45s; }
.sta-l3 { animation-delay: .9s; }
@keyframes sta-dr { to { stroke-dashoffset: 0; } }
/* scroll-drawn lines: JS adds .is-in to the closest .sta-vt */
.sta-js .sta-rd { stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 1.8s cubic-bezier(.4, 0, .2, 1); }
.sta-js .is-in .sta-rd { stroke-dashoffset: 0; }

/* ---------- Reveal ---------- */
@keyframes sta-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.sta-in { animation: sta-up .9s var(--sta-ease-in) both; }
.sta-i1 { animation-delay: .09s; } .sta-i2 { animation-delay: .18s; } .sta-i3 { animation-delay: .27s; }
.sta-js .sta-rv { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--sta-ease-in), transform .8s var(--sta-ease-in); }
.sta-js .sta-rv.is-in { opacity: 1; transform: none; }

/* ---------- Hero slider ---------- */
.sta-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 48px 56px; align-items: center; max-width: 1360px; margin: 0 auto; }
.sta-hero__contact { margin-top: 30px; color: var(--sta-muted); line-height: 1.7; }
.sta-hero__contact a { color: var(--sta-ink); font-weight: 600; }
.sta-stage { background: var(--sta-paper); padding: clamp(20px, 3vw, 36px); }
.sta-slide { display: none; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: end; }
.sta-slide.is-on { display: grid; }
.sta-slide__art { color: var(--sta-line); }
.sta-slide__info { display: flex; flex-direction: column; gap: 14px; }
.sta-slide__name { font-size: 30px; font-weight: 600; margin: 0; }
.sta-slide__desc { line-height: 1.6; color: var(--sta-muted); margin: 0; }
.sta-imgbox { background: #fff; aspect-ratio: 4 / 3; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sta-imgbox img { width: 100%; height: 100%; object-fit: contain; padding: 14px; box-sizing: border-box; }
.sta-link { font-weight: 600; color: var(--sta-green); display: inline-flex; gap: 10px; align-items: center; }
.sta-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 4px; margin-top: 28px; }
.sta-tab { position: relative; text-align: left; font-weight: 600; font-size: 16px; padding: 16px 14px 18px; border: 0; margin: 0; cursor: pointer; background: transparent; color: var(--sta-muted); overflow: hidden; text-transform: none; letter-spacing: 0; line-height: 1.3; min-height: 0; transition: background .25s, color .25s; }
.sta-tab:hover { background: var(--sta-tone); }
.sta-tab::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #C9D0CD; }
.sta-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sta-green); transform: scaleX(0); transform-origin: left; }
.sta-tab.is-on { background: #fff; color: var(--sta-ink); }
.sta-tab.is-on::after { animation: sta-bar 6.5s linear forwards; }
@keyframes sta-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Facts ---------- */
.sta-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 40px; margin-top: 48px; }
.sta-fact__n { font-size: clamp(48px, 6vw, 88px); font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--sta-green-l) !important; margin: 0; }
.sta-fact__t { font-size: 17px; line-height: 1.5; margin: 12px 0 0; color: var(--sta-dtext) !important; }

/* ---------- Showroom (categories) ---------- */
.sta-show { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 56px 80px; align-items: start; }
.sta-show__frame { position: relative; padding: 22px; }
.sta-corner { position: absolute; width: 26px; height: 26px; }
.sta-panel { display: none; flex-direction: column; gap: 12px; }
.sta-panel.is-on { display: flex; }
.sta-panel__main { background: #fff; aspect-ratio: 4 / 3; overflow: hidden; }
.sta-panel__main img, .sta-panel__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sta-panel__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sta-panel__thumbs div { background: #fff; aspect-ratio: 4 / 3; overflow: hidden; }
.sta-dim { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--sta-muted); font-size: 15px; }
.sta-dim i { flex: 1; height: 1px; background: var(--sta-line); }
.sta-dim b { width: 1px; height: 14px; background: var(--sta-line); }
.sta-catlist { display: flex; flex-direction: column; margin-top: 40px; }
.sta-cat { position: relative; display: block; width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--sta-rule); padding: 22px 0 22px 26px; margin: 0; cursor: pointer; color: var(--sta-muted); text-transform: none; letter-spacing: 0; line-height: 1.2; min-height: 0; font-weight: 400; }
.sta-cat::before { content: ''; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; background: transparent; transition: background .3s; }
.sta-cat.is-on { color: var(--sta-ink); }
.sta-cat.is-on::before { background: var(--sta-green); }
.sta-cat__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sta-cat__name { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; }
.sta-cat__count { font-size: 16px; white-space: nowrap; color: var(--sta-muted); }
.sta-cat__desc { display: none; font-size: 17px; line-height: 1.6; color: var(--sta-muted); margin-top: 10px; max-width: 460px; }
.sta-cat.is-on .sta-cat__desc { display: block; animation: sta-up .6s var(--sta-ease-in) both; }

/* ---------- Featured mosaic ---------- */
.sta-mos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 300px; gap: 20px; margin-top: 48px; }
.sta-tile { display: flex; flex-direction: column; background: #fff; color: var(--sta-ink) !important; }
.sta-tile--big { grid-column: span 2; grid-row: span 2; }
.sta-tile__img { flex: 1; min-height: 0; overflow: hidden; }
.sta-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--sta-ease); }
.sta-tile:hover .sta-tile__img img { transform: scale(1.06); }
.sta-tile__cap { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; }
.sta-tile--big .sta-tile__cap { padding: 22px 24px; }
.sta-tile__name { font-weight: 600; font-size: 18px; line-height: 1.3; transition: color .2s; }
.sta-tile--big .sta-tile__name { font-size: 28px; }
.sta-tile:hover .sta-tile__name { color: var(--sta-green); }
.sta-tile__sub { display: block; color: var(--sta-muted); margin-top: 6px; font-weight: 400; font-size: 16px; }
.sta-tile__arrow { color: var(--sta-green); flex: none; }

/* ---------- Steps ---------- */
.sta-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 48px 40px; margin-top: 48px; }
.sta-step { display: flex; flex-direction: column; gap: 18px; }
.sta-step h3 { font-size: 26px; color: var(--sta-dtext); margin: 0; }
.sta-step p { color: var(--sta-dmuted); line-height: 1.65; margin: 0; }
.sta-lp * { transform-box: fill-box; }
@keyframes sta-mag { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(120px, 26px); } 66% { transform: translate(40px, 92px); } }
.sta-mag { animation: sta-mag 6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes sta-grow { 0%, 8% { transform: scaleX(0); } 30%, 85% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
.sta-gr { transform-origin: left center; animation: sta-grow 5s var(--sta-ease) infinite; }
.sta-g2 { animation-delay: .35s; } .sta-g3 { animation-delay: .7s; } .sta-g4 { animation-delay: 1.05s; }
@keyframes sta-sin { 0%, 12% { transform: translateX(150px); opacity: 0; } 42%, 86% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
.sta-si { animation: sta-sin 5s var(--sta-ease-in) infinite; }
@keyframes sta-pop { 0%, 45% { transform: scale(0); } 56%, 88% { transform: scale(1); } 100% { transform: scale(0); } }
.sta-pp { transform-origin: center; animation: sta-pop 5s var(--sta-ease) infinite; }
@keyframes sta-wr { 0%, 100% { transform: rotate(-20deg); } 50% { transform: rotate(16deg); } }
.sta-wr { transform-origin: 20% 80%; animation: sta-wr 2.6s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes sta-spin { to { transform: rotate(360deg); } }
.sta-sp { transform-origin: center; animation: sta-spin 10s linear infinite; }

/* ---------- CTA install loop ---------- */
.sta-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.sta-cta__art { max-width: 520px; justify-self: end; width: 100%; }
.sta-cd { stroke-dasharray: 1000; animation: sta-cd 10s cubic-bezier(.4, 0, .2, 1) infinite; }
@keyframes sta-cd { 0% { stroke-dashoffset: 1000; } 26%, 100% { stroke-dashoffset: 0; } }
.sta-cg { animation: sta-cg 10s infinite; } @keyframes sta-cg { 0%, 26% { opacity: 0; } 38%, 100% { opacity: 1; } }
.sta-cl { animation: sta-cl 10s infinite; } @keyframes sta-cl { 0%, 34% { opacity: 0; } 44%, 100% { opacity: 1; } }
.sta-cs { animation: sta-cs 10s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes sta-cs { 0%, 48% { transform: none; } 62%, 74% { transform: translateX(-148px); } 88%, 100% { transform: none; } }
.sta-ck { transform-origin: center; animation: sta-ck 10s var(--sta-ease) infinite; }
@keyframes sta-ck { 0%, 86% { transform: scale(0); opacity: 0; } 92%, 100% { transform: scale(1); opacity: 1; } }
.sta-cw { animation: sta-cw 10s infinite; } @keyframes sta-cw { 0% { opacity: 0; } 3%, 96% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Projects ---------- */
.sta-projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 48px 32px; margin-top: 40px; }
.sta-proj { display: flex; flex-direction: column; gap: 6px; color: var(--sta-ink) !important; }
.sta-proj__art { background: var(--sta-paper); padding: 28px 24px 18px; color: var(--sta-line); aspect-ratio: 4 / 3; display: flex; align-items: flex-end; box-sizing: border-box; overflow: hidden; margin-bottom: 8px; }
.sta-proj__art img { width: 100%; height: 100%; object-fit: cover; }
.sta-proj__art--photo { padding: 0; }
.sta-proj__cat { color: var(--sta-muted); font-size: 15px; }
.sta-proj__name { font-size: 22px; font-weight: 600; line-height: 1.3; transition: color .2s; }
.sta-proj:hover .sta-proj__name { color: var(--sta-green); }

/* ---------- Page banner ---------- */
.sta-banner { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; }
.sta-banner__art { max-width: 440px; justify-self: end; width: 100%; color: var(--sta-line); }

/* ---------- Rows (services / articles) ---------- */
.sta-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px 64px; align-items: center; padding: 48px 0; border-top: 1px solid var(--sta-rule); }
.sta-row h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.1; margin: 0; }
.sta-row p { font-size: 18px; line-height: 1.7; color: var(--sta-muted); margin: 16px 0 0; max-width: 520px; }
.sta-row__art { max-width: 380px; color: var(--sta-line); }

/* ---------- Contact ---------- */
.sta-info > div { padding: 22px 0; border-top: 1px solid var(--sta-rule); }
.sta-info small { display: block; color: var(--sta-muted); font-size: 15px; }
.sta-info strong { display: block; font-size: 20px; line-height: 1.6; margin-top: 4px; font-weight: 500; }
.sta-formbox { background: var(--sta-paper); padding: 36px; }
.sta-formbox input:not([type=submit]), .sta-formbox textarea { border: 1px solid #8A969D; border-radius: 0; box-shadow: none; background: #fff; }
.sta-formbox input[type=submit] { background: var(--sta-green); color: #fff; border-radius: 0; text-transform: none; letter-spacing: 0; min-height: 50px; padding: 0 26px; }

/* ---------- Marquee ---------- */
.sta-mq-wrap { overflow: hidden; }
.sta-mq { display: flex; gap: 72px; width: max-content; animation: sta-mq 42s linear infinite; }
.sta-mq span { font-size: 24px; font-weight: 600; color: var(--sta-muted); white-space: nowrap; }
@keyframes sta-mq { to { transform: translateX(-50%); } }

/* ---------- WooCommerce catalog ---------- */
.woocommerce-page .shop-container, .post-type-archive-product .shop-container { background: var(--sta-tone); }
.product-small .box-image { background: #fff; }
.product-small .box-image img { object-fit: contain; transition: transform .6s var(--sta-ease); }
.product-small:hover .box-image img { transform: scale(1.06); }
.product-small .name a { font-weight: 600; font-size: 17px; color: var(--sta-ink); }
.sta-ask { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; margin-top: 8px; background: var(--sta-green); color: #fff !important; font-weight: 600; }
.sta-ask:hover { background: var(--sta-green-d); }
.badge-container .badge-inner { background: var(--sta-green); border-radius: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.sta-hero { grid-template-columns: 1fr; }
	.sta-mos { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; }
	.sta-hide-s { display: none !important; }
}
@media (max-width: 560px) {
	.sta-slide { grid-template-columns: 1fr; }
	.sta-tile--big .sta-tile__name { font-size: 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.sta-ln, .sta-js .sta-rd { stroke-dashoffset: 0 !important; }
	[class*="sta-"] { animation: none !important; transition: none !important; }
	.sta-js .sta-rv { opacity: 1; transform: none; }
}
