/* SERDEC WordPress theme adjustments: use existing SERDEC illustrations and visual vocabulary. */
:root {--sa-turquoise:#23ab82}
body.admin-bar .site-header{top:32px}
@media(max-width:782px){body.admin-bar .site-header{top:46px}}
body{overflow-x:hidden}
.subject-grid.academy-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:25px}
.academy-grid .subject-card{min-width:0;background:#fff;border:1px solid #f1f3f1;border-radius:25px;box-shadow:0 14px 38px rgba(25,56,72,.09);overflow:hidden;transition:transform .24s,box-shadow .24s}
.academy-grid .subject-card:hover{transform:translateY(-7px);box-shadow:0 20px 46px rgba(25,56,72,.15)}
.academy-grid .subject-image{height:206px;position:relative;overflow:hidden;background:var(--soft)}
.academy-grid .subject-image img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.academy-grid .subject-card:hover img{transform:scale(1.045)}
.academy-grid .subject-emoji{position:absolute;right:12px;top:12px;font-size:25px;border:3px solid white;background:rgba(255,255,255,.94);border-radius:15px;min-width:49px;height:49px;display:grid;place-items:center}
.academy-grid .subject-body{padding:25px 25px 20px}
.academy-grid .subject-body h3{font-size:23px;line-height:1.25;margin:9px 0 10px;color:#18364c}
.academy-grid .subject-body p{font-size:14px;line-height:1.7;min-height:48px;color:#68808b;margin:0 0 22px}
.academy-grid .subject-category{font-size:10px;letter-spacing:1px;font-weight:900;color:#1d9d7b}
.academy-grid .subject-footer{display:flex;justify-content:space-between;align-items:center;gap:9px;padding-top:14px;border-top:1px solid #eef2f0}
.academy-grid .subject-check{font-size:11px;font-weight:900;color:#5b8f7b}
.academy-grid .round-arrow{border:0;background:#def6ed;color:#168c6f;width:46px;height:46px;border-radius:16px;font-size:24px;font-weight:900;cursor:pointer;transition:.2s}
.academy-grid .round-arrow:hover{background:#2cae86;color:white;transform:rotate(12deg)}
.section-heading h2{font-size:clamp(30px,4vw,52px);margin:10px 0 12px;letter-spacing:-1.6px;color:#17334e;line-height:1.18}
.section-heading h2 span{color:#20a781}
.section-heading p{color:#637987;margin:0}
.section-heading-sticker{font-size:58px;transform:rotate(6deg)}
.sa-consent{display:flex;align-items:flex-start;gap:10px;font-size:13px;font-weight:750;line-height:1.6;margin:15px 0;cursor:pointer}
.sa-consent input{margin-top:4px;min-width:18px;min-height:18px}
.sa-honeypot{position:absolute!important;left:-9000px!important;width:1px!important;height:1px!important;opacity:0}
.form-message{background:#fef5d6;padding:12px;border-radius:10px;color:#4e4f33;font-size:13px;margin-top:10px}
.form-message.hidden{display:none}
.auth-note a{text-decoration:underline;color:#168f72}
.mobile-menu.open{display:flex;flex-direction:column;padding:20px 26px;background:#fff;box-shadow:0 15px 30px #d3e7e340;gap:6px}
.mobile-menu a,.mobile-menu button{display:block;text-align:left;padding:12px 14px;background:#f0f9f4;color:#1a4252;border:0;border-radius:12px;font-weight:900}
.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,130px);padding:13px 20px;border-radius:14px;background:#12394a;color:white;box-shadow:0 16px 35px #092b3b33;z-index:900;opacity:0;transition:.25s;max-width:min(440px,90vw);font-size:14px;text-align:center}
.toast.visible{transform:translate(-50%,0);opacity:1}
.sa-page-content{padding-top:70px;padding-bottom:100px;min-height:60vh}
.sa-page-content .sa-post{background:#fff;padding:30px;border-radius:24px;margin:22px 0;box-shadow:0 9px 30px #182e4a0d}
.sa-page-content .sa-post a{text-decoration:underline}
#authOverlay .modal{max-height:90vh;overflow-y:auto}
#player .player-bar{position:relative;z-index:1}
#player #bookFrame{width:100%;height:100%;min-height:0;border:0;background:white;flex:1}
.player-actions button{cursor:pointer}
.player-actions .complete-btn:disabled{opacity:.6;cursor:not-allowed}
.player.hidden,.overlay.hidden,.celebration.hidden{display:none!important}
#celebration{z-index:700}
#bookFrame:fullscreen{height:100vh;width:100vw;background:white}
@media(max-width:1060px){.subject-grid.academy-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.section-heading-sticker{display:none}}
@media(max-width:700px){.subject-grid.academy-grid{grid-template-columns:1fr}.academy-grid .subject-image{height:210px}.academy-grid .subject-body p{min-height:0}.subject-grid{gap:17px}.mobile-toggle{display:flex}.site-header{height:74px}.nav-links,.nav-actions{display:none}.nav-shell{justify-content:space-between}.hero-grid{grid-template-columns:1fr}.hero-copy{padding-top:16px}.hero-art{min-height:380px}.central-frame{height:250px}.secondary-frame{height:130px}.tag-bottom{bottom:3%}.section-pad{padding:55px 0}.dash-stats{grid-template-columns:1fr}.dash-welcome{flex-wrap:wrap}.dash-heading h2{font-size:25px}.dash-actions{flex-wrap:wrap}.mini-ribbon{flex-wrap:wrap;justify-content:center}.mini-ribbon i{display:none}.hero h1{letter-spacing:-1.6px}.player-bar{display:flex!important;flex-wrap:wrap;justify-content:space-between}.player-middle{display:none}.player-actions .desktop-label{display:none}.auth-form .field-row{display:grid;grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}}

/* SERDEC shop integration */
.subject-footer a.round-arrow{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;flex-shrink:0}
.subject-footer .subject-check{font-weight:800}
@media(max-width:700px){.subject-footer .subject-check{font-size:12px}}

/* Book-card usability: activate same action from anywhere on its surface. */
.subject-grid .subject-card-clickable{cursor:pointer}
.subject-grid .subject-card-clickable:focus-visible{outline:4px solid #139c80;outline-offset:5px}
.academy-grid .round-arrow.book-unavailable{display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;color:#778b9a;cursor:default;transform:none;user-select:none}

/* Fix logged-in admin bar overlap on embedded book player */
body.admin-bar .player{top:32px;height:calc(100vh - 32px)}
@media(max-width:782px){body.admin-bar .player{top:46px;height:calc(100vh - 46px)}}

/* SERDEC Academy 3.1: calm child-friendly layout and readable book toolbar */
:root{--sa-kid-green:#139c75;--sa-kid-navy:#143a56}
.site-header .nav-links{gap:12px}
.site-header .nav-link{font-size:15px;padding:13px 17px}
.site-header .nav-link:hover{background:#dff7ed}
.hero{padding-top:32px}.hero-grid{min-height:490px}.hero-art{min-height:490px}
.subjects-section{padding-top:56px}.academy-grid .subject-card{border:2px solid #e3f1ee;box-shadow:0 8px 22px #14395412}
.academy-grid .subject-body h3{font-size:25px}.academy-grid .subject-body p{font-size:15px;min-height:38px}
.academy-grid .round-arrow{width:58px;height:58px;border-radius:20px;font-size:30px}
.sa-page-content .sa-post{padding:26px 30px}
.sa-page-content .sa-post h1{font-size:clamp(27px,4vw,43px);margin-top:0}
.sa-page-content .sa-post:has(.sacp-shop){background:transparent;padding:0;box-shadow:none}
#player .player-bar{grid-template-columns:auto 1fr auto;gap:10px;min-height:65px;padding:10px 18px}
#player .player-back,#player .player-actions button,#player .player-actions a{font-size:14px;border-radius:15px;min-height:44px;padding:10px 13px}
#player .player-middle{font-size:16px}
#player .player-actions{gap:7px}
#player .player-direct{display:inline-flex;align-items:center;justify-content:center;background:#e9f6f1;color:#126a55;font-weight:900}
#player .player-actions .complete-btn{display:none} /* Quizzes belong in parent dashboard, not children's reading area */
#player .player-loading .sa-loading-hint{font-size:13px;color:#507787;font-weight:500;margin:0;text-align:center}
body.sa-book-open #wpadminbar{display:none!important}
body.sa-book-open.admin-bar #player{top:0;height:100dvh}
body.sa-book-open .site-header{visibility:hidden}
#player{height:100dvh}
@media(max-width:782px){body.sa-book-open.admin-bar #player{top:0;height:100dvh}}
@media(max-width:700px){#player .player-bar{grid-template-columns:1fr auto;display:grid!important;min-height:65px;padding:8px}#player .player-actions{flex-wrap:nowrap}#player .player-back,#player .player-actions button,#player .player-actions a{font-size:12px;padding:8px}#player .player-middle{display:none}#player .player-direct .desktop-label{display:none}.academy-grid .subject-body h3{font-size:22px}.hero-art{min-height:320px}}

.sa-store-unavailable{background:linear-gradient(145deg,#f0fbf6,#fff9ea);border:2px solid #dcf1e7;border-radius:25px;text-align:center;padding:48px 24px;max-width:900px;margin:20px auto}
.sa-store-unavailable .sa-store-icon{font-size:70px}
.sa-store-unavailable h2{font-size:clamp(28px,3vw,42px);color:#193b55;margin:14px 0}
.sa-store-unavailable p{font-size:17px;line-height:1.8;color:#537686}
.sa-store-unavailable .sa-shop-admin-note{padding:15px;border:1px solid #f5d1a5;background:#fff9e9;border-radius:14px;margin:16px 0;color:#63431b;text-align:left}
/* One compact Academy exit row + native book controls, not repeated lesson menus. */
#player .player-bar{grid-template-columns:1fr auto!important;min-height:54px!important;padding:6px 12px!important}
#player .player-middle,#player #openSeparate{display:none!important}
#player .player-actions{grid-column:2;grid-row:1}
#player .player-back{grid-column:1;grid-row:1}

/* SERDEC Academy 3.3 – professional, accessible parent authentication */
.auth-inline-actions{display:flex;justify-content:flex-end;margin:3px 0 0}
.auth-inline-link,.auth-back{border:0;background:none;color:#128766;text-decoration:underline;font-weight:850;padding:6px 2px;cursor:pointer;font-size:13px}
.auth-inline-link:hover,.auth-back:hover{color:#0f644e}
.auth-back{align-self:center;text-decoration:none;margin-top:9px}
.auth-reset-icon{width:64px;height:64px;background:#e8f7ef;border-radius:20px;display:grid;place-items:center;font-size:32px;margin:3px auto}
.auth-reset-intro{color:#657c89;line-height:1.7;font-size:14px;text-align:center;margin:8px 0 15px}
.auth-form .field-wrapper .password-toggle{width:36px;height:36px;right:9px;top:50%;display:grid;place-items:center;border-radius:10px;background:#f0f7f5;color:#31556b;transform:translateY(-50%);font-size:15px;padding:4px}
.auth-form .field-wrapper input:has(+ .password-toggle){padding-right:55px}
.auth-submit:disabled{opacity:.65;cursor:wait;transform:none}
#authMessage{line-height:1.6;word-break:normal;overflow-wrap:break-word}
#authMessage.success{background:#e7faf0;border-color:#b0e9ce;color:#116b4e}
#authOverlay .modal{scrollbar-width:thin;scrollbar-color:#cfe5de transparent}
@media(max-width:640px){#authOverlay{padding:12px}#authOverlay .modal{padding:25px 18px;max-height:calc(100dvh - 25px)}.auth-reset-intro{font-size:13px}}

/* Kids storefront paywall: full-size buy action, never an ambiguous arrow. */
.sa-pay-book-btn{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:10px 17px;border:0;border-radius:14px;background:#169a79;color:#fff!important;font-size:14px;font-weight:900;text-decoration:none!important;white-space:nowrap;box-shadow:0 4px 0 #0c7358;transition:transform .2s,background .2s}
.sa-pay-book-btn:hover,.sa-pay-book-btn:focus-visible{background:#107e62;transform:translateY(-2px)}
.sa-pay-book-btn.pending{background:#eaf5f1;color:#176b5a!important;box-shadow:none;border:1px solid #cde8df}
.academy-grid .subject-footer{flex-wrap:wrap}
.academy-grid .subject-check{line-height:1.45}
@media(max-width:420px){.sa-pay-book-btn{width:100%}}

/* Version 3.4.1 - make every locked book's next step clearly clickable */
.academy-grid .subject-card-clickable {cursor:pointer;}
.academy-grid .subject-card-clickable:hover .sa-pay-book-btn,
.academy-grid .subject-card-clickable:focus-visible .sa-pay-book-btn {background:#107e62;box-shadow:0 4px 0 #09573f;color:#fff!important}
.academy-grid .sa-book-setup-link{background:#e8f4ee;color:#126d58!important;border:1px solid #bfe8d5;box-shadow:none}
.academy-grid .subject-card-clickable:hover .sa-book-setup-link,
.academy-grid .subject-card-clickable:focus-visible .sa-book-setup-link {background:#c7f2df;color:#0d5a44!important;box-shadow:none}
.academy-grid .subject-card-clickable:focus-visible {outline:4px solid #139c80;outline-offset:4px;}

/* SERDEC 3.4.3: two distinct purchase choices on locked books. */
.sa-book-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:100%}
.sa-book-actions .sa-cart-book-btn{display:inline-flex;justify-content:center;align-items:center;min-height:44px;padding:8px 12px;border:1px solid #abd9ca;border-radius:13px;background:#effaf4;color:#146b55!important;font-size:13px;font-weight:900;text-decoration:none!important;white-space:nowrap}
.sa-book-actions .sa-cart-book-btn:hover{background:#d7f2e5}
.sa-book-actions .sa-pay-book-btn{min-height:44px;padding:8px 12px;font-size:13px}
@media(max-width:420px){.sa-book-actions{width:100%}.sa-book-actions>a{flex:1}}

/* 3.4.5: child-friendly fullscreen: controls remain visible inside the parent fullscreen element */
#player:fullscreen{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;background:#edfaff!important;z-index:2147483647!important}
#player:fullscreen .player-bar{padding-right:220px;min-height:64px;flex-shrink:0}
#player .sa-exit-fullscreen{position:absolute;right:16px;top:10px;z-index:2147483647;background:#e84f55;color:white;border:3px solid white;border-radius:19px;padding:12px 16px;min-height:48px;font-size:15px;font-weight:900;cursor:pointer;box-shadow:0 5px 17px #1a273e38}
#player .sa-exit-fullscreen.hidden{display:none!important}
#player:fullscreen .sa-exit-fullscreen{display:block!important}
#player .player-loading.sa-soft-loading{opacity:0;pointer-events:none;transition:opacity .25s}
.brand-mark--image img,.modal-icon--logo img{object-fit:contain!important;display:block!important}
@media(max-width:680px){#player:fullscreen .player-bar{padding-right:12px;padding-top:68px;min-height:116px}#player:fullscreen .sa-exit-fullscreen{right:12px;top:10px;font-size:13px}}

/* SERDEC Soomaali homepage card 3.5.8: use official new picture (both girls with hijab). */
.subjects-section .academy-grid > .subject-card:first-child .subject-image {
  background-image:url('./images/somali-hijab-card-final-358.webp?serdec_image=358');
  background-size:cover;
  background-position:center;
}
