/*!
 * Nettoge Child Theme - Component Bundle
 * Includes:
 *  - Floating heading UI
 *  - Windows 7 tab variant (.is-style-win7)
 *  - 7.css balloon (.is-style-7css-balloon)
 *  - Alert warning box (.is-style-alert-warning)
 */

/* ===== Floating heading UI ===== */
:root {
  --swl-fix_headerH: 60px;
  --swl-adminbarH: 32px;
}

.floating-heading-container {
  display: none;
  position: fixed;
  top: var(--swl-fix_headerH);
  left: 0;
  right: 0;
  background-color: #fff;
  z-index: 998;
  opacity: 0;
  transition: opacity .2s ease, transform .3s ease, height .3s ease;
  transform: translateY(-100%);
  box-sizing: border-box;
  font-family: var(--wp--preset--font-family--system-font, sans-serif);
  isolation: isolate;
  mix-blend-mode: normal;
}

.floating-heading-container.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.floating-heading {
  cursor: pointer;
  transition: opacity .2s ease;
}

#floating-heading-h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.4;
  margin: 0;
  padding: 10px;
  font-weight: 700;
  letter-spacing: .03em;
}

#floating-heading-h2 .fh-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

#floating-heading-h2 .fh-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#floating-heading-h3 {
  line-height: 1.4;
  margin: 0;
  padding: 10px 10px 10px 30px;
  font-weight: 700;
  letter-spacing: .03em;
  border-top: 2px solid currentColor;
}

/* H2が非表示の時はH3の上部ボーダーを消す */
#floating-heading-h2:not(.is-visible) + #floating-heading-h3 {
  border-top: none;
  padding-top: 10px;
}

.floating-heading:hover {
  background-color: rgba(0, 0, 0, .05);
}

.floating-heading.is-visible {
  display: block;
}

.floating-heading:not(.is-visible) {
  display: none;
  opacity: 0;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}

@media (min-width: 960px) {
  .floating-heading-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  #floating-heading-h2 {
    font-size: 1.4em;
  }

  #floating-heading-h3 {
    font-size: 1.2em;
    padding-left: 20px;
  }
}

@media (max-width: 959px) {
  .floating-heading-container {
    left: 0 !important;
    padding-left: 15px;
    padding-right: 15px;
    top: 0 !important;
    background-color: #fff;
  }

  #floating-heading-h2 {
    font-size: 1.2em;
  }

  #floating-heading-h3 {
    font-size: 1.1em;
    padding-left: 20px;
  }
}

/* ===== Windows 7 tab style (.is-style-win7) ===== */
.is-style-win7 {
  --w7-font: 9pt "Segoe UI","SegoeUI","Noto Sans",sans-serif;
  --w7-tab-bg: #fff;
  --w7-el-bg: #f2f2f2;
  --w7-el-bg-s-1: #ebebeb;
  --w7-el-bg-s-2: #cfcfcf;
  --w7-el-bd: #8e8f8f;
  --w7-el-bd-h: #3c7fb1;
  --w7-el-bd-a: #6d91ab;
  --w7-el-bdr: 3px;
  --w7-el-sd: inset 0 0 0 1px #fffc;
  --w7-el-sd-a: inset 1px 1px 0 #0003, inset -1px 1px 0 #0001;
  --w7-el-grad: linear-gradient(var(--w7-el-bg) 45%, var(--w7-el-bg-s-1) 45%, var(--w7-el-bg-s-2));
  --w7-el-grad-h: linear-gradient(#eaf6fd 45%, #bee6fd 0, #a7d9f5);
  --w7-el-grad-a: linear-gradient(#e5f4fc, #c4e5f6 30% 50%, #98d1ef 50%, #68b3db);
  --w7-panel-bw: 1px;
  --w7-panel-bs: 0 0 0 1px #fff9;
  --w7-pad: 14px;
  --w7-pad-t: 14px;
  --w7-pad-r: 14px;
  --w7-pad-b: 14px;
  --w7-pad-l: 14px;
}

.editor-styles-wrapper .is-style-win7 .c-tabList,
.is-style-win7 .c-tabList {
  gap: 0;
  text-indent: 0;
  position: relative;
  margin: 0 0 -3px !important;
  padding-left: 3px !important;
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button[role="tab"],
.is-style-win7 .c-tabList__button[role="tab"] {
  background: var(--w7-el-grad);
  border: 1px solid var(--w7-el-bd);
  border-radius: 0;
  box-shadow: var(--w7-el-sd);
  color: #222;
  font: var(--w7-font);
  min-height: 23px;
  padding: 2px 10px;
  position: relative;
  z-index: 1;
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button[role="tab"]:hover,
.is-style-win7 .c-tabList__button[role="tab"]:hover {
  border-color: var(--w7-el-bd-h);
  background: var(--w7-el-grad-h);
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button[role="tab"]:active,
.is-style-win7 .c-tabList__button[role="tab"]:active {
  border-color: var(--w7-el-bd-a);
  background: var(--w7-el-grad-a);
  box-shadow: var(--w7-el-sd-a);
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button[role="tab"][aria-selected="true"],
.is-style-win7 .c-tabList__button[role="tab"][aria-selected="true"] {
  background: var(--w7-tab-bg);
  border-bottom: 0;
  box-shadow: none;
  margin: -2px 0 1px -3px;
  padding-bottom: 4px;
  z-index: 8;
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button[role="tab"][disabled],
.is-style-win7 .c-tabList__button[role="tab"][disabled] {
  opacity: .6;
}

.editor-styles-wrapper .is-style-win7 > .c-tabBody,
.is-style-win7 > .c-tabBody {
  background: var(--w7-tab-bg);
  border: var(--w7-panel-bw) solid var(--w7-el-bd);
  margin-bottom: 9px;
  padding: var(--w7-pad, 14px);
  position: relative;
  z-index: 2;
  box-shadow: none;
}

.editor-styles-wrapper .is-style-win7 > .c-tabBody:before,
.is-style-win7 > .c-tabBody:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-top: 0;
  pointer-events: none;
}

.editor-styles-wrapper .is-style-win7 > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
.is-style-win7 > .c-tabBody > .c-tabBody__item[aria-hidden="false"] {
  background: var(--w7-tab-bg);
  border: 0;
  padding: var(--w7-pad, 14px);
  position: relative;
  z-index: 2;
  box-shadow: none;
}

.editor-styles-wrapper .is-style-win7[data-win7-pad="each"] > .c-tabBody,
.is-style-win7[data-win7-pad="each"] > .c-tabBody {
  padding: var(--w7-pad-t, 14px) var(--w7-pad-r, 14px) var(--w7-pad-b, 14px) var(--w7-pad-l, 14px);
}

.editor-styles-wrapper .is-style-win7[data-win7-pad="each"] > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
.is-style-win7[data-win7-pad="each"] > .c-tabBody > .c-tabBody__item[aria-hidden="false"] {
  padding: var(--w7-pad-t, 14px) var(--w7-pad-r, 14px) var(--w7-pad-b, 14px) var(--w7-pad-l, 14px);
}

.editor-styles-wrapper .is-style-win7[data-win7-border="off"] > .c-tabBody,
.editor-styles-wrapper .is-style-win7[data-win7-border="off"] > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
.is-style-win7[data-win7-border="off"] > .c-tabBody,
.is-style-win7[data-win7-border="off"] > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
.editor-styles-wrapper [data-win7-border="off"] > .is-style-win7 > .c-tabBody,
.editor-styles-wrapper [data-win7-border="off"] > .is-style-win7 > .c-tabBody > .c-tabBody__item[aria-hidden="false"] {
  border-width: 0;
  box-shadow: none;
}

.editor-styles-wrapper .is-style-win7[data-win7-border="off"] > .c-tabBody:before,
.is-style-win7[data-win7-border="off"] > .c-tabBody:before,
.editor-styles-wrapper [data-win7-border="off"] > .is-style-win7 > .c-tabBody:before {
  border-top: 1px solid var(--w7-el-bd);
}

.editor-styles-wrapper .is-style-win7[data-win7-border="on"] > .c-tabBody:before,
.is-style-win7[data-win7-border="on"] > .c-tabBody:before,
.editor-styles-wrapper [data-win7-border="on"] > .is-style-win7 > .c-tabBody:before {
  border-top-color: transparent;
}

.p-postListTab.is-style-win7 .c-tabList__button[role="tab"] {
  font: var(--w7-font);
}

.p-postListTab.is-style-win7 .c-tabBody {
  background: var(--w7-tab-bg);
}

.is-style-win7 .c-tabList__item {
  margin: 0;
}

.editor-styles-wrapper .is-style-win7 .c-tabList__item.is-active,
.is-style-win7 .c-tabList__item.is-active {
  margin-bottom: 1px;
  position: relative;
  z-index: 8;
}

@keyframes win7TabFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-style-win7 > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
.p-postListTab.is-style-win7 .c-tabBody__item[aria-hidden="false"] {
  animation: win7TabFade .28s ease-out both;
  will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
  .is-style-win7 > .c-tabBody > .c-tabBody__item[aria-hidden="false"],
  .p-postListTab.is-style-win7 .c-tabBody__item[aria-hidden="false"] {
    animation: none;
  }
}

/* Gutenberg preview fallback */
.editor-styles-wrapper .is-style-win7 .c-tabList__button {
  background: var(--w7-el-grad);
  border: 1px solid var(--w7-el-bd);
  border-radius: 0;
  box-shadow: var(--w7-el-sd);
  color: #222;
  font: var(--w7-font);
  min-height: 23px;
  padding: 2px 10px;
  position: relative;
  z-index: 1;
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button:hover {
  border-color: var(--w7-el-bd-h);
  background: var(--w7-el-grad-h);
}

.editor-styles-wrapper .is-style-win7 .c-tabList__button:active {
  border-color: var(--w7-el-bd-a);
  background: var(--w7-el-grad-a);
  box-shadow: var(--w7-el-sd-a);
}

.editor-styles-wrapper .is-style-win7 .c-tabList__item.is-active .c-tabList__button {
  background: var(--w7-tab-bg);
  border-bottom: 0;
  box-shadow: none;
  margin: -2px 0 1px -3px;
  padding-bottom: 4px;
  z-index: 8;
}

/* ===== 7.css Balloon ===== */
.is-style-7css-balloon {
  --w7-el-bdr: 3px;
  --w7-el-bg-s-1: #ebebeb;
  --w7-bl-bd: #0006;
  --w7-blt-size: 18px;
  --w7-blt-offset: 1em;
  background: linear-gradient(to bottom, #fff, var(--w7-el-bg-s-1));
  border: 1px solid var(--w7-bl-bd);
  border-radius: var(--w7-el-bdr);
  box-shadow: 5px 5px 3px -3px var(--w7-bl-bd);
  padding: 1em 1em 1em 2.5em;
  position: relative;
}

.is-style-7css-balloon:before {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.5 1.5v18h18l-18-18Z' fill='%23fff' stroke='%23fff'/%3E%3Cpath d='M1 19.5H.5v-18l18 18H18' stroke='%23939393'/%3E%3C/svg%3E");
  content: "";
  height: var(--w7-blt-size);
  left: var(--w7-blt-offset);
  position: absolute;
  top: calc(var(--w7-blt-size) * -1);
  width: var(--w7-blt-size);
}

.is-style-7css-balloon.is-top:before {
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg width='20' height='20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.5 1.5v18h18l-18-18Z' fill='%23ebebeb' stroke='%23ddd'/%3E%3Cpath d='M1 19.5H.5v-18l18 18H18' stroke='%23939393'/%3E%3C/svg%3E");
  bottom: calc(var(--w7-blt-size) * -1);
  top: unset;
  transform: scale(-1);
}

.is-style-7css-balloon.is-top.is-right:before {
  transform: scaleY(-1);
}

.is-style-7css-balloon.is-left:before {
  left: unset;
  right: var(--w7-blt-offset);
}

.is-style-7css-balloon.is-left.is-bottom:before {
  transform: scaleX(-1);
}

.is-style-7css-balloon.is-left,
.is-style-7css-balloon.is-left.is-bottom {
  padding-right: 2.5em;
}

/* ===== Alert warning box ===== */
.is-style-alert-warning,
.is-style-alert-warning-top {
  --aw-frame: 8px;
  --aw-radius: 10px;
  --aw-inner-border: 3px;
  --aw-stripe-dark: #000;
  --aw-stripe-accent: #f7c600;
  --aw-text: #111;
  --aw-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  --aw-icon-size: 36px;
  box-sizing: border-box;
  position: relative;
  color: var(--aw-text);
  line-height: 1.6;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  border-radius: var(--aw-radius);
  border: var(--aw-frame) solid transparent;
  padding: 14px 16px 14px 60px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(45deg, var(--aw-stripe-dark) 0 12px, var(--aw-stripe-accent) 12px 24px) border-box;
  box-shadow: var(--aw-shadow), inset 0 0 0 var(--aw-inner-border) #111;
}

.is-style-alert-warning::before,
.is-style-alert-warning-top::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--aw-icon-size);
  height: var(--aw-icon-size);
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='warnGrad' x1='0' x2='0' y1='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffd54d'/%3E%3Cstop offset='1' stop-color='%23f7b500'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M28.9 6.9 3.7 51.8A6 6 0 0 0 8.9 61h46.2a6 6 0 0 0 5.2-9.2L35.1 6.9a6 6 0 0 0-6.2 0z' fill='url(%23warnGrad)' stroke='%23111' stroke-width='3' /%3E%3Crect x='30' y='22' width='4' height='18' rx='2' fill='%23111'/%3E%3Ccircle cx='32' cy='46' r='3' fill='%23111'/%3E%3C/svg%3E");
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2));
}

.is-style-alert-warning-top {
  --aw-icon-gap: 10px;
  padding: 14px 16px 14px calc(16px + var(--aw-icon-size) + var(--aw-icon-gap)) !important;
}

.is-style-alert-warning-top::before {
  left: 16px;
  top: 16px;
  transform: none;
}

.is-style-alert-warning-top.has-background {
  padding: 14px 16px 14px calc(16px + var(--aw-icon-size) + var(--aw-icon-gap)) !important;
}

.is-style-alert-warning p:first-child,
.is-style-alert-warning-top p:first-child {
  margin-top: 0;
}

.is-style-alert-warning p:last-child,
.is-style-alert-warning-top p:last-child {
  margin-bottom: 0;
}

