/* ============================================
   EDITOR CONTENT STYLES
   .ph-entry-content でスコープ
   page.php / single.php のみに適用
============================================ */

.ph-entry-content {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ===== HEADINGS ===== */
.ph-entry-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin: 64px 0 24px;
  padding: 16px 0 16px 20px;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--brand), var(--cyan)) 1;
  background: linear-gradient(90deg, rgba(22,111,186,0.04), transparent 60%);
  line-height: 1.5;
}

.ph-entry-content h2:first-child { margin-top: 0; }

.ph-entry-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  position: relative;
  line-height: 1.5;
}

.ph-entry-content h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
}

.ph-entry-content h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin: 40px 0 12px;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
  line-height: 1.5;
}

.ph-entry-content h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  margin: 32px 0 10px;
  line-height: 1.5;
}

.ph-entry-content h6 {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  margin: 28px 0 8px;
  line-height: 1.5;
}

/* ===== PARAGRAPH ===== */
.ph-entry-content p {
  margin-bottom: 1.6em;
}

.ph-entry-content > *:last-child {
  margin-bottom: 0;
}

/* ===== LINKS ===== */
.ph-entry-content a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(22,111,186,0.3);
  text-underline-offset: 3px;
  transition: color 0.3s, text-decoration-color 0.3s;
}

.ph-entry-content a:hover {
  color: var(--cyan);
  text-decoration-color: var(--cyan);
}

/* ===== LISTS ===== */
.ph-entry-content ul {
  margin: 0 0 1.6em;
  padding: 0;
  list-style: none;
}

.ph-entry-content ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 0.6em;
}

.ph-entry-content ul li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.75em;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  border-radius: 2px;
  transform: rotate(45deg);
}

/* Nested UL */
.ph-entry-content ul ul {
  margin: 0.5em 0 0.5em;
}

.ph-entry-content ul ul li::before {
  background: none;
  border: 1.5px solid var(--brand);
  width: 6px;
  height: 6px;
}

.ph-entry-content ol:not(.ph-toc__list) {
  margin: 0 0 1.6em;
  padding: 0;
  list-style: none;
  counter-reset: ol-counter;
}

.ph-entry-content ol:not(.ph-toc__list) > li {
  position: relative;
  padding-left: 36px;
  margin-bottom: 0.6em;
  counter-increment: ol-counter;
}

.ph-entry-content ol:not(.ph-toc__list) > li::before {
  content: counter(ol-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--fn-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

/* Nested OL */
.ph-entry-content ol:not(.ph-toc__list) ol {
  margin: 0.5em 0 0.5em;
  counter-reset: ol-counter;
}

/* ===== BLOCKQUOTE ===== */
.ph-entry-content blockquote,
.ph-entry-content .wp-block-quote {
  margin: 2em 0;
  padding: 28px 32px 28px 28px;
  background: var(--off);
  border: none;
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, var(--brand), var(--cyan)) 1;
  position: relative;
  font-style: normal;
}

.ph-entry-content blockquote::before,
.ph-entry-content .wp-block-quote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 20px;
  font-family: var(--fn-display);
  font-size: 60px;
  font-weight: 700;
  color: rgba(22,111,186,0.1);
  line-height: 1;
}

.ph-entry-content blockquote p:last-child,
.ph-entry-content .wp-block-quote p:last-child {
  margin-bottom: 0;
}

.ph-entry-content blockquote cite,
.ph-entry-content .wp-block-quote cite,
.ph-entry-content .wp-block-quote__citation {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-style: normal;
  color: #64748b;
}

/* Pullquote */
.ph-entry-content .wp-block-pullquote {
  margin: 2.5em 0;
  padding: 40px 32px;
  border-top: 3px solid var(--brand);
  border-bottom: 3px solid var(--brand);
  text-align: center;
  background: none;
}

.ph-entry-content .wp-block-pullquote blockquote {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-image: none;
}

.ph-entry-content .wp-block-pullquote blockquote::before { display: none; }

.ph-entry-content .wp-block-pullquote p {
  font-size: 20px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.7;
}

/* ===== TABLE ===== */
.ph-entry-content table,
.ph-entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  font-size: 14px;
  line-height: 1.7;
}

.ph-entry-content th,
.ph-entry-content .wp-block-table th {
  padding: 14px 18px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.1);
}

.ph-entry-content td,
.ph-entry-content .wp-block-table td {
  padding: 14px 18px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  background: #fff;
}

.ph-entry-content tr:nth-child(even) td,
.ph-entry-content .wp-block-table tr:nth-child(even) td {
  background: var(--off);
}

/* Striped variant */
.ph-entry-content .wp-block-table.is-style-stripes td {
  border-left: none;
  border-right: none;
}

/* ===== IMAGES / FIGURE ===== */
.ph-entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.ph-entry-content figure {
  margin: 2em 0;
}

.ph-entry-content figcaption,
.ph-entry-content .wp-element-caption {
  margin-top: 10px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
  line-height: 1.6;
}

/* Wide / Full alignment */
.ph-entry-content .alignwide {
  margin-left: -40px;
  margin-right: -40px;
  max-width: calc(100% + 80px);
  width: calc(100% + 80px);
}

.ph-entry-content .alignfull {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}

.ph-entry-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.ph-entry-content .alignleft {
  float: left;
  margin-right: 2em;
  margin-bottom: 1em;
}

.ph-entry-content .alignright {
  float: right;
  margin-left: 2em;
  margin-bottom: 1em;
}

/* ===== BUTTONS ===== */
.ph-entry-content .wp-block-button {
  margin-bottom: 1.6em;
}

.ph-entry-content .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 36px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Noto Sans JP", sans-serif;
  border-radius: 40px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
}

/* Default (Fill) */
.ph-entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff;
}

.ph-entry-content .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(22,111,186,0.35);
  text-decoration: none;
  color: #fff;
}

/* Outline */
.ph-entry-content .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.ph-entry-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  text-decoration: none;
}

/* Buttons container */
.ph-entry-content .wp-block-buttons {
  margin-bottom: 1.6em;
}

/* ===== SEPARATOR ===== */
.ph-entry-content .wp-block-separator,
.ph-entry-content hr {
  margin: 3em 0;
  border: none;
  height: 1px;
  background: var(--border);
}

.ph-entry-content .wp-block-separator.is-style-wide {
  background: var(--border);
}

.ph-entry-content .wp-block-separator.is-style-dots {
  background: none;
  text-align: center;
}

.ph-entry-content .wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
  width: 60px;
  margin-left: auto;
  margin-right: auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--cyan));
  border-radius: 2px;
}

/* ===== COLUMNS ===== */
.ph-entry-content .wp-block-columns {
  margin-bottom: 2em;
  gap: 32px;
}

.ph-entry-content .wp-block-column {
  margin-bottom: 0;
}

/* ===== GROUP ===== */
.ph-entry-content .wp-block-group {
  margin-bottom: 2em;
}

.ph-entry-content .wp-block-group.has-background {
  padding: 32px;
  border-radius: 0;
}

/* ===== CODE / PREFORMATTED ===== */
.ph-entry-content pre,
.ph-entry-content .wp-block-code {
  margin: 2em 0;
  padding: 24px 28px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0;
}

.ph-entry-content code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.88em;
  padding: 2px 8px;
  background: rgba(22,111,186,0.06);
  color: var(--brand);
  border-radius: 3px;
}

.ph-entry-content pre code,
.ph-entry-content .wp-block-code code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

/* ===== COVER ===== */
.ph-entry-content .wp-block-cover {
  margin: 2em 0;
  min-height: 320px;
}

/* ===== GALLERY ===== */
.ph-entry-content .wp-block-gallery {
  margin: 2em 0;
}

.ph-entry-content .wp-block-gallery .wp-block-image {
  margin: 0;
}

/* ===== DETAILS (accordion) ===== */
.ph-entry-content details {
  margin-bottom: 1em;
  border: 1px solid var(--border);
  background: #fff;
}

.ph-entry-content details summary {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--heading);
  cursor: pointer;
  background: var(--off);
  transition: background 0.3s;
}

.ph-entry-content details summary:hover {
  background: rgba(22,111,186,0.04);
}

.ph-entry-content details[open] summary {
  border-bottom: 1px solid var(--border);
}

.ph-entry-content details > *:not(summary) {
  padding: 0 20px;
}

/* ===== EMBED / VIDEO ===== */
.ph-entry-content .wp-block-embed {
  margin: 2em 0;
}

.ph-entry-content .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.ph-entry-content .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ===== SINGLE POST META ===== */
.ph-single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
}

.ph-single-meta__cats a {
  color: var(--elec);
  font-size: 13px;
}

.ph-single-thumb {
  margin: 0 0 2.5em;
}

.ph-single-thumb img {
  width: 100%;
  height: auto;
}

/* ===== SINGLE POST NAV ===== */
.ph-single-nav {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.ph-single-nav__inner {
  display: flex;
  gap: 20px;
}

.ph-single-nav__item {
  flex: 1;
  padding: 20px;
  background: var(--off);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s;
}

.ph-single-nav__item:hover {
  background: #fff;
  border-color: var(--brand);
  text-decoration: none;
}

.ph-single-nav__item--next {
  text-align: right;
}

.ph-single-nav__label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.ph-single-nav__title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1023px) {
  .ph-entry-content .alignwide {
    margin-left: -20px;
    margin-right: -20px;
    max-width: calc(100% + 40px);
    width: calc(100% + 40px);
  }
}

@media (max-width: 767px) {
  .ph-entry-content {
    font-size: 14px;
  }

  .ph-entry-content h2 {
    font-size: 20px;
    margin-top: 48px;
    padding: 14px 0 14px 16px;
  }

  .ph-entry-content h3 {
    font-size: 18px;
    margin-top: 36px;
  }

  .ph-entry-content h4 {
    font-size: 16px;
  }

  .ph-entry-content .alignwide {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
  }

  .ph-entry-content .alignleft,
  .ph-entry-content .alignright {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }

  .ph-entry-content .wp-block-columns {
    flex-direction: column;
    gap: 20px;
  }

  .ph-entry-content .wp-block-pullquote p {
    font-size: 17px;
  }

  .ph-single-nav__inner {
    flex-direction: column;
  }

  .ph-single-nav__item--next {
    text-align: left;
  }
}
