/* Island v2: one band on top, one above the buttons, the middle of the island left open. Same in 2D and 3D.
   Service: SWELL's slider on top, the service guide below. Blog / illustration / About: guide on top, cards below. */
/* Top runs island -> footer. The old slider and body come back only for old links (island-legacy.js sets data-ph-top=legacy);
   the secret corner (.bh-alt-only) keeps working in the two-colour mode. */
/* Only the slider at its home spot below the island; the service stop borrows it into the deck. */
html[data-ph-top=island] #ph-island~#post_slider,html[data-ph-top=island] #content .w-frontBottom{display:none}
html[data-ph-top=island] #content .post_content>:not(.bh-alt-only){display:none}
html[data-ph-top=island]:not([data-bh-alt]) #content{display:none}

#ph-island .stage{--ph-ink:#211e28;--ph-line:#413659}
#ph-island #poster{transform-origin:0 0;transition:transform .6s cubic-bezier(.3,.7,.2,1)}
/* The 3D canvas fades in over the poster (the overview lands on the same pixels); the poster leaves once covered. */
#ph-island #scene{opacity:0;transition:opacity .35s ease-out}
#ph-island #scene[data-shown]{opacity:1}
#ph-island .ph-hud{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;gap:8px;padding:var(--island-header-clearance,10px) 2% calc(8px + var(--island-bottom-clip,0px));pointer-events:none}
/* The buttons stay at the bottom also when the top band is empty (overview). */
#ph-island .ph-bottom{display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;margin-top:auto}
/* Overview: the picture is the lead. Only a quiet cue that scrolling walks the island (one screen per stop). */
#ph-island .stage[data-stop=overview][data-scroll=true] .ph-bottom::before{content:"スクロールで島をめぐる ↓" / "";font-size:.78rem;letter-spacing:.08em;color:var(--ph-ink);text-shadow:0 0 3px #fff,0 0 3px #fff}
#ph-island .stage[data-stop=overview]:not([data-fallback]):not([data-mode=loading]) #info{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#ph-island #guide,#ph-island #deck,#ph-island #controls>*{pointer-events:auto}

/* Guide: text on the page colour with the theme's radius, as the card band (no own frame, shadow or paper tone). */
#ph-island #guide{max-width:min(94%,760px);background:var(--color_bg,#fff);color:var(--color_text,#333);border-radius:var(--swl-radius--4,4px);padding:.4rem .7rem;text-align:center;font-size:.85rem;line-height:1.4}
#ph-island #guide strong{display:block;font-size:.9rem}
#ph-island #guide strong a{display:inline-block;padding:.15em .3em}
#ph-island #guide nav{display:flex;flex-wrap:wrap;justify-content:center;gap:0 .15em;margin-top:.1rem}
#ph-island #guide nav a{display:inline-block;padding:.3em .5em;font-size:.8rem}

/* Bottom band. The cards inside are the theme's own (.ph-native-slot is outside the island's scoped styles), drawn by
   SWELL and the child theme: frame, category label, title, thumb ratio and spacing as on the old top. The band is only
   the page background colour behind them: no panel border, no shadow, no blur or glow. */
#ph-island #deck{box-sizing:border-box;width:min(96%,820px);background:var(--color_bg,#fff);color:var(--color_text,#333);border-radius:var(--swl-radius--4,4px);padding:8px 8px 0}
#ph-island #deck:not([data-kind=service]){width:min(96%,600px)}
#ph-island #deck:not([data-state=ok]){display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:.2rem .8rem;font-size:.8rem;width:auto;max-width:96%;padding:4px 8px}
#ph-island #deck[hidden]{display:none}
#ph-island .ph-deck__note{margin:.2rem .3rem}
#ph-island .ph-deck__retry{padding:.3em .8em;font-size:.78rem}

/* Service: SWELL's #post_slider as is (its Swiper settings, dots, swiping, 3.3 s / 2.5 s). */
#ph-island .ph-strip #post_slider{margin:0}
/* On top, under the header: the band stays low (thumbs keep the theme's ratio; the band is narrowed instead, titles
   stop at two lines). */
#ph-island #deck[data-at=top]{padding:6px 8px 0}
#ph-island #deck[data-at=top][data-state=ok]{width:min(96%,720px)}
#ph-island #deck[data-at=top] .p-postList__title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* No Swiper (theme script not loaded): a plain sideways row, five / two in view as the theme's setting. */
#ph-island #deck[data-swiper=off] .swiper-wrapper{display:flex;overflow-x:auto;scroll-snap-type:x mandatory}
#ph-island #deck[data-swiper=off] .swiper-slide{flex:0 0 20%;scroll-snap-align:start}

/* Blog / illustration: SWELL's card list, in one row (three in view, the rest sideways). */
#ph-island #deck .p-postList.-type-card{display:flex;flex-wrap:nowrap;margin:0;padding:0;list-style:none;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:thin}
#ph-island #deck .-type-card>.p-postList__item{flex:0 0 33.333%;width:auto;max-width:none;margin-bottom:8px;scroll-snap-align:start}

#ph-island #controls{position:static;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 8px;pointer-events:none;max-width:98%}
#ph-island #controls p{order:-1;flex-basis:100%;margin:0;font-size:.78rem;text-shadow:0 0 3px #fff,0 0 3px #fff}
#ph-island #stopLinks{gap:.35em}
#ph-island #stopLinks button,#ph-island #stopLinks .link,#ph-island .mode-bar button{font-size:.8rem;padding:.38em .75em}
#ph-island #stopLinks [aria-current=true]{background:var(--ph-line);color:#fff}
#ph-island .mode-bar{position:static;display:flex;gap:.35em}
#ph-island #mode{font-weight:700}

/* Shortish screens: the bands stay at the theme's size but a little narrower, the island's middle open. */
@media(max-height:700px){#ph-island #deck[data-state=ok]{width:min(96%,560px)}#ph-island #deck[data-at=top][data-state=ok]{width:min(96%,680px)}#ph-island #guide{padding:.25rem .6rem}}
@media(max-width:959px){#ph-island #deck[data-swiper=off] .swiper-slide{flex-basis:50%}}
/* Phones upright: the bands use the full width (the theme's two cards in view at a readable size) and the text keeps
   the theme's size; only the padding tightens. */
@media(max-width:600px){
  #ph-island #deck{padding:6px 6px 0}
  #ph-island #deck[data-at=top][data-state=ok]{width:96%}
  #ph-island #deck .-type-card>.p-postList__item{flex-basis:46%}
  #ph-island #guide nav a{padding:.25em .4em}
  #ph-island #stopLinks button,#ph-island #stopLinks .link,#ph-island .mode-bar button{padding:.35em .6em}
}

/* Wide but short screens (short Chrome windows such as 1440x480, phones turned sideways such as 844x390): squeezing the
   bands over the island would leave neither readable. While a stop shows a band, the bands stand in a column beside
   the island instead, in the same order (top band first), at the theme's size; the island and the buttons keep the
   rest. island-v2.js reads the column's edge so the poster and the 3D view centre the island in what is left. */
@media(orientation:landscape) and (max-height:640px) and (min-aspect-ratio:3/2){
  #ph-island .ph-hud:has(#guide:not([hidden])),#ph-island .ph-hud:has(#deck:not([hidden])){
    display:grid;grid-template-columns:minmax(0,1fr) clamp(300px,46%,700px);grid-template-rows:auto minmax(0,1fr) auto;
    gap:8px 12px;align-items:start;justify-items:stretch;padding-left:max(1.5%,env(safe-area-inset-left));padding-right:max(1.5%,env(safe-area-inset-right))}
  #ph-island .ph-hud:has(#deck[data-kind=service]:not([hidden])){grid-template-columns:minmax(0,1fr) clamp(320px,56%,820px)}
  #ph-island .ph-hud:has(#guide:not([hidden])) .ph-bottom,#ph-island .ph-hud:has(#deck:not([hidden])) .ph-bottom{display:contents}
  #ph-island .ph-hud>#guide,#ph-island .ph-hud>#deck{grid-column:2;grid-row:1}
  #ph-island .ph-bottom>#guide,#ph-island .ph-bottom>#deck{grid-column:2;grid-row:2;max-height:100%;overflow:auto}
  #ph-island .ph-hud #guide,#ph-island .ph-hud #deck{width:auto!important;max-width:none;margin:0}
  #ph-island .ph-hud:has(#guide:not([hidden])) #controls,#ph-island .ph-hud:has(#deck:not([hidden])) #controls{grid-column:1;grid-row:3;justify-self:center}
  #ph-island #deck .-type-card>.p-postList__item{flex-basis:33.333%}
}
@media(prefers-reduced-motion:reduce){#ph-island #poster,#ph-island #scene{transition:none}}

/* The local preview uses the same SWELL icons without a cross-origin font request. */
@font-face{font-family:icomoon;font-style:normal;font-weight:400;src:url("./swell-icomoon.woff2") format("woff2")}
