/* ============================================================
   isthiseducation.com style.css
   Notion-inspired design system + dark banner for the home page
   ============================================================ */

/* ===== Design tokens ===== */
:root {
  --text: #37352f;
  --text-light: #787774;
  --text-faint: #9b9a97;
  --bg: #ffffff;
  --bg-secondary: #f7f6f3;
  --bg-hover: #efefee;
  --border: #e9e9e7;
  --radius: 8px;
  --shadow-md: 0 4px 14px rgba(15,15,15,0.09);
  --max: 900px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
          Helvetica, "Apple Color Emoji", Arial, sans-serif;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.85);
    color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
}
.brand:hover { background: var(--bg-hover); }
.brand-icon { font-size: 1rem; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s;
}
.menu-btn:hover { background: var(--bg-hover); }

/* ============================================================
   SLIDE-IN MENU
   ============================================================ */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15,15,15,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.menu-backdrop.open { opacity: 1; pointer-events: auto; }

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(370px, 100%);
  background: var(--bg);
    color: var(--text); 
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.menu-panel.open { transform: translateX(0); }

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.menu-head-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.menu-close:hover { background: var(--bg-hover); color: var(--text); }

.menu-nav {
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.menu-item:hover { background: var(--bg-hover); }
.menu-item-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}
.menu-item-title {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  display: block;
}
.menu-item-sub {
  font-size: 0.8125rem;
  color: var(--text-faint);
  line-height: 1.35;
  display: block;
}
.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 16px;
}
.menu-foot { padding: 4px 16px 24px; }
.menu-foot p {
  font-size: 0.75rem;
  color: var(--text-faint);
  line-height: 1.5;
  margin-bottom: 10px;
}
.menu-social {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.menu-social a {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.menu-social a:hover { background: var(--bg-hover); }

/* ============================================================
   DARK BANNER (home page)
   ============================================================ */
.banner-dark {
  background: #1f1d1a;
  color: #ffffff;
  padding: 2.75rem 0 2.25rem;
  position: relative;
  overflow: hidden;
}
.banner-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(96,165,250,0.22), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(244,114,182,0.18), transparent 45%);
  pointer-events: none;
}
.banner-dark-inner {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  position: relative;
}
.banner-dark h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1rem;
  max-width: 22ch;
}
.banner-dark p {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.6;
  max-width: 56ch;
  margin-bottom: 1.75rem;
}

/* Shared button row */
.banner-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.banner-dark .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: transparent;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}
.banner-dark .btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}
.banner-dark .btn-primary {
  background: #ffffff;
  color: #1f1d1a;
  border-color: #ffffff;
}
.banner-dark .btn-primary:hover {
  background: #f0efed;
  border-color: #f0efed;
}

.banner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.banner-dark .banner-chips {
  padding-top: 1.75rem;
  justify-content: flex-start;
}
.banner-dark .chip {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.88);
  border: none;
}

/* Remove double border between banner and first section */
.banner-dark + main > .section:first-child {
  border-top: none;
  padding-top: 1.75rem;
}

/* ============================================================
   LIGHT COVER + HERO (used on interior pages)
   ============================================================ */
.cover {
  height: 150px;
  background: linear-gradient(120deg, #dbeafe 0%, #e0e7ff 35%, #fae8ff 70%, #ffe4e6 100%);
  position: relative;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.55), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.4), transparent 40%);
}

.hero { padding-bottom: 1.75rem; }
.page-icon {
  font-size: 3.25rem;
  line-height: 1;
  margin-top: -38px;
  margin-bottom: 0.7rem;
  display: inline-block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
  transition: transform 0.2s;
}
.page-icon:hover { transform: scale(1.06) rotate(-4deg); }

.page-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.55rem;
}
.page-desc {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 58ch;
  margin-bottom: 1.1rem;
}

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

/* ============================================================
   CHIPS
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-hover);
  color: #32302c;
  border: none;
  white-space: nowrap;
}
.chip-blue   { background: #d3e5ef; color: #183347; }
.chip-green  { background: #dbeddb; color: #1c3829; }
.chip-purple { background: #e8deee; color: #412454; }
.chip-orange { background: #fadec9; color: #49290f; }
.chip-pink   { background: #f5e0e9; color: #4c2338; }
.chip-yellow { background: #fdecc8; color: #402c1b; }
.chip-red    { background: #ffe2dd; color: #5d1715; }
.chip-gray   { background: #e3e2e0; color: #32302c; }
.chip-cyan   { background: #d3f0f0; color: #0d3a3a; }
.chip-brown  { background: #eee0da; color: #4a2e22; }
.chip-lime   { background: #e3f2d3; color: #2a4015; }
.chip-indigo { background: #dbe1f5; color: #1e2a5c; }
.chip-cyan   { background: #d3f0f0; color: #0d3a3a; }

/* ============================================================
   SECTION
   ============================================================ */
.section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
}
.section-title {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title .emoji { font-size: 1.1rem; }

.see-all {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.see-all:hover { background: var(--bg-hover); color: var(--text); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-light);
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.filter-tab:hover { background: var(--bg-hover); color: var(--text); }
.filter-tab.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 600;
}
.filter-count {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 5px;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}
.filter-tab.active .filter-count { color: var(--text-light); }

/* ============================================================
   GALLERY GRID
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 15px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #d9d9d6;
}

.card-cover {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.1rem;
  position: relative;
  overflow: hidden;
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.5), transparent 55%);
}
.card-cover span {
  position: relative;
  z-index: 1;
}

.cover-a { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.cover-b { background: linear-gradient(135deg, #dbeddb, #c9e6c9); }
.cover-c { background: linear-gradient(135deg, #fdecc8, #fbe0b0); }
.cover-d { background: linear-gradient(135deg, #e8deee, #ded0e8); }
.cover-e { background: linear-gradient(135deg, #f5e0e9, #eed3e0); }
.cover-f { background: linear-gradient(135deg, #fadec9, #f7d0b4); }
.cover-g { background: linear-gradient(135deg, #ffe2dd, #ffd0c8); }

.card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.card-foot {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.card-action {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #2383e2;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.9375rem;
}
.empty-state[hidden] { display: none; }

/* ============================================================
   CALLOUT
   ============================================================ */
.callout {
  display: flex;
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.callout-icon {
  font-size: 1.2rem;
  line-height: 1.4;
  flex-shrink: 0;
}
.callout-text {
  font-size: 0.9375rem;
  color: var(--text-light);
}
.callout-text strong {
  color: var(--text);
  font-weight: 600;
}
.callout-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2383e2;
}
.callout-link:hover { text-decoration: underline; }

/* ============================================================
   READING PROGRESS BAR (post pages)
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: #2383e2;
  transition: width 0.1s linear;
}

/* ============================================================
   POST PAGE
   ============================================================ */
.post-cover {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.post-cover span {
  position: relative;
  z-index: 1;
}

.post-header { padding-bottom: 1.5rem; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-bottom: 0.9rem;
}

a.chip { transition: opacity 0.15s; }
a.chip:hover { text-decoration: none; opacity: 0.82; }

.post-body {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text);
  max-width: 68ch;
}
.post-body > * + * { margin-top: 0.9rem; }

.post-body h2 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2.25rem;
  margin-bottom: 0.25rem;
}
.post-body h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 1.6rem;
  margin-bottom: 0.15rem;
}

.post-body ul,
.post-body ol { padding-left: 1.5rem; }
.post-body li + li { margin-top: 0.3rem; }

.post-body a {
  color: #2383e2;
  text-decoration: underline;
  text-decoration-color: rgba(35,131,226,0.35);
  text-underline-offset: 2px;
}
.post-body a:hover { text-decoration-color: #2383e2; }

.post-body blockquote {
  border-left: 3px solid var(--text);
  padding: 2px 0 2px 1rem;
  margin: 1.35rem 0;
  color: var(--text-light);
  font-style: italic;
}

.post-body img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.post-body code {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.post-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
}
.post-body .callout { margin: 1.5rem 0; }

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 68ch;
}
.post-tags-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 2rem;
}
.post-nav a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: background 0.15s, border-color 0.15s;
}
.post-nav a:hover {
  background: var(--bg-secondary);
  border-color: #d9d9d6;
}
.post-nav-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.post-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}
.post-nav a.next { text-align: right; }

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2383e2;
}
.back-link:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 3rem;
  font-size: 0.8125rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .page-title { font-size: 1.9rem; }
  .page-icon { font-size: 2.6rem; margin-top: -32px; }
  .cover { height: 120px; }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
  }
  .card-cover { height: 92px; font-size: 1.7rem; }
  .card-title { font-size: 0.875rem; }

  .post-cover { height: 160px; font-size: 3rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav a.next { text-align: left; }

  .banner-dark { padding: 3rem 0 2.5rem; }
  .banner-dark h1 { font-size: 2rem; }
  .banner-dark p { font-size: 1rem; }
  .banner-dark .btn { padding: 9px 16px; font-size: 0.875rem; }
}

/* Allow cards to use a real image instead of an emoji */
.card-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: block;
}
.card-cover.has-image::after {
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 60%);
}

/* ============================================================
   POST HERO  cover image with title overlay
   ============================================================ */
.post-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #1f1d1a;
  color: #ffffff;
}
.post-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.post-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15,15,15,0.30) 0%,
    rgba(15,15,15,0.55) 45%,
    rgba(15,15,15,0.88) 100%
  );
  z-index: 1;
}
.post-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  padding: 3rem 0 2.5rem;
}
.post-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  max-width: 22ch;
  color: #ffffff;
}
.post-hero p {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.78);
  margin-bottom: 1.25rem;
}
.post-hero .banner-chips { padding-top: 0; }
.post-hero .chip {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.post-hero .chip:hover {
  background: rgba(255,255,255,0.25);
}

@media (max-width: 640px) {
  .post-hero { min-height: 280px; }
  .post-hero-inner { padding: 2rem 0 1.75rem; }
  .post-hero h1 { font-size: 1.75rem; }
}