/* BT — Tech Notes page (Essential Addons post grid) as a clean card grid.
   Card order: title → image (fixed 16:9, never huge) → excerpt → author/date + read more. */
body.bt-notes .elementor-widget-eael-post-grid,
body.bt-notes .elementor-widget-eael-post-grid > .elementor-widget-container { max-width: 1180px; margin-inline: auto; }

/* page heading injected by notes.js */
.bt-notes-head { max-width: 1180px; margin: 0 auto; padding: 56px 20px 8px; color: #e6edf6; }
.bt-notes-head .bt-eyebrow { color: #5ec8ff; font-weight: 700; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; }
html[data-bt-lang="fa"] .bt-notes-head .bt-eyebrow, html:not([data-bt-lang]) .bt-notes-head .bt-eyebrow { letter-spacing: 0; }
.bt-notes-head h1 { font-size: clamp(28px, 4vw, 40px) !important; font-weight: 800; margin: 0 0 10px !important; line-height: 1.35; color: #e6edf6 !important; }
.bt-notes-head p { color: #9fb0c9 !important; font-size: 16.5px; line-height: 1.8; margin: 0; max-width: 680px; }

/* grid */
body.bt-notes .eael-post-grid {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 24px !important; height: auto !important; padding: 24px 20px 64px !important; margin: 0 !important;
}
body.bt-notes .eael-post-grid .eael-grid-post.eael-post-grid-column {
  position: static !important; left: auto !important; top: auto !important; transform: none !important;
  width: 100% !important; min-width: 0 !important; max-width: none !important; margin: 0 !important; padding: 0 !important; float: none !important;
  justify-self: stretch !important; transition: none !important; /* the old masonry script animates width/transform */
}
body.bt-notes .eael-grid-post-holder {
  height: 100%; margin: 0 !important; border-radius: 16px !important; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)) !important;
  border: 1px solid rgba(94,200,255,.16) !important; box-shadow: 0 10px 30px rgba(0,0,0,.25) !important;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
body.bt-notes .eael-grid-post-holder:hover {
  transform: translateY(-4px); border-color: rgba(94,200,255,.45) !important;
  box-shadow: 0 18px 44px rgba(0,0,0,.4), 0 0 0 1px rgba(94,200,255,.12) !important;
}

/* reorder: title first, then image */
body.bt-notes .eael-grid-post-holder-inner { display: flex !important; flex-direction: column; height: 100%; padding: 0 !important; }
body.bt-notes .eael-entry-wrapper { display: contents !important; }
body.bt-notes .eael-entry-header { order: 1; padding: 20px 22px 14px !important; margin: 0 !important; }
body.bt-notes .eael-entry-media  { order: 2; margin: 0 22px !important; border-radius: 12px; overflow: hidden; position: relative; }
body.bt-notes .eael-entry-content { order: 3; padding: 14px 22px 0 !important; flex: 1 1 auto; }
body.bt-notes .eael-entry-footer { order: 4; padding: 14px 22px 18px !important; margin: 14px 0 0 !important; border-top: 1px solid rgba(255,255,255,.06); display: flex !important; align-items: center; gap: 10px; }

/* title */
body.bt-notes .eael-entry-title {
  font-size: 19px !important; line-height: 1.55 !important; font-weight: 700 !important; margin: 0 !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body.bt-notes .eael-entry-title a { color: #e6edf6 !important; text-decoration: none !important; transition: color .2s; }
body.bt-notes .eael-grid-post-holder:hover .eael-entry-title a { color: #5ec8ff !important; }

/* image: fixed 16:9 frame, never taller than the card wants */
body.bt-notes .eael-entry-thumbnail { position: relative; aspect-ratio: 16 / 9; height: auto !important; padding: 0 !important; background: #0e1830; }
body.bt-notes .eael-entry-thumbnail img {
  position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important;
  object-fit: cover; object-position: top center; transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
body.bt-notes .eael-grid-post-holder:hover .eael-entry-thumbnail img { transform: scale(1.05); }
body.bt-notes .eael-entry-overlay { border-radius: 12px; background: rgba(11,18,32,.35) !important; }

/* excerpt */
body.bt-notes .eael-grid-post-excerpt p {
  color: #9fb0c9 !important; font-size: 14.5px !important; line-height: 1.85 !important; margin: 0 0 12px !important;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
body.bt-notes .eael-post-elements-readmore-btn {
  display: inline-flex !important; align-items: center; gap: 6px; padding: 7px 16px !important; border-radius: 999px !important;
  background: rgba(94,200,255,.1) !important; color: #5ec8ff !important; border: 1px solid rgba(94,200,255,.3) !important;
  font-size: 13.5px !important; font-weight: 600 !important; text-decoration: none !important; transition: background-color .2s, color .2s;
}
body.bt-notes .eael-post-elements-readmore-btn:hover { background: #2b7cff !important; color: #fff !important; border-color: #2b7cff !important; }

/* footer meta */
body.bt-notes .eael-author-avatar img { width: 30px !important; height: 30px !important; border-radius: 50% !important; border: 1px solid rgba(94,200,255,.35); }
body.bt-notes .eael-entry-meta { display: flex !important; flex-wrap: wrap; gap: 4px 10px; font-size: 13px !important; color: #9fb0c9 !important; }
body.bt-notes .eael-entry-meta a, body.bt-notes .eael-entry-meta time { color: #9fb0c9 !important; text-decoration: none !important; }
body.bt-notes .eael-posted-on::before { content: "•"; margin-inline-end: 8px; opacity: .6; }

/* direction per language (grid order too: newest on the right in Persian) */
html:not([data-bt-lang="en"]) body.bt-notes .eael-post-grid { direction: rtl; }
html[data-bt-lang="en"] body.bt-notes .eael-post-grid { direction: ltr; }
html:not([data-bt-lang="en"]) body.bt-notes .eael-grid-post-holder { direction: rtl; text-align: right; }
html[data-bt-lang="en"] body.bt-notes .eael-grid-post-holder { direction: ltr; text-align: left; }
html:not([data-bt-lang="en"]) .bt-notes-head { direction: rtl; text-align: right; }
html[data-bt-lang="en"] .bt-notes-head { direction: ltr; text-align: left; }

/* the newest post gets a wider "featured" card on large screens */
@media (min-width: 1000px) {
  body.bt-notes .eael-post-grid > .eael-grid-post:first-child { grid-column: span 2; }
  body.bt-notes .eael-post-grid > .eael-grid-post:first-child .eael-entry-title { font-size: 23px !important; }
  body.bt-notes .eael-post-grid > .eael-grid-post:first-child .eael-entry-thumbnail { aspect-ratio: 21 / 9; }
}
@media (max-width: 600px) {
  body.bt-notes .eael-post-grid { grid-template-columns: 1fr !important; padding: 16px 16px 48px !important; gap: 18px !important; }
  .bt-notes-head { padding: 36px 16px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  body.bt-notes .eael-grid-post-holder, body.bt-notes .eael-entry-thumbnail img { transition: none !important; }
}

/* posts without a featured image: no empty frame */
body.bt-notes .eael-entry-media:not(:has(img)) { display: none !important; }
body.bt-notes .eael-author-avatar:empty { display: none; }
