/*
 * Visitor Homepage styles
 * Palette focus: clean, editorial, minimal.
 */

:root{
  --vhp-blue: #47a1df;
  --vhp-bg: #f4f7fb;
  --vhp-card: #ffffff;
  --vhp-text: #0f172a;
  --vhp-muted: #5b677a;
  --vhp-line: rgba(15, 23, 42, 0.08);
  /* 圆角克制一点：整体更偏杂志/编辑感 */
  --vhp-radius: 10px;
  --vhp-radius-sm: 8px;
  --vhp-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --vhp-shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
  --vhp-container: 1040px;
  --vhp-slide-basis: 62%;
}

/* Base */
html.vhp-html, body.vhp-body{
  height: 100%;
}

body.vhp-body{
  margin: 0;
  background: var(--vhp-bg);
  color: var(--vhp-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.vhp-app{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.vhp-container{
  width: min(var(--vhp-container), 100%);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.vhp-header{
  background: var(--vhp-blue);
  color: #fff;
}

.vhp-header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 12px;
}

.vhp-logo{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vhp-logo .custom-logo-link{
  display: inline-flex;
  align-items: center;
}

.vhp-logo img.custom-logo{
  max-height: 30px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.06));
}

.vhp-site-title{
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

.vhp-hamburger{
  width: 44px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.95);
  background: transparent;
  border-radius: var(--vhp-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vhp-hamburger:focus-visible{
  outline: 3px solid rgba(255,255,255,0.55);
  outline-offset: 2px;
}

.vhp-hamburger-lines{
  position: relative;
  width: 18px;
  height: 12px;
}

.vhp-hamburger-lines::before,
.vhp-hamburger-lines::after,
.vhp-hamburger-lines{
  display: block;
}

.vhp-hamburger-lines::before,
.vhp-hamburger-lines::after{
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.98);
  border-radius: 2px;
}

.vhp-hamburger-lines{
  background: rgba(255,255,255,0.98);
  height: 2px;
  border-radius: 2px;
}

.vhp-hamburger-lines::before{ top: -5px; }
.vhp-hamburger-lines::after{ top: 5px; }

/* Drawer */
.vhp-drawer-overlay{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 9998;
}

.vhp-drawer{
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(86vw, 360px);
  background: var(--vhp-card);
  z-index: 9999;
  transform: translateX(-106%);
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
  box-shadow: 16px 0 40px rgba(15, 23, 42, 0.22);
}

.vhp-drawer-inner{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.vhp-drawer-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--vhp-blue);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.22);
}

.vhp-drawer-title{
  font-weight: 700;
  letter-spacing: .2px;
}

.vhp-drawer-close{
  width: 36px;
  height: 36px;
  border-radius: var(--vhp-radius-sm);
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.12);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #fff;
}

.vhp-drawer-close:focus-visible{
  outline: 3px solid rgba(255,255,255,0.45);
  outline-offset: 2px;
}

.vhp-drawer-content{
  padding: 12px 14px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Drawer search */
.vhp-drawer-search{
  margin-bottom: 12px;
}

.vhp-search-form{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--vhp-radius-sm);
  background: rgba(71, 161, 223, 0.10);
  border: 1px solid rgba(71, 161, 223, 0.22);
}

.vhp-search-label{
  flex: 1;
  min-width: 0;
}

.vhp-search-field{
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.2;
  color: var(--vhp-text);
  padding: 8px 2px;
}

.vhp-search-field::placeholder{
  color: rgba(15, 23, 42, 0.55);
}

.vhp-search-submit{
  width: 38px;
  height: 38px;
  border-radius: var(--vhp-radius-sm);
  border: 0;
  background: var(--vhp-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(71, 161, 223, 0.22);
}

.vhp-search-submit:focus-visible{
  outline: 3px solid rgba(71, 161, 223, 0.35);
  outline-offset: 2px;
}

.vhp-drawer-custom{
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

/* Open state */
html.vhp-drawer-open .vhp-drawer{
  transform: translateX(0);
}

html.vhp-drawer-open{
  overflow: hidden;
}

/* Main */
.vhp-main{
  flex: 1;
  padding: 14px 0 10px;
}

/* Slider */
.vhp-slider-section{
  padding: 6px 0 4px;
}

.vhp-slider{
  position: relative;
}

.vhp-slider-viewport{
  overflow: hidden;
  padding: 8px 0 2px;
}

.vhp-slider-track{
  display: flex;
  gap: 14px;
  will-change: transform;
  transition: transform 560ms cubic-bezier(.2,.9,.2,1);
  padding: 2px 6px;
}

@media (prefers-reduced-motion: reduce){
  .vhp-slider-track{ transition: none; }
}

.vhp-slide{
  flex: 0 0 var(--vhp-slide-basis);
  max-width: var(--vhp-slide-basis);
}

.vhp-slide-card{
  display: block;
  text-decoration: none;
  color: inherit;
}

.vhp-slide-media{
  aspect-ratio: 16 / 9;
  border-radius: var(--vhp-radius);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.04);
  box-shadow: var(--vhp-shadow);
  border: 1px solid rgba(255,255,255,0.6);
}

.vhp-slide-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

/* Slider UI */
.vhp-slider-ui{
  pointer-events: none;
}

.vhp-slider-nav{
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: var(--vhp-radius-sm);
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(15,23,42,0.18);
  backdrop-filter: blur(5px);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(15,23,42,0.20);
}

.vhp-slider-nav span{
  font-size: 22px;
  line-height: 1;
  margin-top: -1px;
}

.vhp-slider-prev{ left: 8px; }
.vhp-slider-next{ right: 8px; }

.vhp-slider-nav:focus-visible{
  outline: 3px solid rgba(71, 161, 223, 0.55);
  outline-offset: 2px;
}

.vhp-slider-dots{
  pointer-events: auto;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 10px 0 0;
}

.vhp-dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15,23,42,0.25);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.vhp-dot.is-active{
  width: 18px;
  background: rgba(71, 161, 223, 0.95);
}

/* Actions */
.vhp-actions{
  padding: 12px 0 10px;
}

.vhp-actions-row{
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.vhp-action{
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.vhp-action-circle{
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--vhp-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 22px rgba(71, 161, 223, 0.26);
  border: 1px solid rgba(255,255,255,0.35);
}

.vhp-action-icon{
  color: #fff;
  display: inline-flex;
}

.vhp-action-label{
  margin-top: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .2px;
  color: rgba(15, 23, 42, 0.85);
}

.vhp-action:focus-visible{
  outline: 3px solid rgba(71, 161, 223, 0.35);
  outline-offset: 4px;
  border-radius: var(--vhp-radius);
}

/* Posts */
.vhp-posts{
  padding: 10px 0 18px;
}

.vhp-posts-header{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}

.vhp-posts-title{
  margin: 0;
  font-size: 16px;
  letter-spacing: .2px;
}

.vhp-posts-subtitle{
  color: var(--vhp-muted);
  font-size: 12px;
}

.vhp-posts-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vhp-post-card{
  background: var(--vhp-card);
  border-radius: var(--vhp-radius);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--vhp-shadow-sm);
  overflow: hidden;
}

.vhp-post-link{
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.vhp-post-thumb{
  aspect-ratio: 2 / 3;
  background: rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.vhp-post-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
}

.vhp-post-placeholder{
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(15,23,42,0.06), rgba(15,23,42,0.02), rgba(15,23,42,0.06));
  background-size: 200% 100%;
  animation: vhp-shimmer 1.2s infinite;
}

@keyframes vhp-shimmer{
  0%{ background-position: 0 0; }
  100%{ background-position: 200% 0; }
}

.vhp-post-title{
  margin: 0;
  padding: 10px 12px 16px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: .1px;
  word-break: break-word;
}

.vhp-post-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.vhp-post-card{
  transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (prefers-reduced-motion: reduce){
  .vhp-post-card{ transition: none; }
}

.vhp-empty{
  padding: 16px;
  border: 1px dashed rgba(15,23,42,0.15);
  border-radius: var(--vhp-radius);
  color: var(--vhp-muted);
  background: rgba(255,255,255,0.65);
}

/* Footer */
.vhp-footer{
  background: var(--vhp-blue);
  color: rgba(255,255,255,0.95);
  padding: 18px 0 20px;
}

.vhp-footer-inner{
  font-size: 13px;
  line-height: 1.6;
}

.vhp-footer-inner a{
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Mobile: slider full viewport width */
@media (max-width: 767.98px){
  .vhp-slider-section .vhp-container{
    width: 100%;
    padding: 0;
  }

  .vhp-slider-track{
    padding: 2px 16px;
  }
}

/* Larger screens */
@media (min-width: 768px){
  .vhp-header-inner{ height: 60px; padding: 0 18px; }
  .vhp-container{ padding: 0 22px; }
  :root{ --vhp-slide-basis: 56%; }
  .vhp-actions-row{ justify-content: center; gap: 40px; }
  .vhp-action{ flex: 0 0 auto; }
  .vhp-action-circle{ width: 62px; height: 62px; }
  .vhp-posts-title{ font-size: 18px; }
  .vhp-posts-grid{ gap: 16px; }
  .vhp-post-title{ font-size: 14px; }
}

@media (min-width: 1100px){
  :root{ --vhp-slide-basis: 52%; }
  .vhp-slider-prev{ left: 12px; }
  .vhp-slider-next{ right: 12px; }
}


/*
 * v1.1.1 style tweaks (based on real-site feedback)
 * - Tighten header-to-slider spacing
 * - Center the drawer close icon
 * - Make search box pill-shaped, no button, stronger specificity
 * - Enlarge post thumbnails to reduce internal white borders
 */

/* 1) Header bottom -> slider spacing (target: ~4px) */
body.vhp-body .vhp-main{
  padding-top: 4px;
}

body.vhp-body .vhp-slider-section{
  padding-top: 0;
  margin-top: 0;
}

body.vhp-body .vhp-slider-viewport{
  padding-top: 0;
}

body.vhp-body .vhp-slider-track{
  padding-top: 0;
}

@media (max-width: 767.98px){
  body.vhp-body .vhp-slider-track{
    padding-top: 0;
  }
}

/* 2) Drawer close button: perfectly centered "X" */
.vhp-drawer-close{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0; /* hide the raw × character */
  line-height: 0;
}

.vhp-drawer-close::before,
.vhp-drawer-close::after{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.vhp-drawer-close::before{ transform: translate(-50%, -50%) rotate(45deg); }
.vhp-drawer-close::after{  transform: translate(-50%, -50%) rotate(-45deg); }

/* 3) Drawer search: pill, no button, higher priority than theme */
body.vhp-body .vhp-drawer-search{
  margin-bottom: 12px;
}

body.vhp-body form.vhp-search-form{
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 6px 14px !important;
  border-radius: 999px !important;
  background: rgba(15, 23, 42, 0.04) !important;
  border: 1px solid rgba(15, 23, 42, 0.10) !important;
  box-shadow: none !important;
}

body.vhp-body .vhp-search-label{
  flex: 1;
  min-width: 0;
  display: block !important;
}

body.vhp-body input.vhp-search-field{
  width: 100% !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  font-size: 13px !important;
  line-height: 1.2 !important;
  color: rgba(15, 23, 42, 0.92) !important;
  padding: 10px 0 !important;
  margin: 0 !important;
}

body.vhp-body input.vhp-search-field::placeholder{
  color: rgba(15, 23, 42, 0.55) !important;
}

/* If any old template still outputs a button, hide it. */
body.vhp-body .vhp-search-submit{
  display: none !important;
}

/* 4) Post thumbnails: scale up to reduce whitespace inside featured images */
body.vhp-body .vhp-post-img{
  transform: scale(1.2);
  transform-origin: center;
}
