/* === Theme === */
:root{
  --accent: #6366f1;        /* indigo */
  --accent-strong: #4f46e5; /* indigo darker */
  --brand-icon: 40px;
}

/* === Global === */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f9f9f9;
  color: #333;
  text-align: center;
  padding-bottom: 3rem;
  overflow-x: hidden;
}


.hero {
  padding: 2rem 1rem;
  background: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
h1 {
  margin-bottom: 0.2rem;
  font-size: 3.5rem;
  font-family: 'Caveat', cursive;
}
.search-container { margin-top: 1rem; }
input[type="text"] {
  padding: 0.6rem;
  width: 60%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
}
button {
  padding: 0.6rem 1.2rem;
  margin-left: 0.5rem;
  background-color: #5c67f2;
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
}
button:hover { background-color: #4a54e1; }

/* === Navbar === */
.navbar{
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px; /* NEW: space between brand and buttons */
  background: #222;
  color: #fff;
  padding: 1rem 2rem;
  /* respect notches/safe areas */
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.brand{
  display:flex; align-items:center; gap:10px;
  color:#fff; text-decoration:none; white-space:nowrap;
}
.brand-mark{
  width:32px; height:32px; border-radius:8px;
  background:linear-gradient(135deg, var(--accent), var(--accent-strong));
  display:inline-block;
}
.brand-name{ font-family:'Caveat', cursive; font-size:1.9rem; letter-spacing:.2px; }
.brand-icon{
  width: var(--brand-icon) !important;
  height: var(--brand-icon) !important;
  flex: 0 0 var(--brand-icon);
  display: block;
  border-radius: 8px;
}

.nav-links{
  list-style:none;
  display:flex;
  align-items:center;
  gap:.6rem;
  margin:0;
  padding:0;
  margin-left:auto;
  justify-content:flex-end;
}
.nav-links li{ margin:0; padding:0; }
.nav-links a { color: white; text-decoration: none; }

.action-btn{
  background: var(--accent);
  color:#fff;
  padding:.5rem .9rem;
  border:none;
  border-radius:10px;
  text-decoration:none;
  font-weight:700;
  cursor:pointer;
  display:inline-flex; align-items:center; gap:8px;
}
.action-btn:hover{ background: var(--accent-strong); }
.action-btn:focus-visible{ outline:2px dashed #fff; outline-offset:2px; border-radius:10px; }

.nav-icon-btn{
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color:#fff; border:none; border-radius:10px;
  padding:.5rem .65rem; font-weight:700; font-size:1.05rem; line-height:1;
  display:inline-flex; align-items:center; justify-content:center;
  min-width:38px; height:34px; box-shadow:0 1px 2px rgba(0,0,0,.04); cursor:pointer;
}
.nav-icon-btn:hover{ filter:brightness(.97); background: linear-gradient(135deg, var(--accent-strong), var(--accent-strong)); }
.nav-icon-btn:focus-visible{ outline:2px dashed #fff; outline-offset:2px; }
.nav-icon-btn:disabled{ opacity:.45; cursor:not-allowed; filter:grayscale(.1); }


@media (max-width: 430px){
  .brand-name{ font-size:1.6rem; }
  .brand-icon{ width:34px !important; height:34px !important; } 
  .nav-links{ gap:.4rem; }
  .action-btn{ padding:.42rem .62rem; border-radius:8px; font-size:.9rem; }
  .nav-icon-btn{ height:32px; min-width:34px; padding:.45rem .55rem; font-size:1rem; }
}


@media (max-width: 370px){
  .navbar{ flex-wrap: wrap; row-gap: 8px; }
  .nav-links{
    width:100%;
    justify-content:space-between; 
  }
}

.nav-links .action-btn{
  padding:.38rem .7rem;
  border-radius:8px;
  font-size:.9rem;
  gap:6px;
  line-height:1;
}

/* === Results Grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

/* === Card === */
.card {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;


  display: flex;
  flex-direction: column;
  container-type: inline-size;
  min-width: 0;
}
.card:hover { transform: translateY(-5px); }

.card img {
  display: block;
  width: 100%;
  height: clamp(200px, 40vw, 320px);
  object-fit: cover;
  border-radius: 8px;
  margin: 0 0 .5rem 0;
  transition: transform 0.5s ease;
}
.card:hover img { transform: scale(1.05); }

.card h3 { margin:.5rem 0 .25rem; line-height:1.2; }
.card a { color: #5c67f2; font-weight: bold; text-decoration: none; }
.card a:hover { text-decoration: underline; }


.card-title{
  display:block;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.card .meta-row{
  display:flex;
  align-items:baseline;
  gap:.75rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:.95rem;
  line-height:1.2;
}
.card .meta-row .kv{
  display:flex;
  gap:.35rem;
  flex:0 1 auto;      
  min-width:0;       
}
.card .meta-row .kv .value{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}

@container (max-width: 420px){ .card .meta-row{ font-size:.90rem; gap:.55rem; } }
@container (max-width: 360px){ .card .meta-row{ font-size:.84rem; gap:.45rem; } }
@container (max-width: 320px){ .card .meta-row{ font-size:.78rem; gap:.40rem; } }


.skeleton {
  min-height: 240px;
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 37%, #eee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* === Explore grid (curated) === */
.explore-section { padding: 0.5rem 0 0; }
.explore-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto; padding: 0 1rem;
}
.explore-header h2 { margin: 0.5rem 0; font-size: 1.6rem; text-align: left; }

.explore-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 0 1rem 1rem;
}
@media (max-width: 1100px){ .explore-grid{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 900px){ .explore-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 560px){ .explore-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }

.explore-card{
  background:#fff; border-left:3px solid var(--accent);
  padding:.75rem; border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,.06);
  text-align:left; cursor:pointer; transition:transform .15s ease;
  display:flex; flex-direction:column; height:100%;
}
.explore-card:hover{ transform: translateY(-2px); }
.explore-card strong{
  display:block; font-weight:700; color:#111; margin-bottom:4px;
  font-size:1rem; line-height:1.2;
}
.explore-card p{ margin:0; font-size:.85rem; color:#555; line-height:1.3; }
.explore-card strong, .explore-card p{
  overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical;
}
.explore-card strong{ -webkit-line-clamp:2; }   
.explore-card p{ -webkit-line-clamp:2; }

/* Explore actions */
.explore-actions { display:flex; gap:8px; align-items:center; }
.arrow-btn{
  width:34px; height:34px; border-radius:8px;
  background:var(--accent); color:#fff; border:none; cursor:pointer;
}
.arrow-btn:hover{ background:var(--accent-strong); }
.arrow-btn:focus-visible{ outline:2px dashed #fff; outline-offset:2px; }
.arrow-btn:disabled{ opacity:.5; cursor:not-allowed; }

/* Show more vibes */
#shuffleVibesBtn{
  background: var(--accent); color:#fff; border-radius:10px;
  padding:.5rem .9rem; border:none; cursor:pointer;
}
#shuffleVibesBtn:hover{ background: var(--accent-strong); }
#shuffleVibesBtn:focus-visible{ outline:2px dashed #fff; outline-offset:2px; }

/* === Filters === */
#filtersContainer { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.filters-bar{
  display:flex; gap:12px; align-items:center; padding:10px 12px;
  background:#fff; z-index:10; border:1px solid #eee; border-radius:10px;
  box-shadow:0 1px 2px rgba(0,0,0,0.04); margin:8px 0 16px; position:sticky; top:72px;
}
.filters-left{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.filters-right{ margin-left:auto; display:flex; gap:8px; align-items:center; }
.filters-bar label{ font-size:14px; display:flex; gap:6px; align-items:center; }
.filters-bar select{
  padding:6px 8px; border:1px solid #ddd; border-radius:8px; background:#fff;
}
.clear-filters{
  padding:6px 12px; border-radius:8px; background:#000; color:#fff; border:none; cursor:pointer;
}
.clear-filters:hover{ background:#111; }

/* === Utility === */
.hidden { display: none !important; }
.load-more{
  margin:20px auto; display:block; padding:10px 20px; font-size:1rem;
  cursor:pointer; border-radius:6px; background:#444; color:#fff; border:none; transition:background .3s;
}
.load-more:hover{ background:#222; }

/* === Footer === */
footer{
  margin-top: 48px;
  padding: 24px 16px;
  border-top: 1px solid #e5e7eb;
  color: #64748b;
  text-align: center;
}
footer p{ margin: 0; }
footer a{
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
footer a:hover{ color: var(--accent-strong); }
footer a:focus-visible{ outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-color-scheme: dark){
  footer{ border-top-color: #1f2937; color: #cbd5e1; }
}
.site-footer.footer-light p.legal{ font-size:.6rem; line-height:1.4; color:#888; }


.plumbob { vertical-align: -3px; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


.welcome-panel{
  position:absolute; top:72px; right:4px;
  width:min(360px, calc(100% - 24px));
  background: linear-gradient(180deg, #ffffff, #fafaff);
  border:1px solid #e5e7eb; border-left:4px solid var(--accent);
  border-radius:16px; box-shadow:0 12px 30px rgba(17,24,39,.14);
  padding:16px 16px 14px; text-align:left; z-index:10; display:none;
}
.welcome-panel.show{ display:block; }
.welcome-panel::before{ display:none !important; }
.welcome-panel{ -webkit-backdrop-filter:none; backdrop-filter:none; }
.welcome-panel h3{ margin:0 28px 8px 0; font-size:1.1rem; color:#111; }
.welcome-panel h3::after{
  content:""; display:block; width:36px; height:3px; border-radius:3px; margin-top:6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}
.welcome-panel p{ margin:0 0 10px 0; color:#555; font-size:.95rem; }
.welcome-close{
  position:absolute; top:8px; right:8px; width:28px; height:28px;
  padding:0; border:none; border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color:#fff; display:grid; place-items:center; font-size:16px; font-weight:700; cursor:pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.welcome-close:hover{ filter: brightness(.96); }
.welcome-close:focus-visible{ outline:2px dashed #fff; outline-offset:2px; }

@media (max-width: 640px){
  .welcome-panel{
    position: fixed;                 /* was absolute */
    left: 8px;
    right: 8px;
    bottom: max(12px, env(safe-area-inset-bottom));
    top: auto;                    
    width: auto;
    max-height: 45vh;               
    overflow: auto;                
    z-index: 1050;                  
    animation: welcomeSlideUp .22s ease-out both;
  }
}

@keyframes welcomeSlideUp{
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}



#recentGrid .card a{ position: relative; display:block; }
.badge-new{
  position:absolute; top:8px; left:8px;
  background: var(--accent); color:#fff;
  font-size:.75rem; padding:2px 6px; border-radius:6px;
}


.back-to-top{
  position: fixed; right:16px; bottom:16px; width:44px; height:44px;
  border:none; border-radius:9999px; background:var(--accent); color:#fff;
  font-size:20px; line-height:44px; text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.12); cursor:pointer; z-index:1100;
  opacity:0; transform: translateY(10px); pointer-events:none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show{ opacity:1; transform: translateY(0); pointer-events:auto; }
.back-to-top:hover{ background: var(--accent-strong); }
@media (prefers-reduced-motion: reduce){ .back-to-top{ transition:none; } }



.creator-link{
  all: unset;                        
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .18rem .44rem;            
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  font-weight: 600;
  font-size: .85rem;                 
  line-height: 1;
  cursor: pointer;

 
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.creator-link::before{
  content: "👤";
  font-size: .9em;
  opacity: .7;
  flex: 0 0 auto;
}
.creator-link:hover{
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}
.creator-link:focus-visible{
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  border-radius: 999px;
}


.card p:has(.creator-link){
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  overflow: hidden;                  
}
.card p:has(.creator-link) strong{
  flex: 0 0 auto;                    
}

.card p:has(.creator-link) .creator-link{
  flex: 0 1 auto;                   
  min-width: 0;                    
}

.creator-row{ display:flex; align-items:center; gap:.5rem; white-space:nowrap; overflow:hidden; }
.creator-row strong{ flex:0 0 auto; }
.creator-row .creator-link{ flex:0 1 auto; min-width:0; }



.card .rec-actions{display:flex;gap:.5rem;margin:.5rem 0 .25rem}
.card .rec-btn{font-size:.85rem;padding:.3rem .55rem;border-radius:.5rem;cursor:pointer}
.card .rec-btn.indigo{background:#4f46e5;color:#fff;border:1px solid #4338ca;box-shadow:0 1px 0 rgba(0,0,0,.05)}
.card .rec-btn.indigo:hover{background:#4338ca;border-color:#3730a3}
.card .rec-btn.indigo:active{transform:translateY(1px)}
.card .rec-btn.indigo:focus-visible{outline:2px solid #c7d2fe;outline-offset:2px}
.card .rec-btn.indigo:disabled{background:#a5b4fc;border-color:#818cf8;color:#fff;opacity:.85;cursor:default}

.card > a:first-child{ position: relative; display:block; }
.card .rec-overlay{ position:absolute; inset:0; border-radius:.75rem; }

.card .rec-overlay{
  position:absolute; inset:0; background:rgba(0,0,0,.45);
  display:none; align-items:center; justify-content:center; border-radius:.75rem;
  z-index:50; opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.card .rec-overlay.open{ display:flex; opacity:1; pointer-events:auto; }

.card .rec-ov-panel{
  width:min(720px,92%); max-height:90%;
  background:#111827; color:#fff; border-radius:.75rem; box-shadow:0 15px 45px rgba(0,0,0,.45);
  display:flex; flex-direction:column; overflow:hidden;
}
.card .rec-ov-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:.6rem .8rem; background:rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.card .rec-ov-title{ font-size:.95rem; max-width:80%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card .rec-ov-close{ background:transparent; color:#fff; border:0; font-size:1.1rem; line-height:1; cursor:pointer; }
.card .rec-ov-row{ display:flex; gap:.6rem; overflow:auto; padding:.6rem; background:#0b1220; }
.card .rec-ov-row .rec{ width:140px; flex:0 0 auto; text-decoration:none; color:inherit; display:flex; flex-direction:column; }
.card .rec-ov-row .rec img{ width:140px; height:140px; object-fit:cover; border-radius:.5rem; background:#1f2937; }
.card .rec-ov-row .rec span{
  display:block; font-size:.8rem; margin-top:.35rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.card .rec-ov-empty{ padding:.8rem; color:#cbd5e1; }


.card .cta-row{
  display:flex; align-items:center; justify-content:center; gap:.5rem;
  margin:.5rem 0 .25rem; flex-wrap:nowrap;
}
.card a.download,
.card .find-similar-btn{
  white-space:nowrap; font-size:.85rem; line-height:1; padding:.38rem .70rem; border-radius:.5rem;
}
.card a.download{
  display:inline-block; text-decoration:none; font-weight:700;
  background:#4f46e5; color:#fff; border:1px solid #4338ca; box-shadow:0 1px 0 rgba(0,0,0,.05);
}
.card a.download:hover{ background:#4338ca; border-color:#3730a3; }
.card a.download:focus-visible{ outline:2px solid #c7d2fe; outline-offset:2px; }
.card .find-similar-btn{
  background:#4f46e5; color:#fff; border:1px solid #4338ca; font-weight:700;
}
.card .find-similar-btn:hover{ background:#4338ca; border-color:#3730a3; }
.card .find-similar-btn:focus-visible{ outline:2px solid #c7d2fe; outline-offset:2px; }


#resultsGrid .load-more{
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-block;
  width: auto;
}


#recentGrid > *, #recentGrid .card { min-width: 0; }
#recentGrid .card h3.card-title{
  display:block; max-width:100%; min-width:0;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  line-height:1.2; margin:.5rem 0 .25rem;
}


.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
[data-when] { transition: opacity .15s ease; }

.explore-card { position: relative; }
.vibe-badge {
  position: absolute;
  top: 2px;    
  right: 8px;  
  font-size: 10px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 600;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}


.vibe-badge--new{background:#16a34a}
.vibe-badge--seasonal{background:#eb9f25}

@media (max-width: 480px) {
  .vibe-badge {
    font-size: 9px;
    padding: 2px 5px;
  }
}

/* ---------- From The Edit + Blog Page Grid ---------- */


#recentArticlesStatic,
.blog-grid-container {
  margin: 3rem auto;         
  max-width: 1200px;          
  padding: 0 1rem;
}


#recentArticlesStatic .explore-header,
.blog-grid-container .explore-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* === BLOG PAGE HEADING === */
.blog-heading {
  max-width: 1200px;          
  padding: 0 1rem;            
  margin: 3rem auto 2rem;     
  text-align: center;         
}
.blog-heading h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}
.blog-heading .tagline {
  font-size: 1.1rem;
  color: var(--text-muted, #555);
}


#recentArticlesStatic .article-list,
.blog-grid {
  display: grid;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  #recentArticlesStatic .article-list,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }
}
@media (min-width: 1100px) {
  #recentArticlesStatic .article-list,
  .blog-grid {
    grid-template-columns: repeat(3, minmax(360px, 1fr));
  }
}


#recentArticlesStatic .article-card,
.blog-grid .article-thumb {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
#recentArticlesStatic .article-card:hover,
.blog-grid .article-thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}


#recentArticlesStatic .article-link,
.blog-grid .article-thumb {
  display: block;
  color: inherit;
  text-decoration: none;
}


#recentArticlesStatic .article-link img,
.blog-grid .article-thumb img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  background: #fff;
}


#recentArticlesStatic .article-title,
.blog-grid .article-title {
  margin: .9rem 1.1rem 1.2rem;
  font-size: 1.05rem;
  line-height: 1.35;
  text-align: center;
}
#recentArticlesStatic .article-link:hover .article-title,
.blog-grid .article-thumb:hover .article-title {
  text-decoration: underline;
}

/* ---------- Blog page heading ---------- */
.blog-heading h1 {
  font-size: 3rem;       
  line-height: 1.2;      
  font-weight: 700;     
  margin-bottom: 0.5rem; 
}

.blog-heading .tagline {
  font-size: 1.25rem;    
  color: #555;          
}


/* ---------- Article page layout ---------- */


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


.article-page { padding-top: 1rem; }
.article-header { margin: 2.25rem auto 1rem; text-align: center; }


.article-title {
  font-size: 2.5rem;      
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: .35rem;
}
@media (min-width: 900px) {
  .article-title { font-size: 3rem; }
}
.pub-date {
  color: #666; 
  font-size: 0.95rem;
  margin: 0;
}


.article-hero { margin: 1rem auto 2rem; }
.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;        
  object-fit: contain;     
  background: #fff;         
}

.prose {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-color, #111);
  margin-bottom: 4rem;
}
.prose h2 {
  font-size: 1.6rem;
  line-height: 1.3;
  margin: 2rem 0 .75rem;
}
.prose hr {
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.08);
  margin: 2rem 0;
}
.prose a { color: var(--link-color, #1a73e8); text-decoration: underline; }
.prose p { margin: 0 0 1rem; }


.cc-links {
  margin: .5rem 0 1.5rem 1.25rem;
  padding: 0;
}
.cc-links li { margin: .35rem 0; }


.back-link { margin-top: 2rem; }
.back-link a { text-decoration: none; }
.back-link a:hover { text-decoration: underline; }




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


.article-two-col {
  display: grid;
  gap: 2rem;
}


@media (min-width: 1100px) {
  .article-two-col {
    grid-template-columns: minmax(420px, 520px) 1fr; 
    align-items: start;
  }
}


.article-rail .sticky-hero {
  position: sticky;
  top: 90px;            
}
.article-rail figure {
  margin: 0;
}
.article-rail img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}
.article-caption {
  margin-top: .5rem;
  font-size: .95rem;
  opacity: .8;
  text-align: center;
}


.article-title {
  font-size: clamp(2rem, 2.1vw + 1rem, 2.75rem);
  line-height: 1.15;
  margin: 0 0 .25rem;
  text-align: left;
}
.pub-date { margin: 0 0 1.25rem; opacity: .7; }


.toc-box {
  margin: 1rem 0 1.5rem;
  padding: .9rem 1rem;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
}
.toc-box strong { display:block; margin-bottom:.35rem; }
.toc-box nav { display:flex; flex-wrap:wrap; gap:.5rem .85rem; }
.toc-box a { text-decoration:none; color:var(--link-color,#333); opacity:.9; }
.toc-box a:hover { text-decoration:underline; opacity:1; }


.prose {
  font-size: 1.05rem;
  line-height: 1.7;
}
.prose h2 {
  font-size: clamp(1.3rem, 1.2vw + 1rem, 1.75rem);
  margin: 1.75rem 0 .5rem;
}
.prose hr { border: 0; height: 1px; background: #eee; margin: 1.5rem 0; }
.prose .cc-links { padding-left: 1.25rem; }
.prose .cc-links li { margin: .35rem 0; }


.inline-gallery {
  display:grid; gap:.75rem; margin:1.25rem 0;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px){ .inline-gallery { grid-template-columns: repeat(3, 1fr); } }
.inline-gallery img { width:100%; height:auto; border-radius:10px; }


.article-back { margin-top: 2rem; text-align:center; }



@media (min-width: 1100px) {
  .article-two-col {
   
    min-height: calc(100vh - 90px); 
  }


  .story-pane {
    position: sticky;
    top: 90px;               
    align-self: start;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(0,0,0,.06);
    overflow: hidden;        
  }


  .story-scroll {
    max-height: calc(100vh - 90px);
    overflow: auto;
    padding: 1.25rem 1.25rem 1.5rem;
    scroll-behavior: smooth;
  }
}


@media (max-width: 1099px) {
  .story-pane { position: static; border: none; box-shadow: none; }
  .story-scroll { max-height: none; overflow: visible; padding: 0; }
}


.article-two-col {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr; 
  gap: 2rem;
  align-items: stretch; 
}


.article-two-col .article-body {
  max-height: 100%;     
  overflow-y: auto;     
  padding-right: 1rem;  
  box-sizing: border-box;
}


.cc-gallery {
  display: grid;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 2rem 0;


  grid-template-columns: repeat(2, 1fr);
  
  grid-auto-rows: 1fr; 
}


@media (max-width: 600px) {
  .cc-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}

.cc-gallery li {
  text-align: center;

  display: flex;
  flex-direction: column;
}

.cc-gallery li a {
  flex: 1; 
  display: flex;            
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
  color: inherit;
}

.cc-gallery li a:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.cc-gallery li img {
  display: block;
  width: 100%;
  height: 250px;           
  object-fit: cover;     
}

.cc-gallery li span {
  margin-top: auto;       
  padding: 1rem 0;      
  font-size: 0.9rem;
  color: #444; 
}


.article-back a {
  color: #555;             
  font-size: 1rem;          
  text-decoration: none;     
  border-bottom: 1px solid #ccc; 
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-back a:hover {
  color: #000;             
  border-color: #000;       
}


.story-pane,
.story-pane article,
.story-pane article p,
.story-pane article h1,
.story-pane article h2,
.story-pane article h3,
.story-pane article li,
.article-back a {
  font-family: inherit;   
}


.title-link{
  color: inherit;
  text-decoration: none;
}
.title-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}
.title-link:focus-visible{
  outline: 2px dashed var(--accent, #6366f1);
  outline-offset: 3px;
  border-radius: 4px;
}

.related-posts {
  margin: 32px 0;
}

.related-title {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* three per row */
  gap: 16px;
}

.related-card {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  padding: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
  background: #fff; /* optional: keeps cards clean */
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.related-card img {
  width: 120px;
  height: auto;
  border-radius: 8px;
  flex: 0 0 auto;
}

.related-meta h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.related-meta p {
  margin: 0;
  font-size: .95rem;
  color: #444;
}

@media (max-width: 900px) {
  .related-list {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
  }
}

@media (max-width: 600px) {
  .related-list {
    grid-template-columns: 1fr; /* stack on phones */
  }
}

@media (max-width: 768px) {
  .related-card {
    flex-direction: row;
  }

  .related-card img {
    width: 96px;
  }
}

