@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Lato:wght@300;400;700&display=swap');

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

:root {
  --sky: #e8f4f8;
  --sky-mid: #c5dfe8;
  --sky-deep: #7fb5cc;
  --cloud: #f9fbfc;
  --gold: #c9a84c;
  --gold-light: #f0e6c8;
  --text-dark: #2c3e50;
  --text-mid: #556270;
  --text-light: #8a99a6;
  --white: #ffffff;
  --success: #4a9e6b;
  --danger: #c0392b;
  --border: rgba(127, 181, 204, 0.3);
}

body {
  font-family: 'Lato', sans-serif;
  background: var(--cloud);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.nav-brand .logo-icon { width: 36px; height: 36px; }

.nav-brand span {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--text-dark);
  line-height: 1.2;
  max-width: 200px;
}

.nav-links { display: flex; gap: 0.5rem; align-items: center; }

.nav-btn {
  background: none;
  border: none;
  font-family: 'Lato', sans-serif;
  font-size: 0.85rem;
  color: var(--text-mid);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
}

.nav-btn:hover { background: var(--sky); color: var(--text-dark); }
.nav-btn.active { color: var(--sky-deep); font-weight: 700; }

.nav-btn.logout-btn {
  border: 1px solid var(--sky-mid);
  color: var(--text-mid);
}

.nav-btn.logout-btn:hover { background: #fff0f0; color: var(--danger); border-color: #f5c6c6; }

.page { display: none; }
.page.active { display: block; }

.home-hero {
  background: linear-gradient(160deg, #e8f4f8 0%, #f0e9d2 100%);
  padding: 4rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -80px; right: -40px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: rgba(201,168,76,0.08);
}

.home-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.home-hero .subtitle {
  font-size: 1rem;
  color: var(--text-mid);
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.home-hero p {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto 0.5rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.home-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.info-card .info-icon { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--sky-deep); }
.info-card h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 500; color: var(--text-dark); margin-bottom: 0.3rem; }
.info-card p { font-size: 0.85rem; color: var(--text-mid); line-height: 1.6; }

.login-section { max-width: 420px; margin: 0 auto 3rem; padding: 0 1rem; }

.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  box-shadow: 0 4px 24px rgba(127,181,204,0.12);
}

.login-card h2 { font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 400; color: var(--text-dark); margin-bottom: 0.25rem; text-align: center; }
.login-card .login-sub { font-size: 0.82rem; color: var(--text-light); text-align: center; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }

.form-group label { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em; color: var(--text-mid); margin-bottom: 0.4rem; text-transform: uppercase; }

.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--sky-mid);
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--cloud);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus { border-color: var(--sky-deep); background: var(--white); }

.login-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--sky-deep);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Lato', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}

.login-btn:hover { background: #5a9ab8; }
.login-error { font-size: 0.82rem; color: var(--danger); text-align: center; margin-top: 0.75rem; min-height: 1em; }
.login-hint { font-size: 0.78rem; color: var(--text-light); text-align: center; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }

.inner-header { background: var(--white); border-bottom: 1px solid var(--border); padding: 1.5rem 2rem 1.25rem; }
.inner-header h1 { font-family: 'Playfair Display', serif; font-size: 1.7rem; font-weight: 400; color: var(--text-dark); margin-bottom: 0.2rem; }
.inner-header p { font-size: 0.88rem; color: var(--text-light); }

.inner-body { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }

.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }

.staff-card { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem 1.25rem; text-align: center; }

.staff-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 0.75rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--white);
}

.staff-card h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 500; margin-bottom: 0.2rem; color: var(--text-dark); }
.staff-card .staff-role { font-size: 0.78rem; color: var(--sky-deep); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; margin-bottom: 0.6rem; }
.staff-card p { font-size: 0.82rem; color: var(--text-mid); line-height: 1.6; }

.about-intro { background: var(--gold-light); border: 1px solid rgba(201,168,76,0.3); border-radius: 12px; padding: 1.25rem 1.5rem; font-size: 0.95rem; line-height: 1.7; color: var(--text-dark); }

.links-add-form { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.links-add-form h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 500; margin-bottom: 1rem; color: var(--text-dark); }

.link-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }

.link-fields input, .link-desc-input {
  width: 100%; padding: 0.55rem 0.8rem;
  border: 1px solid var(--sky-mid); border-radius: 8px;
  font-family: 'Lato', sans-serif; font-size: 0.88rem; color: var(--text-dark);
  background: var(--cloud); outline: none; transition: border-color 0.2s;
}

.link-fields input:focus, .link-desc-input:focus { border-color: var(--sky-deep); background: var(--white); }
.link-desc-input { width: 100%; margin-bottom: 0.75rem; }

.add-link-btn { background: var(--sky-deep); color: var(--white); border: none; border-radius: 8px; padding: 0.55rem 1.2rem; font-family: 'Lato', sans-serif; font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.add-link-btn:hover { background: #5a9ab8; }

.links-list { display: flex; flex-direction: column; gap: 0.75rem; }

.link-item { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.25rem; display: flex; align-items: flex-start; gap: 0.75rem; }
.link-item-icon { color: var(--sky-deep); font-size: 1.1rem; margin-top: 2px; flex-shrink: 0; }
.link-item-body { flex: 1; }
.link-item a { font-size: 0.95rem; font-weight: 700; color: var(--sky-deep); text-decoration: none; }
.link-item a:hover { text-decoration: underline; }
.link-item .link-meta { font-size: 0.78rem; color: var(--text-light); margin-top: 0.15rem; }
.link-item p { font-size: 0.85rem; color: var(--text-mid); margin-top: 0.3rem; line-height: 1.5; }

.link-delete { background: none; border: none; color: #dbb; cursor: pointer; font-size: 1rem; padding: 2px 4px; border-radius: 4px; transition: color 0.2s; }
.link-delete:hover { color: var(--danger); }

.new-thread-form { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.new-thread-form h3 { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 500; margin-bottom: 0.75rem; color: var(--text-dark); }

.new-thread-form input, .new-thread-form textarea {
  width: 100%; padding: 0.55rem 0.8rem;
  border: 1px solid var(--sky-mid); border-radius: 8px;
  font-family: 'Lato', sans-serif; font-size: 0.88rem; color: var(--text-dark);
  background: var(--cloud); outline: none; transition: border-color 0.2s;
  margin-bottom: 0.6rem; resize: vertical;
}

.new-thread-form input:focus, .new-thread-form textarea:focus { border-color: var(--sky-deep); background: var(--white); }

.post-btn { background: var(--gold); color: var(--white); border: none; border-radius: 8px; padding: 0.55rem 1.2rem; font-family: 'Lato', sans-serif; font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: background 0.2s; }
.post-btn:hover { background: #b5923e; }

.threads { display: flex; flex-direction: column; gap: 1rem; }

.thread-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

.thread-header { padding: 1rem 1.25rem 0.75rem; cursor: pointer; display: flex; align-items: flex-start; gap: 0.75rem; }
.thread-header:hover { background: var(--sky); }

.thread-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; color: var(--white); flex-shrink: 0; }

.thread-meta { flex: 1; }
.thread-meta .thread-title { font-weight: 700; font-size: 0.95rem; color: var(--text-dark); margin-bottom: 0.2rem; }
.thread-meta .thread-info { font-size: 0.78rem; color: var(--text-light); }
.thread-body-text { font-size: 0.88rem; color: var(--text-mid); margin-top: 0.3rem; line-height: 1.5; }

.thread-toggle { font-size: 0.8rem; color: var(--sky-deep); font-weight: 700; align-self: center; padding: 4px 8px; border-radius: 6px; background: var(--sky); }

.thread-replies { display: none; border-top: 1px solid var(--border); background: var(--cloud); padding: 1rem 1.25rem; }
.thread-replies.open { display: block; }

.reply { display: flex; gap: 0.6rem; margin-bottom: 0.75rem; }
.reply-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--white); flex-shrink: 0; }
.reply-content { flex: 1; }
.reply-author { font-size: 0.8rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.15rem; }
.reply-text { font-size: 0.85rem; color: var(--text-mid); line-height: 1.5; }

.reply-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.reply-form input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--sky-mid); border-radius: 8px; font-family: 'Lato', sans-serif; font-size: 0.85rem; background: var(--white); outline: none; }
.reply-form input:focus { border-color: var(--sky-deep); }

.reply-btn { background: var(--sky-deep); color: var(--white); border: none; border-radius: 8px; padding: 0.5rem 0.9rem; font-family: 'Lato', sans-serif; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.reply-btn:hover { background: #5a9ab8; }

.empty-state { text-align: center; color: var(--text-light); font-size: 0.88rem; padding: 2rem; font-style: italic; }
