/* =====================================================================
   Gallery-KULC — สไตล์หลัก (หน้าเว็บ + ส่วนประกอบที่ใช้ร่วมกับหลังบ้าน)
   เปลี่ยนสีหลักของเว็บได้ที่ตัวแปร --accent ด้านล่าง
   ===================================================================== */
:root {
  /* โทนสีมหาวิทยาลัยเกษตรศาสตร์ : เขียวนนทรี + เขียวใบไม้อ่อน */
  --accent: #006664;
  --accent-strong: #004f4d;
  --accent-soft: #e2f0ef;
  --on-accent: #ffffff;
  --lime: #b2bb1e;
  --lime-strong: #98a016;
  --on-lime: #1f2a12;
  --deep: #00403f;          /* แถบบน / ส่วนท้าย */
  --on-deep: #e6f1f0;
  --on-deep-muted: #a9c9c6;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #ecf0ee;
  --text: #222221;
  --heading: #2f4a47;
  --muted: #63706d;
  --border: #dbe2df;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fbf3cf;
  --warn: #7a6200;
  --info-soft: #e2f0ef;
  --info: #00504e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 50, 48, .06), 0 6px 20px rgba(0, 50, 48, .07);
  --shadow-hover: 0 2px 4px rgba(0, 50, 48, .08), 0 16px 36px rgba(0, 50, 48, .16);
  --font: "Sarabun", "Prompt", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --font-head: "Prompt", "Sarabun", "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4fc4bd;
    --accent-strong: #7ad9d3;
    --accent-soft: #12312f;
    --on-accent: #042524;
    --lime: #c6cf3a;
    --lime-strong: #d6de5c;
    --on-lime: #1a2208;
    --deep: #072524;
    --on-deep: #dcebe9;
    --on-deep-muted: #8fb1ae;
    --bg: #0e1615;
    --surface: #16201f;
    --surface-2: #1f2b2a;
    --text: #e6eeec;
    --heading: #e6eeec;
    --muted: #96a6a3;
    --border: #293735;
    --danger: #ff8a80;
    --danger-soft: #3a1b19;
    --warn-soft: #36300f;
    --warn: #ecd574;
    --info-soft: #12312f;
    --info: #9ad8d3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 34px rgba(0, 0, 0, .45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16.5px; line-height: 1.7;
  color: var(--text); background: var(--bg);
}
main { flex: 1; padding-bottom: 3rem; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); color: var(--heading); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 200; background: var(--lime); color: var(--on-lime); padding: .5em 1em; }
.skip-link:focus { left: 8px; top: 8px; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.req { color: var(--danger); font-weight: 400; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: inherit; font-family: var(--font-head); font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap;
  padding: .62em 1.15em; border-radius: 999px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
/* ปุ่มเน้นสีเขียวใบไม้ (ใช้บนพื้นเขียวเข้ม) */
.btn-accent { background: var(--lime); color: var(--on-lime); font-weight: 600; }
.btn-accent:hover { background: var(--lime-strong); }
.btn-onhero { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.btn-onhero:hover { background: rgba(255, 255, 255, .14); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { font-size: .85rem; padding: .45em .9em; }
.btn-block { display: flex; width: 100%; margin-top: .6rem; }
.inline-form { display: inline; margin: 0; }

/* ---------- ฟอร์ม ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .3rem; }
.field small { display: block; color: var(--muted); font-size: .8rem; margin-top: .25rem; }
input[type=text], input:not([type]), input[type=search], input[type=password], input[type=email], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6em .8em; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.field-row > .field { margin-bottom: 1rem; }
.field-row > * { min-width: 0; }
input[type=date], input[type=datetime-local] { padding-inline: .5em; }
.radio-row { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; margin-top: .5rem; }

.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin: 1rem 0; font-size: .95rem; }
.alert-success { background: var(--accent-soft); color: var(--accent-strong); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* ---------- แถบบน + Header ---------- */
.topbar { background: var(--deep); color: var(--on-deep); font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 34px; }
.topbar-org { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-links { display: flex; gap: 1.1rem; flex-shrink: 0; }
.topbar a { color: var(--on-deep-muted); }
.topbar a:hover { color: #fff; }
.site-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 3px solid var(--lime); box-shadow: 0 2px 10px rgba(0, 50, 48, .06); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--lime); flex-shrink: 0; }
.brand-logo { height: 46px; width: auto; max-width: 160px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-family: var(--font-head); }
.brand-text strong { font-size: 1.08rem; color: var(--accent); font-weight: 600; }
.brand-text small { color: var(--muted); font-size: .76rem; }
.header-search { flex: 1; max-width: 400px; margin-left: auto; position: relative; color: var(--muted); }
.header-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.header-search input { border-radius: 999px; padding-left: 2.6em; background: var(--surface-2); border-color: transparent; min-height: 42px; }
.site-nav { display: flex; align-items: center; gap: .2rem; font-family: var(--font-head); }
.site-nav > a:not(.btn) { position: relative; color: var(--heading); padding: .5em .8em; font-size: .95rem; border-radius: 8px; }
.site-nav > a:not(.btn):hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.site-nav > a.active { color: var(--accent); font-weight: 500; }
.site-nav > a.active::after { content: ""; position: absolute; left: .8em; right: .8em; bottom: .1em; height: 3px; border-radius: 3px; background: var(--lime); }
.site-nav .nav-user { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 0; color: var(--heading); padding: 8px; cursor: pointer; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: 3.4rem 0 3rem;
  background: linear-gradient(115deg, #00403f 0%, #006664 55%, #0a7f76 100%); }
.hero::before { content: ""; position: absolute; inset: 0 0 0 auto; width: 46%; background: var(--lime); opacity: .16; clip-path: polygon(38% 0, 100% 0, 100% 100%, 0 100%); }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 46px solid rgba(255, 255, 255, .06); }
.hero-inner { position: relative; z-index: 1; }
.hero-kicker { display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 .6rem; font-family: var(--font-head); font-size: .92rem; color: #dfe8a8; letter-spacing: .02em; }
.hero-kicker::before { content: ""; width: 34px; height: 3px; border-radius: 3px; background: var(--lime); }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3rem); font-weight: 700; margin-bottom: .35em; }
.hero-lead { color: rgba(255, 255, 255, .86); max-width: 620px; margin: 0 0 1.5rem; }
.hero-search { display: flex; flex-wrap: wrap; gap: .6rem; max-width: 760px; }
.hero-search input { flex: 1 1 260px; border-radius: 999px; padding: .8em 1.3em; min-height: 52px; border-color: transparent; background: #fff; color: #222221; box-shadow: 0 8px 26px rgba(0, 0, 0, .18); }
.hero-search .btn { min-height: 52px; padding-inline: 1.7em; }
.hero-stats { display: flex; gap: 2.2rem; margin: 1.9rem 0 0; font-family: var(--font-head); }
.hero-stats div { display: flex; align-items: baseline; gap: .45rem; }
.hero-stats dt { font-size: 1.7rem; font-weight: 600; color: #e4ec7a; line-height: 1; }
.hero-stats dd { margin: 0; font-size: .9rem; color: rgba(255, 255, 255, .8); }

/* ---------- Chips ---------- */
.hero + .container { padding-top: 1.2rem; }
.chip-row { display: flex; align-items: center; gap: .5rem; margin: .9rem 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip-label { font-size: .8rem; color: var(--muted); flex-shrink: 0; min-width: 2.6rem; }
.chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: .45em; padding: .38em .95em; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .9rem; }
.chip:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); text-decoration: none; }
.chip:hover em { background: rgba(255, 255, 255, .2); color: inherit; }
.chip em { font-style: normal; font-size: .75rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 0 .55em; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2rem 0 1rem; }
.section-head h2, .page-title { position: relative; padding-left: .85rem; }
.section-head h2::before, .page-title::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 5px; border-radius: 4px; background: linear-gradient(var(--lime), var(--accent)); }
.section-head h2 { font-size: 1.4rem; margin: 0; }
.page-title { font-size: 1.6rem; margin: 1.8rem 0 1.2rem; }

/* ---------- การ์ดกิจกรรม ---------- */
.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--lime); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card:hover::after { transform: scaleX(1); }
.card-media { position: relative; display: block; aspect-ratio: 3 / 2; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.badge { position: absolute; display: inline-flex; align-items: center; gap: .3em; font-size: .75rem; font-weight: 500; padding: .22em .7em; border-radius: 999px; backdrop-filter: blur(6px); }
.badge-internal { top: 10px; left: 10px; background: var(--lime); color: var(--on-lime); font-weight: 600; }
.badge-count { bottom: 10px; right: 10px; background: rgba(0, 0, 0, .58); color: #fff; }
.badge-cover { top: 8px; right: 8px; background: var(--accent); color: var(--on-accent); }
.card-body { padding: .95rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card-meta { font-size: .8rem; color: var(--muted); }
.card-meta a { color: var(--accent); font-weight: 500; }
.card-meta .dot { margin: 0 .45em; opacity: .6; }
.card-title { font-family: var(--font-head); font-size: 1.02rem; margin: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: auto; padding-top: .3rem; }
.tag { font-size: .78rem; padding: .12em .65em; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.tag:hover { text-decoration: none; filter: brightness(.95); }
.tag-more { background: var(--surface-2); color: var(--muted); }

.empty { text-align: center; padding: 3.5rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); margin: 1rem 0; }
.empty p { margin: 0 0 .8rem; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin: 2.2rem 0 0; }
.page { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 .6em; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
a.page:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.page { font-family: var(--font-head); }
.page.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.page.disabled, .page.gap { opacity: .4; border-color: transparent; background: none; }

/* ---------- ค้นหาละเอียด ---------- */
.search-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.8rem; align-items: start; }
.filters { background: var(--surface); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: .92rem; }
.tag-picker { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 190px; overflow-y: auto; padding: 2px; margin-bottom: .5rem; }
.tag-check { cursor: pointer; }
.tag-check input { position: absolute; opacity: 0; pointer-events: none; }
.tag-check span { display: inline-block; font-size: .84rem; padding: .25em .8em; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); user-select: none; }
.tag-check input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tag-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.results-tools { display: flex; gap: .5rem; align-items: center; }
.results-tools select { width: auto; min-height: 40px; border-radius: 999px; padding-block: .4em; }
.filters-toggle { display: none; }
.grid-results { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- หน้ากิจกรรม ---------- */
.breadcrumb { display: flex; gap: .5rem; font-size: .88rem; color: var(--muted); margin: 1.5rem 0 1rem; }
.activity-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 700; margin: .5rem 0 .7rem; }
.activity-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .76rem; font-weight: 500; padding: .18em .75em; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill-public { background: var(--accent-soft); color: var(--accent-strong); }
.pill-internal { background: var(--warn-soft); color: var(--warn); }
.pill-draft { background: var(--danger-soft); color: var(--danger); }
.meta-list { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem 1.3rem; padding: 0; margin: 0; color: var(--muted); font-size: .92rem; }
.meta-list li { display: inline-flex; align-items: center; gap: .4em; }
.activity-admin { margin-top: .9rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.activity-desc { max-width: 820px; margin: 1.3rem 0; font-size: 1.02rem; }
.activity-extra { display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0 1.4rem; }
.activity-extra .tags { margin: 0; padding: 0; }

/* กริดภาพแบบแถวสูงเท่ากัน (justified) */
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.4rem; }
.photo-grid::after { content: ""; flex-grow: 1000; }
.photo { position: relative; flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * 210px); aspect-ratio: var(--r); overflow: hidden; border-radius: 10px; background: var(--surface-2); cursor: zoom-in; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, filter .3s; }
.photo:hover img { transform: scale(1.035); filter: brightness(1.04); }
.photo-cap { position: absolute; inset: auto 0 0 0; padding: 1.4rem .7rem .5rem; font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); opacity: 0; transition: opacity .2s; }
.photo:hover .photo-cap, .photo:focus-visible .photo-cap { opacity: 1; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: flex; background: #0b0d0c; color: #f1f3f2; }
.lb-stage { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 56px 12px 62px; touch-action: pan-y; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; transition: opacity .2s; }
.lb-img.loading { opacity: .25; }
.lb-btn { position: absolute; z-index: 2; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .12); width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; line-height: 1; display: grid; place-items: center; transition: background .15s; }
.lb-btn:hover { background: rgba(255, 255, 255, .26); }
.lb-close { top: 10px; right: 12px; font-size: 1.15rem; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-bar { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; font-size: .88rem; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); }
.lb-caption { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-info-toggle { background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 999px; padding: .45em 1em; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.lb-info-toggle:hover { background: rgba(255, 255, 255, .26); }
.lb-info { width: 330px; flex-shrink: 0; background: #161a18; border-left: 1px solid #2a302d; padding: 1.4rem 1.3rem; overflow-y: auto; }
.lb-info h3 { font-size: 1rem; margin-bottom: .8rem; }
.lb-info-caption { color: #cfd6d2; font-size: .92rem; margin: 0 0 1rem; }
.lb-info dl { margin: 0 0 1.2rem; display: grid; grid-template-columns: auto 1fr; gap: .45rem .9rem; font-size: .88rem; }
.lb-info dt { color: #8e9a94; white-space: nowrap; }
.lb-info dd { margin: 0; word-break: break-word; }
.lb-info .muted { color: #8e9a94; }
.lb-info .btn-primary { background: #b2bb1e; color: #1f2a12; font-weight: 600; }
.lb.info-hidden .lb-info { display: none; }
body.lb-open { overflow: hidden; }

/* ---------- Auth ---------- */
.auth-card { max-width: 420px; margin: 3.5rem auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.auth-card { border-top: 4px solid var(--accent); }
.auth-card h1 { font-size: 1.45rem; color: var(--accent); }
.checklist { list-style: none; padding: 0; margin: 1rem 0; font-size: .9rem; }
.checklist .ok { color: var(--accent-strong); }
.checklist .bad { color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: var(--on-deep); font-size: .9rem; border-top: 4px solid var(--lime); }
.site-footer a { color: var(--on-deep-muted); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.7fr 1.1fr .9fr 1.1fr; gap: 2rem; padding-block: 2.4rem 2rem; }
.footer-brand { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; font-family: var(--font-head); }
.footer-brand strong { display: block; color: #fff; font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.footer-brand small { color: var(--on-deep-muted); font-size: .78rem; }
.footer-brand .brand-mark { background: rgba(255, 255, 255, .1); }
.footer-brand .brand-logo { height: 54px; }
.site-footer p { margin: 0 0 .35rem; color: var(--on-deep-muted); }
.site-footer h3 { color: #fff; font-size: .95rem; margin-bottom: .8rem; padding-bottom: .5rem; position: relative; }
.site-footer h3::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 3px; border-radius: 3px; background: var(--lime); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; color: var(--on-deep-muted); }
.footer-social { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.footer-social a { border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .2em .85em; font-size: .8rem; color: var(--on-deep); }
.footer-social a:hover { background: var(--lime); border-color: var(--lime); color: var(--on-lime); text-decoration: none; }
.footer-bottom { background: rgba(0, 0, 0, .22); font-size: .8rem; color: var(--on-deep-muted); }
.footer-bottom-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; padding-block: .85rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
  .footer-about { grid-column: 1 / -1; }
  .topbar-links a:nth-child(n+2) { display: none; }
  .header-inner { flex-wrap: wrap; padding-block: 10px; gap: .6rem; }
  .brand { margin-right: auto; }
  .nav-toggle { display: block; order: 2; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .site-nav { order: 4; display: none; flex: 1 1 100%; flex-direction: column; align-items: stretch; padding: .3rem 0 .5rem; }
  .site-nav.open { display: flex; }
  .site-nav > a:not(.btn) { padding: .7em .9em; }
  .site-nav > a.active::after { display: none; }
  .site-nav > a.active { background: var(--accent-soft); }
  .site-nav .nav-user { max-width: none; }
  .site-nav .btn { width: 100%; margin-top: .3rem; }
  .lb { flex-direction: column; }
  .lb-info { width: auto; max-height: 46vh; border-left: 0; border-top: 1px solid #2a302d; }
  .lb-prev, .lb-next { width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero::before { width: 70%; }
  .hero-stats { gap: 1.4rem; }
  .hero-stats dt { font-size: 1.35rem; }
  .brand-text small { display: none; }
  .container { padding: 0 14px; }
  .hero { padding: 2rem 0 1.5rem; }
  .grid, .grid-results { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .card-body { padding: .7rem .75rem .8rem; }
  .card-title { font-size: .93rem; }
  .card .tags { display: none; }
  .badge { font-size: .68rem; }
  .photo-grid { gap: 5px; }
  .photo { flex-basis: calc(var(--r) * 120px); border-radius: 6px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .filters .field-row { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .auth-card { padding: 1.4rem; margin: 1.5rem auto; }
  .lb-stage { padding: 52px 0 58px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
