/* =========================================================
  brand-components.css
  Purpose:
   - Brand content styling (hkdp / brand-mode blocks)
   - Headings, links, lists, media normalization
   - UI components: pills, sns bar, tiles, buttons, line band
  Scope:
   - body.hk-brand (canonical)
   - body.page-template-page-brand-php (compat)
========================================================= */

/* =========================================================
  1) Content scope (HKDP / Brand pages / Circuit Guide)
  + Media normalization (PCでも統一)
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home, .circuit-guide){
  color: var(--text);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .circuit-guide) .hkdp-muted{
  color: var(--muted);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .circuit-guide) :is(p, li, dt, dd){
  color: var(--text);
  line-height: 1.9;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp p{ margin: 0 0 12px; }

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-card p:last-child{
  margin-bottom: 0;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .circuit-guide) a{
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.22);
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .circuit-guide) a:hover{
  color: var(--linkHover);
  border-bottom-color: rgba(255,255,255,.45);
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp ul.hkdp-list{
  list-style: disc;
  padding-left: 1.2em;
  margin: 8px 0 12px;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp ul.hkdp-list li{
  list-style: disc;
  margin: 8px 0;
  line-height: 1.9;
}

/* ---------- Media normalization (Brand hkdp only) ---------- */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp :is(figure, .wp-block-image){
  margin: 12px 0 0;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp :is(img, iframe, video){
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

@media (min-width: 769px){
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-card :is(img, iframe, video){
    width: min(560px, 100%);
    margin: 0;
    margin-top: 0;
    margin-right: auto;
  }

  /* figure が勝手に中央寄せ/余白を持つケースを潰す */
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-card :is(figure, .wp-block-image){
    margin-left: 0;
    margin-right: 0;
  }
}

/* unify “card media” look */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-card :is(img, iframe){
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
}

/* YouTube / Maps etc */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-card iframe{
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 220px;
}

/* kill old floats inside brand (alignleft/rightがPC崩れの原因になりやすい) */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp :is(.alignleft, .alignright){
  float: none !important;
  margin: 12px 0 !important;
}

/* =========================================================
  2) Unified Pills (HKDP + Home)
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) .hkdp-nav{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  row-gap:10px;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn{
  position: relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.16);

  color: rgba(255,255,255,.92);
  text-decoration:none !important;
  border-bottom: 0 !important;

  font-size: 13px;
  letter-spacing: .08em;
  white-space: nowrap;
  opacity: .92;
  overflow:hidden;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn:hover{
  opacity:1;
  background: rgba(255,255,255,.10);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn--primary{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn--primary:hover{
  background: rgba(255,255,255,.16);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:8px;
  height:2px;
  border-radius:999px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.10) 0%,
    rgba(255,255,255,.10) 40%,
    rgba(255,255,255,.85) 50%,
    rgba(255,255,255,.10) 60%,
    rgba(255,255,255,.10) 100%
  );
  background-size:240% 100%;
  background-position:0% 50%;
  opacity:.65;
  pointer-events:none;
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-nav__btn:hover::after{
  animation: pcbGlint 900ms ease-out 1;
  opacity:.95;
}

/* =========================================================
  3) SNS bar
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) .hkdp-snsbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 12px;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-snsbar__link{
  display:inline-flex;
  align-items:center;
  gap:10px;

  height: 42px;
  padding: 0 14px;

  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);

  color: rgba(255,255,255,.92);
  opacity:.92;

  text-decoration: none !important;
  border-bottom: 0 !important;
  white-space: nowrap;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) a.hkdp-snsbar__link:hover{
  opacity:1;
  background: rgba(255,255,255,.10);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) .hkdp-snsbar__icon{
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: currentColor;
  opacity: .95;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .hkdp-home) .hkdp-snsbar__label{
  font-size: 13px;
  letter-spacing: .08em;
  line-height: 1;
}

/* =========================================================
  4) Links tiles
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px){
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px){
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-grid{
    grid-template-columns: 1fr;
  }
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-tile{
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(0,0,0,.65);
  overflow: hidden;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp a.hkdp-tile__link{
  display:block;
  padding: 16px 16px 14px;
  border-bottom:0 !important;
  text-decoration:none !important;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.92);
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp a.hkdp-tile__link:hover{
  background: rgba(255,255,255,.08);
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-tile__k{
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  opacity: .80;
  margin-bottom: 6px;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-tile__t{
  font-size: 15px;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .hkdp-tile__d{
  font-size: 13px;
  line-height: 1.7;
  opacity: .78;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp #links .hkdp-tile:empty{
  display:none !important;
}

/* =========================================================
  5) Heading scale + H2 PCB frame (CONTENT ONLY)
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h1,h2,h3,h4,.wp-block-heading){
  color: var(--h-ink);
  letter-spacing: .04em;
  line-height: 1.2;
  margin: 0 0 12px;
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) h1{
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: .03em;
  margin: 0 0 14px;
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) h2{
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: .06em;
  margin: 26px 0 12px;
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h3, h3.wp-block-heading){
  font-size: clamp(16px, 2.0vw, 22px);
  letter-spacing: .06em;
  margin: 18px 0 10px;
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h4, h4.wp-block-heading){
  font-size: clamp(14px, 1.6vw, 18px);
  letter-spacing: .08em;
  margin: 14px 0 8px;
  opacity: .92;
}

/* H2 frame */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h2, h2.wp-block-heading){
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;

  padding: 10px 54px 10px 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.16);
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h2, h2.wp-block-heading)::before{
  content:"";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 22px;
  height: 2px;
  transform: translateY(-50%);
  background: rgba(255,255,255,.35);
  border-radius: 999px;
}
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h2, h2.wp-block-heading)::after{
  content:"";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 26px;
  height: 10px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle, rgba(255,255,255,.78) 0 3px, transparent 4px) right center / 10px 10px no-repeat,
    linear-gradient(90deg, rgba(255,255,255,.35), rgba(255,255,255,.35)) left center / 14px 2px no-repeat;
  opacity: .9;
}

/* reset parent h4 box */
body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) h4{
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  color: var(--h-ink);
}

@media (max-width: 768px){
  body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h2, h2.wp-block-heading){
    padding-left: 14px;
  }
  body:is(.hk-brand, .page-template-page-brand-php) :is(.hkdp, .brand-mode, .hkdp-home) :is(h2, h2.wp-block-heading)::before{
    left: -14px;
    width: 14px;
  }
}

/* =========================================================
  6) Gutenberg Buttons (Brand Mode unify)
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button .wp-block-button__link{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);

  color: rgba(255,255,255,.92);
  text-decoration: none !important;
  border-bottom: 0 !important;

  font-size: 13px !important;
  letter-spacing: .08em;
  white-space: nowrap;

  opacity: .92;
  overflow: hidden;
  box-shadow: none !important;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button .wp-block-button__link:hover{
  opacity: 1;
  background: rgba(255,255,255,.10);
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button.is-style-fill .wp-block-button__link{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.12);
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button.is-style-fill .wp-block-button__link:hover{
  background: rgba(255,255,255,.16);
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button .wp-block-button__link::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:8px;
  height:2px;
  border-radius:999px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,.10) 0%,
    rgba(255,255,255,.10) 40%,
    rgba(255,255,255,.85) 50%,
    rgba(255,255,255,.10) 60%,
    rgba(255,255,255,.10) 100%
  );
  background-size:240% 100%;
  background-position:0% 50%;
  opacity:.65;
  pointer-events:none;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp .wp-block-button .wp-block-button__link:hover::after{
  animation: pcbGlint 900ms ease-out 1;
  opacity:.95;
}

/* =========================================================
  7) LINE band (drop-in)
========================================================= */
body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband{
  margin: 12px auto 0;
  padding: 0 18px;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__inner{
  max-width: 1040px;
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;

  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(0,0,0,.34);

  min-width: 0;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__text{
  min-width: 0;
  flex: 1 1 auto;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__inner > :not(.hkdp-lineband__btn){
  min-width: 0;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__k{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(255,255,255,.95);
  margin: 0 0 2px;
  opacity: .95;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__t{
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  color: rgba(255,255,255,.82);

  overflow: hidden;
  text-overflow: ellipsis;
}

body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__btn{
  flex: 0 0 auto;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 42px;
  padding: 0 14px;

  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.16);

  color: rgba(255,255,255,.95);
  text-decoration: none !important;
  border-bottom: 0 !important;

  font-size: 13px;
  letter-spacing: .08em;
  white-space: nowrap;
  opacity: .92;

  min-width: 118px;
}
body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__btn:hover{
  opacity: 1;
  background: rgba(255,255,255,.14);
}

@media (max-width: 520px){
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband{ padding: 0 14px; }

  body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__inner{
    flex-direction: column;
    align-items: stretch;
  }
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__btn{
    width: 100%;
    min-width: 0;
  }
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp-lineband__t{
    text-overflow: clip;
  }
}

/* =========================================================
  8) Mobile: hkdp padding tweak
========================================================= */
@media (max-width: 768px){
  body:is(.hk-brand, .page-template-page-brand-php) .hkdp{
    padding-left: 0;
    padding-right: 0;
  }
}

/* =========================
  9) Contact note (Brand)
========================= */
body.hk-brand .hk-contact .hk-contact-note{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: grid;
  gap: 10px;
}

body.hk-brand .hk-contact .hk-contact-note__row{
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

@media (max-width: 640px){
  body.hk-brand .hk-contact .hk-contact-note__row{
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

body.hk-brand .hk-contact .hk-contact-note__k{
  font-size: 12px;
  letter-spacing: .10em;
  opacity: .70;
  text-transform: uppercase;
}

body.hk-brand .hk-contact .hk-contact-note__v{
  font-size: 13px;
  line-height: 1.7;
  opacity: .92;
}