/* ─────────────────────────────────────────────────────────────
   theme.css — Beta redesign for Ricardo M. Czekster's homepage
   Goal: same content, clearer information architecture, an
   organised top navigation instead of one long flat sidebar list.
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

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

html { font-family: 'IBM Plex Sans', sans-serif; scroll-behavior: smooth; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  line-height: 1.6;
  font-size: 15px;
  font-weight: 400;
}

a { color: #1a56db; text-decoration: none; }
a:visited { color: #1a56db; }
a:hover, a:active { text-decoration: underline; }

h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.4em; line-height: 1.2; }
h2 { font-weight: 600; margin-top: 1.4em; margin-bottom: 0.4em; padding-top: 0.2em; border-top: 1px solid #eef0f3; }
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-weight: 500; margin-top: 1.2em; margin-bottom: 0.2em; }
h4 { font-weight: 500; margin-top: 1em; margin-bottom: 0.2em; }

p { margin-top: 0; margin-bottom: 0.75em; font-weight: 300; color: #444; line-height: 1.75; font-size: 0.95rem; }

.clearfix { clear: both; }

/* ══════════════════════════════════════════════════════════════
   TOP NAVIGATION (replaces the old .sidebar)
   ══════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 2px solid #1a1a1a;
}

.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.brand { line-height: 1.3; }
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a !important;
  text-decoration: none !important;
  letter-spacing: -0.01em;
}
.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: #999;
  font-weight: 300;
}
.brand-sub a { color: #999; }
.brand-sub a:hover { color: #1a56db; }

/* nav list */
.site-nav { flex: 1 1 auto; }
.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  justify-content: flex-end;
  list-style: none;
}

.nav-item { position: relative; }

.nav-link, .nav-parent {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-link:hover, .nav-parent:hover { background: #f0f4ff; color: #1a56db; }
.nav-item.active > .nav-link,
.nav-item.active details > .nav-parent { color: #1a56db; background: #f0f4ff; }
.caret { font-size: 0.65em; font-style: normal; opacity: 0.6; }

/* dropdown — built on native <details>/<summary>, not hover.
   Click/tap to open, click/tap again to close. Keyboard accessible
   (summary is focusable and Enter/Space toggles it natively).
   No hover-gap, no :focus-within timing issues. */
.nav-item details { position: relative; }

.nav-item summary.nav-parent {
  list-style: none;
}
.nav-item summary.nav-parent::-webkit-details-marker { display: none; }
.nav-item summary.nav-parent::marker { content: ""; }

.dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 210px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  padding: 6px;
  list-style: none;
  z-index: 200;
}
.nav-item details[open] > .dropdown {
  display: block;
}

/* On real mouse/trackpad devices, reveal the dropdown on hover too —
   click/tap still works and is what touch and keyboard use, this just
   adds the instant-hover convenience desktop users expect. */
@media (hover: hover) and (pointer: fine) {
  .nav-item.has-dropdown:hover > details > .dropdown {
    display: block;
  }
}
.dropdown li a {
  display: block;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 400;
  color: #333;
  border-radius: 4px;
  text-decoration: none;
}
.dropdown li a:hover { background: #f0f4ff; color: #1a56db; }
.dropdown li a.current { color: #1a56db; font-weight: 600; }

/* mobile toggle (checkbox hack, no JS needed) */
.nav-toggle { display: none; }
.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.nav-toggle-label span {
  display: block;
  height: 2px;
  background: #1a1a1a;
  border-radius: 2px;
}

@media (max-width: 780px) {
  .nav-toggle-label { display: flex; }

  .site-nav {
    display: none;
    flex-basis: 100%;
    order: 3;
  }
  .nav-toggle:checked ~ .site-nav { display: block; }

  .nav-list { flex-direction: column; justify-content: flex-start; }
  .nav-item { width: 100%; }
  .nav-link, .nav-parent { display: block; padding: 10px 4px; }

  /* on mobile the dropdown just becomes an indented block under the
     open <details> — same open/close mechanism as desktop, no separate
     rules needed beyond removing the floating-overlay styling */
  .nav-item details[open] > .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 14px;
  }
}

/* ══════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════════════════ */

.wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
}

.columns {
  display: block;
}

.main {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 28px 64px;
}

@media (max-width: 574px) {
  .main { padding: 28px 18px 48px; }
}

.main > :first-child { margin-top: 0 !important; margin-left: 0 !important; }
.main > :last-child  { margin-bottom: 0 !important; margin-right: 0 !important; }

/* ── Section title (mono label) ── */
.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
  margin-top: 2em;
}

/* ── Callout boxes (unchanged, content relies on these) ── */
.callout {
  border-left: 3px solid #1a56db;
  background: #f0f4ff;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}
.callout-warning {
  border-left: 3px solid #e3a008;
  background: #fffbf0;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}
.callout-red {
  border-left: 3px solid #e02424;
  background: #fff5f5;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}
.callout-green {
  border-left: 3px solid #057a55;
  background: #f0faf5;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
}
.callout-grey {
  border-left: 3px solid #9ca3af;
  background: #f9fafb;
  padding: 0.75em 1em;
  margin: 1em 0;
  border-radius: 0 4px 4px 0;
  font-style: italic;
}
.callout-title {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35em;
  color: #555;
}

/* ── Code ── */
pre {
  background-color: #f8f9fa;
  border: 1px solid #e8e8e8;
  padding: 0.9em 1em;
  overflow-x: auto;
  border-radius: 4px;
  line-height: 1.45em;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
}
pre::-webkit-scrollbar { display: none; }
code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.84em;
  background-color: #f8f9fa;
  border: 1px solid #e8e8e8;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
pre code { border: none; padding: 0; background: none; font-size: inherit; }
pre.terminal { border: 1px solid #000; background-color: #1e1e1e; color: #f8f8f2; }
pre.terminal code { background-color: #1e1e1e; }

/* ── Lists ── */
ul, ol { margin-left: 1.35em; margin-top: 0.3em; margin-bottom: 0.3em; }
li { margin: 0.15em 0; }

/* ── HR ── */
hr { border: none; border-top: 1px solid #e8e8e8; margin: 1.5em 0; }
hr.postfooter { border-top: 1px solid #e8e8e8; margin: 2em 0 1em 0; }

/* ── Postfooter ── */
.postfooter {
  border-top: 1px solid #e8e8e8;
  margin-top: 3em;
  padding-top: 1em;
  font-size: 0.875rem;
  color: #888;
}
.postfooter a { color: #888; }
.postfooter a:hover { color: #1a56db; text-decoration: underline; }
.postfooter2 { border-top: 1px solid #e8e8e8; margin-top: 3em; }

/* ── Footer ── */
.footer {
  margin-top: 3em;
  padding: 1.5em 28px;
  border-top: 1px solid #e8e8e8;
  text-align: center;
  color: #aaa;
  font-size: 0.8rem;
}
.footer a { color: #aaa; border-bottom: none; }
.footer a:hover { color: #1a56db; text-decoration: underline; }
.footer a:visited { color: #aaa; }

/* ── Blockquote ── */
blockquote {
  font-style: italic;
  padding-left: 1em;
  border-left: 3px solid #e8e8e8;
  margin-left: 0;
  color: #555;
}

/* ── Images ── */
img { max-width: 100%; height: auto; }

/* ── Misc ── */
.avatar {
  width: 125px; height: 125px;
  float: left; border-radius: 6px;
  margin-bottom: 1em; margin-right: 2em; margin-top: 1em;
}
.meta { margin-top: 0.3em; font-weight: 300; color: #888; }
mark { background-color: #fef3c7; padding: 0 0.15em; border-radius: 2px; }

.book-detail { margin-top: 2em; margin-bottom: 2em; }
.book-detail h2 { margin-bottom: 0.2em; }
.book-detail .publication-date { font-weight: 300; margin-top: 0; color: #888; }
.book-detail .cover { float: left; margin-top: 10px; margin-right: 10px; }
.book-detail img { height: 126px; width: 100px; }

.posts tr td:first-child,
.talks tr td:first-child,
.podcasts tr td:first-child { min-width: 100px; font-weight: 300; text-align: right; }

ul.values { list-style-type: none; padding-left: 0; }
ul.values li { padding: 0.5em; }

.first-word-uppercase-p::first-letter {
  font-size: 1.4em; font-weight: 600; line-height: 1;
}

/* ── Button (login form) ── */
.button, button, input[type=submit] {
  background-color: #1a56db;
  border: none;
  color: white;
  padding: 8px 20px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
}
.button:hover, button:hover, input[type=submit]:hover {
  background-color: #1e429f;
}

/* ── Table ── */
table.data-table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
table.data-table td, table.data-table th { padding: 6px 10px; border: 1px solid #e8e8e8; }
table.data-table th { background: #f8f9fa; font-weight: 600; }

block { display: inline-block; font-weight: 600; }

/* ── FYP timeline page: card-style month sections, pill jump-nav,
     recolored overview table ── */
.tl-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1em 0 1.5em;
  padding: 0;
}
.tl-jump br { display: none; }
.tl-jump a {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f4ff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a56db;
  text-decoration: none;
}
.tl-jump a:hover { background: #1a56db; color: #fff; }

.tl-table { border-collapse: collapse; margin: 1em 0; border-radius: 6px; overflow: hidden; }
.tl-table td { border: 1px solid #dbe4f5; padding: 8px 6px; font-size: 0.8rem; text-align: center; }
.tl-table tr:first-child td { color: #fff; font-weight: 600; font-size: 0.78rem; letter-spacing: 0.02em; }

.tl-block {
  border-left: 3px solid #1a56db;
  background: #fafbff;
  border-radius: 0 8px 8px 0;
  padding: 1.4em 1.6em;
  margin: 1.8em 0;
}
.tl-month {
  margin-top: 0 !important;
  border-top: none !important;
  color: #1a56db;
}
.tl-sub { font-size: 1rem !important; margin-bottom: 1em !important; }
.tl-sub mark { font-weight: 500; }
.tl-block hr { border-top: 1px dashed #dbe4f5; }
.tl-block > a[href="#top"] {
  display: inline-block;
  margin-top: 1em;
  font-size: 0.78rem;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   HOMEPAGE (index.php) — hero, pull-quote, quicklinks,
   engagement groups, membership badges
   ══════════════════════════════════════════════════════════════ */

.hero {
  display: flex;
  flex-direction: row-reverse;
  gap: 2em;
  align-items: center;
  padding: 0.5em 0 2em;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 2em;
  flex-wrap: wrap;
}
.hero-photo {
  width: 160px; height: 160px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(26,86,219,0.15);
  flex-shrink: 0;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a56db;
  margin-bottom: 0.4em !important;
  font-weight: 500;
}
.hero-text h1 {
  font-size: 2.1rem;
  margin-bottom: 0.25em;
  border-top: none;
}
.hero-role {
  font-size: 1.05rem !important;
  color: #444 !important;
  font-weight: 400 !important;
  margin-bottom: 1em !important;
}
.hero-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 1.2em;
}
.hero-tags .tag {
  background: #f0f4ff;
  color: #1a56db;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none !important;
}
.btn-primary { background: #1a56db; color: #fff !important; }
.btn-primary:hover { background: #1e429f; }
.btn-outline { border: 1px solid #1a56db; color: #1a56db !important; }
.btn-outline:hover { background: #f0f4ff; }

.pull-quote-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.3em !important;
}
blockquote.pull-quote {
  border-left: none;
  padding: 0.4em 0 0.4em 1.6em;
  position: relative;
  margin: 0 0 2em;
  font-size: 1.15rem;
  font-style: italic;
  color: #333;
}
blockquote.pull-quote p { font-size: inherit; color: inherit; font-weight: 400; margin-bottom: 0.3em; }
blockquote.pull-quote::before {
  content: "\201C";
  position: absolute;
  left: -0.05em;
  top: -0.15em;
  font-size: 3rem;
  color: #dbe4f5;
  font-style: normal;
  line-height: 1;
}
blockquote.pull-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.82rem;
  color: #888;
}
blockquote.pull-quote cite::before { content: "\2014\00A0"; }

.quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 2em;
}
.quicklink-card {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 1em 1.1em;
}
.quicklink-card p { margin-bottom: 0 !important; font-size: 0.88rem !important; }

.research-img {
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.cta-row { margin: 1.2em 0 2em; }

.latest-engagement {
  background: #f0f4ff;
  border-radius: 6px;
  padding: 0.7em 1em;
  font-size: 0.9rem !important;
}

.engagement-group {
  border-left: 3px solid #dbe4f5;
  padding-left: 1.2em;
  margin: 1.6em 0;
}
.engagement-group h3 { margin-top: 0; color: #1a1a1a; }
.engagement-group ul { list-style-type: circle; }

.membership-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 1em 0 1.5em;
}
.membership-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid #057a55;
  background: #f0faf5;
  border-radius: 0 8px 8px 0;
  padding: 0.9em 1.1em;
}
.membership-card img { max-width: 70px; height: auto; }
.membership-card p { margin: 0 !important; }

@media (max-width: 574px) {
  .hero { flex-direction: column; text-align: center; }
  .hero-tags, .hero-cta { justify-content: center; }
}

/* ══════════════════════════════════════════════════════════════
   INTERESTS PAGE — card grid, hobby block
   ══════════════════════════════════════════════════════════════ */

.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 1.5em 0 2em;
}
.interest-card {
  border: 1px solid #e8e8e8;
  border-left-width: 4px;
  border-radius: 6px;
  padding: 1.1em 1.3em;
  background: #fff;
}
.interest-card-wide { grid-column: 1 / -1; }
.interest-icon { font-size: 0.95em; margin-right: 0.2em; }
.interest-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4em !important;
  font-weight: 600;
}
.interest-card p:last-child { margin-bottom: 0 !important; font-size: 0.9rem !important; }

.interest-card-blue   { border-left-color: #1a56db; background: #f7f9ff; }
.interest-card-blue   .interest-label { color: #1a56db; }
.interest-card-teal   { border-left-color: #0d9488; background: #f2fbfa; }
.interest-card-teal   .interest-label { color: #0d9488; }
.interest-card-amber  { border-left-color: #d97706; background: #fffaf0; }
.interest-card-amber  .interest-label { color: #d97706; }
.interest-card-purple { border-left-color: #7c3aed; background: #faf7ff; }
.interest-card-purple .interest-label { color: #7c3aed; }
.interest-card-red    { border-left-color: #dc2626; background: #fff8f7; }
.interest-card-red    .interest-label { color: #dc2626; }

.hobby-block {
  display: flex;
  gap: 1.6em;
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 1.5em 0 2em;
}
.hobby-img {
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.hobby-text { flex: 1; min-width: 240px; }
.hobby-text .pull-quote { margin-top: 0.8em; }

@media (max-width: 574px) {
  .hobby-block { flex-direction: column; }
}

/* ══════════════════════════════════════════════════════════════
   PAGE BANNER — consistent header treatment site-wide, reusing
   the hero's eyebrow-label style, minus the photo
   ══════════════════════════════════════════════════════════════ */

.page-banner {
  padding: 0.3em 0 1.2em;
  border-bottom: 1px solid #eef0f3;
  margin-bottom: 1.6em;
}
.page-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1a56db;
  margin-bottom: 0.35em !important;
  font-weight: 500;
}
.page-banner h1 {
  font-size: 1.9rem;
  margin-bottom: 0 !important;
}
