/* enpost notifier - minimal, non-intrusive */
#enpost-notifier-mount{
  position: fixed;
  z-index: 99999;
  --enpost-icon-ox: 16px;
  --enpost-icon-oy: 16px;
}

/* default */
#enpost-notifier-mount.enpost-icon-bottom-right{
  right: var(--enpost-icon-ox);
  bottom: var(--enpost-icon-oy);
  left: auto; top: auto;
}

#enpost-notifier-mount.enpost-icon-bottom-left{
  left: var(--enpost-icon-ox);
  bottom: var(--enpost-icon-oy);
  right: auto; top: auto;
}

#enpost-notifier-mount.enpost-icon-top-right{
  right: var(--enpost-icon-ox);
  top: var(--enpost-icon-oy);
  left: auto; bottom: auto;
}

#enpost-notifier-mount.enpost-icon-top-left{
  left: var(--enpost-icon-ox);
  top: var(--enpost-icon-oy);
  right: auto; bottom: auto;
}

#enpost-notifier-btn{
  position:fixed;
  z-index:99999;
  width:56px;
  height:56px;
  border-radius:9999px;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
  background:#111;
  color:#fff;
  font-weight:700;
  letter-spacing:.02em;
  font-size:14px;
}
#enpost-notifier-btn img{ width:28px; height:28px; border-radius:6px; }
#enpost-notifier-badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:9999px;
  background:#e11d48;
  color:#fff;
  font-size:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 16px rgba(0,0,0,.18);
}
#enpost-notifier-panel{
  position:fixed;
  right:16px;
  bottom:84px;
  z-index:99999;
  width:460px;
  max-width:calc(100vw - 32px);
  height:80vh;
  max-height:80vh;
  background:#fff;
  border-radius:16px;
  box-shadow:0 18px 50px rgba(0,0,0,.22);
  overflow:hidden;
  display:none;
  flex-direction:column;
}
#enpost-notifier-panel.is-open{ display:flex; }
#enpost-notifier-header{
  padding:10px 12px;
  border-bottom:1px solid rgba(0,0,0,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
#enpost-notifier-title{ font-weight:700; font-size:14px; }
#enpost-notifier-close{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  padding:6px 8px;
}
#enpost-notifier-list{
  padding:12px;
  overflow:auto;
  flex:1;
  background:#fafafa;
}
.enpost-notifier-item{
  background:#fff;
  border-radius:12px;
  padding:10px 10px;
  margin-bottom:10px;
  border:1px solid rgba(0,0,0,.06);
}
.enpost-notifier-item a{
  text-decoration:none;
  color:inherit;
  display:block;
}
.enpost-notifier-item-title{
  font-weight:700;
  font-size:13px;
  margin-bottom:6px;
}
.enpost-notifier-item-excerpt{
  font-size:12px;
  opacity:.85;
  line-height:1.45;
    white-space: pre-line;
}
#enpost-notifier-footer{
  padding:10px 12px;
  border-top:1px solid rgba(0,0,0,.08);
  display:flex;
  gap:8px;
}
#enpost-notifier-footer a,
#enpost-notifier-footer button{
  flex:1;
  border-radius:10px;
  padding:10px 10px;
  border:1px solid rgba(0,0,0,.1);
  background:#fff;
  cursor:pointer;
  font-weight:700;
}
#enpost-notifier-footer a{
  text-align:center;
}
#enpost-notifier-popup{
  position:fixed;
  right:16px;
  bottom:84px;
  z-index:100000;
  background:#111;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  box-shadow:0 14px 40px rgba(0,0,0,.25);
  display:none;
  max-width:260px;
  font-size:13px;
}
#enpost-notifier-popup.is-show{ display:block; }
@keyframes enpostShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
#enpost-notifier-btn.is-shake{
  animation: enpostShake 0.55s ease-in-out 0s 1;
}
#enpost-notifier-btn,
#enpost-notifier-mount{
  transition: opacity .18s ease, transform .18s ease;
}

/* Smart hide/dim */
body.enpost-modal-open #enpost-notifier-mount{
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease;
}

#enpost-notifier-btn.is-dim{
  opacity: .35;
  transform: scale(.92);
  transition: opacity .15s ease, transform .15s ease;
}

#enpost-notifier-btn.is-dim #enpost-notifier-badge{
  opacity: .55;
}



.enpost-notifier-item{
  display:flex;
  gap:10px;
  padding:10px;
}
.enpost-notifier-thumb{
  width:56px;
  height:56px;
  border-radius:12px;
  overflow:hidden;
  flex:0 0 56px;
  background:#f3f4f6;
}
.enpost-notifier-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.enpost-notifier-body{
  min-width:0;
  flex:1;
}
.enpost-notifier-item-url{
  margin-top:8px;
  font-size:12px;
  opacity:.85;
  word-break:break-all;
}
.enpost-notifier-item-url a{
  text-decoration:underline;
}



/* ===== Panel height & layout ===== */
.enpost-notifier-panel{
  height: 78vh;
  max-height: 78vh;
}
.enpost-notifier-list{
  max-height: calc(78vh - 140px); /* header+footer分ざっくり */
  overflow: auto;
}

/* header を常に見えるように（閉じるボタンが隠れない） */
.enpost-notifier-header{
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
}

/* 閉じるボタン（クラス名が違う場合は、該当ボタンにこのクラスを付けるのが最短） */
.enpost-notifier-close,
.enpost-notifier-header .close,
.enpost-notifier-header button[aria-label="Close"],
.enpost-notifier-header button[aria-label="閉じる"]{
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 40;
}

/* ===== Big media card ===== */
.enpost-notifier-item--big{
  padding: 0;
  overflow: hidden;
}
.enpost-notifier-media{
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
}
.enpost-notifier-media img{
  width: 100%;
  height: 220px;     /* ここを変えると“メイン寄せ”が調整できる */
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.enpost-notifier-item--big .enpost-notifier-body{
  padding: 10px 12px 12px;
}
.enpost-notifier-item--big .enpost-notifier-item-title{
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.enpost-notifier-item--big .enpost-notifier-item-excerpt{
  font-size: 13px;
  opacity: .82;
}
.enpost-notifier-item--big .enpost-notifier-item-url{
  margin-top: 8px;
  font-size: 12px;
  opacity: .8;
  word-break: break-all;
}
.enpost-notifier-item--big .enpost-notifier-item-url a{
  text-decoration: underline;
}

/* ===== Modal (lightbox) ===== */
.enpost-notifier-modal{
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.enpost-notifier-modal--hidden{
  display: none;
}
.enpost-notifier-modal__inner{
  position: relative;
  max-width: 980px;
  width: 100%;
  max-height: 92vh;
}
.enpost-notifier-modal__img{
  width: 100%;
  height: auto;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 14px;
  display: block;
  background: #000;
}
.enpost-notifier-modal__close{
  position: absolute;
  right: -6px;
  top: -6px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.95);
  cursor: pointer;
  font-size: 22px;
  line-height: 36px;
}


/* ===== FIX: big card layout (override old flex rule) ===== */
.enpost-notifier-item--big{
  display: block !important;     /* ← これが崩れの本丸 */
}

.enpost-notifier-item--big .enpost-notifier-body{
  width: 100% !important;
  min-width: 0;
}

.enpost-notifier-item--big .enpost-notifier-item-title,
.enpost-notifier-item--big .enpost-notifier-item-excerpt,
.enpost-notifier-item--big .enpost-notifier-item-url{
  white-space: normal;
  word-break: break-word;
}

/* ついでに、以前の小サムネ用flexが効いても影響しないように */
.enpost-notifier-item--big .enpost-notifier-thumb{
  display: none !important;
}


/* =========================================================
   Enpost Notifier – polish pack (modal + spacing)
   ========================================================= */

/* --- Panel: breathe a bit more --- */
#enpost-notifier-panel{
  border-radius: 20px;
}
#enpost-notifier-list{
  padding: 14px 14px 18px; /* 余白UP */
}
#enpost-notifier-footer{
  padding: 14px;
  gap: 10px;
}
#enpost-notifier-footer a,
#enpost-notifier-footer button{
  border-radius: 14px;
}

/* --- Card spacing --- */
.enpost-notifier-item--big{
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 12px;
}
.enpost-notifier-item--big .enpost-notifier-body{
  padding: 12px 14px 14px;
}
.enpost-notifier-item--big .enpost-notifier-item-title{
  letter-spacing: .01em;
  line-height: 1.35;
}
.enpost-notifier-item--big .enpost-notifier-item-excerpt{
  line-height: 1.5;
  margin-top: 6px;
}
.enpost-notifier-item--big .enpost-notifier-item-url{
  margin-top: 10px;
}

/* --- Big media: 조금 more premium --- */
.enpost-notifier-media{
  border-radius: 18px;
  overflow: hidden;
}
.enpost-notifier-media img{
  height: 240px;             /* ここは好みで 200〜280 */
  border-radius: 18px;
  transform: translateZ(0);
  transition: transform .25s ease, filter .25s ease;
}
.enpost-notifier-media img:hover{
  transform: scale(1.02);
  filter: saturate(1.05);
}

/* =========================================================
   Modal (lightbox) – smooth, premium
   ========================================================= */
.enpost-notifier-modal{
  background: rgba(10, 10, 12, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
  transition: opacity .18s ease;
}
.enpost-notifier-modal--hidden{
  display: flex;             /* hiddenでもレイアウト維持してアニメしやすくする */
  opacity: 0;
  pointer-events: none;
}

/* inner: pop */
.enpost-notifier-modal__inner{
  max-width: 980px;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  transform: translateY(8px) scale(.985);
  transition: transform .18s ease;
}
.enpost-notifier-modal:not(.enpost-notifier-modal--hidden) .enpost-notifier-modal__inner{
  transform: translateY(0) scale(1);
}

/* image: clean */
.enpost-notifier-modal__img{
  border-radius: 20px;
  background: rgba(0,0,0,.35);
  box-shadow:
    0 30px 80px rgba(0,0,0,.35),
    0 8px 22px rgba(0,0,0,.25);
}

/* close button: classy pill */
.enpost-notifier-modal__close{
  right: 10px;
  top: 10px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 22px;
  line-height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
    padding: 0;
}
.enpost-notifier-modal__close:hover{
  transform: scale(1.06);
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.28);
}
.enpost-notifier-modal__close:active{
  transform: scale(.98);
}

/* mobile safe */
@media (max-width: 480px){
  .enpost-notifier-media img{ height: 210px; }
  .enpost-notifier-modal__close{
    width: 40px; height: 40px; line-height: 40px;
  }
}


/* ===== Footer buttons: primary/secondary contrast fix ===== */
#enpost-notifier-footer{
  display: flex;
  gap: 10px;
}

#enpost-notifier-footer a,
#enpost-notifier-footer button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
}

/* Primary: open stream */
#enpost-notifier-footer a{
  background: var(--enpost-accent, #1b57ff);
  color: #fff !important;
  border: 1px solid var(--enpost-accent, #1b57ff);
}

/* Secondary: close */
#enpost-notifier-footer button{
  background: #fff !important;
  color: #111 !important;             /* ← これで白文字問題を確実に止める */
  border: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 10px 25px rgba(0,0,0,.06);
}

/* Hover */
#enpost-notifier-footer a:hover{
  filter: brightness(.98);
}
#enpost-notifier-footer button:hover{
  background: rgba(0,0,0,.03) !important;
}

/* Focus */
#enpost-notifier-footer a:focus,
#enpost-notifier-footer button:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(11,95,255,.25);
}

.enpost-notifier-item-meta{
  margin-top: 10px;
  font-size: 12px;
  opacity: .65;
  line-height: 1.3;
}


.enpost-notifier-item-meta{
  margin-top: 10px;
  font-size: 12px;
  opacity: .72;
  line-height: 1.35;
  display: grid;
  gap: 4px;
}
.enpost-notifier-item-meta .meta-row{
  display: block;
}


/* =========================================================
   Mobile app-like mode (<= 640px)
   ========================================================= */
@media (max-width: 640px){

  /* panel: full screen */
  #enpost-notifier-panel{
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 5vh !important;
    top: 0 !important;

    width: 100% !important;
    height: 95vh !important;
    max-height: 100vh !important;

    margin: 0 !important;
    border-radius: 0 !important;
    transform: translateY(100%);
    transition: transform .22s ease;
    box-shadow: none !important;
    z-index: 99990;
  }
  #enpost-notifier-panel.is-open{
    transform: translateY(0);
  }

  /* header: sticky + compact */
  #enpost-notifier-header{
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 14px 14px 10px !important;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
  }

  /* close button bigger */
  #enpost-notifier-close{
    width: 44px;
    height: 44px;
    border-radius: 999px;
  }

  /* list: reduce outer padding */
  #enpost-notifier-list{
    padding: 12px 12px 110px !important; /* footer分の余白 */
    max-height: none !important;
    overflow: auto !important;
  }

  /* cards: edge-to-edge feel */
  .enpost-notifier-item--big{
    margin-bottom: 14px;
    border-radius: 16px;
  }
  .enpost-notifier-media img{
    height: 210px; /* スマホは少し低く */
  }

  /* footer: fixed bottom bar, big tap targets */
  #enpost-notifier-footer{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 12px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,.06);
  }
  #enpost-notifier-footer a,
  #enpost-notifier-footer button{
    flex: 1;
    height: 52px;
    border-radius: 14px;
    font-size: 16px;
  }

  /* FAB: keep visible, but slightly smaller on mobile */
  #enpost-notifier-btn{
    width: 56px;
    height: 56px;
    border-radius: 999px;
  }

  /* overlay feel: darken background when panel open */
  body.enpost-notifier-open{
    overflow: hidden;
  }
  body.enpost-notifier-open::before{
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.28);
    z-index: 99980;
  }
}


/* Mobile: when panel is open, hide/slide away the FAB (new button) */
@media (max-width: 640px){
  body.enpost-notifier-open #enpost-notifier-btn{
    transform: translateX(120%) !important; /* 右へ退避 */
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform .22s ease, opacity .22s ease;
  }

  /* 通常時の戻り（念のため） */
  #enpost-notifier-btn{
    transition: transform .22s ease, opacity .22s ease;
  }
}


/* iOS safe-area fix for fixed footer */
@media (max-width: 640px){

  /* footer を safe-area 分だけ上げる */
  #enpost-notifier-footer{
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  /* list の下余白も footer+safe-area 分だけ確保 */
  #enpost-notifier-list{
    padding-bottom: calc(130px + env(safe-area-inset-bottom)) !important;
  }

  /* 念のため：panel 自体も safe-area に配慮 */
  #enpost-notifier-panel{
    padding-bottom: env(safe-area-inset-bottom) !important;
  }
}


#enpost-notifier-panel .enpost-notifier-item-excerpt{
  white-space: pre-line;
  line-height: 1.6;
}


/* ========== enpost Notifier: chic card UI (minimal) ========== */

.enpost-notifier {
  font-family: system-ui, -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
}

.enpost-notifier-item,
.enpost-notifier-card,
.enpost-notifier-row {
  background: #fff;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  overflow: hidden;
}

/* cover */
.enpost-notifier-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0,0,0,.03);
}
.enpost-notifier-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* inner */
.enpost-notifier-body,
.enpost-notifier-content {
  padding: 14px 14px 12px;
}

.enpost-notifier-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .02em;
  margin: 0 0 6px;
  color: #111;
}

.enpost-notifier-excerpt {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(0,0,0,.68);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* meta row */
.enpost-notifier-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,.06);
  color: rgba(0,0,0,.55);
  font-size: 12px;
}

.enpost-notifier-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.enpost-notifier-date,
.enpost-notifier-author {
  white-space: nowrap;
}

/* Like button */
.enpost-like-btn,
.enpost-notifier-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(0,0,0,.02);
  color: rgba(0,0,0,.75);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.enpost-like-btn:hover,
.enpost-notifier-like:hover {
  background: rgba(0,0,0,.04);
}
.enpost-like-btn.is-liked,
.enpost-notifier-like.is-liked {
  background: rgba(255, 77, 122, .10);
  border-color: rgba(255, 77, 122, .25);
}

/* URL (subtle) */
.enpost-notifier-url,
.enpost-notifier-link {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(0,0,0,.40);
  text-decoration: none;
  word-break: break-all;
}
.enpost-notifier-url:hover,
.enpost-notifier-link:hover {
  color: rgba(0,0,0,.65);
  text-decoration: underline;
}

/* compact on mobile */
@media (max-width: 480px) {
  .enpost-notifier-item,
  .enpost-notifier-card,
  .enpost-notifier-row {
    border-radius: 14px;
  }
  .enpost-notifier-body,
  .enpost-notifier-content {
    padding: 12px;
  }
  .enpost-notifier-title { font-size: 14px; }
  .enpost-notifier-excerpt { font-size: 12.5px; }
}

body.enpost-modal-open #enpost-notifier{
  display:none !important;
}

#enpost-notifier{
  z-index:9990;
}

#enpost-notifier-panel { z-index: 90000 !important; }

.enpost-notifier-modal{ position:fixed !important; inset:0 !important; z-index:2147483647 !important; }
.enpost-notifier-modal__inner{ position:relative; z-index:2147483647 !important; }
body.enpost-modal-open #enpost-notifier-panel{ display:none !important; }

/* Video must fit inside modal */
.enpost-notifier-modal__video{
  display: block;
  max-width: 100%;
  max-height: 80vh;   /* keep room for close button/header */
  width: auto;
  height: auto;
  object-fit: contain;
}
