/* =========================================
   KEPCO Widget Styles (Post Page Version)
   ========================================= */
:root {
  --kepco-widget_post-page-red: #e60012;
  --kepco-widget_post-page-gray-bg: #f5f5f5;
  --kepco-widget_post-page-border: #ddd;
  --kepco-widget_post-page-text: #333;
}

/* Container & Reset */
.kepco-widget_post-page-container {
  font-family: "Noto Sans JP", "Yu Gothic", sans-serif;
  box-sizing: border-box;
}

.kepco-widget_post-page-container * {
  box-sizing: border-box;
}

/* ----------------------------------
   Trigger Button (Book Icon)
   ---------------------------------- */
.kepco-widget_post-page-trigger {
  position: fixed;
  right: 0;
  bottom: 114px;
  width: 70px;
  height: 70px;
  background-color: var(--kepco-widget_post-page-red);
  border: none;
  border-radius: 15px 0 0 15px;
  /* box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); */
  cursor: pointer;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 5px;
}

.kepco-widget_post-page-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

/* アテ画像用のスタイル */
.kepco-widget_post-page-trigger-icon-img {
  width: 32px;
  height: auto;
  margin: 6px auto 0;
  display: block;
}

.kepco-widget_post-page-trigger-label {
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  display: block;
}

/* ----------------------------------
   Main Panel (Popup)
   ---------------------------------- */
.kepco-widget_post-page-panel {
  position: fixed;
  right: 56px;
  top: 250px;

  width: 258px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  z-index: 9999;

  /* Initial State: Hidden with Animation Setup */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;

  /* 安全策: コンテンツが長すぎる場合のスクロール処理 */
  max-height: calc(100vh - 200px);
  border-radius: 10px;
}

/* Active State (Open) */
.kepco-widget_post-page-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ----------------------------------
   Close Button
   ---------------------------------- */
.kepco-widget_post-page-close {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 25px;
  height: 25px;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 15px;
  line-height: 30px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kepco-widget_post-page-close:hover {
  background: #444;
}

/* ----------------------------------
   Header & Tabs
   ---------------------------------- */
.kepco-widget_post-page-panel-header {
  background: var(--kepco-widget_post-page-red);
  color: #fff;
  font-weight: bold;
  text-align: center;
  padding: 5px 0;
  font-size: 2rem;
  border-radius: 10px 10px 0 0;
}

.kepco-widget_post-page-panel-tabs {
  display: flex;
  justify-content: space-between;
  padding: 20px 15px 3px 15px;
  background: #fff;
  gap: 5px;
}

.kepco-widget_post-page-tab-btn {
  flex: 1;
  border: none;
  background: #ccc;
  /* Inactive Color */
  color: #fff;
  font-size: 12px;
  padding: 6px 0;
  cursor: pointer;
  margin: 0 2px;
  border-radius: 5px;
  transition: background 0.3s;
  line-height: 1.3;
}

.kepco-widget_post-page-tab-btn:first-child {
  margin-left: 0;
}

.kepco-widget_post-page-tab-btn:last-child {
  margin-right: 0;
}

.kepco-widget_post-page-tab-btn.active {
  background: var(--kepco-widget_post-page-red);
  font-weight: bold;
  /* font-size: 1.3rem; */
}

/* ----------------------------------
   Content Areas
   ---------------------------------- */
.kepco-widget_post-page-content-box {
  display: none;
  /* Hide all by default */
  padding: 0 15px 20px;
  background: #fff;
  border-radius: 0 0 10px 10px;
}

.kepco-widget_post-page-content-box.active {
  display: block;
  /* Show active */
  animation: kepcoFadeIn 0.3s ease;
}

@keyframes kepcoFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kepco-widget_post-page-content-title {
  color: var(--kepco-widget_post-page-red);
  font-size: 2rem;
  text-align: center;
  margin: 10px 0 0;
  border-bottom: 1px solid var(--kepco-widget_post-page-red);
  padding-bottom: 5px;
  display: inline-block;
  width: 100%;
  font-weight: bold;
}

/* List Styles: Common */
.kepco-widget_post-page-text-list,
.kepco-widget_post-page-thumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.kepco-widget_post-page-text-list li,
.kepco-widget_post-page-thumb-list li {
  border-bottom: 1px solid #eee;
  padding: 14px 0;
}

.kepco-widget_post-page-text-list li:last-child,
.kepco-widget_post-page-thumb-list li:last-child {
  border-bottom: none;
}

/* Link Reset */
.kepco-widget_post-page-content-box a {
  text-decoration: none;
  color: var(--kepco-widget_post-page-text);
  display: block;
  transition: opacity 0.2s;
}

.kepco-widget_post-page-content-box a:hover {
  opacity: 0.7;
}

/* Tab 1: Column (Text List) */
.kepco-widget_post-page-text-list li a {
  font-size: 1.5rem;
  line-height: 1.3;
  position: relative;
  padding-right: 15px;
}

.kepco-widget_post-page-text-list li a::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  font-size: 16px;
}

/* Tab 2 & 3: Thumbnail Lists */
.kepco-widget_post-page-thumb-list a {
  display: flex;
  align-items: center;
}

.kepco-widget_post-page-thumb-img {
  width: 80px;
  flex-shrink: 0;
  margin-right: 10px;
}

.kepco-widget_post-page-thumb-img img {
  width: 100%;
  height: auto;
  display: block;
  background: #ddd;
}

.kepco-widget_post-page-thumb-text {
  font-size: 12px;
  line-height: 1.4;
}

/* Company Specific (Tab 2) */
.kepco-widget_post-page-company-label {
  display: block;
  font-size: 10px;
  color: #999;
  margin-bottom: 2px;
}

.kepco-widget_post-page-thumb-list.type-company p {
  margin: 0;
  font-size: 1.4rem;
}

/* Material Specific (Tab 3) */
.kepco-widget_post-page-thumb-list.type-material p {
  margin: 0;
  font-size: 11px;
}

/* Footer Link */
.kepco-widget_post-page-panel-footer {
  margin-top: 10px;
  text-align: left;
}

.kepco-widget_post-page-footer-link {
  color: var(--kepco-widget_post-page-red) !important;
  font-size: 1.6rem;
  font-weight: bold;
  position: relative;
  padding-left: 26px;
  display: inline-block;
  line-height: 1.4;
}

.kepco-widget_post-page-footer-link::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 3px;
  background: var(--kepco-widget_post-page-red);
  color: #fff;
  width: 20px;
  height: 19px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 18px;
  text-align: center;
  font-family: sans-serif;
}

/* ----------------------------------
   Mobile Optimization (Bottom Sheet)
   ---------------------------------- */
@media (max-width: 768px) {
  /* Trigger Adjust */
  .kepco-widget_post-page-trigger {
    right: 0;
    bottom: 110px;
    width: 60px;
    height: 60px;
  }

  /* Panel becomes Bottom Sheet */
  .kepco-widget_post-page-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    /* scrollable if too tall */

    border-radius: 20px 20px 0 0;
    /* Rounded top corners */
    transform: translateY(100%);
    /* Slide from bottom */
    transform-origin: center bottom;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
  }
  .kepco-widget_post-page-content-box {
    padding: 0 15px 50px;
  }
  .kepco-widget_post-page-panel.is-open {
    transform: translateY(0);
  }

  /* Close Button Move inside header for mobile or float better */
  .kepco-widget_post-page-close {
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
  }

  /* Tabs Adjustment for thumb touch */
  .kepco-widget_post-page-tab-btn {
    padding: 10px 0;
    font-size: 13px;
  }

  /* List items slightly bigger for tap */
  .kepco-widget_post-page-text-list li a,
  .kepco-widget_post-page-thumb-text {
    font-size: 13px;
  }
}
