/* AlumniHub.net */
:root {
  --bg: #fbf8f3;
  --bg-alt: #f2ece2;
  --surface: #ffffff;
  --text: #1f2a37;
  --muted: #5d6673;
  --border: #e3dccf;
  --primary: #1d4e89;
  --primary-hover: #163d6c;
  --accent: #c8963e;
  --success: #1f7a4d;
  --danger: #b42318;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 42, 55, .06), 0 6px 20px rgba(31, 42, 55, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: 1.9rem; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; }
.narrow-sm { max-width: 420px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; font-family: var(--serif); }
.header-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.header-nav a:not(.button) { color: var(--text); text-decoration: none; font-weight: 500; }
.header-nav a:not(.button):hover { color: var(--primary); }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; }
.link-button:hover { color: var(--danger); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid var(--primary);
  background: var(--primary); color: #fff; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button:disabled { opacity: .6; cursor: progress; }
.button-small { padding: 7px 14px; font-size: .9rem; }
.button-ghost { background: transparent; color: var(--primary); }
.button-ghost:hover { background: var(--primary); color: #fff; }
.button-success { background: var(--success); border-color: var(--success); }
.button-success:hover { background: #17603c; border-color: #17603c; }
.button-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Hero */
.hero {
  padding: 80px 0 72px;
  background:
    radial-gradient(circle at 85% 20%, rgba(200, 150, 62, .18), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(29, 78, 137, .14), transparent 50%),
    var(--bg);
  text-align: center;
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 0 0 12px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 860px; margin: 0 auto 18px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 2rem; margin-bottom: 20px; }
.empty { border: 2px dashed var(--border); border-radius: var(--radius); padding: 48px 16px; text-align: center; color: var(--muted); }

/* Gallery */
.gallery { list-style: none; margin: 0; padding: 0; columns: 4 240px; column-gap: 14px; }
.gallery li { break-inside: avoid; margin-bottom: 14px; }
.gallery-item { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; height: auto; transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.03); }
.gallery-caption {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: .9rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }

/* Forms */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack .button { margin-top: 12px; }
.field-label { display: block; font-weight: 600; margin: 16px 0 6px; }
.stack .field-label { margin: 6px 0 0; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 78, 137, .2); }
.upload-form .button { margin-top: 18px; width: 100%; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 180px; padding: 20px; border: 2px dashed var(--border); border-radius: var(--radius);
  text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: rgba(29, 78, 137, .04); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--primary); }
.preview { max-height: 220px; border-radius: 8px; object-fit: contain; }

.progress { position: relative; height: 26px; margin-top: 18px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #2f6cb3); transition: width .15s; }
.progress-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; font-weight: 600; }

.notice { margin: 16px 0; padding: 12px 16px; border-radius: 8px; border: 1px solid; }
.notice-success { background: #ecf8f1; border-color: #a9dcc0; color: #14532d; }
.notice-error { background: #fdf0ee; border-color: #f2b8b0; color: #7a1d14; }
.notice-info { background: #eef4fb; border-color: #b6cde9; color: #173c66; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 20, .92);
  display: flex; align-items: center; justify-content: center; padding: 56px 16px;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: min(1400px, 100%); max-height: calc(100vh - 160px); width: auto; height: auto; border-radius: 6px; }
.lightbox figcaption { color: #f1f1f1; margin-top: 14px; text-align: center; max-width: 720px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; cursor: pointer; border-radius: 999px; font-size: 2rem; line-height: 1; width: 48px; height: 48px; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
body.no-scroll { overflow: hidden; }

/* Admin */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tab { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.count { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--bg-alt); font-size: .8rem; text-align: center; }
.mod-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.mod-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.mod-thumb { display: block; background: var(--bg-alt); aspect-ratio: 4 / 3; }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.mod-caption { margin: 0 0 4px; font-weight: 500; overflow-wrap: anywhere; }
.mod-body .small { margin: 0 0 12px; }
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; text-align: center; }

@media (max-width: 600px) {
  .hero { padding: 56px 0 48px; }
  .header-nav { gap: 12px; }
  .header-nav a:not(.button) { display: none; }
  body.admin .header-nav a:not(.button) { display: inline; }
  .card { padding: 18px; }
  .gallery { columns: 2 140px; column-gap: 10px; }
  .gallery li { margin-bottom: 10px; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 12px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
