/* ============================================================
   Miro Custom Styles
   - Liquid Frosted Glass Hero Card & Action Buttons
   - Hanging Cat Back-to-Top Widget
   - 2-Column Responsive Post Grid (1-Column on Mobile)
   ============================================================ */

/* --- 1. Hero Cover Liquid Glass & Readability --- */
.focusinfo {
  max-width: 900px !important;
  width: 92%;
}

.miro-hero-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  max-width: 860px;
}

.miro-hero-row .header-tou {
  flex-shrink: 0;
}

.miro-hero-row .header-tou img {
  width: 128px;
  height: 128px;
  border-radius: 50% !important;
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.22), 0 14px 36px rgba(15, 23, 42, 0.28);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.miro-hero-row .header-tou img:hover {
  transform: rotate(360deg) scale(1.05);
  box-shadow: 0 0 0 8px rgba(255, 107, 74, 0.32), 0 18px 42px rgba(15, 23, 42, 0.35);
}

.miro-hero-row .header-info.miro-hero-glass {
  flex: 1;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 22px 26px !important;
  text-align: left;
  box-sizing: border-box;
  overflow: visible !important;
  white-space: normal !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.62) !important;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  color: #1e293b !important;
}

body.dark .miro-hero-row .header-info.miro-hero-glass {
  background: rgba(22, 26, 36, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f1f5f9 !important;
}

/* Welcome Glass Pill + Live Stats */
.miro-welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.miro-welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

body.dark .miro-welcome-pill {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f8fafc;
}

.miro-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  animation: miroPulseDot 2.2s ease-in-out infinite;
}

@keyframes miroPulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.75; }
}

.miro-hero-stats {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  opacity: 0.9;
}

body.dark .miro-hero-stats {
  color: #94a3b8;
}

/* Slogan & Subtitle Readability */
.miro-hero-slogan {
  margin-bottom: 16px;
}

.miro-typing-line {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  color: #0f172a;
  margin-bottom: 4px;
}

.miro-typing-line i {
  font-size: 12px;
  opacity: 0.5;
  margin: 0 5px;
  vertical-align: top;
}

.miro-hero-sub {
  margin: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.55 !important;
  color: #475569 !important;
  white-space: normal !important;
}

body.dark .miro-typing-line {
  color: #f8fafc;
}

body.dark .miro-hero-sub {
  color: #cbd5e1 !important;
}

/* Hero Action Buttons */
.miro-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.miro-hbtn-wrap {
  position: relative;
  display: inline-flex;
}

.miro-hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  font-family: inherit;
}

.miro-hbtn:hover {
  transform: translateY(-2px);
}

.miro-hbtn-primary {
  background: linear-gradient(135deg, #ff6b4a 0%, #ff8c42 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(255, 107, 74, 0.34);
}

.miro-hbtn-primary:hover {
  box-shadow: 0 8px 20px rgba(255, 107, 74, 0.45);
  color: #ffffff !important;
}

.miro-hbtn-github {
  background: #24292f !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 5px 14px rgba(36, 41, 47, 0.28);
}

.miro-hbtn-github:hover {
  background: #1b1f23 !important;
  color: #ffffff !important;
  box-shadow: 0 7px 18px rgba(36, 41, 47, 0.38);
}

.miro-hbtn-glass {
  background: rgba(255, 255, 255, 0.65);
  color: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.miro-hbtn-glass:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a !important;
}

body.dark .miro-hbtn-glass {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.16);
}

body.dark .miro-hbtn-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff !important;
}

/* Popovers for Donate QR & Contact Email */
.miro-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  color: #1e293b;
  text-align: center;
  min-width: 170px;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

body.dark .miro-popover {
  background: rgba(24, 28, 38, 0.95);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
}

.miro-hbtn-wrap:hover .miro-popover,
.miro-hbtn-wrap.open .miro-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.miro-donate-pop img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto 8px;
}

.miro-donate-pop span,
.miro-email-pop span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.miro-email-pop small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.miro-pop-empty {
  white-space: normal !important;
  font-weight: 500 !important;
  color: #64748b;
  line-height: 1.5;
}

/* --- 2. Hanging Cat Back-to-Top Widget --- */
#moblieGoTop,
#changskin {
  display: none !important;
}

#miro-hanging-cat {
  position: fixed;
  top: 0;
  right: 25px;
  z-index: 998;
  width: 70px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  outline: none;
  transform: translateY(-960px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.65s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.35s ease;
  transform-origin: top center;
}

#miro-hanging-cat.miro-cat-visible {
  transform: translateY(min(-40px, calc(82vh - 900px)));
  opacity: 1;
  pointer-events: auto;
}

#miro-hanging-cat.miro-cat-visible .miro-cat-img {
  animation: miroCatSway 3.8s ease-in-out infinite;
  transform-origin: 50% 0%;
}

#miro-hanging-cat:hover {
  transform: translateY(min(-26px, calc(84vh - 900px)));
}

#miro-hanging-cat .miro-cat-img {
  width: 70px;
  height: 900px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.18));
}

.miro-cat-tip {
  position: absolute;
  right: calc(100% + 6px);
  bottom: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  color: #1e293b;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

body.dark .miro-cat-tip {
  background: rgba(30, 35, 48, 0.94);
  color: #f8fafc;
}

#miro-hanging-cat:hover .miro-cat-tip {
  opacity: 1;
  transform: translateX(0);
}

@keyframes miroCatSway {
  0%, 100% { transform: rotate(-2.2deg); }
  50% { transform: rotate(2.2deg); }
}

/* --- 3. Two-Column Post List (Desktop) -> Single-Column (Mobile) --- */
@media (min-width: 769px) {
  body.home .site-content,
  body.blog .site-content,
  body.archive .site-content,
  body.search .site-content {
    max-width: 1080px !important;
  }

  body.home #main.site-main,
  body.blog #main.site-main,
  body.archive #main.site-main,
  body.search #main.site-main {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
  }

  body.home #main.site-main > h1.main-title,
  body.blog #main.site-main > h1.main-title,
  body.archive #main.site-main > h1.main-title,
  body.search #main.site-main > h1.main-title,
  body.home #main.site-main > .archive-header,
  body.archive #main.site-main > .page-header,
  body.search #main.site-main > .page-header,
  #main.site-main > .no-results {
    grid-column: 1 / -1;
    margin-bottom: 6px;
  }

  body.home #main.site-main article.post-list-thumb,
  body.blog #main.site-main article.post-list-thumb,
  body.archive #main.site-main article.post-list-thumb,
  body.search #main.site-main article.post-list-thumb {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 360px;
    margin: 0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  body.dark #main.site-main article.post-list-thumb {
    background: rgba(28, 32, 44, 0.82);
    border-color: rgba(255, 255, 255, 0.1);
  }

  #main.site-main article.post-list-thumb:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  }

  #main.site-main article.post-list-thumb .post-thumb {
    float: none !important;
    width: 100% !important;
    height: 210px !important;
    flex-shrink: 0;
  }

  #main.site-main article.post-list-thumb .post-thumb a {
    height: 100% !important;
    border-radius: 0 !important;
  }

  #main.site-main article.post-list-thumb .post-content-wrap {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    padding: 18px 20px 20px !important;
    margin: 0 !important;
    box-sizing: border-box;
    text-align: left !important;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  #main.site-main article.post-list-thumb .post-content {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  #main.site-main article.post-list-thumb .post-meta,
  #main.site-main article.post-list-thumb .post-date {
    text-align: left !important;
    justify-content: flex-start !important;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .miro-hero-row {
    flex-direction: column;
    gap: 16px;
  }

  .miro-hero-row .header-tou img {
    width: 96px;
    height: 96px;
  }

  .miro-hero-row .header-info.miro-hero-glass {
    width: 100% !important;
    padding: 16px 18px !important;
    text-align: center;
  }

  .miro-welcome-bar,
  .miro-hero-actions {
    justify-content: center;
  }

  #miro-hanging-cat {
    right: 8px;
    width: 56px;
  }

  #miro-hanging-cat .miro-cat-img {
    width: 56px;
    height: 720px;
  }

  #miro-hanging-cat.miro-cat-visible {
    transform: translateY(min(-30px, calc(82vh - 720px)));
  }

  body.home #main.site-main,
  body.blog #main.site-main,
  body.archive #main.site-main,
  body.search #main.site-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
