/* ============ EmilyClark.top - Global Styles ============ */
:root {
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1e2230;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --border: #2a2f3f;
  --radius: 14px;
  --max-w: 1100px;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  max-width: var(--max-w);
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.3px;
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 10px;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 0 40px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto; }

/* ---------- Section titles ---------- */
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 34px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 6px;
  height: 26px;
  background: var(--accent);
  border-radius: 3px;
}

/* ---------- Filters / search ---------- */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0 26px;
}

.toolbar input[type="search"] { flex: 1; min-width: 200px; }

.chip {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}

/* ---------- Post grid & cards ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 999px;
}

.card h3 { font-size: 1.1rem; line-height: 1.35; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent-2); text-decoration: none; }

.card p.excerpt { color: var(--muted); font-size: 0.92rem; flex: 1; }
.card .meta { font-size: 0.8rem; color: var(--muted); }

.card .btn.card-btn {
  align-self: flex-start;
  padding: 9px 18px;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 2px;
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #1a1200;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 50px 0;
  grid-column: 1 / -1;
}

/* ---------- Single post ---------- */
.post-view {
  max-width: 780px;
  margin: 30px auto 60px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-view > img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}
.post-content { padding: 28px; }
.post-content h2 { margin-bottom: 14px; font-size: 1.8rem; }
.post-content .meta { color: var(--muted); margin-bottom: 18px; font-size: 0.9rem; }
.post-btn-wrap { margin: 0 0 16px; }
.btn.post-btn { padding: 13px 30px; font-size: 1.05rem; }
.post-content .body p, .post-content .body li { margin-bottom: 12px; }
.post-content .body h3 { margin: 20px 0 10px; color: var(--accent-2); }
.post-content .body ul, .post-content .body ol { padding-left: 22px; margin-bottom: 12px; }
.back-btn {
  display: inline-block;
  margin: 20px 28px;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Forms ---------- */
input, textarea, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin: 14px 0 6px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #1a1200;
  font-weight: 800;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn:hover { background: var(--accent-2); }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #7f1d1d;
}
.btn.danger:hover { background: #7f1d1d22; }
.btn.small { padding: 7px 14px; font-size: 0.85rem; }

/* ---------- Pages ---------- */
.page-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  margin: 30px auto 50px;
  max-width: 780px;
}
.page-box h1 { margin-bottom: 16px; font-size: 1.6rem; }
.page-box p, .page-box li { color: var(--muted); }
.page-box ul { padding-left: 22px; margin: 10px 0; }
.page-box h3 { margin: 18px 0 8px; color: var(--accent-2); }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 26px;
}
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { font-size: 0.95rem; }
.contact-info div { margin-bottom: 14px; color: var(--muted); }
.contact-info strong { color: var(--text); display: block; }

.form-msg {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  display: none;
}
.form-msg.ok { display: block; background: #14532d33; color: #4ade80; border: 1px solid #14532d66; }
.form-msg.err { display: block; background: #7f1d1d33; color: #f87171; border: 1px solid #7f1d1d66; }

/* ---------- Admin ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  margin-top: 26px;
}
@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.admin-side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
}
.admin-side button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
}
.admin-side button:hover, .admin-side button.active {
  background: var(--surface-2);
  color: var(--accent-2);
}

.admin-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 400px;
}

.login-box {
  max-width: 380px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}
.login-box h1 { font-size: 1.4rem; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.login-box input { margin-top: 14px; }
.login-box .btn { margin-top: 18px; width: 100%; }

.admin-post-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--surface-2);
}
.admin-post-row img {
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.admin-post-row .info { flex: 1; min-width: 0; }
.admin-post-row .info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-post-row .info span { font-size: 0.8rem; color: var(--muted); }

.img-preview {
  max-width: 260px;
  border-radius: 10px;
  margin-top: 8px;
  display: none;
  border: 1px solid var(--border);
}
.msg-row {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.msg-row .head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.msg-row .head strong { color: var(--accent-2); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding: 30px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer .links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-2); }
