/* Tông màu matcha pastel — muốn đổi màu, sửa các biến bên dưới */
:root {
  --bg: #f6f8f1;            /* nền kem xanh */
  --panel: #e7efdb;         /* nền cột giới thiệu */
  --panel-2: #dbe8cb;
  --card: #fffffa;
  --text: #2e3a2a;          /* xanh rêu đậm */
  --muted: #6b7a63;
  --line: #dde6d0;
  --matcha: #8fb06a;        /* xanh matcha */
  --matcha-deep: #587a3c;   /* chữ nhấn, đủ tương phản */
  --matcha-soft: #edf3e3;
  --blossom: #f3d9d2;       /* hồng phấn nhẹ làm điểm xuyết */
  --shadow: 0 8px 24px rgba(74, 99, 52, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  line-height: 1.65;
}

/* ---------- Bố cục 2 cột ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  min-height: 100vh;
}

/* ---------- Cột trái: giới thiệu ---------- */
.profile {
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.7), transparent 45%),
    linear-gradient(170deg, var(--panel) 0%, var(--panel-2) 100%);
  border-right: 1px solid var(--line);
}
.profile-inner {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 56px 40px 32px;
}

.avatar-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  margin-bottom: 24px;
}
.initials, .avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid var(--card);
  box-shadow: var(--shadow);
}
.initials {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--matcha) 0%, #b9d29a 100%);
  color: #fff;
  font-family: "Lora", serif;
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.initials[hidden] { display: none; }
.avatar { object-fit: cover; }

.profile h1 {
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.25;
  margin: 0 0 6px;
}
.role {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 20px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--card);
  color: var(--matcha-deep);
  font-weight: 600;
  font-size: .9rem;
}
.role:empty { display: none; }
.intro { color: var(--text); }
.intro p { margin: 0 0 12px; }
.intro a { color: var(--matcha-deep); }

.links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.links a {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: .88rem;
  transition: background .15s, color .15s, border-color .15s;
}
.links a:hover { background: var(--matcha); border-color: var(--matcha); color: #fff; }

.footer {
  margin-top: auto;
  padding-top: 32px;
  color: var(--muted);
  font-size: .8rem;
}

/* ---------- Cột phải: dòng thời gian ---------- */
.content {
  padding: 56px 48px 80px;
  max-width: 820px;
  width: 100%;
}
.section-title {
  font-family: "Lora", serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 28px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 32px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 8px; bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--matcha), var(--line));
}
.empty { color: var(--muted); }

.year-marker {
  position: relative;
  display: inline-block;
  margin: 32px 0 14px -32px;
  padding: 2px 14px;
  border-radius: 999px;
  background: var(--matcha);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
}
.year-marker:first-child { margin-top: 0; }

.item { position: relative; margin-bottom: 16px; }
.item::before {
  content: "";
  position: absolute;
  left: -30px; top: 24px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--matcha);
  transition: background .15s;
}
.item:hover::before { background: var(--matcha); }

.card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--matcha);
  box-shadow: var(--shadow);
}
.card:focus-visible { outline: 3px solid var(--matcha); outline-offset: 2px; }
.card > span:not(.tags) { display: block; }
.date { font-size: .85rem; color: var(--muted); }
.title { font-weight: 600; font-size: 1.1rem; margin: 2px 0 4px; }
.summary { color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: .75rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--matcha-soft);
  color: var(--matcha-deep);
}
.tag:nth-child(3n+2) { background: #fbeee9; color: #9a5a48; }
.more { margin-top: 10px; font-size: .85rem; color: var(--matcha-deep); font-weight: 500; }

/* ---------- Hộp chi tiết ---------- */
.modal {
  width: min(680px, calc(100vw - 32px));
  max-height: 85vh;
  border: none;
  border-radius: 20px;
  padding: 32px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(46, 58, 42, .25);
}
.modal::backdrop { background: rgba(46, 58, 42, .35); backdrop-filter: blur(4px); }
.modal h3 { font-family: "Lora", serif; font-weight: 600; margin: 4px 0 0; font-size: 1.6rem; line-height: 1.3; }
.modal-img { width: 100%; border-radius: 14px; margin-bottom: 16px; }
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--matcha-soft);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--matcha-deep);
  cursor: pointer;
}
.modal-close:hover { background: var(--matcha); color: #fff; }

.btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 22px;
  border-radius: 12px;
  background: var(--matcha-deep);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}
.btn:hover { background: var(--matcha); }

/* Nội dung Markdown trong hộp chi tiết */
.details { margin-top: 16px; overflow-wrap: anywhere; }
.details img { max-width: 100%; border-radius: 12px; }
.details h1, .details h2, .details h3 { font-family: "Lora", serif; margin: 22px 0 8px; line-height: 1.3; }
.details h1 { font-size: 1.35rem; }
.details h2 { font-size: 1.2rem; }
.details h3 { font-size: 1.05rem; }
.details a { color: var(--matcha-deep); }
.details blockquote {
  margin: 12px 0;
  padding: 6px 16px;
  border-left: 3px solid var(--matcha);
  background: var(--matcha-soft);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}
.details code { background: var(--matcha-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.details pre { background: var(--bg); padding: 12px; border-radius: 10px; overflow-x: auto; }
.details pre code { background: none; padding: 0; }
.details table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.details th, .details td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.details th { background: var(--matcha-soft); }

/* ---------- Điện thoại & máy tính bảng: xếp chồng ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .profile { border-right: none; border-bottom: 1px solid var(--line); }
  .profile-inner {
    position: static;
    min-height: 0;
    align-items: center;
    text-align: center;
    padding: 48px 16px 32px;
  }
  .role { align-self: center; }
  .links { justify-content: center; }
  .footer { display: none; }
  .content { padding: 32px 16px 64px; }
}
