/* public/assets/css/main.css
   Clean baseline — stable parsing (NO tags)
   Supports: header, nav, profile pill, theme toggle, footer, posts grid
*/

/* =========================
   Theme variables
   ========================= */
:root{
  --bg:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --card:#ffffff;
  --border:rgba(148,163,184,.22);
  --link:#0ea5e9;

  --header-bg: rgba(4,10,24,.75);
  --header-border: rgba(255,255,255,.08);

  --pill-bg: rgba(15,23,42,.55);
  --pill-border: rgba(148,163,184,.35);

  --shadow: 0 14px 40px rgba(2,6,23,.10);
}

:root[data-theme="dark"]{
  --bg:#020617;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --card: rgba(2,6,23,.55);
  --border: rgba(148,163,184,.18);
  --link:#7aa3ff;

  --shadow: 0 18px 55px rgba(0,0,0,.35);
}

/* =========================
   Base reset
   ========================= */
*,
*::before,
*::after{ box-sizing:border-box; }

html, body{ height:100%; }

body{
  margin:0;
  font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{ color:var(--link); text-decoration:none; }
a:hover{ text-decoration:underline; text-underline-offset:3px; }

.container{
  max-width:1100px;
  margin:0 auto;
  padding:0 1rem;
}

/* =========================
   Header (your HTML classes)
   ========================= */
.site-header{
  width:100%;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top:0;
  z-index: 999;
}

.site-header-inner{
  max-width: 1200px;
  margin: 0 auto;
  padding: .8rem 1.25rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

/* Brand */
.site-brand{
  display:inline-flex;
  align-items:center;
  gap:.75rem;
  text-decoration:none;
}

.site-logo{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:contain;
  display:block;
}

.site-brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.15;
}

.site-brand-name{
  font-weight:700;
  letter-spacing:.02em;
  color:#f1f5f9;
}

.site-brand-tagline{
  font-size:.75rem;
  color:#38bdf8;
  opacity:.9;
}

/* Nav */
.site-nav{
  display:flex;
  gap:1.25rem;
  flex-wrap:wrap;
  align-items:center;
}

.site-nav a{
  color:#cdd6e5;
  font-size:.9rem;
  padding-bottom:3px;
  text-decoration:none;
  transition: .15s ease;
}

.site-nav a:hover{
  color:#fff;
  border-bottom:1px solid #38bdf8;
}

.site-nav a.is-active{
  color:#fff;
  font-weight:700;
  border-bottom:2px solid #38bdf8;
}

/* Primary pill links */
.site-nav a.is-primary{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.45rem .8rem;
  border-radius:999px;
  font-weight:800;
  letter-spacing:.01em;
  border:1px solid rgba(59,130,246,.35);
  background: rgba(59,130,246,.12);
  color:#fff;
  text-decoration:none;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.site-nav a.is-primary:hover{
  transform: translateY(-1px);
  background: rgba(59,130,246,.18);
  border-color: rgba(59,130,246,.55);
}

/* Right side */
.site-cta-nav{
  display:flex;
  align-items:center;
  gap:.65rem;
}

/* Profile pill */
.header-profile-pill{
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  padding:.35rem .75rem;
  border-radius:999px;
  background: var(--pill-bg);
  border:1px solid var(--pill-border);
  color: rgba(226,232,240,.95);
  text-decoration:none;
  font-size:.9rem;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.header-profile-pill:hover{
  transform: translateY(-1px);
  border-color: rgba(56,189,248,.6);
  box-shadow: 0 8px 20px rgba(2,6,23,.25);
}

.header-profile-avatar{
  width:28px;
  height:28px;
  border-radius:999px;
  object-fit:cover;
  border:1px solid rgba(56,189,248,.6);
}

.header-profile-label{
  font-weight:700;
}

/* Theme toggle pill + icon swap */
.theme-toggle-pill{
  border: 1px solid rgba(148,163,184,.35);
  background: rgba(15,23,42,.55);
  color: rgba(226,232,240,.95);
  border-radius: 999px;
  padding: .35rem .55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-pill:hover{ background: rgba(255,255,255,.08); }

.theme-toggle-pill:focus-visible{
  outline: 3px solid rgba(56,189,248,.35);
  outline-offset: 2px;
}

.theme-icon{ display:inline-block; line-height:1; }
:root[data-theme="dark"] .theme-icon.light{ display:none; }
:root:not([data-theme="dark"]) .theme-icon.dark{ display:none; }

/* Header responsive */
@media (max-width: 980px){
  .site-header-inner{
    flex-wrap:wrap;
    justify-content:center;
  }
  .site-nav{
    order:3;
    justify-content:center;
  }
  .site-cta-nav{ order:2; }
}

/* =========================
   Footer
   ========================= */
.site-footer{
  border-top: 1px solid rgba(148,163,184,.25);
  background:#020617;
  color:#cbd5f5;
  margin-top: 3rem;
}

.footer-inner{
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 1.5rem;
  font-size:.9rem;
}

.footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:.9rem;
}

.footer-links a{ color:#cbd5f5; text-decoration:none; }
.footer-links a:hover{ color:#facc15; }

@media (max-width: 720px){
  .footer-inner{
    flex-direction:column;
    align-items:flex-start;
  }
}
/* Footer logo size fix */
.footer-logo {
  height: 28px;
  width: auto;
  display: block;
}

.footer-left .brand {
  align-items: center;
  gap: 0.5rem;
}
.footer-logo {
  height: 28px;
  width: auto;
  display: block;
}
.footer-logo{height:28px;width:auto;display:block}


/* ======================================================================
   CANONICAL: Posts grid + cards (place at VERY BOTTOM of main.css)
   ====================================================================== */

/* Theme-safe defaults */
:root{
  --card: #ffffff;
  --border: #e6eaf0;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 1px 0 rgba(15,23,42,.04);
  --muted: #475569;
}

:root[data-theme="dark"]{
  --card: rgba(15, 23, 42, 0.96);
  --border: rgba(148, 163, 184, 0.28);
  --shadow: 0 18px 46px rgba(2, 6, 23, 0.55);
  --shadow-soft: 0 1px 0 rgba(0,0,0,.25);
  --muted: #9ca3af;
}

/* Grid */
.posts-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

@media (max-width:1100px){
  .posts-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width:720px){
  .posts-grid{ grid-template-columns: 1fr; }
}

/* Title & excerpt helpers */
.posts-grid h2, .posts-grid h3{
  margin:0 0 .65rem;
  line-height:1.35;
  letter-spacing:-.01em;
}

.posts-grid p{
  margin:0 0 .85rem;
  color: var(--muted);
  line-height:1.55;
}

.posts-grid h2 + p,
.posts-grid h3 + p{
  display:-webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* ======================================================================
   CANONICAL: Posts grid + cards (BOTTOM-OF-FILE OVERRIDE)
   Purpose: eliminate cascade drift across generated/curated pages
   Marker: must be LAST non-whitespace line in main.css
   ====================================================================== */

/* Theme-safe defaults (fallbacks) */
:root{
  --card: #ffffff;
  --border: #e6eaf0;
  --shadow-soft: 0 1px 0 rgba(15,23,42,.04);
  --shadow: 0 14px 38px rgba(15,23,42,.10);
  --muted: #475569;
}

:root[data-theme="dark"]{
  --card: rgba(15,23,42,.96);
  --border: rgba(148,163,184,.28);
  --shadow-soft: 0 1px 0 rgba(0,0,0,.25);
  --shadow: 0 18px 46px rgba(2,6,23,.55);
  --muted: #9ca3af;
}

/* Grid */
.posts-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

@media (max-width:1100px){
  .posts-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width:720px){
  .posts-grid{ grid-template-columns: 1fr; }
}

/* Card base */
.posts-grid > *{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  display:flex;
  flex-direction:column;
  min-height: 210px;
}

.posts-grid > *:hover,
.posts-grid > *:focus-within{
  transform: translateY(-4px);
  border-color: rgba(59,130,246,.35);
  box-shadow: var(--shadow);
}

/* Title & excerpt helpers */
.posts-grid h2, .posts-grid h3{
  margin:0 0 .65rem;
  line-height:1.35;
  letter-spacing:-.01em;
}

.posts-grid p{
  margin:0 0 .85rem;
  color: var(--muted);
  line-height:1.55;
}

/* Clamp excerpt when it follows title */
.posts-grid h2 + p,
.posts-grid h3 + p{
  display:-webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* ======================================================================
   CANONICAL: Posts grid + cards (place at VERY BOTTOM of main.css)
   ====================================================================== */

/* Theme-safe defaults */
:root{
  --card: #ffffff;
  --border: #e6eaf0;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 1px 0 rgba(15,23,42,.04);
  --muted: #475569;
}

:root[data-theme="dark"]{
  --card: rgba(15, 23, 42, 0.96);
  --border: rgba(148, 163, 184, 0.28);
  --shadow: 0 18px 46px rgba(2, 6, 23, 0.55);
  --shadow-soft: 0 1px 0 rgba(0,0,0,.25);
  --muted: #9ca3af;
}

/* Grid */
.posts-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

@media (max-width:1100px){
  .posts-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width:720px){
  .posts-grid{ grid-template-columns: 1fr; }
}

/* Card base */
.posts-grid > *{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  display:flex;
  flex-direction:column;
  min-height: 210px;
}

.posts-grid > *:hover,
.posts-grid > *:focus-within{
  transform: translateY(-4px);
  border-color: rgba(59,130,246,.35);
  box-shadow: var(--shadow);
}

/* Title & excerpt helpers */
.posts-grid h2, .posts-grid h3{
  margin:0 0 .65rem;
  line-height:1.35;
  letter-spacing:-.01em;
}

.posts-grid p{
  margin:0 0 .85rem;
  color: var(--muted);
  line-height:1.55;
}

.posts-grid h2 + p,
.posts-grid h3 + p{
  display:-webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* JLT_CANONICAL_POSTS_GRID_V1 */

