/* ============================================================
 * SOICT Graduation — frontend (sáng editorial, giống bản gốc)
 * Font Inter được enqueue riêng (không dùng @import để tránh render-blocking).
 * ========================================================== */

/* ---- Lucky spin wheel animation ---- */
@keyframes sgd-spin-anim {
	0%   { transform: rotate(0deg); }
	100% { transform: rotate(var(--sgd-spin-deg, 3600deg)); }
}
.sgd-root {
	scroll-behavior: smooth;
	--sgd-primary: #B31F24;
	--sgd-primary-hover: #91161A;
	--sgd-primary-50: #FBEDED;
	--sgd-primary-100: #F6DADA;
	--sgd-maroon: #780705;
	--sgd-gold: #eee078;
	--sgd-bg: #FFFFFF;
	--sgd-bg-2: #F8F9FA;
	--sgd-bg-3: #F1F1F1;
	--sgd-border: #E5E5E5;
	--sgd-border-strong: #DDDDDD;
	--sgd-ink: #333333;
	--sgd-ink-2: #666666;
	--sgd-ink-3: #9CA3AF;

	font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--sgd-ink);
	background: #ffffff !important;
	line-height: 1.6;
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
	/* Lấp đầy cột nội dung của theme (KHÔNG dùng 100vw để tránh tràn ngang do
	   thanh cuộn). Muốn tràn mép thật sự: đặt trang/row "Full width" trong Flatsome. */
	width: 100%;
}
.sgd-root *,
.sgd-root *::before,
.sgd-root *::after { box-sizing: inherit; }
/* [hidden] phải thực sự ẩn (vì .sgd-btn/.sgd-modal... đặt display: lệ overrides). */
.sgd-root [hidden], [hidden].sgd-modal, [hidden].sgd-lightbox, [hidden].sgd-popup { display: none !important; }
.sgd-root h1, .sgd-root h2, .sgd-root h3 { letter-spacing: -0.015em; }

/* ---- Sections & container ---- */
.sgd-section { background: #ffffff; padding: clamp(56px, 9vw, 120px) 0; }
.sgd-section--muted { background: var(--sgd-bg-2); }
.sgd-container { max-width: 1152px; margin: 0 auto; padding: 0 24px; }

/* ---- Section header (eyebrow + title + rule) ---- */
.sgd-head { max-width: 42rem; }
.sgd-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.sgd-eyebrow { margin: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2em; color: var(--sgd-primary); }
.sgd-h2 { margin: .75rem 0 0; font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 600; line-height: 1.12; color: var(--sgd-ink); }
.sgd-h3 { margin: .6rem 0 0; font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; color: var(--sgd-ink); }
.sgd-desc { margin: 1rem 0 0; max-width: 42rem; color: var(--sgd-ink-2); font-size: clamp(1rem, 2vw, 1.125rem); }
.sgd-desc-sm { margin: .5rem 0 0; color: var(--sgd-ink-2); font-size: .9rem; }
.sgd-head--center .sgd-desc { margin-left: auto; margin-right: auto; }
.sgd-rule { margin-top: 1.5rem; height: 2px; width: 48px; background: var(--sgd-primary); }
.sgd-head--center .sgd-rule { margin-left: auto; margin-right: auto; }

/* ---- Buttons ---- */
.sgd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	height: 2.75rem; padding: 0 1.25rem; border-radius: .5rem; font-weight: 500; font-size: .95rem;
	text-decoration: none; cursor: pointer; border: 1px solid transparent;
	transition: all .2s cubic-bezier(.22, 1, .36, 1);
}
.sgd-btn:active { transform: scale(.99); }
.sgd-btn:disabled { opacity: .5; cursor: not-allowed; }
.sgd-btn--lg { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.sgd-btn--block { width: 100%; }
.sgd-btn--primary { background: var(--sgd-primary); color: #fff; }
.sgd-btn--primary:hover { background: var(--sgd-primary-hover); }
.sgd-btn--outline { background: transparent; color: var(--sgd-ink); border-color: var(--sgd-border-strong); }
.sgd-btn--outline:hover { background: var(--sgd-bg-2); }
.sgd-btn--icon { width: 2.5rem; height: 2.5rem; padding: 0; font-size: 1.25rem; background: #fff; border-color: var(--sgd-border); color: var(--sgd-ink); }

/* ---- Dot nav ---- */
.sgd-dotnav { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; flex-direction: column; gap: 14px; }
@media (min-width: 1024px) { .sgd-dotnav { display: flex; } }
.sgd-dotnav a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.sgd-dotnav a span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--sgd-border-strong); background: #fff; transition: all .2s; }
.sgd-dotnav a.is-active span { background: var(--sgd-primary); border-color: var(--sgd-primary); transform: scale(1.2); }
.sgd-dotnav a em { font-style: normal; font-size: .78rem; color: var(--sgd-ink-2); background: #fff; padding: 2px 8px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); opacity: 0; transform: translateX(6px); transition: all .2s; }
.sgd-dotnav a:hover em, .sgd-dotnav a.is-active em { opacity: 1; transform: translateX(0); }

/* ---- Hero ---- */
.sgd-hero { padding: clamp(48px, 7vw, 96px) 0; }
.sgd-hero__grid { display: grid; gap: 3rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1024px) { .sgd-hero__grid { grid-template-columns: 7fr 5fr; gap: 2.5rem; } }
.sgd-hero__title { margin: .75rem 0 0; font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 800; line-height: 1.03; letter-spacing: -.02em; color: var(--sgd-ink); }
.sgd-hero__title span { display: block; }
.sgd-hero__desc { margin: 1.5rem 0 0; max-width: 36rem; color: var(--sgd-ink-2); font-size: clamp(1rem, 2vw, 1.125rem); }
.sgd-hero__cta { margin-top: 2.5rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.sgd-hero__media { position: relative; }
.sgd-hero__slides { position: relative; aspect-ratio: 4/3; border-radius: 1rem; overflow: hidden; background: linear-gradient(135deg, #fdecec, #f8d8d8); box-shadow: 0 20px 50px rgba(120,7,5,.18); }
.sgd-hero__card { position: relative; margin: -3rem 0 0 auto; width: min(23rem, 100%); background: #fff; border: 1px solid var(--sgd-border); border-radius: 1rem; padding: 1.1rem 1.25rem; box-shadow: 0 16px 40px rgba(0,0,0,.12); }
.sgd-hero__card .sgd-eyebrow { color: var(--sgd-ink); }
.sgd-hero__card .sgd-countdown { margin: .6rem 0 1rem; }

/* Slideshow */
.sgd-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.75rem; color: #fff; background-size: cover; background-position: center; }
.sgd-slide.is-active { opacity: 1; }
.sgd-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, rgba(120,7,5,.72)); }
.sgd-slide__q, .sgd-slide__a { position: relative; z-index: 1; }
.sgd-slide__q { font-size: 1.05rem; font-weight: 600; }
.sgd-slide__a { font-size: .85rem; opacity: .9; margin-top: .35rem; }

/* Countdown — luôn nằm ngang, gọn, có dấu :
   Mặc định căn GIỮA vì đây là khối trang trí; hero-card và popup tự kế thừa.
   Muốn trái phải → ghi đè bằng `.sgd-countdown--start` (hoặc style="justify-content:flex-start"). */
.sgd-countdown { display: flex !important; flex-direction: row !important; flex-wrap: nowrap; align-items: flex-start; justify-content: center; gap: .3rem; }
.sgd-countdown--start { justify-content: flex-start !important; }
.sgd-cd-unit { flex: 0 0 auto; background: #1a1a1a; color: #fff; border-radius: .5rem; padding: .4rem .3rem; min-width: 2.7rem; text-align: center; box-shadow: inset 0 -3px 0 var(--sgd-gold); }
.sgd-cd-unit b { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.15; }
.sgd-cd-unit span { display: block; font-size: .52rem; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.sgd-cd-sep { flex: 0 0 auto; color: var(--sgd-ink-3); font-weight: 700; font-size: 1.1rem; line-height: 1; margin-top: .45rem; }
.sgd-cd-done { color: var(--sgd-ink-2); font-weight: 600; }

/* ---- Schedule ---- */
.sgd-sched-grid { margin-top: 3rem; display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .sgd-sched-grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
.sgd-sched-intro { color: var(--sgd-ink-2); font-size: .95rem; }
.sgd-timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--sgd-border); }
.sgd-timeline__item { display: grid; grid-template-columns: 80px 1fr; gap: 1.5rem; align-items: baseline; padding: 1.5rem 0; border-bottom: 1px solid var(--sgd-border); }
@media (min-width: 768px) { .sgd-timeline__item { grid-template-columns: 120px 1fr; gap: 2.5rem; } }
.sgd-timeline__time { font-family: ui-monospace, monospace; font-weight: 500; color: var(--sgd-primary); font-size: .95rem; }
.sgd-timeline__title { margin: 0; font-size: 1.125rem; font-weight: 600; color: var(--sgd-ink); }
.sgd-timeline__desc { margin: .25rem 0 0; color: var(--sgd-ink-2); font-size: .9rem; }

/* ---- Avatar ---- */
.sgd-avatar__grid { margin-top: 3rem; display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .sgd-avatar__grid { grid-template-columns: 5fr 7fr; gap: 3rem; } }
.sgd-avatar__steps { display: flex; flex-direction: column; gap: 2.5rem; }
.sgd-step .sgd-upload { margin-top: 1.25rem; }
.sgd-frames { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-start; padding-bottom: .5rem; }
/* Reset cứng vì .sgd-frame-thumb là <button> bị theme Flatsome áp style nút.
   Responsive: vuông trên mobile, rộng hơn trên tablet/desktop. */
.sgd-frame-thumb { flex: 0 0 auto; width: 4.5rem !important; min-width: 4.5rem !important; max-width: 4.5rem !important; height: auto !important; background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; cursor: pointer; text-transform: none !important; letter-spacing: 0 !important; font: inherit; color: inherit; line-height: normal; min-height: 0 !important; }
@media (min-width: 768px) {
	.sgd-frame-thumb { width: 5.5rem !important; min-width: 5.5rem !important; max-width: 5.5rem !important; }
}
.sgd-frame-thumb__box { display: block; position: relative; width: 4.5rem; height: 4.5rem; border-radius: .75rem; overflow: hidden; border: 2px solid var(--sgd-border); background: var(--sgd-bg-2); transition: all .2s; }
@media (min-width: 768px) {
	.sgd-frame-thumb__box { width: 5.5rem; height: 5.5rem; }
}
.sgd-frame-thumb__box img { width: 100% !important; height: 100% !important; min-width: 0 !important; max-width: none !important; object-fit: cover !important; display: block; margin: 0 !important; padding: 0 !important; }
.sgd-frame-thumb.is-active .sgd-frame-thumb__box { border-color: var(--sgd-primary); box-shadow: 0 0 0 2px var(--sgd-primary); }
.sgd-frame-thumb.is-active .sgd-frame-thumb__box::after { content: "✓"; position: absolute; top: .25rem; right: .25rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--sgd-primary); color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sgd-frame-thumb__name { display: none; }
.sgd-frame-thumb.is-active .sgd-frame-thumb__name { color: var(--sgd-primary); }
.sgd-avatar__stage { display: flex; flex-direction: column; align-items: center; }
/* Cropper responsive: 80vw trên mobile, tăng dần lên desktop */
.sgd-cropper { position: relative; width: min(80vw, 100%); aspect-ratio: 1; border-radius: 1rem; overflow: hidden; background: var(--sgd-bg-3); border: 1px solid var(--sgd-border); box-shadow: 0 1px 3px rgba(0,0,0,.06); cursor: grab; touch-action: none; user-select: none; }
@media (min-width: 768px) { .sgd-cropper { width: min(60vw, 28rem); } }
@media (min-width: 1024px) { .sgd-cropper { width: min(45vw, 32rem); } }
.sgd-cropper.is-grabbing { cursor: grabbing; }
.sgd-cropper.is-dropping { outline: 3px dashed var(--sgd-primary); outline-offset: -6px; background: var(--sgd-primary-50); }
.sgd-cropper__hint { padding: 0 1rem; text-align: center; }
/* max-width:none QUAN TRỌNG: theme ép img max-width:100% → ảnh layout sai kích thước,
   khiến ảnh tải về (canvas) lệch tỉ lệ so với preview. Ép về kích thước gốc. */
#sgd-crop-img { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; max-width: none !important; width: auto !important; height: auto !important; }
.sgd-frame-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sgd-cropper__hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--sgd-ink-2); }
/* Avatar bar responsive theo cropper */
.sgd-avatar__bar { width: 100%; margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
@media (min-width: 768px) { .sgd-avatar__bar { width: min(60vw, 28rem); } }
@media (min-width: 1024px) { .sgd-avatar__bar { width: min(45vw, 32rem); } }
.sgd-avatar__tools { position: relative; width: 100%; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.sgd-avatar__tool-group { display: flex; gap: .5rem; }
.sgd-avatar__actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.sgd-zoom-wrap { display: flex; justify-content: flex-end; }
.sgd-zoom-btn { font-size: .85rem; gap: .35rem; }
.sgd-zoom-btn svg { flex-shrink: 0; }
.sgd-zoom-dropdown { position: absolute; top: 100%; right: 0; margin-top: .35rem; background: #fff; border: 1px solid var(--sgd-border); border-radius: .5rem; box-shadow: 0 4px 16px rgba(0,0,0,.12); overflow: hidden; z-index: 10; }
.sgd-zoom-dropdown[hidden] { display: none; }
.sgd-zoom-dropdown button { display: block; width: 100%; padding: .5rem 1.25rem; border: none; background: none; font-size: .85rem; color: var(--sgd-ink); cursor: pointer; text-align: center; white-space: nowrap; }
.sgd-zoom-dropdown button:hover { background: var(--sgd-bg-2); }
.sgd-fit-btn { width: 2.5rem; height: 2.5rem; padding: 0; }
.sgd-fit-btn svg { flex-shrink: 0; }
.sgd-btn--ghost { background: transparent; color: var(--sgd-ink-2); border-color: transparent; }
.sgd-btn--ghost:hover { background: var(--sgd-bg-2); color: var(--sgd-ink); }

/* ---- Lucky spin ---- */
.sgd-spin__grid { margin-top: 3rem; display: grid; gap: 3rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .sgd-spin__grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
.sgd-gifts { list-style: none; margin: 2.5rem 0 0; padding: 0; border-top: 1px solid var(--sgd-border); }
.sgd-gifts li { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem 0; border-bottom: 1px solid var(--sgd-border); }
.sgd-gifts li > :not(img) { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; }
.sgd-gifts img { width: 3rem; height: 3rem; object-fit: contain; flex-shrink: 0; }
.sgd-gift-info { display: flex; align-items: center; gap: .75rem; }
.sgd-gift-label { margin: 0; font-size: 1rem; font-weight: 600; color: var(--sgd-ink); }
.sgd-gift-prob { font-family: ui-monospace, monospace; font-size: .9rem; font-weight: 500; color: var(--sgd-primary); }
.sgd-spin__right { display: flex; flex-direction: column; align-items: center; }
.sgd-wheel { position: relative; width: 100%; max-width: min(92vw, 520px); aspect-ratio: 1; margin: 0 auto; }
.sgd-wheel__rim { position: absolute; inset: 0; border-radius: 50%; padding: 14px; background: radial-gradient(circle at 30% 30%, #ecde77 0%, #c9b748 75%, #8a7d2e 100%); box-shadow: 0 18px 40px -12px rgba(120, 7, 5, .55); }
.sgd-wheel__ring { width: 100%; height: 100%; border-radius: 50%; padding: 6px; }
.sgd-wheel__face { width: 100%; height: 100%; border-radius: 50%; transform-origin: 50% 50%; animation: sgd-spin-anim linear forwards; }
.sgd-wheel__svg { width: 100%; height: 100%; display: block; }
.sgd-wheel__pearls { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.sgd-wheel__pointer { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); z-index: 20; width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--sgd-maroon); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.sgd-spin-btn { margin-top: 2rem; min-width: 12rem; }
.sgd-used { margin-top: 1.5rem; width: 100%; max-width: 28rem; margin-left: auto; margin-right: auto; }
.sgd-card-win { border: 1px solid var(--sgd-primary-100); background: var(--sgd-primary-50); border-radius: .75rem; padding: 1.25rem; text-align: center; }
.sgd-card-miss { border: 1px solid var(--sgd-border); background: var(--sgd-bg-2); border-radius: .75rem; padding: 1.25rem; text-align: center; }
.sgd-card-win strong, .sgd-card-miss strong { display: block; color: var(--sgd-primary); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; }
.sgd-card-win p, .sgd-card-miss p { margin: .35rem 0 0; color: var(--sgd-ink); font-size: 1.05rem; font-weight: 600; }

/* ---- Lookup ---- */
.sgd-lookup { margin-top: 5rem; border-top: 1px solid var(--sgd-border); padding-top: 3rem; }
.sgd-lookup__row { max-width: 36rem; margin: 1.5rem auto 0; display: flex; gap: .75rem; }
.sgd-lookup__row input { flex: 1; height: 3rem; padding: 0 1rem; border: 1px solid var(--sgd-border); border-radius: .5rem; font-size: 1rem; }
.sgd-lookup__result { max-width: 36rem; margin: 1.25rem auto 0; }

/* ---- Spin notice ---- */
.sgd-spin__notice { max-width: 36rem; margin: 3rem auto 0; padding: 1.5rem 2rem; background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%); border-left: 4px solid #ffc107; border-radius: .5rem; text-align: center; }
.sgd-spin__notice p { margin: 0; font-size: 1rem; line-height: 1.6; color: #856404; }
.sgd-spin__notice-inline { margin-top: 1.5rem; padding: 1rem 1.25rem; background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%); border-left: 4px solid #ffc107; border-radius: .5rem; font-size: 0.9rem; line-height: 1.5; color: #856404; }

/* ---- Yearbook — Story Gallery Frame ---- */
.sgd-yearbook {
	background: linear-gradient(180deg,
		#ffffff 0%,
		#fffbf0 15%,
		#fff8dc 45%,
		#fff4d4 50%,
		#fff8dc 55%,
		#fffbf0 85%,
		#ffffff 100%
	);
	padding: 3rem 0 2.5rem;
}

/* Class Pills */
.sgd-yb__pills { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin: 1.5rem auto 0; max-width: 60rem; }
.sgd-yb-pill {
	padding: .5rem 1.25rem;
	border-radius: 999px;
	border: 1px solid var(--sgd-border);
	background: #fff;
	cursor: pointer;
	font-size: .85rem;
	font-weight: 600;
	color: var(--sgd-ink-2);
	white-space: nowrap;
	transition: all .25s ease;
}
.sgd-yb-pill:hover { border-color: var(--sgd-primary); color: var(--sgd-primary); }
.sgd-yb-pill.is-active { background: var(--sgd-primary); color: #fff; border-color: var(--sgd-primary); box-shadow: 0 4px 12px -2px rgba(179,31,36,.35); }
.sgd-yb__empty-pill { color: var(--sgd-ink-2); font-size: .85rem; }

/* Story Grid Frame — simple container */
.sgd-yb__frame {
	margin: 2rem auto 0;
	max-width: 1140px;
	border: 1px solid #f0e6c8;
	border-radius: 16px;
	background: linear-gradient(135deg, #fffef9 0%, #fffdf0 100%);
	box-shadow: 0 4px 24px rgba(180,140,40,.12);
	overflow: hidden;
}

/* Story Grid — responsive columns */
.sgd-story-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
	padding: 1.5rem;
}
@media (max-width: 1024px) { .sgd-story-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .sgd-story-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; padding: 1rem; } }

/* Story Card */
.sgd-story-card {
	position: relative;
	aspect-ratio: 3/4;
	overflow: hidden;
	border-radius: 10px;
	cursor: pointer;
	background: linear-gradient(145deg, #fff9e6 0%, #fff8dc 100%);
	border: 1px solid #f0e6c8;
	box-shadow: 0 2px 8px rgba(180,140,40,.15);
	transition: transform .25s ease, box-shadow .25s ease;
}
.sgd-story-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(0,0,0,.14);
}
.sgd-story-card__img-wrap { width: 100%; height: 100%; overflow: hidden; }
.sgd-story-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.sgd-story-card:hover .sgd-story-card__img { transform: scale(1.06); }
.sgd-story-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 50%, transparent 100%);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 1rem;
	opacity: 0;
	transition: opacity .3s ease;
}
.sgd-story-card:hover .sgd-story-card__overlay { opacity: 1; }
.sgd-story-card__quote {
	color: #fff;
	font-size: .8rem;
	line-height: 1.5;
	margin: 0 0 .5rem;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.sgd-story-card__cta {
	color: #F1C40F;
	font-size: .75rem;
	font-weight: 700;
	margin: 0;
}
.sgd-yb__empty { grid-column: 1 / -1; text-align: center; color: var(--sgd-ink-2); padding: 3rem 0; font-size: .95rem; }

/* Skeleton loading */
.sgd-skeleton-card { cursor: default; animation: none; background: #fff; }
.sgd-skeleton-card:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.sgd-skeleton-img {
	width: 100%;
	aspect-ratio: 3/4;
	background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: sgd-shimmer 1.5s infinite;
}
.sgd-skeleton-text {
	height: .75rem;
	margin: .75rem .75rem 0;
	background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: sgd-shimmer 1.5s infinite;
	border-radius: 4px;
}
@keyframes sgd-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Pagination */
.sgd-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin: 1.5rem auto 0;
}
.sgd-pagination .sgd-btn:disabled {
	opacity: .35;
	cursor: not-allowed;
}
#sgd-page-info {
	font-size: .85rem;
	color: var(--sgd-ink-2);
	min-width: 8rem;
	text-align: center;
}

/* Story Detail Overlay */
.sgd-story-detail {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sgd-story-detail[hidden] { display: none; }
.sgd-story-detail__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.85);
}
.sgd-story-detail__card {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	max-width: 560px;
	width: calc(100% - 32px);
	max-height: calc(100vh - 64px);
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 64px rgba(0,0,0,.4);
	animation: sgd-story-in .3s ease;
}
@keyframes sgd-story-in { from { opacity: 0; transform: scale(.95) translateY(20px); } to { opacity: 1; transform: none; } }
.sgd-story-detail__close {
	position: absolute;
	top: 10px;
	right: 12px;
	z-index: 10;
	background: rgba(0,0,0,.4);
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	color: #fff;
	font-size: 1.4rem;
	cursor: pointer;
	line-height: 1;
	transition: background .2s;
}
.sgd-story-detail__close:hover { background: rgba(0,0,0,.7); }
.sgd-story-detail__media {
	flex: 0 0 auto;
	position: relative;
	display: inline-block;
}
.sgd-story-detail__media img {
	display: block;
	width: 100%;
	max-height: 60vh;
	object-fit: contain;
	background: #000;
}
.sgd-story-share-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 40px;
	height: 40px;
	background: rgba(0, 0, 0, 0.7);
	border: none;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	transition: opacity 0.2s, background 0.2s;
	z-index: 10;
}
.sgd-story-share-btn svg {
	width: 18px !important;
	height: 18px !important;
	flex-shrink: 0;
	display: block;
}
.sgd-story-share-btn:hover {
	background: rgba(0, 0, 0, 0.9);
}
.sgd-story-detail__body { padding: 1.25rem 1.5rem 1.5rem; }
.sgd-story-detail__quote {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--sgd-ink);
	margin: 0 0 .75rem;
	font-style: italic;
}
.sgd-story-detail__class {
	font-size: .8rem;
	color: var(--sgd-ink-2);
	margin: 0 0 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .08em;
}

/* ---- Modal / lightbox / popup / story-detail ---- */
/* QUAN TRỌNG: display:flex bên dưới đè [hidden]; ép ẩn khi có [hidden]. */
.sgd-modal[hidden], .sgd-lightbox[hidden], .sgd-popup[hidden], .sgd-story-detail[hidden] { display: none !important; }
.sgd-modal, .sgd-lightbox { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; }
.sgd-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.sgd-modal__dialog { position: relative; z-index: 1; background: #fff; border-radius: 1rem; padding: 1.75rem; max-width: 26rem; width: calc(100% - 40px); text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.sgd-modal__x, .sgd-lightbox__x { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: #999; line-height: 1; }
.sgd-modal__body h3 { margin: 0 0 .5rem; font-size: 1.4rem; font-weight: 600; color: var(--sgd-ink); }
.sgd-modal__body p { margin: .5rem 0; color: var(--sgd-ink-2); }
.sgd-modal__body .sgd-btn { margin-top: 1rem; }
.sgd-modal__prize-img { width: 130px; height: 130px; object-fit: contain; margin: 0 auto .75rem; display: block; }
.sgd-modal__gift-name { margin: 0 0 .75rem !important; font-size: 1.25rem !important; color: var(--sgd-primary) !important; font-weight: 600 !important; text-align: center; }
.sgd-modal__title { margin: 0 0 1rem !important; font-size: 1.5rem !important; color: var(--sgd-ink) !important; text-align: center; font-weight: 600 !important; }
.sgd-modal__share-msg { margin: 0 0 .75rem !important; font-size: .95rem !important; color: var(--sgd-ink) !important; text-align: center; font-style: italic; }
.sgd-lightbox { background: rgba(0,0,0,.9); }
.sgd-lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; }
.sgd-lightbox__x { color: #fff; font-size: 2rem; }
.sgd-popup { position: fixed; bottom: 20px; right: 20px; z-index: 9000; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.2); padding: 18px 20px; max-width: 340px; border-top: 4px solid var(--sgd-primary); }
.sgd-popup__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 14px; }
.sgd-popup__head strong { margin: 0; padding: 0; color: var(--sgd-ink); font-size: 1.02rem; text-align: left; }
/* Biến thể căn giữa tiêu đề (không còn nút × ở header). */
.sgd-popup__head--center strong { flex: 1; text-align: center; padding: 0; }
/* Nút "Để sau" — nằm cuối popup, không bao giờ đè lên chữ tiêu đề. */
.sgd-popup__later { display: block; margin: 10px auto 0; padding: 0; height: auto; min-height: 0; background: none; border: none; color: var(--sgd-ink-2); font-size: .85rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.sgd-popup__later:hover { color: var(--sgd-ink); background: none; }
.sgd-popup__cd { margin-bottom: 16px; }
.sgd-popup .sgd-btn { width: 100%; }

/* Hero card — biến thể căn giữa mọi thứ (eyebrow, countdown, nút). */
.sgd-hero__card--center { text-align: center; }

/* ---- Opening (Lời mở đầu — Thanks Party) ---- */
.sgd-opening { padding-top: clamp(40px, 6vw, 80px); }
.sgd-opening__layout {
	display: grid;
	gap: clamp(2rem, 4vw, 3.5rem);
	grid-template-columns: 1fr;
	align-items: start;
}
@media (min-width: 1024px) {
	.sgd-opening__layout { grid-template-columns: 6fr 5fr; gap: 3rem; }
}
.sgd-opening__title {
	margin: .5rem 0 0;
	font-size: clamp(1.6rem, 3.4vw, 2.6rem);
	font-weight: 600;
	line-height: 1.18;
	color: var(--sgd-ink);
	max-width: 48rem;
}
.sgd-opening__brand {
	color: var(--sgd-primary);
	font-weight: 700;
}
.sgd-opening__dash {
	color: var(--sgd-primary);
	font-weight: 500;
	margin: 0 .15em;
}
.sgd-opening__body {
	margin-top: 2rem;
	max-width: 48rem;
	color: var(--sgd-ink-2);
	font-size: clamp(1rem, 1.6vw, 1.075rem);
	line-height: 1.75;
}
.sgd-opening__body p { margin: 0 0 1rem; }
.sgd-opening__body p strong { color: var(--sgd-primary); font-weight: 700; }
.sgd-opening__sign { margin-top: 2.25rem !important; font-size: 1.15rem; color: var(--sgd-ink); }

/* ---- Opening media (marquee ảnh) ---- */
.sgd-opening__media {
	position: relative;
	overflow: hidden;
	border-radius: 1rem;
	background: linear-gradient(135deg, #fff8e6 0%, #fff4d4 50%, #fff0d0 100%);
	padding: 1rem 0;
	box-shadow: 0 16px 40px -16px rgba(180,140,40,.2);
	/* CHE 2 bên để cảm giác ảnh trôi ra/vào mượt. */
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.sgd-opening__track {
	display: flex;
	gap: 1rem;
	width: max-content;
	padding: 0 .5rem;
	will-change: transform;
}
.sgd-opening__track + .sgd-opening__track { margin-top: 1rem; }
.sgd-opening__track--r { animation: sgd-opening-marquee-r 38s linear infinite; }
.sgd-opening__track--l { animation: sgd-opening-marquee-l 46s linear infinite; }
.sgd-opening__media:hover .sgd-opening__track { animation-play-state: paused; }

.sgd-opening__tile {
	position: relative;
	flex: 0 0 auto;
	width: clamp(160px, 18vw, 220px);
	aspect-ratio: 4 / 5;
	margin: 0;
	border-radius: .9rem;
	overflow: hidden;
	background: var(--sgd-bg-3);
	border: 4px solid #fff;
	box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .35);
	transform: rotate(var(--sgd-tilt, 0deg)) translateY(0);
	transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
}
.sgd-opening__tile:nth-child(2n) { --sgd-tilt: -1.5deg; }
.sgd-opening__tile:nth-child(3n) { --sgd-tilt: 1.8deg; }
.sgd-opening__tile:nth-child(5n) { --sgd-tilt: -2deg; }
.sgd-opening__tile:hover {
	transform: rotate(0) translateY(-6px) scale(1.03);
	box-shadow: 0 18px 40px -10px rgba(120, 7, 5, .35);
}
.sgd-opening__tile img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s cubic-bezier(.22, 1, .36, 1);
}
.sgd-opening__tile:hover img { transform: scale(1.08); }
/* (brand-tag đã bỏ — giữ placeholder comment để dễ tìm nếu cần thêm lại) */
/* Caption đè đen trong suốt phía dưới ảnh — IG Story style. */
.sgd-opening__cap {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	padding: 1.5rem 1rem .9rem;
	color: #fff;
	font-size: clamp(.82rem, 1.15vw, .98rem);
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: .005em;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
	background: linear-gradient(0deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, 0) 100%);
	opacity: .92;
	transform: translateY(0);
	transition: opacity .4s ease, letter-spacing .4s ease;
}
.sgd-opening__tile:hover .sgd-opening__cap { opacity: 1; letter-spacing: .015em; }

@keyframes sgd-opening-marquee-r {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}
@keyframes sgd-opening-marquee-l {
	from { transform: translateX(-50%); }
	to { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
	.sgd-opening__track--r, .sgd-opening__track--l { animation: none; }
}

/* ---- Footer: See you at the party ---- */
.sgd-footer {
	background: #fff;
	padding: 80px 20px;
	text-align: center;
}
.sgd-footer__inner {
	max-width: 680px;
	margin: auto;
}
.sgd-footer__eyebrow {
	margin: 0;
	color: var(--sgd-primary);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.sgd-footer__title {
	margin: 12px 0;
	color: var(--sgd-primary);
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
}
.sgd-footer__rule {
	width: 48px;
	height: 2px;
	background: var(--sgd-primary);
	margin: 22px auto 34px;
}
.sgd-footer__subtitle {
	margin: 0 0 20px;
	color: #777;
	font-size: 16px;
}
.sgd-footer__keywords {
	margin: 10px 0;
	font-size: 18px;
	font-weight: 500;
	color: #222;
	line-height: 1.6;
}
.sgd-footer__see-you {
	margin-top: 42px;
	color: var(--sgd-primary);
	font-size: 22px;
	font-style: italic;
	font-weight: 600;
}

/* ---- Share Card ---- */
.sgd-share-card {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sgd-share-card[hidden] { display: none; }
.sgd-share-card__bg {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	background-attachment: fixed;
}
.sgd-share-card__content {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 480px;
	padding: 20px;
}
.sgd-share-card__inner {
	background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
	border-radius: 20px;
	padding: 32px 24px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.sgd-share-card__inner img {
	width: 100%;
	max-height: 320px;
	object-fit: cover;
	border-radius: 12px;
	margin-bottom: 16px;
}
.sgd-share-card__inner blockquote {
	font-size: 1.1rem;
	line-height: 1.6;
	color: #333;
	margin: 0 0 12px;
	font-style: italic;
}
.sgd-share-card__inner p {
	font-size: 0.85rem;
	color: #666;
	margin: 0 0 20px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}
.sgd-share-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 24px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #1877F2;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s;
}
.sgd-share-card__btn:hover {
	background: #166fe5;
	transform: translateY(-2px);
}
.sgd-share-card__hashtag {
	margin: 16px 0 0;
	color: #B31F24;
	font-weight: 600;
	font-size: 0.95rem;
}
