/* Foxy's Sound Guide. Same palette and card shape as the vehicle guide, with one addition that
   matters here: a large, obvious play button that shows when a sound is playing. */
:root{--cream:#fff7df;--paper:#fffdf5;--ink:#37352f;--muted:#69645a;--leaf:#24613d;--leaf-pale:#e6f5df;--orange:#c45135;--line:#e9dcc2;--sky-pale:#e8f4fb}
*{box-sizing:border-box}
body{margin:0;background:linear-gradient(150deg,var(--cream),#f1fbf3);color:var(--ink);font:17px/1.45 ui-rounded,"Avenir Next",system-ui,sans-serif}
button{font:inherit;cursor:pointer}
button:disabled{opacity:.5;cursor:default}
:focus-visible{outline:3px solid #173f60;outline-offset:3px}
.visually-hidden{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.wrap{width:min(1120px,calc(100% - 32px));margin:auto}
.site-head{padding:16px 0 4px}
.back{color:var(--leaf);font-weight:800;text-decoration-thickness:2px}
.hero{text-align:center;padding:4px 0 8px}
.hero .fox{font-size:40px;line-height:1}
.hero h1{font-size:clamp(1.3rem,3.2vw,2rem);line-height:1.2;margin:4px auto;color:var(--orange);max-width:900px}
.hero p{margin:4px auto;max-width:720px;color:var(--muted);font-weight:650}
.summary{text-align:center;color:var(--muted);font-size:.9rem;margin:4px 0 10px}
.language-row,.tabs,.actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.language-row{margin:10px 0}
.chip,.tab,.button{border:2px solid var(--line);border-radius:999px;background:#fff;padding:8px 13px;font-weight:800;min-height:44px;color:var(--ink)}
.chip[aria-pressed=true],.tab[aria-pressed=true]{border-color:var(--leaf);background:var(--leaf-pale);color:#174d31}
.button{background:var(--orange);border-color:var(--orange);color:#fff;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.button.secondary{background:#fff;color:var(--ink);border-color:var(--line)}
.toolbar{display:flex;gap:8px;justify-content:center;align-items:center;flex-wrap:wrap;max-width:720px;margin:0 auto 8px}
.search{flex:1 1 260px;display:flex}
.search input{flex:1;min-width:0;min-height:44px;border:2px solid var(--line);border-radius:999px;padding:8px 14px;font:inherit;background:#fff}
.tabs{margin:6px 0 4px}
.tabs .tab{font-size:15px;padding:7px 11px}
.empty{text-align:center;font-weight:800;color:#6a391d}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:12px;padding-bottom:34px}
.card{background:var(--paper);border:2px solid var(--line);border-radius:20px;overflow:hidden;display:flex;flex-direction:column;min-width:0}
.card picture{display:block;position:relative;aspect-ratio:4/3;background:#edf3ea;overflow:hidden}
.card picture img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;display:block}
.photo-button{display:block;width:100%;padding:0;border:0;background:none}
.photo-credit,.sound-credit{margin:0;font-size:.72rem;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
.photo-credit{padding:5px 12px 0}
.sound-credit{padding-top:4px}
.photo-credit a,.sound-credit a{color:inherit;text-decoration:none;border-bottom:1px dotted currentColor;display:inline-block;padding:2px 0}
.photo-credit a:hover,.sound-credit a:hover,.photo-credit a:focus-visible,.sound-credit a:focus-visible{color:var(--orange)}
.card-copy{padding:8px 12px 12px;display:flex;flex-direction:column;gap:4px;flex:1}
.sound-title{font-size:1.05rem;line-height:1.25;margin:0}
.sound-word{margin:0;font-size:1.15rem;font-weight:900;color:var(--orange)}
.detail{margin:0;font-size:.9rem}
.places{margin:4px 0 0;display:flex;flex-wrap:wrap;gap:2px 12px;font-size:.78rem;font-weight:800;color:#4a694e}
.native-audio{width:100%;margin-top:6px}
html.js .native-audio{display:none}
.enhanced-only{display:none!important}
html.js .enhanced-only{display:flex!important}
html.js .tab.enhanced-only,html.js .chip.enhanced-only{display:inline-flex!important}

/* The play button: large enough for a small hand, and it changes shape and colour while a sound
   plays so a child can see that tapping again stops it. */
.play{margin-top:auto;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:52px;border:0;border-radius:999px;background:var(--leaf);color:#fff;font-weight:900;font-size:1rem;box-shadow:0 4px 0 rgba(23,77,49,.22)}
.card .play{margin-top:8px}
.play:hover{background:#1d5334}
.play:active{transform:translateY(2px);box-shadow:0 2px 0 rgba(23,77,49,.22)}
.play-icon{width:0;height:0;border-style:solid;border-width:9px 0 9px 15px;border-color:transparent transparent transparent #fff}
.play.playing{background:var(--orange);box-shadow:0 4px 0 rgba(106,49,34,.22)}
.play.playing .play-icon{width:14px;height:14px;border:0;border-radius:3px;background:#fff;animation:pulse 1s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(.72)}}
@media (prefers-reduced-motion:reduce){.play.playing .play-icon{animation:none}.play:active{transform:none}}
.audio-error,.photo-error{margin:4px 0 0;color:#6a391d;font-weight:700;font-size:.85rem}
.photo-error{padding:18px}

.adult{border-top:1px solid var(--line);padding:24px 0 44px;color:var(--muted)}
details{background:#fff;border:2px solid var(--line);border-radius:18px;padding:12px 15px}
summary{cursor:pointer;font-weight:800;color:var(--ink)}
.credit{border-top:1px solid var(--line);padding:12px 0;overflow-wrap:anywhere;font-size:15px}
.credit a{color:var(--leaf);font-weight:750;display:inline-block;padding:8px 2px}
.credit-target{background:#fff3cd;border-radius:10px;padding-left:8px;padding-right:8px}

/* Viewer: the photograph takes the available screen; names, the sound word and the play button sit
   below it in portrait and beside it in landscape. */
.viewer{border:0;border-radius:22px;padding:0;background:var(--paper);box-shadow:0 20px 70px rgba(55,43,24,.22)}
.viewer::backdrop{background:rgba(50,44,28,.55)}
#viewer{width:min(1180px,calc(100% - 16px));height:min(900px,calc(100dvh - 16px));max-width:none;max-height:calc(100dvh - 16px);overflow:auto}
#viewer .viewer-body{height:100%;min-height:0;display:grid;grid-template-rows:minmax(140px,1fr) auto;gap:12px;padding:12px;text-align:center}
#viewer picture{display:block;position:relative;min-height:0;width:100%;height:100%;background:#edf3ea;border-radius:14px;overflow:hidden}
#viewer picture img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.viewer-info{min-width:0;align-self:center;display:flex;flex-direction:column;gap:6px}
.viewer-info .sound-title{font-size:clamp(1.1rem,2.2vw,1.6rem);color:var(--orange)}
.viewer-info .sound-word{font-size:clamp(1.4rem,3vw,2rem)}
.viewer-info .play{max-width:360px;margin:4px auto;min-height:60px;font-size:1.1rem}
.count{margin:0;font-weight:850;color:var(--leaf);font-size:.85rem}
#voiceStatus{font-size:.85rem;margin:0}
.goodbye{grid-row:1/-1;align-self:center;padding:20px 8px}
.goodbye .fox{font-size:80px}
.goodbye h2{color:var(--leaf)}
@media (orientation:landscape) and (min-width:650px){
  #viewer .viewer-body{grid-template-columns:minmax(0,2fr) minmax(250px,1fr);grid-template-rows:minmax(0,1fr);gap:16px;text-align:left}
  .viewer-info{max-height:100%;overflow:auto;padding:4px}
  .viewer-info .play{margin-left:0}
  #viewer .actions{justify-content:flex-start}
  .goodbye{grid-column:1/-1;text-align:center}
  .goodbye .actions{justify-content:center!important}
}
.gate{width:min(460px,calc(100% - 24px))}
.gate-body{padding:20px;text-align:center}
.caregiver-check{display:flex;align-items:center;gap:12px;text-align:left;padding:14px;border:2px solid var(--line);border-radius:14px}
.caregiver-check input{min-width:24px;height:24px}
.gate-destination{overflow-wrap:anywhere;color:var(--muted)}

@media (max-width:860px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){.tabs{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;padding:4px 2px 8px}.tabs .tab{flex:0 0 auto;white-space:nowrap}}
@media (max-width:520px){
  body{font-size:16px}
  .wrap{width:calc(100% - 24px)}
  .grid{grid-template-columns:minmax(0,1fr);gap:12px}
  .hero h1{font-size:1.15rem}
  .hero h1 span{white-space:nowrap}
  .hero p{font-size:.9rem}
  .toolbar{flex-direction:column;align-items:stretch}
  .search{flex-basis:auto}
  #viewer{width:calc(100% - 10px);height:calc(100dvh - 10px);max-height:calc(100dvh - 10px);border-radius:16px}
  #viewer .viewer-body{padding:8px;gap:8px}
  #viewer .actions .button{font-size:.85rem;padding:7px 10px}
}
@media (orientation:landscape) and (min-width:650px) and (max-height:500px){
  .viewer-info{gap:3px}
  .viewer-info .sound-word{font-size:1.2rem}
  .viewer-info .detail{font-size:.85rem}
  .viewer-info .play{min-height:48px}
}

/* The explanation in the other two languages is in the static page for readers and
   search, and hidden once the language switch takes over; grown-up questions. */
html.js .detail-alt{display:none}
.detail-alt{color:var(--muted)}
.faq{border-top:1px solid var(--line);padding:22px 0 4px}
.faq h2{font-size:1.1rem;margin:0 0 10px}
.faq-item{margin:0 0 8px}
.faq-item p{margin:8px 0;font-size:.95rem}
.faq-item p[lang="zh-Hans"],.faq-item p[lang="ms"]{color:var(--muted)}
.more-guides{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;padding:0 0 40px}
.more-guides a{border:2px solid var(--line);border-radius:999px;padding:10px 16px;background:#fff;color:var(--ink);font-weight:800;text-decoration:none}
.more-guides a:hover,.more-guides a:focus-visible{border-color:var(--leaf)}
