:root
{
  --paper: #f6f7fb;
  --ink: #111;
  --muted: #444;
  --card: #fff;
  --line: #cfe0ff;
  --line2: #c9c9c9;
  --accent: #0d779e;
  --cta: #e4a170;
  --btn: #111;
  --radius: 18px;
  --shadow: 0 0 3px rgba( 0, 0, 0, 0.15 );
  --maxw: 1180px;

  --base:  clamp( 18px, 2.1vw, 22px );
  --h1:    clamp( 26px, 4.2vw, 44px );
  --h2:    clamp( 20px, 2.8vw, 28px );
  --small: clamp( 14px, 1.7vw, 18px );
}

html, body
{
  margin: 0;
  padding: 0;
  background: var( --paper );
  color: var( --ink );
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var( --base );
}

a
{
  color: #000000;
  font-weight: 700;
}
a:hover { text-decoration: none; }

.wrap
{
  max-width: var( --maxw );
  margin: 0 auto;
  padding: 14px 16px;
}

.topbar
{
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.brand
{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var( --ink );
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}

.brand img.logo
{
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.brand img[alt="EN-CA"]
{
  width: 22px !important;
  height: auto;
}

.cta
{
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba( 228, 161, 112, 0.30 );
  border: 2px solid rgba( 0, 0, 0, 0.14 );
  text-align: center;
  font-weight: 800;
  margin: 18px 0 12px 0;
}

.cta > br { display: none; }

.cta_tree_left img
{
  border-radius: 50%;
  height: auto;
  margin-left: 3rem;
  width: 10%;
}

.latestLink
{
  display: inline-block;
  background: #111;
  color: #fff;
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: clamp( 18px, 2.4vw, 24px );
  font-weight: 900;
  margin: 14px 0 16px 0;
}

.latestLink[aria-disabled="true"]
{
  pointer-events: none;
  opacity: 0.70;
}

.hero-card
{
  background: var( --card );
  border: 3px solid #0b6bd3;
  border-radius: 24px;
  padding: clamp( 14px, 2.6vw, 26px );
  box-shadow: var( --shadow );
}

#ALL .menu
{
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax( 210px, 1fr ) );
  gap: 18px 22px;
  justify-items: center;
  align-items: start;
  padding: 14px 10px;
}

#ALL .menu a
{
  width: 100%;
  max-width: 175px;

  display: block;
  text-decoration: none;
  background: #ffffff;
  border: 2px solid rgba( 47, 120, 255, 0.20 );
  border-radius: 14px;
  padding: 22px 16px 18px 16px;
  text-align: center;
  box-shadow: 0 10px 22px rgba( 0, 0, 0, 0.08 );
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  min-height: 170px;
}

#ALL .menu a:hover
{
  border-color: rgba( 47, 120, 255, 0.45 );
  box-shadow: 0 14px 28px rgba( 0, 0, 0, 0.12 );
}

#ALL .menu a:active
{
  transform: translateY( 1px );
}

#ALL .menu .uc-img
{
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* =========================================
   Color section layout
   ========================================= */

.subjects
{
  display: block;
  padding: 22px 14px;
  background: #ffffff;
  max-width: 1100px;
  margin: 10px auto 0 auto;
  text-align: center;
  border-radius: 22px;
}

.subjects .back
{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  text-decoration: none;
}

.subjects .back img
{
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.subjects .back img:hover
{
  transform: scale( 1.08 );
}

.subjects .links
{
  display: grid;
  grid-template-columns: repeat( auto-fit, minmax( 170px, 1fr ) );
  gap: 20px 24px;
  justify-items: center;
  padding: 10px 6px 24px 6px;
}

/* Each subject card holds:
   - main big tile (image + title)
   - sub buttons (up to 6)
*/
.subject-card
{
  width: 100%;
  max-width: 195px;
}

.subject-main,.subbtns
{
  width: 100%;

  display: block;
  text-decoration: none;
  background: #ffffff;
  border: 2px solid rgba( 47, 120, 255, 0.20 );
  border-radius: 16px;
  padding: 18px 14px 14px 14px;
  text-align: center;
  box-shadow: 0 10px 22px rgba( 0, 0, 0, 0.08 );
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;

  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
}

.subject-main:hover
{
  border-color: rgba( 47, 120, 255, 0.45 );
  box-shadow: 0 14px 28px rgba( 0, 0, 0, 0.12 );
  transform: translateY( -1px );
}

.subject-main:active
{
  transform: translateY( 1px );
  box-shadow: 0 8px 16px rgba( 0, 0, 0, 0.08 );
}

.subject-main .uc-img
{
  width: 150px;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.subject-main .uc1-img
{
  width: 180px;
  height: 180px;
}

.subject-title
{
  margin-top: 8px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.subbtns
{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.subbtn
{
  display: block;
  text-align: center;
  padding: 8px 6px;
  font-size: 0.82rem;
  border-radius: 12px;
  background: #eef2f7;
  color: #111;
  text-decoration: none;
  font-weight: 900;
  line-height: 1.1;
  border: 1px solid rgba( 0, 0, 0, 0.10 );
}

.subbtn:hover
{
  background: #dde6f0;
}

@media ( max-width: 700px )
{
  .subjects .links
  {
    grid-template-columns: repeat( 2, minmax( 160px, 1fr ) );
  }

  .subject-card
  {
    max-width: none;
  }
}

.card
{
  background: var( --card );
  border: 1px solid var( --line );
  border-radius: var( --radius );
  box-shadow: var( --shadow );
  padding: 16px 16px 14px 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.courseware_scroll
{
  background: #fbfaf7;
  border: 1px solid rgba( 0, 0, 0, 0.22 );
  border-radius: 12px;

  padding: 14px 16px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;

  font-size: 18px;
  line-height: 1.35;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.courseware_scroll::-webkit-scrollbar { width: 14px; }
.courseware_scroll::-webkit-scrollbar-track
{
  background: rgba( 0, 0, 0, 0.06 );
  border-radius: 10px;
}
.courseware_scroll::-webkit-scrollbar-thumb
{
  background: rgba( 0, 0, 0, 0.22 );
  border-radius: 10px;
}

.courseware_scroll h4
{
  margin: 12px 0 6px 0;
  font-size: 20px;
  font-weight: 900;
}

.courseware_scroll h4:first-child { margin-top: 0; }

.courseware_scroll ul
{
  margin: 0 0 10px 22px;
  padding: 0;
}

.courseware_scroll li
{
  margin: 0 0 6px 0;
}

.footer-note
{
  margin: 18px 0 0 0;
  text-align: center;
  font-size: small;
  opacity: 0.90;
}

.support-line
{
  margin: 0 auto 3rem auto;
  font-size: x-large;
  font-weight: bold;
  unicode-bidi: bidi-override;
  direction: rtl;
  text-align: center;
}

pre.license
{
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: clamp( 13px, 1.7vw, 16px );
  line-height: 1.4;
  background: #fafafa;
  border: 1px solid var( --line2 );
  border-radius: 14px;
  padding: 14px;
  margin: 0;
}

*, *:before, *:after
{
  box-sizing: border-box;
}

@media ( max-width: 420px )
{
  .subjects
  {
    padding: 18px 12px;
  }

  .subjects .links
  {
    grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
    gap: 10px 10px;
  }

  .subject-main
  {
    padding: 12px 10px 10px 10px;
    border-radius: 14px;
  }

  .subbtn
  {
    padding: 8px 6px;
    font-size: 0.86rem;
  }

  .cta_head
  {
    font-size: clamp( 22px, 3.0vw, 34px );
    font-weight: 950;
    line-height: 1.12;
    margin: 0 0 6px 0;
  }
}
.flagSprite30 {
	width: 64px;
	height: 48px;
	background-image: url( "flags/flags_sprite.png" );
	background-repeat: no-repeat;
	background-position: calc( var( --n, 0 ) * -64px ) 0;
	border-radius: 18%;
	display: inline-block;
}

/* Wrapper for flags */
.brand .flagRow
{
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;  /* space after "Jit For All" */
  line-height: 0;
  white-space: nowrap;
}

.brand .flagRow .flagTiny
{
  --flagScale: 0.35;
  transform: scale( var( --flagScale ) );
  transform-origin: left center;

  margin-right: calc( -64px * ( 1 - var( --flagScale ) ) );

  display: inline-block;
  vertical-align: middle;
}

.brand .flagRow .flagTiny:last-child
{
  margin-right: 0;
}



    .flagSprite30
    {
      width: 64px;
      height: 48px;
      background-image: url( "/flags/flags_sprite.png" );
      background-repeat: no-repeat;
      background-position: calc( var( --n, 0 ) * -64px ) 0;
      border-radius: 18%;
      display: inline-block;
    }



.flagTiny { transform: scale(0.35); transform-origin: left center; }

