/* ==========================================================================
   SAMOEDKKU — หน้าหลักของเว็บสโมสรนักศึกษาคณะศึกษาศาสตร์ มข.
   โครงและสไตล์ตามเว็บค่ายสานฝัน (sanfun_newver) เปลี่ยนเป็นสีของ SAMOED (ส้ม + อิฐ)
   ใช้คู่กับ site-head.php / site-header.php / site-footer.php
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-surface: #fff8f3;          /* พื้นส่วนสลับ (อุ่นกว่าเทาของสานฝัน ให้เข้ากับส้มอิฐ) */

  --text-main: #2b1b15;
  --text-muted: #6b5a53;
  --text-dim: #8f7f78;

  --accent: #f15a22;              /* ส้ม SAMOED — ตกแต่ง / เงาเรือง */
  --accent-ink: #c4411a;          /* ส้มเข้ม — ปุ่ม ลิงก์ ตัวหนังสือ (อ่านได้บนพื้นขาว) */
  --accent-deep: #8a2f1f;         /* อิฐ — hover / ข้อความเน้น */
  --accent-light: #fff1e8;

  --border-subtle: #f0e2d8;
  --border-glow: rgba(241, 90, 34, 0.35);

  --shadow-sm: 0 2px 8px rgba(43, 27, 21, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(43, 27, 21, 0.08), 0 4px 6px -2px rgba(43, 27, 21, 0.03);
  --shadow-glow: 0 12px 30px -5px rgba(241, 90, 34, 0.2);

  --font-heading: 'Outfit', 'Prompt', sans-serif;
  --font-body: 'Prompt', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.site {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ไม่ตั้งค่า img / a ทั้งหน้า — ไฟล์นี้ใช้ร่วมกับหน้าเก่าที่ยังใช้ Bootstrap + ธีมเดิม */
body.site a { text-decoration: none; }

.s-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

.skip-link {
  position: absolute; left: 1rem; top: -60px; z-index: 2000;
  background: var(--text-main); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid rgba(241, 90, 34, 0.55); outline-offset: 3px; }

/* --------------------------------------------------------------------------
   HEADER — แถบเมนูลอยทรงแคปซูล
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.25rem 0;
  transition: padding var(--transition-normal);
}
.site-header.scrolled { padding: 0.75rem 0; }

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 14px 18px 14px 24px;
  border-radius: 50px;
  border: 1px solid rgba(240, 226, 216, 0.7);
  transition: box-shadow var(--transition-normal), background-color var(--transition-normal);
}
.site-header.scrolled .nav-container { background-color: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow-md); }

.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo img { display: block; height: 40px; width: auto; transition: transform var(--transition-fast); }
.brand-logo:hover img { transform: scale(1.03); }

.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links li { white-space: nowrap; }

.s-nav-link {
  position: relative;
  display: inline-block;
  padding: 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.s-nav-link:hover, .s-nav-link.active { color: var(--accent-ink); }
.s-nav-link::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px;
  background: var(--accent); border-radius: var(--radius-full);
  transform: scaleX(0); transform-origin: left; transition: transform var(--transition-fast);
}
.s-nav-link:hover::after, .s-nav-link.active::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.nav-social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-full);
  background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}
.nav-social-btn:hover { background: var(--accent-light); color: var(--accent-ink); border-color: var(--border-glow); transform: translateY(-2px); }

.mobile-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-main); cursor: pointer;
}
.mobile-drawer-social { display: none; }

/* --------------------------------------------------------------------------
   HERO — ภาพตึกคณะจางเป็นขาว + แสงส้ม + โลโก้กลางจอ + ปุ่มบริการ
   -------------------------------------------------------------------------- */
.s-hero {
  position: relative;
  overflow: hidden;
  padding: 10rem 0 6rem;
  background: var(--bg);
}
/* หน้าย่อย: ส่วนหัวสั้น ไม่มีภาพ มีแค่แสงส้ม */
.s-hero-compact { padding: 8.5rem 0 5rem; }
.s-hero-compact .s-container { position: relative; z-index: 1; }

.hero-bg-media { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-bg-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero-bg-media::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.27) 0%, rgba(255, 255, 255, 0.67) 40%, #fff 90%, #fff 100%);
}
.hero-ambient {
  position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 500px; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(241, 90, 34, 0.16) 0%, rgba(241, 90, 34, 0.05) 50%, transparent 70%);
  filter: blur(80px);
}

.hero-content { position: relative; z-index: 1; text-align: center; max-width: 900px; margin: 0 auto; }

.hero-title { margin: 0 0 1.5rem; }
.hero-logo-img {
  display: block;
  width: 100%; max-width: clamp(280px, 42vw, 480px); height: auto; margin: 0 auto;
  filter: drop-shadow(0 12px 30px rgba(241, 90, 34, 0.22));
  transition: transform var(--transition-normal);
}
.hero-logo-img:hover { transform: scale(1.02); }

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.7;
  margin: 0 auto 2.25rem;
}
.hero-subtitle-en { display: block; font-family: var(--font-heading); letter-spacing: 0.02em; }
.nowrap { white-space: nowrap; }

/* รายการบริการ — แบบป้ายบอกทาง: แถวเรียบ คั่นด้วยเส้น ไม่มีไล่สี/เงาเรือง */
.service-board {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem 1.05rem 1.5rem;
  color: var(--text-main);
  transition: background-color var(--transition-fast);
}
.service-row + .service-row { border-top: 1px solid var(--border-subtle); }
.service-text { display: flex; flex-direction: column; min-width: 0; }
.service-name { font-weight: 700; font-size: 1.08rem; line-height: 1.4; }
.service-sub { font-size: 0.9rem; color: var(--text-muted); }
.service-arrow {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-subtle); color: var(--accent-ink);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.service-arrow svg { width: 18px; height: 18px; }
.service-row:hover { background: var(--accent-light); }
.service-row:hover .service-name { color: var(--accent-deep); }
.service-row:hover .service-arrow { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }

/* --------------------------------------------------------------------------
   SECTIONS
   -------------------------------------------------------------------------- */
.section { padding: 6rem 0; scroll-margin-top: 90px; }
.section-alt { background-color: var(--bg-surface); }

.section-hashtag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  margin-bottom: 0.6rem;
}
.s-section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}
.section-desc { color: var(--text-muted); max-width: 65ch; margin: 0; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem 2rem; margin-bottom: 2rem;
}

/* แบนเนอร์ + ข้อความ (โครงเดียวกับ "ค่ายสานฝันคือค่ายอะไร?") */
.feature-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 4rem; align-items: center; }
.feature-highlight {
  background: var(--accent-light); border: 1px solid rgba(241, 90, 34, 0.25);
  border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-top: 1.25rem;
  font-weight: 600; color: var(--accent-deep);
}
.feature-media {
  display: block; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.feature-media img { display: block; width: 100%; height: auto; }

/* แถบสินค้าเลื่อนวน (หน้าแรก ใต้ Freshy ED58) — 2 ชุดต่อกัน เลื่อนไปครึ่งหนึ่งแล้ววนใหม่; ชี้/แตะ/โฟกัสแล้วหยุด */
.product-marquee { margin-top: 3.5rem; overflow: hidden; padding: 0.5rem 0 1rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.product-marquee-track { display: flex; width: max-content; animation: product-marquee var(--marquee-time, 40s) linear infinite; }
.product-marquee:hover .product-marquee-track, .product-marquee:focus-within .product-marquee-track { animation-play-state: paused; }
.product-marquee-list { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0 0.625rem; }
@keyframes product-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-card { display: flex; flex-direction: column; width: 200px; color: var(--text-main); text-decoration: none; }
.marquee-card:hover { color: var(--text-main); }
.marquee-img { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border-subtle); transition: transform 0.25s, box-shadow 0.25s; }
.marquee-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.marquee-card:hover .marquee-img, .marquee-card:focus-visible .marquee-img { transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.marquee-card:focus-visible { outline: none; }
.marquee-card:focus-visible .marquee-img { outline: 3px solid var(--border-glow); outline-offset: 2px; }
.marquee-name { font-weight: 600; margin-top: 0.6rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marquee-price { font-family: var(--font-heading); font-weight: 700; color: var(--accent-ink); }
.marquee-tag { position: absolute; left: 0.5rem; top: 0.5rem; background: var(--text-main); color: #fff; font-size: 0.75rem; padding: 0.1rem 0.55rem; border-radius: 999px; }
.marquee-card.is-sold-out img { filter: grayscale(1); opacity: 0.55; }
@media (max-width: 600px) { .marquee-card { width: 150px; } .product-marquee-list { gap: 0.9rem; } .product-marquee { margin-top: 2.5rem; } }
/* ผู้ใช้ที่ปิดภาพเคลื่อนไหว: ไม่เลื่อนเอง ปัดดูเองได้ */
@media (prefers-reduced-motion: reduce) {
  .product-marquee { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .product-marquee-track { animation: none; }
  .product-marquee-list[aria-hidden] { display: none; }
}
a.feature-media:hover { transform: translateY(-6px); border-color: var(--border-glow); box-shadow: var(--shadow-glow); }

.s-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem; border-radius: var(--radius-full);
  font-family: var(--font-body); font-weight: 600; font-size: 0.98rem;
  transition: all var(--transition-fast); border: 1px solid transparent;
}
.s-btn-primary { background: var(--accent-ink); color: #fff; box-shadow: 0 4px 15px rgba(241, 90, 34, 0.35); }
.s-btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); }
.s-btn-secondary { background: var(--bg-surface); color: var(--text-main); border-color: var(--border-subtle); }
.s-btn-secondary:hover { background: var(--accent-light); border-color: var(--border-glow); color: var(--accent-ink); }
.s-btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* --------------------------------------------------------------------------
   CALENDAR
   -------------------------------------------------------------------------- */
.legend { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; font-size: 0.9rem; color: var(--text-muted); }
.legend li::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.5rem; vertical-align: 1px; }
.legend .samo::before { background: var(--accent-ink); }
.legend .google::before { background: #475569; }

.calendar-card {
  position: relative;
  background: #fff; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
#loading { display: none; position: absolute; top: 1.2rem; right: 1.5rem; font-size: 0.85rem; color: var(--text-dim); }

.calendar-card .fc {
  --fc-border-color: var(--border-subtle);
  --fc-button-bg-color: #fff;
  --fc-button-border-color: var(--border-subtle);
  --fc-button-text-color: var(--text-main);
  --fc-button-hover-bg-color: var(--accent-light);
  --fc-button-hover-border-color: var(--border-glow);
  --fc-button-active-bg-color: var(--accent-ink);
  --fc-button-active-border-color: var(--accent-ink);
  --fc-today-bg-color: #fff4ec;
  --fc-event-bg-color: #475569;
  --fc-event-border-color: #475569;
  --fc-neutral-bg-color: var(--bg-surface);
  --fc-list-event-hover-bg-color: var(--accent-light);
  font-family: var(--font-body);
}
.calendar-card .fc .fc-toolbar-title { font-family: var(--font-heading); font-weight: 700; font-size: 1.4rem; }
.calendar-card .fc .fc-button { border-radius: var(--radius-full); padding: 0.4rem 1rem; font-weight: 500; box-shadow: none !important; }
.calendar-card .fc .fc-button-primary:not(:disabled).fc-button-active,
.calendar-card .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.calendar-card .fc .fc-button-group .fc-button { border-radius: var(--radius-full); margin-left: 4px; }
.calendar-card .fc .fc-col-header-cell-cushion { color: var(--text-muted); font-weight: 500; padding: 0.5rem 0.25rem; }
.calendar-card .fc .fc-daygrid-day-number { color: var(--text-main); font-size: 0.9rem; }
.calendar-card .fc .fc-daygrid-event { border-radius: 6px; padding: 1px 4px; font-size: 0.82rem; cursor: pointer; }
.calendar-card .fc .fc-scrollgrid { border-radius: var(--radius-md); overflow: hidden; }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.site-footer { background: #2b1b15; color: #f8f1ec; padding: 2.5rem 0; }
.footer-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.25rem; }
.footer-copy { flex: 1 1 480px; color: #cbb8ae; font-size: 0.9rem; line-height: 1.7; margin: 0; }
.footer-copy strong { color: #fff; font-weight: 600; }
.footer-credit-link { color: var(--accent); font-weight: 600; }
.footer-credit-link:hover { text-decoration: underline; }
.footer-social-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.footer-social-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f8f1ec; font-size: 0.825rem; font-weight: 500;
  transition: all var(--transition-fast);
}
.footer-social-btn:hover { background: rgba(241, 90, 34, 0.18); border-color: var(--accent); color: #fff; }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .nav-links { gap: 1rem; }
  .s-nav-link { font-size: 0.88rem; }
}

@media (max-width: 960px) {
  .site-header { padding: 0.75rem 0; }
  .nav-container { padding: 10px 12px 10px 18px; }
  .brand-logo img { height: 34px; }
  .nav-actions .nav-social-btn { display: none; }
  .mobile-toggle { display: flex; }

  .nav-links {
    position: fixed; top: 76px; left: 1rem; right: 1rem;
    flex-direction: column; align-items: stretch; gap: 0.3rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  }
  .nav-links.show { transform: none; opacity: 1; pointer-events: auto; }
  .s-nav-link {
    display: flex; align-items: center; width: 100%; min-height: 48px; padding: 0.75rem 1rem;
    border-radius: var(--radius-sm); font-size: 1.02rem; font-weight: 600; color: var(--text-main);
  }
  .s-nav-link:hover, .s-nav-link.active { background: var(--accent-light); color: var(--accent-ink); }
  .s-nav-link::after { display: none; }
  .mobile-drawer-social { display: flex; gap: 0.5rem; padding: 0.75rem 0.25rem 0; margin-top: 0.4rem; border-top: 1px solid var(--border-subtle); }
  .mobile-drawer-social a {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0.6rem; border-radius: var(--radius-full); background: var(--bg-surface);
    border: 1px solid var(--border-subtle); color: var(--text-main); font-size: 0.9rem; font-weight: 500;
  }

  .feature-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  .s-container { padding: 0 1rem; }
  .s-hero { padding: 7rem 0 3.5rem; }
  .s-hero-compact { padding: 6.5rem 0 3rem; }
  .hero-logo-img { max-width: min(300px, 82vw); }
  .hero-subtitle { font-size: 1rem; }
  .service-row { padding: 0.95rem 1rem 0.95rem 1.15rem; }
  .section { padding: 4rem 0; }
  .s-section-title { font-size: 1.6rem; }
  .calendar-card { padding: 0.75rem; }
  .calendar-card .fc .fc-toolbar { flex-direction: column; gap: 0.6rem; }
  .calendar-card .fc .fc-toolbar-title { font-size: 1.2rem; }
  .footer-bar { flex-direction: column; text-align: center; }
  .footer-social-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  a.feature-media:hover, .nav-social-btn:hover { transform: none; }
}
