/*
 * The six doors of the kids site (Helpers/KidsDoors.cs, Views/Shared/_Layout.cshtml, Views/Doors/Index.cshtml):
 * picture-first buttons with one word, the same order on every screen; behind each door at most six big picture
 * tiles; the grown-ups' corner set apart. Sky Garden clay and glass, the .c-* colour families from kids.css, logical
 * properties for Arabic and Urdu, still for reduced motion.
 */

/* ================= The header's doors (computers and big tablets) ================= */
@media (min-width: 901px) {
    .sg-nav-list { gap: 2px; padding: 5px; border-radius: 30px; }
    .sg-nav-list .sg-nav-btn {
        position: relative; flex-direction: column; justify-content: center; gap: 1px;
        height: 62px; min-width: 78px; padding: 5px 12px 4px; border-radius: 24px;
        font-size: 14.5px; line-height: 1.05; text-decoration: none;
    }
    .sg-nav-list .sg-nav-ico { width: 32px; height: 32px; }
    .sg-nav-list .sg-nav-btn .sg-chev { position: absolute; top: 7px; inset-inline-end: 6px; width: 11px; height: 11px; }
    .sg-nav-item.is-current > .sg-nav-btn::after {
        content: ""; position: absolute; bottom: -3px; inset-inline: calc(50% - 10px); height: 5px; border-radius: 5px; background: var(--t, #8D72F0);
    }
    .sg-nav-item--home.is-current > .sg-nav-btn::after { background: #4FA8EE; }
    a.sg-nav-btn:hover, a.sg-nav-btn:focus-visible { color: var(--ink); }
}
@media (max-width: 1240px) and (min-width: 901px) {
    .sg-top { gap: 10px; }
    .sg-nav-list .sg-nav-btn { min-width: 68px; padding-inline: 8px; font-size: 13.5px; }
    .sg-nav-list .sg-nav-ico { width: 28px; height: 28px; }
    .k-brand-word small { display: none; }
}

/* ---------- A door's panel: its name, then six picture tiles ---------- */
.sg-drop--door { width: min(600px, calc(100vw - 32px)); padding: 12px; }
.sg-door-head {
    display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 14px 10px 10px; padding-inline: 10px 14px;
    border-radius: 22px; text-decoration: none; color: var(--ink);
    background: radial-gradient(180px 90px at 0% 0%, color-mix(in srgb, var(--t) 38%, transparent), transparent 75%), var(--ts);
    transition: transform .3s var(--ease-bounce);
}
:root[dir="rtl"] .sg-door-head { background: radial-gradient(180px 90px at 100% 0%, color-mix(in srgb, var(--t) 38%, transparent), transparent 75%), var(--ts); }
a.sg-door-head:hover, a.sg-door-head:focus-visible { transform: translateY(-2px); }
.sg-door-head-art { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 20%, #fff)); box-shadow: 0 8px 14px -8px var(--td); }
.sg-door-head-art .sg-ico { width: 40px; height: 40px; }
.sg-door-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.sg-door-head-text b { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.sg-door-head-text small { margin-top: 3px; font-size: .92rem; font-weight: 600; color: var(--ink-soft); }
.sg-door-head-go { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--td); color: #fff; }
:root[data-theme="dark"] .sg-door-head { background: linear-gradient(160deg, color-mix(in srgb, var(--t) 30%, transparent), rgba(255, 255, 255, .05)); }
:root[data-theme="dark"] .sg-door-head-text small { color: #CFC4F5; }

.sg-door-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.sg-door-tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 112px; padding: 12px 8px 10px; border-radius: 24px; text-align: center; text-decoration: none; color: var(--ink);
    background: linear-gradient(170deg, #fff 35%, var(--ts));
    box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--t) 22%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .9), 0 10px 18px -14px var(--td);
    transition: transform .3s var(--ease-bounce), box-shadow .25s;
}
.sg-door-tile:hover, .sg-door-tile:focus-visible { transform: translateY(-4px) rotate(-1deg); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--t) 30%, transparent), inset 0 0 0 2px var(--t), 0 16px 22px -14px var(--td); }
.sg-door-tile[aria-current="page"] { box-shadow: inset 0 0 0 3px var(--t), 0 10px 18px -14px var(--td); }
.sg-door-tile-art { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 20px; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 24%, #fff)); box-shadow: 0 6px 12px -8px var(--td); transition: transform .45s var(--ease-bounce); }
.sg-door-tile:hover .sg-door-tile-art { transform: scale(1.1) rotate(-6deg); }
.sg-door-tile-art .sg-ico { width: 46px; height: 46px; }
.sg-door-tile-art .k-ico { width: 38px; height: 38px; color: var(--td); }
.sg-door-tile b { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.1; }
:root[data-theme="dark"] .sg-door-tile { background: linear-gradient(170deg, rgba(255, 255, 255, .1), color-mix(in srgb, var(--t) 22%, transparent)); color: #FFF7EE; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
:root[data-theme="dark"] .sg-door-tile-art { background: linear-gradient(180deg, rgba(255, 255, 255, .95), color-mix(in srgb, var(--t) 30%, #fff)); }

/* ================= For grown-ups: apart from the doors ================= */
.sg-grown-btn {
    display: flex; align-items: center; gap: 7px; height: 48px; padding-inline: 6px 12px;
    border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
    font-family: var(--font-display); font-weight: 600; font-size: 15px; color: #fff;
    background: linear-gradient(160deg, #3A2F7A, #5B45B0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 10px 18px -12px rgba(43, 35, 80, .8);
    transition: transform .25s var(--ease-bounce), background .2s;
}
.sg-grown-btn:hover, .sg-grown.is-open > .sg-grown-btn { transform: translateY(-2px); background: linear-gradient(160deg, #46399A, #6A52C8); }
.sg-grown.is-current > .sg-grown-btn { box-shadow: inset 0 0 0 2px #FFD45C, 0 10px 18px -12px rgba(43, 35, 80, .8); }
.sg-grown-btn .sg-chev { opacity: .8; }
.sg-grown-lock { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.sg-grown-lock .k-ico { width: 22px; height: 22px; }
.sg-grown-panel { width: 330px; padding: 10px; }
.sg-grown-note { margin: 2px 6px 8px; padding: 8px 12px; border-radius: 14px; background: var(--grape-soft); font-size: .9rem; font-weight: 600; color: var(--grape-deep); }
:root[data-theme="dark"] .sg-grown-note { background: rgba(255, 255, 255, .08); color: #E9E0FF; }
.sg-grown-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 10px 6px 6px; padding-inline: 6px 10px; border-radius: 16px; text-decoration: none; color: var(--ink); }
.sg-grown-row:hover, .sg-grown-row:focus-visible, .sg-grown-row[aria-current="page"] { background: var(--ts); }
.sg-grown-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--ts); color: var(--td); }
.sg-grown-ico .k-ico { width: 24px; height: 24px; }
.sg-grown-text { display: flex; flex-direction: column; line-height: 1.15; }
.sg-grown-text b { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.sg-grown-text small { font-size: .84rem; font-weight: 600; color: var(--ink-faint); }
:root[data-theme="dark"] .sg-grown-text small { color: #CFC4F5; }
.sg-nav-grownups { display: none; }
@media (max-width: 1240px) and (min-width: 901px) {
    .sg-grown-btn > span:not(.sg-grown-lock) { display: none; }
    .sg-grown-btn { padding-inline: 6px 8px; }
    .sg-grown-btn { position: relative; }
}

/* ================= Phones and small tablets: the sheet and the tab bar ================= */
@media (max-width: 900px) {
    .sg-grown { display: none; }
    body.page-world .sg-dock { display: none; }
    .sg-drop--door { width: auto; padding: 0; }
    .sg-door-head { margin: 0 0 6px; padding: 8px 10px; }
    .sg-door-head-art { width: 42px; height: 42px; border-radius: 14px; }
    .sg-door-head-art .sg-ico { width: 32px; height: 32px; }
    .sg-door-head-text b { font-size: 1.1rem; }
    .sg-door-tile { min-height: 96px; padding: 10px 4px 8px; border-radius: 20px; }
    .sg-door-tile-art { width: 50px; height: 50px; border-radius: 16px; }
    .sg-door-tile-art .sg-ico { width: 40px; height: 40px; }
    .sg-door-tile b { font-size: .95rem; }
    .sg-nav-item--home .sg-nav-btn { text-decoration: none; }

    .sg-nav-grownups { display: block; margin-top: 8px; padding: 10px; border-radius: 24px; background: linear-gradient(160deg, #3A2F7A, #5B45B0); color: #fff; }
    .sg-nav-grownups-title { display: flex; align-items: center; gap: 8px; margin: 2px 4px 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
    .sg-nav-grownups-title .k-ico { width: 24px; height: 24px; }
    .sg-nav-grownups ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
    .sg-nav-grownups a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border-radius: 16px; text-decoration: none; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: .95rem; background: rgba(255, 255, 255, .1); }
    .sg-nav-grownups a[aria-current="page"], .sg-nav-grownups a:hover { background: rgba(255, 255, 255, .2); }
    .sg-nav-grownups a .k-ico { flex: none; width: 24px; height: 24px; }

    /* The six doors at the bottom, from tablets down. */
    .k-tabbar {
        position: fixed; z-index: 50; inset-inline: 10px; bottom: 10px;
        display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
        padding: 6px; border-radius: 30px;
        background: rgba(255, 255, 255, .88);
        backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
        box-shadow: inset 0 0 0 1.5px #fff, var(--shadow-l);
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    :root[data-theme="dark"] .k-tabbar { background: rgba(38, 33, 94, .92); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .12), var(--shadow-l); }
    .k-tabbar a {
        position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; min-height: 56px;
        padding: 5px 1px 4px; border-radius: 22px; text-decoration: none;
        font-family: var(--font-display); font-weight: 600; font-size: .76rem; line-height: 1.1; color: var(--ink-soft);
        transition: transform .25s var(--ease-bounce), background .2s;
    }
    .k-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .k-tabbar a .k-ico { width: 34px; height: 34px; transition: transform .4s var(--ease-bounce); }
    .k-tabbar a:active .k-ico { transform: scale(.88); }
    .k-tabbar a[aria-current] { background: var(--ts); color: var(--ink); }
    .k-tabbar a[aria-current] .k-ico { transform: translateY(-3px) scale(1.08); }
    .k-tabbar a[aria-current]::after { content: ""; position: absolute; bottom: 3px; width: 16px; height: 3px; border-radius: 3px; background: var(--t); }
    :root[data-theme="dark"] .k-tabbar a[aria-current] { background: rgba(255, 255, 255, .14); }
    .sg-foot { padding-bottom: 120px; }
}
@media (max-width: 400px) {
    .k-tabbar { inset-inline: 6px; bottom: 6px; padding: 5px; }
    .k-tabbar a { font-size: .7rem; }
    .k-tabbar a .k-ico { width: 30px; height: 30px; }
}
:root[lang="ur"] .k-tabbar a { font-size: .8rem; line-height: 1.5; }

/* ================= Footer: the doors as pictures, the grown-ups' links apart ================= */
.sg-foot-doors { gap: 8px; }
.sg-foot-doors a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 14px 4px 6px; padding-inline: 6px 14px;
    border-radius: 999px; background: var(--paper); box-shadow: var(--shadow-s); color: var(--ink); font-weight: 600;
}
.sg-foot-doors a:hover { color: var(--ink); text-decoration: none; transform: translateY(-2px); }
.sg-foot-ico { width: 32px; height: 32px; }
:root[data-theme="dark"] .sg-foot-doors a { background: rgba(255, 255, 255, .08); }
.sg-foot-grown { align-items: center; margin-top: 12px; font-size: .95rem; }
.sg-foot-grown-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--grape-deep); }
.sg-foot-grown-title .k-ico { width: 20px; height: 20px; }
:root[data-theme="dark"] .sg-foot-grown-title { color: #E9E0FF; }

/* ================= A door page ================= */
.sg-door-say {
    display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 12px; border-radius: 26px;
    background: linear-gradient(160deg, var(--paper), var(--ts)); box-shadow: inset 0 0 0 1.5px var(--glass-edge);
}
.sg-door-say-noor { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: linear-gradient(180deg, #FFF6D8, #FFE3A3); }
.sg-door-say-noor .k-mascot-svg { width: 34px; height: 44px; }
.sg-door-say-text { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.1; }
.sg-door-hear { flex: none; gap: 8px; }
.sg-door-hear .sg-eq { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.sg-door-hear .sg-eq i { width: 4px; height: 10px; border-radius: 2px; background: #fff; }
:root[data-theme="dark"] .sg-door-say { background: linear-gradient(160deg, rgba(255, 255, 255, .06), color-mix(in srgb, var(--t) 22%, transparent)); }

.sg-door-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.sg-door-card {
    position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; height: 100%; min-height: 220px;
    padding: 18px; border-radius: 32px; text-decoration: none; color: var(--ink); overflow: hidden; isolation: isolate;
    background:
        radial-gradient(170px 140px at 100% 0%, color-mix(in srgb, var(--t) 40%, transparent) 0%, transparent 70%),
        linear-gradient(165deg, color-mix(in srgb, var(--paper) 92%, var(--ts)) 30%, var(--ts));
    box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--t) 18%, transparent), inset 0 1.5px 0 rgba(255, 255, 255, .7), 0 22px 34px -24px var(--td);
    transition: transform .35s var(--ease-bounce), box-shadow .3s;
}
:root[dir="rtl"] .sg-door-card { background: radial-gradient(170px 140px at 0% 0%, color-mix(in srgb, var(--t) 40%, transparent) 0%, transparent 70%), linear-gradient(165deg, color-mix(in srgb, var(--paper) 92%, var(--ts)) 30%, var(--ts)); }
.sg-door-card::before { content: ""; position: absolute; z-index: -1; width: 180px; height: 180px; inset-inline-end: -60px; top: -70px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.sg-door-card:hover, .sg-door-card:focus-visible { transform: translateY(-6px) rotate(-.6deg); box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--t) 24%, transparent), inset 0 0 0 2px var(--t), 0 30px 40px -24px var(--td); }
.sg-door-card-art { display: grid; place-items: center; width: 96px; height: 96px; margin-bottom: auto; border-radius: 30px; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--t) 22%, #fff)); box-shadow: inset 0 -4px 0 rgba(76, 52, 150, .08), 0 12px 20px -12px var(--td); transition: transform .5s var(--ease-bounce); }
.sg-door-card:hover .sg-door-card-art { transform: rotate(-8deg) scale(1.08); }
.sg-door-card-art .sg-ico { width: 76px; height: 76px; }
.sg-door-card-art .k-ico { width: 62px; height: 62px; color: var(--td); }
.sg-door-card b { margin-top: 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; line-height: 1.05; }
.sg-door-card small { font-size: .98rem; font-weight: 600; color: var(--ink-soft); line-height: 1.25; padding-inline-end: 44px; }
.sg-door-card-go { position: absolute; inset-inline-end: 16px; bottom: 16px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--td); color: #fff; box-shadow: 0 8px 14px -8px var(--td); }
.sg-door-card-go svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .sg-door-card { background: linear-gradient(165deg, rgba(255, 255, 255, .08) 20%, color-mix(in srgb, var(--t) 26%, transparent)); color: #FFF7EE; }
:root[data-theme="dark"] .sg-door-card small { color: #CFC4F5; }
:root[data-theme="dark"] .sg-door-card::before { background: rgba(255, 255, 255, .06); }

.sg-door-onward { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sg-door-onward a {
    display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 18px 6px 8px; padding-inline: 8px 18px;
    border-radius: 999px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--ink);
    background: var(--paper); box-shadow: var(--shadow-s); transition: transform .3s var(--ease-bounce);
}
.sg-door-onward a:hover, .sg-door-onward a:focus-visible { transform: translateY(-3px); }
.sg-door-onward .sg-ico { width: 44px; height: 44px; }
.sg-door-onward-next { margin-inline-start: auto; background: linear-gradient(160deg, var(--paper), var(--ts)) !important; box-shadow: inset 0 0 0 2px var(--t), var(--shadow-s) !important; }
.sg-door-onward-arrow { width: 24px; height: 24px; color: var(--td); }
:root[data-theme="dark"] .sg-door-onward a { background: rgba(255, 255, 255, .08); color: #FFF7EE; }

@media (max-width: 1100px) {
    .sg-door-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .sg-door-card { min-height: 190px; padding: 14px; border-radius: 28px; }
    .sg-door-card-art { width: 80px; height: 80px; border-radius: 26px; }
    .sg-door-card-art .sg-ico { width: 62px; height: 62px; }
    .sg-door-card b { font-size: 1.35rem; }
}
@media (max-width: 760px) {
    .sg-door-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sg-door-card { min-height: 0; align-items: center; text-align: center; padding: 14px 8px 16px; }
    .sg-door-card-art { margin-bottom: 0; }
    .sg-door-card b { margin-top: 8px; font-size: 1.2rem; }
    .sg-door-card small { padding-inline-end: 0; font-size: .86rem; }
    .sg-door-card-go { display: none; }
    .sg-door-say { padding: 8px; gap: 8px; }
    .sg-door-say-noor { width: 46px; height: 46px; }
    .sg-door-hear-label { display: none; }
    .sg-door-hear { width: 48px; min-height: 48px; padding: 0; justify-content: center; }
    .sg-door-onward a { flex: 1 1 auto; justify-content: center; font-size: 1rem; }
    .sg-door-onward-next { margin-inline-start: 0; }
}

/* ================= The story shelf's extra shelves, folded away ================= */
.sg-more-shelves { margin: 0 0 14px; }
.sg-more-shelves > summary {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 16px 4px 8px; padding-inline: 8px 16px;
    border-radius: 999px; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 600; color: var(--ink);
    background: var(--paper); box-shadow: var(--shadow-s);
}
.sg-more-shelves > summary::-webkit-details-marker { display: none; }
.sg-more-shelves > summary .k-ico { width: 28px; height: 28px; }
.sg-more-shelves > summary .sg-chev { width: 14px; height: 14px; transition: transform .3s var(--ease-bounce); }
.sg-more-shelves[open] > summary .sg-chev { transform: rotate(180deg); }
.sg-more-shelves > .k-cats { margin-top: 10px; }
:root[data-theme="dark"] .sg-more-shelves > summary { background: rgba(255, 255, 255, .08); }
.k-pill .k-ico { width: 22px; height: 22px; margin-inline-end: 4px; vertical-align: -5px; }

@media (prefers-reduced-motion: reduce) {
    .sg-door-tile, .sg-door-tile-art, .sg-door-card, .sg-door-card-art, .sg-door-head, .sg-grown-btn, .sg-door-onward a, .sg-foot-doors a { transition: none; }
    .sg-door-tile:hover, .sg-door-card:hover, .sg-door-card:hover .sg-door-card-art, .sg-door-tile:hover .sg-door-tile-art, .sg-door-onward a:hover { transform: none; }
}

/* The grown-ups' corner menu (Views/Shared/_ParentsNav.cshtml) starts with its own "For grown-ups" tag. */
.k-pnav-tag {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px;
    background: linear-gradient(160deg, #3A2F7A, #5B45B0); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
}
.k-pnav-tag .k-ico { width: 20px; height: 20px; }
