/* ---------------- BLOG PAGE ---------------- */
.blog-header { 
  display:flex; 
  flex-direction:column; 
  align-items:center; 
  justify-content:center;
  text-align:left; 
}
.blog-info { display:flex; align-items:center; gap:28px; margin-bottom:20px; }
.blog-headshot { width:150px; height:150px; border-radius:50%; object-fit:cover; box-shadow:var(--shadow); border:2px solid rgba(255,255,255,.1); }
.blog-buttons { display:flex; flex-direction:column; gap:10px; }

.follow-btn{
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none; 
  color: #fff; 
  font-weight:800; 
  padding:10px 24px; 
  border-radius:12px;
  cursor:pointer; 
  box-shadow:var(--shadow); 
  font-size:18px;
  transition: transform .2s ease, background .3s ease;
}
.follow-btn:hover{ transform: translateY(-2px); opacity:.9 }

/* Blog posts */
.blog-posts { 
  display:flex; 
  flex-direction:column; 
  gap:40px; 
  margin-bottom:40px; 
  width: 100%;
  max-width:none;
}
.blog-post {
  display: flow-root; --post-img-size: 180px;
  padding: 24px; 
  position: relative;
  background: linear-gradient(180deg, rgba(196,75,255,.1), rgba(26,20,63,.8));
  border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.blog-post.left .post-image { float:left; margin: 0 20px 12px 0; }
.blog-post.right .post-image{ float:right; margin: 0 0 12px 20px; }

.post-image {
  width: var(--post-img-size); height: var(--post-img-size);
  object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); flex-shrink: 0; z-index: 2;
}
.post-content { overflow: visible; }
.blog-post::after{ content:""; display:table; clear:both }

@media (max-width:700px){
  .blog-post { padding:18px; --post-img-size: 120px; }
  .post-image{ float:none; display:block; margin:0 auto 12px; }
}
.post-content p { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }
.post-date { 
  font-size: 14px; 
  color: var(--muted); 
  margin-bottom: 6px; }
.post-title { font-size: 22px; font-weight: 800; margin: 0 0 10px; color: var(--text); }

/* --- Make blog post links visible and styled --- */
.blog-post .post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

.blog-post .post-content a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
}

/* Blog post links: visible + underlined */
.blog-post .post-content a,
.blog-post .post-content a:link,
.blog-post .post-content a:visited {
  color: var(--accent) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.blog-post .post-content a:hover,
.blog-post .post-content a:focus {
  color: var(--accent-2) !important;
  text-decoration-color: var(--accent-2);
}

.blog-post .post-content a:hover {
  color: var(--accent-2);
  text-decoration-color: var(--accent-2);
  text-shadow: 0 0 8px var(--accent-2);
}

/* Show more/less buttons */
.blog-controls{ display:flex; justify-content:center; gap:16px; margin-bottom:60px; }
.blog-controls button{
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: none; border-radius: 12px; color: #fff; font-weight: 700; padding: 10px 20px; cursor: pointer; transition: transform .2s ease;
}
.blog-controls button:hover{ transform: translateY(-2px); }


/* ---------------- FOLLOW DRAWER THEME ---------------- */
#followCard{
  right:0; left:auto; width:auto;
  border-left:1px solid rgba(255,255,255,.266);
  background:linear-gradient(180deg, rgba(26,20,63,.96), rgba(14,9,40,.96));
  box-shadow:-12px 0 35px rgba(0,0,0,.45);
  backdrop-filter:blur(16px);
}
.follow-head{
  display:flex; align-items:center; justify-content:center;
  padding:18px 24px; 
  margin:0;
  background:linear-gradient(180deg, rgba(8,7,22,.95), rgba(10,9,28,.85));
  border-bottom:1px solid rgba(255,255,255,.08);
}
.follow-title{ margin:0; padding:7px; font-size:20px; font-weight:900; letter-spacing:.25px; color:var(--text); }

.follow-body{ padding:28px 24px 32px; }
.follow-form{ display:grid; gap:20px; }
.follow-field{ display:grid; gap:8px; }
.follow-label{ font-weight:800; opacity:.9; }
.follow-input{
  width:auto;
  padding:14px 18px;
  font-size:16px; color:var(--text);
  border-radius:14px; border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08);
  transition:border-color .2s ease, background .2s ease;
}
.follow-input::placeholder{ color:rgba(255,255,255,.6); }
.follow-input:focus{ outline:none; border-color:var(--accent); background:rgba(255,255,255,.12); }

.follow-actions{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.follow-btn{
  flex:1; min-width:90px; padding:12px 0; border-radius:12px;
  font-weight:800; font-size:18px; text-align:center; cursor:pointer;
  border:1px solid rgba(255,255,255,.14);
  transition:transform .2s ease, opacity .2s ease, background .3s ease;
}
.follow-btn:hover{ transform:translateY(-1px); opacity:.95; }
.follow-btn:active{ transform:translateY(0); }

.follow-btn-primary{ color:#fff; border-color:rgba(255,255,255,.16); background:linear-gradient(90deg, var(--accent), var(--accent-2)); }
.follow-btn-secondary{ color:#fff; border-color:rgba(255,255,255,.18); background:linear-gradient(180deg, #5aa3ff, #4877ed); }
.follow-btn-tertiary{ color:var(--text); background:rgba(255,255,255,.06); }

.follow-status{
  min-height:20px; font-size:14px; opacity:0;
  transition:opacity .3s ease, background .3s ease, box-shadow .3s ease;
  padding:8px 12px; border-radius:10px; display:inline-block;
}
.follow-status.is-visible{ opacity:1; }
.follow-status.status--success{ color:var(--green); background:rgba(38,194,122,.15); box-shadow:0 0 12px rgba(38,194,122,.25); border:1px solid rgba(38,194,122,.3); }
.follow-status.status--error{ color:var(--red); background:rgba(211,59,83,.15); box-shadow:0 0 12px rgba(211,59,83,.25); border:1px solid rgba(211,59,83,.3); }

/* Make the card contain floats, but let text wrap around the hero */
.blog-post{ display:flow-root; }     /* contain the float */

/* Ensure the inner content DOES NOT create a BFC */
.blog-post .post-content{
  display:block;
  overflow:visible !important;       /* kill any hidden/auto that breaks wrapping */
  contain:none;                      /* just in case */
}

/* Wrap the hero image left/right via the side class on <article> */
.blog-post.left  .post-image{ float:left;  margin:0 20px 12px 0; }
.blog-post.right .post-image{ float:right; margin:0 0 12px 20px; }
.blog-post .post-image{
  width:var(--post-img-size, 180px);
  height:var(--post-img-size, 180px);
  object-fit:cover;
  border-radius:14px;
  display:block;
}

/* Long strings should never blow out of the card */
.blog-post .post-title,
.blog-post .post-content p{
  overflow-wrap:anywhere;
  word-break:break-word;
  hyphens:auto;
}

/* --- BLOG GALLERY PREVIEW (drop-in, non-invasive) --- */
.post-gallery{
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.post-gallery.hidden{ display:none; } /* if you want to force-hide a gallery */

.post-gallery .thumb{
  position: relative;
  aspect-ratio: 1 / 1;       /* perfect squares */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  background: rgba(255,255,255,.04);
}
.post-gallery .thumb img{
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .25s ease, filter .25s ease;
}
.post-gallery .thumb:hover img{ transform: scale(1.04); filter: saturate(110%); }

/* Optional “+N” overlay for last thumb */
.post-gallery .thumb.more::after{
  content: attr(data-more); /* e.g., "+3" */
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(10,9,28,.55);
  backdrop-filter: blur(2px);
  color: #fff; font-weight: 900; font-size: 22px;
  letter-spacing: .4px;
}

/* Mobile: show 2 columns so thumbs stay legible */
@media (max-width:700px){
  .post-gallery{ grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
}

/* ---------------- GALLERY COLLAGE ---------------- */

/* --- Collage: tight 2×2, no extra interior spacing --- */
.post-gallery.collage{
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 4px;                 /* tweak if you want tighter/looser */
  width: 250px;
  height: 250px;
  margin: 16px auto 0;
  clear: both;

  /* keep your box styling */
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
  background: rgba(255,255,255,.04);
  cursor: pointer;
}
/* reset any inherited spacing from older styles */
.post-gallery.collage .thumb{
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;      /* important in case prior rules add borders */
  border-radius: 10px;       /* inner corners */
  overflow: hidden;
}

/* images fill their cell exactly */
.post-gallery.collage .thumb img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-gallery.collage:hover .thumb img{ transform:scale(1.02); filter:saturate(108%); }



/* +N overlay full-block, perfectly centered, always on top */
.post-gallery.collage .thumb.more::after,
.post-gallery.collage .more-badge{
  content: attr(data-more);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 9, 28, .55);
  backdrop-filter: blur(3px);
  color: #fff; font-weight: 900; font-size: 32px; letter-spacing: .5px;
  text-align: center;
  z-index: 3;
  border-radius: 14px;
}


.post-gallery.collage:hover .thumb.more::after,
.post-gallery.collage:hover .more-badge {
  background: rgba(10,9,28,.7);
  font-size: 34px;
}

/* Lightbox modal */
.gallery-modal{ 
  position:fixed; 
  inset:0; 
  z-index:10020; 
  background: rgba(11, 9, 32, 0.7);
  backdrop-filter: blur(10px);
  display:none; 
  align-items: center;
  justify-content: center;
}

.gallery-modal.is-open{ display:block; }
.gallery-modal__overlay{ position:absolute; inset:0; }
.gallery-modal__frame{
  position:absolute; 
  top:8%;
  bottom: 8%;
  left: var(--gutter);
  right: var(--gutter);
  max-width:calc(var(--maxw) + 2*var(--inner-pad-x));
  margin:auto;
  display:grid;
  grid-template-areas:"close close close" "prev img next" "cap cap cap";
  grid-template-columns:60px 1fr 60px;
  grid-template-rows:auto 1fr auto;
  gap:12px;
  border:1px solid rgba(255,255,255,.1);
  background:linear-gradient(180deg,rgba(26,20,63,.96),rgba(14,9,40,.96));
  border-radius:16px; box-shadow:0 30px 80px rgba(0,0,0,.55);
  overflow:hidden;
}
.gallery-modal__close{
  grid-area:close; justify-self:end; margin:10px;
  width:40px; height:40px; border-radius:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.08); color:#fff;
  font-size:18px; cursor:pointer;
}
.gallery-modal__img {
  max-width: auto;
  max-height: 500px; /* image height scales with screen */
  object-fit: contain;
  margin-top: 0;
  align-self: center;
}
.gallery-modal__caption{ 
  grid-area:cap; 
  text-align:center; 
  color:var(--muted); 
  padding:6px 0 12px; 
  font-weight:700; 
}
.gallery-model__caption.is-visible { opacity:1;}
.gallery-modal__arrow{
  align-self:center; width:46px; height:46px; border-radius:50%;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.25); color:#fff;
  font-size:26px; cursor:pointer; backdrop-filter:blur(6px);
}
.gallery-modal__arrow.prev{ grid-area:prev; justify-self:center; }
.gallery-modal__arrow.next{ grid-area:next; justify-self:center; }

@media (max-width:700px){
  .gallery-modal__frame{
    inset:6% max(2%,8px) 6% max(2%,8px);
    grid-template-columns:48px 1fr 48px;
  }
  .gallery-modal__arrow{ width:42px; height:42px; font-size:22px; }
}

/* meta row holds counter + blurb (grid-area: cap already in your frame) */
.gallery-modal__meta{
  grid-area: cap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 8px 12px;
}

.gallery-modal__blurb {
  margin-top: 16px;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
  max-width: 90%;
  line-height: 1.5;
  padding: 8px 14px;
  flex-shrink: 0;
}

.gallery-modal__counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: var(--muted);
  opacity: 0.9;
  font-size: 18px;
}

/* Lightbox modal (adjusted layout) */
.gallery-modal__image-wrap {
  grid-area: img;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* image sticks to top */
  height: 100%;
  position: relative;
  overflow: hidden;
}