/*
Theme Name: Thidasaket (Astra child)
Template: astra
Description: ธีมลูกของ Astra สำหรับเว็บไซต์การประกวดธิดาสาเกต — โทนม่วง/ทอง ฟอนต์ภาษาไทยอ่านง่าย
Version: 1.2.5
Text Domain: thidasaket
*/

:root {
	--ast-global-color-0: #4f1d73; /* primary: deep purple */
	--ast-global-color-1: #66288f;
	--ast-global-color-2: #24152e; /* headings */
	--ast-global-color-3: #3b2f44; /* body text */
	--ast-global-color-4: #fbf7ef;
	--ast-global-color-5: #ffffff;
	--ast-global-color-6: #f7eccb;
	--ast-global-color-7: #2a0f3d;
	--ast-global-color-8: #222222;
}

body, button, input, select, textarea, .ast-button, .ast-custom-button {
	font-family: "Sarabun", "Noto Sans Thai", system-ui, sans-serif !important;
	font-size: 17px;
	line-height: 1.7;
	color: #3b2f44;
}
h1, h2, h3, h4, h5, h6, .entry-title, .site-title, .main-header-menu, .ts-btn, .ts-badge, .ts-card__no {
	font-family: "Prompt", "Sarabun", system-ui, sans-serif !important;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.35;
}
body { background: #fff; }
a { color: #66288f; }
a:hover { color: #a3277c; }

/* ---------- header */
.site-header .ast-above-header-bar,
.site-header .ast-primary-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
	background: #2a0f3d !important;
	border-bottom: 3px solid #c9a227 !important;
}
.ast-above-header-bar .ast-builder-grid-row { min-height: 76px; }
.site-header .custom-logo-link img, .ast-header-break-point .custom-logo-link img { max-height: 64px; width: auto; }
/* Astra's "logo color" setting recolours the logo through an SVG filter (#ast-img-color-filter → #24152e),
   which turned the gold logo almost black on the dark header in the mobile/tablet layout. Keep the original colours. */
.site-header .site-logo-img img, .site-header .custom-logo-link img, .ast-mobile-popup-drawer .site-logo-img img {
	filter: drop-shadow(0 2px 6px rgb(0 0 0 / 35%)) !important;
}
.main-header-menu .menu-link, .ast-header-break-point .main-header-menu .menu-link {
	color: #f3eaf7 !important; font-size: 16px; font-weight: 500;
}
.main-header-menu .menu-item:hover > .menu-link,
.main-header-menu .current-menu-item > .menu-link { color: #e6cf86 !important; }
.main-header-menu .ts-menu-vote > .menu-link {
	margin-inline: 6px; padding-inline: 18px !important; line-height: 40px !important; border-radius: 999px;
	background: linear-gradient(180deg, #e2c35f, #c9a227); color: #2a0f3d !important; font-weight: 700;
}
.main-header-menu .ts-menu-vote > .menu-link:hover { filter: brightness(1.06); color: #2a0f3d !important; }
.ast-mobile-menu-trigger-minimal, .menu-toggle { color: #e6cf86 !important; }
.ast-mobile-popup-drawer .ast-mobile-popup-inner { background: #2a0f3d; }
.ast-mobile-popup-drawer .main-header-menu .menu-link { border-color: rgb(255 255 255 / 10%) !important; }
.ast-mobile-popup-drawer .menu-toggle-close { color: #fff; }
/* mobile/tablet drawer: Astra resets menu-link backgrounds there (background-image:none), which removed the gold
   pill and left the dark-purple "การโหวต" text on the dark-purple drawer. Restore the pill. */
.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote > .menu-link,
.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote:hover > .menu-link,
.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote.current-menu-item > .menu-link {
	width: fit-content; min-width: 160px; justify-content: center; margin: 6px auto !important; line-height: 44px !important; padding: 0 28px !important;
	background: linear-gradient(180deg, #e2c35f, #c9a227) !important; color: #2a0f3d !important; font-weight: 700;
}

/* ---------- page titles */
.page .entry-header .entry-title, .single .entry-header .entry-title {
	color: #3d1659; font-size: clamp(1.8rem, 4vw, 2.5rem);
}
.page .entry-header .entry-title::after {
	content: ""; display: block; width: 64px; height: 4px; margin-top: 12px; border-radius: 4px;
	background: linear-gradient(90deg, #c9a227, #a3277c);
}
.ast-separate-container { background: #fbf7ef; }

/* ---------- footer (Astra copyright row under the plugin's footer band) */
.site-footer .site-below-footer-wrap { background: #1d0a2b !important; color: #cdbbd8; border-top: 1px solid rgb(201 162 39 / 35%); }
.site-footer .ast-footer-copyright, .site-footer .ast-footer-copyright a { color: #cdbbd8 !important; font-size: 14px; }

/* WPForms on the contact page */
.wpforms-container .wpforms-submit { background: #4f1d73 !important; border-radius: 999px !important; padding: 10px 24px !important; }

/* ---------- Lottie animations (LottieFlow by Finsweet, recolored) — see inc/lottie.php */
.ts-lottie { display: inline-block; width: var(--ts-lottie-size, 64px); height: var(--ts-lottie-size, 64px); vertical-align: middle; line-height: 0; }
.ts-lottie svg, .ts-scroll-cue__anim svg, .ts-lottie-top__anim svg, .ts-alert__anim svg { display: block; }

/* hero: scroll-down cue */
.ts-hero.has-cue { padding-bottom: clamp(96px, 11vw, 128px); }
.ts-scroll-cue {
	position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
	display: grid; place-items: center; width: 48px; height: 60px; padding: 0;
	background: none; border: 0; border-radius: 12px; cursor: pointer; opacity: .9;
}
.ts-scroll-cue:hover { opacity: 1; }
.ts-scroll-cue:focus-visible { outline: 2px solid #e6cf86; outline-offset: 2px; }
.ts-scroll-cue__anim { width: 32px; height: 44px; }

/* Astra scroll-to-top button with animated arrow */
#ast-scroll-top.ts-lottie-top {
	width: 48px; height: 48px; padding: 0; border-radius: 50% !important; line-height: 0;
	background: #4f1d73; border: 2px solid #c9a227; box-shadow: 0 6px 18px rgb(42 15 61 / 30%);
}
#ast-scroll-top.ts-lottie-top:hover { background: #66288f; }
#ast-scroll-top.ts-lottie-top:focus-visible { outline: 3px solid #e6cf86; outline-offset: 2px; }
.ts-lottie-top__anim { display: none; width: 22px; height: 30px; margin: 7px auto 0; }
#ast-scroll-top.has-anim .ts-lottie-top__anim { display: block; }
#ast-scroll-top.has-anim .ast-icon { display: none; }

/* vote page: animated check beside "saved" messages */
.ts-alert.has-anim:not([hidden]) { display: flex; align-items: center; gap: 10px; }
.ts-alert__anim { flex: 0 0 auto; width: 32px; height: 32px; }

/* fallback glyph inside an animation holder disappears once the animation is drawn */
.ts-link__arrow.is-ready, .ts-social__icon.is-ready { font-size: 0; }

/* animated arrows in "ดูทั้งหมด →" links */
.ts-link__arrow { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.3em; line-height: 1.25em; text-align: center; }

/* rules accordion: animated plus */
.ts-rules > summary.has-icon { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.ts-rules > summary.has-icon::-webkit-details-marker { display: none; }
.ts-summary__icon { flex: 0 0 auto; width: 26px; height: 26px; }

/* last-10-seconds countdown */
.ts-cd-anim { display: block; width: 72px; height: 69px; margin: 6px auto 0; }
.ts-cd-anim[hidden] { display: none; }

/* footer social links */
.ts-social { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ts-social__link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ts-social__link:hover { text-decoration: underline; }
.ts-social__icon { width: 30px; height: 30px; line-height: 30px; }

/* 404 page */
.ts-404-anim { display: flex; justify-content: center; margin: 8px 0 24px; }
.ts-404-anim .ts-lottie { width: min(440px, 100%); height: auto; aspect-ratio: 1732 / 962; }

/* ---------- button states + press animation (theme-owned buttons; .ts-btn & co. live in the plugin's front.css)
 * Astra fills every <button> on :hover/:focus with #4f1d73, which left these stuck solid purple after a tap. */
/* mobile menu toggle in the dark header: soft tint on hover, magenta + gold edge while pressed */
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline {
	--ts-ring: #e6cf86; border-radius: 10px;
	transition: background-color .2s ease, border-color .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1);
}
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline:focus { background: transparent; border-color: #fff; }
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline:hover { background: rgb(255 255 255 / 10%); border-color: #e6cf86; }
[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline:active { background: #a3277c; border-color: #e6cf86; transform: scale(.92); transition-duration: .08s; }
.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close { transition: transform .3s cubic-bezier(.3, 1.5, .5, 1), color .2s ease; }
.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close:hover { color: #e6cf86; }
.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close:active { color: #e6cf86; transform: scale(.85) rotate(90deg); }

/* gold "โหวต" pill in the menu */
.main-header-menu .ts-menu-vote > .menu-link { --ts-ring: #fff3c4; transition: filter .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1); }
.main-header-menu .ts-menu-vote > .menu-link:active { filter: brightness(.95) saturate(1.25); transform: scale(.94); }

/* hero scroll-down cue: no box, it just dips */
.ts-scroll-cue, .ts-scroll-cue:hover, .ts-scroll-cue:focus { background: none; border: 0; --ts-ring: #e6cf86; }
.ts-scroll-cue { transition: opacity .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1); }
.ts-scroll-cue:active { transform: translateX(-50%) translateY(4px) scale(.9); }

/* scroll-to-top: purple, lighter on hover, magenta while pressed */
#ast-scroll-top.ts-lottie-top { --ts-ring: #e6cf86; transition: background-color .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1); }
#ast-scroll-top.ts-lottie-top:focus { border: 2px solid #c9a227; }
#ast-scroll-top.ts-lottie-top:hover { transform: translateY(-3px); }
#ast-scroll-top.ts-lottie-top:active { background: #a3277c; border-color: #e6cf86; transform: scale(.9); transition-duration: .08s; }

@media (prefers-reduced-motion: reduce) {
	[data-section="section-header-mobile-trigger"] .ast-button-wrap .menu-toggle.ast-mobile-menu-trigger-outline:active,
	.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close:active,
	.main-header-menu .ts-menu-vote > .menu-link:active, #ast-scroll-top.ts-lottie-top:hover, #ast-scroll-top.ts-lottie-top:active { transform: none; }
	.ts-scroll-cue:active { transform: translateX(-50%); }
}

/* ---------- hover / touch animations (2026-11-18)
 * Pointer devices (PC, tablet with mouse): gold underline grows under menu items, the "การโหวต" pill lifts with a
 * light sweep, the logo tilts and glows. Touch devices get no hover states (they would stick after a tap); instead
 * the drawer menu items slide in one after another and flash gold while pressed. */
@keyframes ts-nav-sheen { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(130%) skewX(-20deg); } }
@keyframes ts-drawer-item { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }

/* desktop menu: underline under every item except the pill, always shown under the current page */
.ast-desktop .main-header-menu > .menu-item:not(.ts-menu-vote) > .menu-link { position: relative; }
.ast-desktop .main-header-menu > .menu-item:not(.ts-menu-vote) > .menu-link::after {
	content: ""; position: absolute; left: 16px; right: 16px; bottom: calc(50% - 1.15em); height: 2px; border-radius: 2px;
	background: linear-gradient(90deg, #c9a227, #e6cf86, #c9a227); transform: scaleX(0); opacity: 0;
	transition: transform .35s cubic-bezier(.3, 1.3, .5, 1), opacity .2s ease; pointer-events: none;
}
.ast-desktop .main-header-menu > .current-menu-item:not(.ts-menu-vote) > .menu-link::after { transform: scaleX(.45); opacity: 1; }
.ast-desktop .main-header-menu .ts-menu-vote > .menu-link { position: relative; overflow: hidden; isolation: isolate; }
.ast-desktop .main-header-menu .ts-menu-vote > .menu-link::before {
	content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; width: 60%; pointer-events: none;
	background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent); transform: translateX(-130%) skewX(-20deg);
}

@media (hover: hover) and (pointer: fine) {
	.ast-desktop .main-header-menu > .menu-item:not(.ts-menu-vote) > .menu-link {
		transition: color .25s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1), text-shadow .3s ease;
	}
	.ast-desktop .main-header-menu > .menu-item:not(.ts-menu-vote) > .menu-link:hover {
		transform: translateY(-2px); text-shadow: 0 0 14px rgb(230 207 134 / 55%);
	}
	.ast-desktop .main-header-menu > .menu-item:not(.ts-menu-vote) > .menu-link:hover::after { transform: scaleX(1); opacity: 1; }

	.ast-desktop .main-header-menu .ts-menu-vote > .menu-link {
		transition: filter .2s ease, transform .3s cubic-bezier(.3, 1.5, .5, 1), box-shadow .3s ease;
	}
	.ast-desktop .main-header-menu .ts-menu-vote > .menu-link:hover {
		transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 24px rgb(201 162 39 / 45%), 0 0 0 3px rgb(230 207 134 / 35%);
	}
	.ast-desktop .main-header-menu .ts-menu-vote > .menu-link:hover::before { animation: ts-nav-sheen .75s ease-out; }
	.ast-desktop .main-header-menu .ts-menu-vote > .menu-link:hover:active { transform: scale(.94); transition-duration: .08s; }

	.site-header .custom-logo-link img { transition: transform .45s cubic-bezier(.3, 1.5, .5, 1), filter .3s ease; }
	.site-header .custom-logo-link:hover img {
		transform: scale(1.07) rotate(-3deg);
		filter: drop-shadow(0 2px 6px rgb(0 0 0 / 35%)) drop-shadow(0 0 10px rgb(230 207 134 / 55%)) !important;
	}

	/* drawer opened on a narrow window with a mouse */
	.ast-mobile-popup-drawer .main-header-menu .menu-item:not(.ts-menu-vote) > .menu-link:hover { background-color: rgb(230 207 134 / 10%); }

	.ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close:hover { transform: rotate(90deg); }
	.ts-scroll-cue:hover { transform: translateX(-50%) translateY(3px); }
	.ts-scroll-cue:hover:active { transform: translateX(-50%) translateY(4px) scale(.9); }
}

/* drawer menu (mobile/tablet): items slide in one after another, gold flash while pressed */
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item { animation: ts-drawer-item .45s cubic-bezier(.2, .8, .3, 1) both; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(1) { animation-delay: .06s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(2) { animation-delay: .11s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(3) { animation-delay: .16s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(4) { animation-delay: .21s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(5) { animation-delay: .26s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(6) { animation-delay: .31s; }
.ast-mobile-popup-drawer.active .main-header-menu > .menu-item:nth-child(n+7) { animation-delay: .36s; }
.ast-mobile-popup-drawer .main-header-menu .menu-item:not(.ts-menu-vote) > .menu-link {
	-webkit-tap-highlight-color: transparent; transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.ast-mobile-popup-drawer .main-header-menu .menu-item:not(.ts-menu-vote) > .menu-link:active {
	background-color: rgb(230 207 134 / 16%); color: #e6cf86 !important; transform: scale(.97); transition-duration: .06s;
}
.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote > .menu-link { -webkit-tap-highlight-color: transparent; transition: filter .2s ease, transform .22s cubic-bezier(.3, 1.5, .5, 1); }
.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote > .menu-link:active { transform: scale(.94); filter: brightness(.95) saturate(1.25); }

@media (prefers-reduced-motion: reduce) {
	.ast-desktop .main-header-menu > .menu-item > .menu-link, .ast-desktop .main-header-menu > .menu-item > .menu-link:hover,
	.site-header .custom-logo-link:hover img, .ast-mobile-popup-drawer .ast-mobile-popup-header .menu-toggle-close:hover,
	.ast-mobile-popup-drawer .main-header-menu .menu-item > .menu-link:active,
	.ast-builder-menu-mobile .main-navigation .main-header-menu .ts-menu-vote > .menu-link:active { transform: none !important; }
	.ts-scroll-cue:hover { transform: translateX(-50%); }
	.ast-desktop .main-header-menu > .menu-item > .menu-link::after { transition: opacity .2s linear; transform: scaleX(1); }
	.ast-desktop .main-header-menu > .menu-item:not(.current-menu-item) > .menu-link:not(:hover)::after { opacity: 0; }
	.ast-desktop .main-header-menu .ts-menu-vote > .menu-link::before, .ast-mobile-popup-drawer.active .main-header-menu > .menu-item { animation: none !important; }
}
