/* ──────────────────────────────────────────────
   VARIABLES
────────────────────────────────────────────── */
:root{
  --blue:#1d2b64; --blue2:#162045;
  --gold:#ffb703; --gold2:#f59e0b;
  --accent:#06d6a0;

  --ink:#0f172a; --muted:#64748b;
  --bg:#f9fafb; --card:#ffffff;

  --radius:16px;
  --shadow:0 6px 20px rgba(0,0,0,.08);
  --shadow-strong:0 10px 35px rgba(0,0,0,.18);
  --maxw:1300px;
}

/* ──────────────────────────────────────────────
   RESET / PAGE
────────────────────────────────────────────── */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  display:flex;flex-direction:column;min-height:100vh;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  color:var(--ink); line-height:1.6;
  background:linear-gradient(180deg,var(--blue2) 0%,var(--blue) 25%,var(--bg) 100%);
  background-attachment:fixed;
}
main{flex:1 0 auto}
footer{flex-shrink:0}

/* ──────────────────────────────────────────────
   HEADER / NAV
────────────────────────────────────────────── */
header{
  position:sticky;top:0;z-index:20;color:#fff;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  box-shadow:var(--shadow);
}
.nav-bar{
  max-width:var(--maxw);margin:0 auto;padding:1rem 1.5rem;
  display:grid;grid-template-columns:1fr auto;gap:1rem;align-items:center;
}
.brand{display:flex;align-items:center;gap:.85rem}
.logo-img{
  width:48px;height:48px;border-radius:50%;
  border:2px solid rgba(255,255,255,.25);
  background:radial-gradient(circle at 30% 30%,var(--gold),var(--gold2));padding:4px;
}
.brand h1{
  margin:0;font-weight:900;font-size:1.25rem;
  background:linear-gradient(90deg,var(--gold),#fff);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
.tagline{margin:0;color:#cbd5ff;font-size:.9rem}
nav a{
  color:#f1f5ff;text-decoration:none;font-weight:600;margin-left:1rem;
  padding:.55rem 1rem;border-radius:999px;border:1px solid rgba(255,255,255,.15);
  transition:all .25s ease;
}
nav a:hover{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.35);box-shadow:0 0 12px rgba(255,255,255,.25)}
nav .cta{background:var(--gold);color:#111;border-color:transparent;box-shadow:0 6px 16px rgba(245,158,11,.4)}
nav .cta:hover{background:var(--gold2);transform:translateY(-2px)}

/* ──────────────────────────────────────────────
   LAYOUT
────────────────────────────────────────────── */
.wrap{
  max-width:var(--maxw);margin:1.6rem auto 2.2rem;padding:0 1.5rem;
  display:grid;grid-template-columns:1.65fr .35fr;gap:2rem;
}
.wrap-narrow,.wrap-post{grid-template-columns:1fr}

/* ==================================================
   POSTS GRID: 3 across → 2 on tablet → 1 on mobile
   ================================================== */
/* POSTS: refined 3×3 tiles */
.posts{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1.25rem;
}

.post-tile{
  position:relative; aspect-ratio:1/1; overflow:hidden;
  border-radius:16px;
  background:#0f1b4d;              /* fallback if no image */
  box-shadow:0 8px 24px rgba(0,0,0,.12), inset 0 0 0 1px rgba(255,255,255,.06);
  transition:transform .2s ease, box-shadow .25s ease, filter .25s ease;
}
.post-tile:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 36px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.08);
  filter:saturate(1.05);
}

/* image layer */
.post-tile .tile-bg{
  position:absolute; inset:0;
  background-size:cover; background-position:center;
  transform:scale(1.02);
  transition:transform .35s ease;
}
.post-tile:hover .tile-bg{ transform:scale(1.06); }

/* readable overlay */
.post-tile::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(
    to top,
    rgba(2,8,23,.75) 0%,
    rgba(2,8,23,.35) 48%,
    rgba(2,8,23,0) 72%
  );
}

/* content */
.tile-meta{
  position:absolute; left:14px; right:14px; bottom:14px; z-index:2; color:#fff;
}
.tile-title{
  font-weight:900; font-size:1.05rem; line-height:1.25;
  letter-spacing:.1px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.tile-date{font-size:.82rem; opacity:.9; margin-top:.25rem}

/* clickable tile */
.post-tile a{position:absolute; inset:0; display:block; color:inherit; text-decoration:none}

/* TOP-LEFT TAG BADGE (with color variants) */
.tile-badge{
  position:absolute; top:10px; left:10px; z-index:2;
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.24rem .6rem; border-radius:999px; font-weight:800; font-size:.72rem;
  box-shadow:0 4px 12px rgba(0,0,0,.15), inset 0 0 0 1px rgba(255,255,255,.35);
  backdrop-filter:saturate(1.1);
}
/* default (uncategorized) */
.tile-badge{ background:#fff; color:#1f2937; border:1px solid #e5e7eb; }

/* tag color system */
.tile-badge.badge-teachings      { background:#fff7e6; color:#6b3d00; border-color:#ffd48a; }
.tile-badge.badge-study          { background:#e6f0ff; color:#0b2a6d; border-color:#c7dbff; }
.tile-badge.badge-inspiration    { background:#eafbf3; color:#0f5132; border-color:#b7f0d1; }
.tile-badge.badge-community      { background:#f3e8ff; color:#5a1e96; border-color:#e4c8ff; }
.tile-badge.badge-guidance       { background:#e8f9ff; color:#0c4a6e; border-color:#bfeeff; }
.tile-badge.badge-reflections    { background:#fff0f3; color:#7f1d1d; border-color:#ffd0d9; }
.tile-badge.badge-uncategorized  { background:#eef2f6; color:#334155; border-color:#dbe2ea; }

/* responsive columns */
@media (max-width:1100px){ .posts{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:640px){  .posts{ grid-template-columns:1fr; } }
/* The container row that is absolutely positioned */
.badge-row {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 3;

  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  /* span full width inside the tile */
  width: calc(100% - 20px);
}

/* Fix: badges inside a row should NOT be absolute */
.badge-row .tile-badge {
  position: static;    /* cancels absolute from .tile-badge */
  top: auto;
  left: auto;
}
/* ──────────────────────────────────────────────
   SIDEBAR / PANELS
────────────────────────────────────────────── */
.sidebar{display:flex;flex-direction:column;gap:0rem}
.panel{border-radius:var(--radius);padding:1rem}
.panel h3 {
  display: none;
}

/* Featured (clean, full-bleed) */
.featured-rotator{height:400px;border-radius:12px;overflow:hidden;background:transparent;}
.featured-rotator img{width:100%;height:100%;object-fit:contain}

/* ──────────────────────────────────────────────
   CALENDAR
────────────────────────────────────────────── */
.calendar{
  width:100%;border-collapse:collapse;font-size:.95rem;border-radius:12px;overflow:hidden;
  background:#fff;box-shadow:var(--shadow);
}
.calendar thead th{
  text-align:center;padding:.6rem;background:linear-gradient(135deg,var(--blue),var(--blue2));color:#fff;font-weight:700;border:0;
}
#monthBar{display:flex;justify-content:center;align-items:center;gap:.75rem;line-height:1;padding:.25rem 0}
.cal-nav{
  display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;
  border-radius:999px;background:#fff;color:var(--blue2);border:2px solid var(--gold2);
  font-weight:900;font-size:1rem;cursor:pointer;box-shadow:var(--shadow);
  transition:transform .12s ease,box-shadow .2s ease,background .2s ease;
}
.cal-nav:hover{background:#fff7e6;transform:translateY(-1px);box-shadow:var(--shadow-strong)}
.calendar tbody td{border:1px solid #e5e7eb;text-align:center;padding:.65rem .25rem;background:#fff}
.calendar td.muted{color:#cbd5e1;background:#fafafa}
.calendar td.today{outline:3px solid var(--accent);outline-offset:-3px;font-weight:800}
.calendar td.has-post{background:#fffdf0;position:relative;font-weight:600}
.calendar td.has-post::after{
  content:"";position:absolute;bottom:6px;left:50%;transform:translateX(-50%);
  width:7px;height:7px;border-radius:50%;background:var(--gold);box-shadow:0 0 0 3px rgba(245,158,11,.25);
}

/* ──────────────────────────────────────────────
   CATEGORIES (for categories.html)
────────────────────────────────────────────── */
.cat-filter{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.cat-filter button{
  padding:.45rem .8rem;border-radius:999px;border:1px solid #cbd5e1;background:#fff;cursor:pointer;transition:all .2s ease;
}
.cat-filter button:hover{background:var(--gold);border-color:var(--gold2);color:#111}
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:1.2rem}
.cat-card{
  background:#fff;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:var(--shadow);transition:transform .2s ease, box-shadow .3s ease;min-height:260px;
}
.cat-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-strong)}
.cat-card img{width:100%;aspect-ratio:4/3;object-fit:cover}
.cat-card .info{padding:.85rem}
.cat-card .info .title{font-weight:800;margin-bottom:.25rem;color:#0f1b4d}
.cat-card .info .date{font-size:.85rem;color:var(--muted)}

/* ──────────────────────────────────────────────
   FOOTER
────────────────────────────────────────────── */
footer{
  margin-top:2rem;background:linear-gradient(135deg,var(--blue2),var(--blue));
  color:#e5e7eb;padding:2rem 1.5rem;box-shadow:0 -6px 20px rgba(29,43,100,.35);
}
.footer-inner{
  max-width:var(--maxw);margin:0 auto;display:grid;gap:1rem;grid-template-columns:1fr auto;align-items:center;
}
.footer-nav a{color:var(--gold);text-decoration:none;margin-left:1rem;font-weight:700;position:relative}
.footer-nav a::after{
  content:'';position:absolute;bottom:-3px;left:0;right:0;height:2px;background:var(--gold2);
  transform:scaleX(0);transition:transform .25s ease;transform-origin:center;
}
.footer-nav a:hover::after{transform:scaleX(1)}

/* ──────────────────────────────────────────────
   RESPONSIVE
────────────────────────────────────────────── */
@media (max-width:980px){ .wrap{grid-template-columns:1fr} }

/* ===== Category filter (compact, single line) ===== */
.cat-filter{
  display:flex;
  align-items:center;
  gap:.5rem;
  margin:.25rem 0 1rem;
  overflow-x:auto;           /* stay one line, scroll if needed */
  padding-bottom:.25rem;
  scrollbar-width: thin;
}
.cat-filter button{
  appearance:none;
  border:1px solid #d9dee8;
  background:#fff;
  color:#0f1b4d;
  font-weight:800;
  font-size:.85rem;          /* smaller text */
  padding:.35rem .75rem;     /* smaller chip */
  border-radius:999px;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .12s ease;
  white-space:nowrap;
}
.cat-filter button:hover{ background:#fffdf5; border-color:#ffd48a; transform:translateY(-1px); }
.cat-filter button.active{ background:var(--gold); color:#111; border-color:transparent; }

/* ===== Categories grid (3 across desktop) ===== */
/* Category grid */
.cat-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* breakpoints */
@media (max-width: 1100px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 across on tablet */
  }
}
@media (max-width: 640px) {
  .cat-grid {
    grid-template-columns: 1fr; /* single column on mobile */
  }
}

.cat-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow:var(--shadow);
  transition:transform .18s ease, box-shadow .25s ease;
}
.cat-card:hover{ transform:translateY(-4px); box-shadow:var(--shadow-strong); }

.cat-card img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  background:#0b1f4a;        /* nice fallback color while loading */
}
.cat-card .info{ padding:.85rem; }
.cat-card .info .title{
  font-weight:900; margin:0 0 .25rem; color:#0f1b4d;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.cat-card .info .date{ font-size:.85rem; color:var(--muted); }

/* ──────────────────────────────────────────────
   POST PAGE — Prose Typography & Utilities
   Reuses your variables & look (cards, shadows, gradients)
────────────────────────────────────────────── */
/* Allow multiple badges to sit nicely */
.post-full{
  max-width: 860px;
  margin: 1.25rem auto 0;
  background: var(--card);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2vw, 1.5rem);
}

/* subtle card frame variant */
.card-prose{
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(145deg, rgba(29,43,100,.25), rgba(245,158,11,.35)) border-box;
  border: 1px solid transparent;
}

/* meta row above title injected by JS */
.post-full .post-meta{
  display:flex; gap:.6rem; flex-wrap:wrap;
  color: var(--muted); font-weight:700; font-size:.9rem;
  margin-bottom:.25rem;
}
.post-full time{ opacity:.9 }

/* title */
.post-full > h1{
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing:.2px;
  margin:.15rem 0 .9rem;
  background: linear-gradient(90deg, var(--blue2), var(--gold2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* hero image inserted by JS */
.post-full > img{
  width:100%;
  height:auto;
  display:block;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin:.5rem 0 1.15rem;
}

/* Base prose */
.post-full p{
  margin: .9rem 0;
  font-size: 1.05rem;
  color: #0f172a;
}
.post-full a{
  color: var(--blue2);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 2px solid rgba(13, 31, 89, .2);
  transition: border-color .2s ease, color .2s ease;
}
.post-full a:hover{ color: var(--gold2); border-color: rgba(245,158,11,.55); }

/* Headings inside content */
.post-full h2{
  margin: 1.6rem 0 .6rem;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
  font-weight: 900;
  color:#0f1b4d;
}
.post-full h3{
  margin: 1.2rem 0 .45rem;
  font-size: clamp(1.15rem, 2vw, 1.25rem);
  font-weight: 900;
  color:#11255a;
}

/* Lists */
.post-full ul{
  padding-left: 1.15rem;
  margin: .6rem 0 .9rem;
}
.post-full li{
  margin:.35rem 0;
  list-style: disc;
}
.post-full li::marker{ color: var(--gold2); }

/* Blockquote */
.post-full blockquote{
  margin: 1.1rem 0;
  padding: .85rem 1rem;
  border-left: 4px solid var(--gold2);
  background: linear-gradient(180deg,#fffdf5, #ffffff);
  border-radius: 10px;
  color:#0f1b4d;
  box-shadow: 0 2px 8px rgba(0,0,0,.04) inset;
}

/* Code blocks (our renderer outputs <pre><code>... for ``` fences) */
.post-full pre{
  background:#0b122b;
  color:#f1f5ff;
  padding: .9rem 1rem;
  border-radius: 12px;
  overflow:auto;
  box-shadow: var(--shadow);
  margin: 1rem 0;
  border: 1px solid rgba(255,255,255,.1);
}
.post-full code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
}

/* Horizontal rule (if added later) */
.post-full hr{
  border:0; height:1px; background:linear-gradient(90deg,#e5e7eb,transparent);
  margin:1.25rem 0;
}

/* Tables (in case your content includes them later) */
.post-full table{
  width:100%; border-collapse: collapse; margin: 1rem 0;
  background:#fff; border-radius:12px; overflow:hidden; box-shadow: var(--shadow);
}
.post-full th, .post-full td{
  border: 1px solid #e5e7eb; padding:.6rem .7rem; text-align:left;
}
.post-full thead th{
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color:#fff; border-color:transparent;
}

/* Small utility aside under the post */
.post-utils{
  max-width: 860px;
  margin: 1rem auto 0;
  display: grid;
  gap: 1rem;
}
.post-utils .panel{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow: var(--shadow);
  padding: .8rem 1rem;
}
.post-utils h3{
  margin: 0 0 .5rem;
  font-size: .95rem;
  font-weight: 900;
  color:#0b1f4a;
  letter-spacing:.3px;
}

/* Share buttons */
.share-row{ display:flex; gap:.5rem; flex-wrap:wrap; }
.share-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:.45rem .8rem; border-radius:999px;
  text-decoration:none; font-weight:800; font-size:.9rem;
  border:1px solid #d9dee8; color:#0f1b4d; background:#fff;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.share-btn:hover{ background:#fffdf5; border-color:#ffd48a; transform: translateY(-1px); }

/* Back button */
.btn-back{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.5rem .9rem; border-radius:10px; text-decoration:none;
  font-weight:900; color:#111; background:var(--gold);
  box-shadow: 0 6px 16px rgba(245,158,11,.32);
  transition: transform .12s ease, background .2s ease;
}
.btn-back:hover{ background: var(--gold2); transform: translateY(-2px); }

/* Responsive tweaks */
@media (max-width: 980px){
  .post-full, .post-utils{ margin-top: 1rem; }
}
/* ================================
   Categories Page — Grid + Cards
   ================================ */
   .page-categories .cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(560px, 560px)); /* fixed tile width */
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1.1rem;
  }
  
  .page-categories .cat-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-areas:
      "img meta"
      "desc desc";
    gap: 1rem .95rem;
    align-items: start;
  
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 1rem;
    transition: transform .18s ease, box-shadow .25s ease, background .2s ease;
  }
  .page-categories .cat-card:hover{
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-strong);
    background: #fdfdff;
  }
  .page-categories .cat-card:focus{
    outline: 3px solid var(--gold2);
    outline-offset: 4px;
  }
  
  /* image */
  .page-categories .card--grid .card-img{
    grid-area: img;
    width: 220px; height: 220px;
    object-fit: cover;
    border-radius: 14px;
    background:#0b1f4a;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
  }
  
  /* right-side meta */
  .page-categories .card--grid .card-meta{
    grid-area: meta;
    display: grid;
    grid-auto-rows: min-content;
    gap: .45rem;
    align-content: start;
  }
  .page-categories .card--grid .card-chips{
    display: flex; flex-wrap: wrap; gap: .35rem;
  }
  .page-categories .card--grid .card-title{
    margin: 0;
    font: 900 1.25rem/1.28 Inter, system-ui, sans-serif;
    color: #0f1b4d;
  }
  .page-categories .card--grid .card-date{ 
    font-size: .85rem; 
    color: var(--muted); 
  }
  
  /* description under both */
  .page-categories .card--grid .card-desc{
    grid-area: desc;
    margin: .1rem 0 0;
    font-size: 1rem;
    line-height: 1.65;
    color: #0f172a;
    background: linear-gradient(180deg,#ffffff, #fbfcff);
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: .75rem .85rem;
  }
  
  /* chips polish */
  .page-categories .cat-chip{
    display:inline-flex; align-items:center;
    padding:.22rem .6rem; border-radius:999px;
    font-weight:800; font-size:.78rem; line-height:1;
    border:1px solid rgba(0,0,0,.12);
    white-space:nowrap; box-shadow: 0 1px 0 rgba(0,0,0,.04) inset;
    text-shadow: 0 1px 0 rgba(255,255,255,.4);
  }
  
  /* ======================
     Responsive breakpoints
     ====================== */
  @media (max-width: 900px){
    .page-categories .cat-card{
      grid-template-columns: 180px 1fr;
    }
    .page-categories .card--grid .card-img{
      width: 180px; height: 180px;
    }
  }
  @media (max-width: 700px){
    .page-categories .cat-grid{ grid-template-columns: 1fr; }
    .page-categories .cat-card{
      grid-template-columns: 1fr;
      grid-template-areas:
        "img"
        "meta"
        "desc";
    }
    .page-categories .card--grid .card-img{
      width: 100%; height: 220px;
    }
  }

 /* =====================
   Category Chips / Tags
   ===================== */
/* Category Chips */
.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.1;
  border: 1px solid rgba(0,0,0,.08);
  white-space: nowrap;
  cursor: pointer;

  /* subtle shadow & transition */
  box-shadow: 0 1px 1px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  text-decoration: none;   /* if you make them <a> */
  outline: none;           /* remove the default orange */
}

/* Hover state */
.cat-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0,0,0,.1);
  filter: brightness(1.05);
}

/* Active (when clicked) */
.cat-chip:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,.08) inset;
  filter: brightness(.95);
}

/* Make post content images responsive */
.post-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto; /* optional: centers and adds spacing */
}