/* ============================================================
   RB Student Council — Shared Design System
   Ratchaburi School (โรงเรียนราชโบริกานุเคราะห์ / RB)
   Palette: Pink + Charcoal + Warm white
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@400;500;600;700&family=Chonburi&family=Sora:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand — RB official palette */
  --pink:        #B62477;  /* primary magenta */
  --pink-deep:   #6248A9;  /* deep purple */
  --purple:      #8754AD;  /* mid purple */
  --pink-soft:   #F0E6F7;  /* soft purple tint */
  --pink-tint:   #FAF5FD;  /* lightest purple wash */
  --lilac:       #DCC8EC;  /* soft lilac */
  --charcoal:    #241B33;  /* deep purple-black */
  --ink:         #38304A;
  --grey:        #726A82;
  --line:        #EAE0F2;
  --paper:       #FFFDFE;
  --white:       #FFFFFF;
  --gold:        #FFB048;  /* RB gold */
  --gold-deep:   #C77F1A;

  /* Type */
  --display: 'Chonburi', 'IBM Plex Sans Thai', serif;
  --head:    'Sora', 'IBM Plex Sans Thai', sans-serif;
  --body:    'IBM Plex Sans Thai', 'Sora', sans-serif;

  /* Layout */
  --max:     1180px;
  --radius:  18px;
  --radius-sm: 12px;
  --shadow:  0 14px 40px -18px rgba(98, 72, 169, 0.35);
  --shadow-sm: 0 6px 18px -10px rgba(36, 27, 51, 0.25);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 22px; }

/* ---------- Decorative background ---------- */
.bg-grain {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 600px at 85% -5%, var(--lilac), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, var(--pink-soft), transparent 55%),
    var(--paper);
}
.bg-grain::after {
  content: ''; position: fixed; inset: 0; z-index: -1; opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ---------- Header / Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 252, 253, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 46px; height: 46px;
  background: url('../images/logo.png') center/contain no-repeat;
  flex-shrink: 0;
}
/* ซ่อนตัวอักษร "RB" ที่อยู่ใน div แต่ยังให้ screen reader อ่านได้ */
.brand-logo { font-size: 0; color: transparent; }
.brand-text b { font-family: var(--head); font-weight: 800; font-size: 16px; color: var(--charcoal); display: block; line-height: 1.15; }
.brand-text span { font-size: 11px; color: var(--grey); letter-spacing: 1px; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-family: var(--head); font-size: 14px; font-weight: 500;
  padding: 9px 14px; border-radius: 10px; color: var(--ink);
  transition: all .18s ease;
}
.nav-links a:hover { background: var(--pink-soft); color: var(--pink-deep); }
.nav-links a.active { background: var(--pink); color: #fff; }

.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { width: 24px; height: 2px; background: var(--charcoal); border-radius: 2px; transition: .2s; }

.mobile-menu { display: none; flex-direction: column; gap: 4px; padding: 12px 22px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mobile-menu a { font-family: var(--head); font-weight: 500; padding: 11px 14px; border-radius: 10px; }
.mobile-menu a:hover { background: var(--pink-soft); }
.mobile-menu.open { display: flex; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 16px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--head); font-size: 12px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--pink-deep);
  background: var(--pink-soft); padding: 7px 14px; border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }

h1.title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 6vw, 62px); line-height: 1.1; color: var(--charcoal);
  letter-spacing: -0.5px; margin-bottom: 20px;
}
h1.title .hl { color: var(--pink-deep); }

.lead { font-size: 17px; color: var(--grey); max-width: 620px; margin-bottom: 30px; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  font-family: var(--head); font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 12px; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: linear-gradient(135deg, var(--pink), var(--pink-deep)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-3px); }
.btn-ghost { background: var(--white); color: var(--charcoal); border: 1.5px solid var(--line); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--pink); color: var(--pink-deep); }

/* ---------- Stats strip ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 40px; }
.stat {
  flex: 1; min-width: 130px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.stat b { font-family: var(--head); font-size: 30px; font-weight: 800; color: var(--pink-deep); display: block; }
.stat span { font-size: 13px; color: var(--grey); }

/* ---------- Sections ---------- */
section { padding: 32px 0; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--head); font-weight: 800; font-size: clamp(24px, 3.5vw, 34px); color: var(--charcoal); letter-spacing: -0.5px; }
.sec-head p { color: var(--grey); font-size: 15px; margin-top: 4px; }
.sec-link { font-family: var(--head); font-weight: 600; font-size: 14px; color: var(--pink-deep); white-space: nowrap; }
.sec-link:hover { text-decoration: underline; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--pink-soft); }

.tag {
  display: inline-block; font-family: var(--head); font-size: 11px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; color: var(--pink-deep);
  background: var(--pink-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.tag.gold { color: var(--gold-deep); background: #FFF1DC; }
.card h3 { font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--charcoal); margin-bottom: 8px; line-height: 1.35; }
.card p { font-size: 14px; color: var(--grey); }
.card .date { font-size: 13px; color: var(--pink-deep); font-weight: 600; margin-top: 12px; }

/* ---------- Footer ---------- */
.footer { background: var(--charcoal); color: #E8DDE2; padding: 54px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer h4 { font-family: var(--head); font-weight: 700; color: #fff; margin-bottom: 16px; font-size: 15px; }
.footer .f-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer .f-brand .brand-logo { background: url('../images/logo.png') center/contain no-repeat; }
.footer .f-brand b { font-family: var(--head); color: #fff; font-size: 17px; }
.footer p { font-size: 14px; color: #C9B9C0; max-width: 320px; }
.footer a { display: block; font-size: 14px; color: #C9B9C0; padding: 5px 0; transition: color .15s; }
.footer a:hover { color: var(--pink); }
.footer-bottom { border-top: 1px solid #3a2d33; margin-top: 36px; padding-top: 22px; font-size: 13px; color: #9a8a91; text-align: center; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page header (inner pages) ---------- */
.page-hero { padding: 28px 0 24px; }
.page-hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 50px); color: var(--charcoal); letter-spacing: -.5px; margin-bottom: 14px; }
.page-hero p { color: var(--grey); font-size: 16px; max-width: 640px; }
.crumb { font-family: var(--head); font-size: 13px; color: var(--grey); margin-bottom: 18px; }
.crumb a:hover { color: var(--pink-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .nav-links { display: none; }
  .burger { display: flex; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 12px; }
}
