/* หน้าสาธารณะ: หน้ารวมรางวัล + หน้ารางวัล (เปิดจาก QR) */
:root { --gold: #c9a227; --gold-soft: #fbf3d9; --navy: #14284b; --navy-2: #1f3d6e; }
body.pub { background: #f5f3ee; }
.pub a { color: var(--navy-2); }
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, #2c5490 100%); color: #fff; padding: 1.4rem 1rem 1.2rem; text-align: center; position: relative; }
.hero .school { opacity: .9; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; gap: .5rem; }
.hero .school img { height: 46px; }
.hero h1 { margin: .1rem 0 .1rem; font-size: 2.3rem; letter-spacing: .5px; color: #fff; }
.hero h1 .star { color: var(--gold); }
.hero .sub { opacity: .85; margin: 0; }
.hero .stats { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .7rem; }
.hero .stats span { background: rgba(255,255,255,.12); border-radius: 99px; padding: .05rem .8rem; font-size: .95rem; }
.hero .login { position: absolute; right: .8rem; top: .6rem; color: #fff; opacity: .8; font-size: .9rem; text-decoration: none; }
.hero .login:hover { opacity: 1; text-decoration: underline; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem 2rem; }
.filters { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: .8rem; margin: -1rem auto 1rem; position: relative; display: grid; gap: .5rem; }
.filters .srow { display: flex; gap: .5rem; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 260px; font-size: 1.05rem; }
.filters select { flex: 0 1 auto; min-width: 9rem; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chips button { background: #f1f3f7; color: var(--text); border: 1px solid var(--border); border-radius: 99px; padding: .1rem .75rem; font-size: .95rem; font-weight: 400; min-height: 0; }
.chips button.on { background: var(--navy-2); color: #fff; border-color: var(--navy-2); }
.chips button .dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.who-bar { background: var(--gold-soft); border: 1px solid #ecd78f; border-radius: 10px; padding: .5rem .8rem; margin-bottom: .8rem; display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.acard { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--text) !important; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.acard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.14); }
.acard .ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #e9edf4, #d7deea); position: relative; overflow: hidden; }
.acard .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acard .ph .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 3.4rem; opacity: .55; }
.lv { position: absolute; left: .5rem; top: .5rem; color: #fff; border-radius: 99px; padding: 0 .6rem; font-size: .85rem; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.acard .bd { padding: .55rem .75rem .7rem; display: flex; flex-direction: column; gap: .1rem; flex: 1; }
.acard .res { color: #8a5a00; font-weight: 700; font-size: .95rem; }
.acard .tt { font-weight: 700; font-size: 1.08rem; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acard .pp { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.acard .dt { color: var(--muted); font-size: .88rem; margin-top: auto; padding-top: .2rem; }
.more { text-align: center; margin: 1.2rem 0; }
.empty-box { text-align: center; color: var(--muted); padding: 2.5rem 1rem; background: #fff; border-radius: 12px; }
.foot { text-align: center; color: var(--muted); font-size: .9rem; padding: 1rem; }
.foot button { font-size: .9rem; }

/* หน้ารางวัล */
.award { max-width: 900px; margin: 0 auto; padding: 0 1rem 2rem; }
.award .back { display: inline-block; margin: .8rem 0; text-decoration: none; }
.aw-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.aw-cover { background: #1b2a44; max-height: 62vh; display: flex; justify-content: center; }
.aw-cover img { max-width: 100%; max-height: 62vh; object-fit: contain; display: block; }
.aw-head { padding: 1rem 1.2rem .4rem; text-align: center; }
.aw-head .res { display: inline-block; color: #8a5a00; background: var(--gold-soft); border: 1px solid #ecd78f; border-radius: 99px; padding: 0 .9rem; font-weight: 700; font-size: 1.15rem; }
.aw-head h1 { margin: .35rem 0 .1rem; font-size: 1.85rem; line-height: 1.15; }
.aw-head .ev { font-size: 1.15rem; color: #333; }
.aw-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; padding: .6rem 1.2rem 1rem; margin: 0; }
.aw-facts dt { color: var(--muted); }
.aw-facts dd { margin: 0; }
.aw-facts .ppl a { text-decoration: none; border-bottom: 1px dotted; }
.aw-desc { padding: 0 1.2rem 1rem; white-space: pre-wrap; font-size: 1.1rem; line-height: 1.45; }
.aw-sec { padding: .2rem 1.2rem 1.2rem; }
.aw-sec h2 { font-size: 1.25rem; margin: .5rem 0; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem; }
.gal button { padding: 0; border: 0; background: #e9edf4; border-radius: 8px; overflow: hidden; aspect-ratio: 4/3; min-height: 0; }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal .cert { aspect-ratio: auto; }
.gal .cert img { object-fit: contain; background: #fff; max-height: 260px; }
.aw-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; padding: 0 1.2rem 1.2rem; }
.lightbox { position: fixed; inset: 0; background: rgba(10,14,22,.92); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lightbox img { max-width: 96vw; max-height: 90vh; object-fit: contain; }
.lightbox .x { position: absolute; top: .6rem; right: .8rem; font-size: 1.6rem; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 50%; width: 2.6rem; height: 2.6rem; min-height: 0; padding: 0; }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.15); color: #fff; border: 0; font-size: 1.8rem; width: 3rem; height: 3rem; border-radius: 50%; min-height: 0; padding: 0; }
.lightbox .prev { left: .6rem; } .lightbox .next { right: .6rem; }
.loading-ph { color: var(--muted); padding: 2rem; text-align: center; }

@media (max-width: 640px) {
  .hero { padding: .8rem .8rem 1.4rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero .stats span:nth-child(n+3) { display: none; }
  .filters { padding: .6rem; gap: .4rem; }
  .filters .srow select { flex: 1 1 40%; min-width: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
  .acard .tt { font-size: 1rem; }
  .aw-head h1 { font-size: 1.5rem; }
  .aw-facts { grid-template-columns: 1fr; }
  .aw-facts dt { margin-top: .3rem; }
  .hero .login { position: static; display: inline-block; margin-bottom: .3rem; }
}
