/* ================= RESPONSIVE: mobile, tablet and desktop (loads after main.css) =================
 * 1. BASE            images, tables, overflow, tap sizes
 * 2. MENU DRAWER     hamburger menu for tablet, small laptops and mobile (1280px and below)
 * 3. TABLET          up to 900px
 * 4. PHONE           up to 600px
 * 5. SMALL PHONE     up to 380px
 * 6. CUT-OFF TABLE   Course | year | year
 * 7. DESKTOP MENU    one clean line from 1281px up, sub-menus stay on screen
 * 8. SHORT SCREENS   phone held sideways, small laptop windows
 * 9. CONTENT FIXES   consent line, fact tables, scroll hint on wide tables
 * 10. ADMIN BAR      drawer sits below the WordPress bar when you are logged in
 * ============================================================================================ */

/* ================= 1. BASE ================= */
html{-webkit-text-size-adjust:100%}
img,video,iframe,svg{max-width:100%}img{height:auto}
body{overflow-x:hidden}
.ca-tw,.ca-cmp-out{overflow-x:auto;-webkit-overflow-scrolling:touch}
.ca-btn,.ca-ddb,.ca-menu>li>a{min-height:44px}
.ca-burger,.ca-nav-ov,.ca-nav-x{display:none}

/* ================= 2. MENU DRAWER (tablet and mobile) ================= */
@media(max-width:1280px){
  .ca-header .ca-hd-in,.ca-header .ca-hd-sec>.elementor-container{display:flex;flex-wrap:wrap;align-items:center;gap:0 12px;padding:8px 14px;max-width:none}
  .ca-header .ca-hd-c1,.ca-header .ca-hd-c2{width:100%!important;flex:1 1 100%;min-width:0}
  .ca-header .elementor-column.ca-hd-c1>.elementor-widget-wrap,.ca-header .elementor-column.ca-hd-c2>.elementor-widget-wrap{padding:0!important}
  .ca-header .ca-hd-c1 .elementor-widget,.ca-header .ca-hd-c2 .elementor-widget{margin-bottom:0!important}
  .ca-header .ca-hd-c1,.ca-header .ca-logo{padding-right:60px}
  .ca-header .ca-hd-c1 img,.ca-header .ca-logo img{max-height:46px;width:auto}
  .ca-logo img{max-height:46px;width:auto}
  .ca-burger{display:flex;align-items:center;justify-content:center;width:46px;height:46px;position:absolute;top:8px;right:14px;z-index:3;border:1px solid var(--bd);border-radius:12px;background:var(--card);cursor:pointer;padding:0}
  .ca-burger span,.ca-burger span:before,.ca-burger span:after{display:block;width:22px;height:2px;background:var(--pri);border-radius:2px;position:relative;content:""}
  .ca-burger span:before{position:absolute;top:-7px;left:0}.ca-burger span:after{position:absolute;top:7px;left:0}
  .ca-burger span{position:relative}
  .ca-hd-r{flex:1 1 100%;order:3;min-width:0}
  /* the course pills stay visible under the logo row and scroll sideways */
  .ca-strip{display:flex;gap:10px;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:4px 0 6px;margin:0}
  .ca-strip::-webkit-scrollbar{display:none}
  .ca-pills{display:flex;flex-wrap:nowrap;gap:8px;white-space:nowrap;margin:0;padding:0;list-style:none}.ca-pills li{flex:0 0 auto}.ca-allbtn{flex:0 0 auto}
  /* the menu itself becomes a slide-in drawer */
  .ca-nav{position:fixed;top:0;right:0;bottom:0;width:min(88vw,380px);height:100vh;height:100dvh;background:var(--bg);z-index:1001;display:flex!important;flex-direction:column;gap:0;margin:0;padding:64px 0 24px;overflow-y:auto;-webkit-overflow-scrolling:touch;box-shadow:-14px 0 34px rgba(0,0,0,.28);transform:translateX(105%);visibility:hidden;transition:transform .25s ease,visibility .25s}
  body.ca-nav-open .ca-nav{transform:none;visibility:visible}
  .ca-nav-ov{display:block;position:fixed;inset:0;background:rgba(20,5,10,.5);z-index:1000;opacity:0;pointer-events:none;transition:opacity .2s}
  body.ca-nav-open .ca-nav-ov{opacity:1;pointer-events:auto}
  body.ca-nav-open{overflow:hidden}
  .ca-nav-x{display:flex;align-items:center;justify-content:center;position:absolute;top:12px;right:14px;width:44px;height:44px;border:1px solid var(--bd);border-radius:12px;background:var(--card);font-size:26px;line-height:1;color:var(--pri);cursor:pointer;padding:0}
  .ca-nl{display:block!important;width:100%;margin:0;padding:0}
  .ca-nav .ca-menu{display:block!important;margin:0;padding:0;list-style:none;width:100%}
  .ca-nav .ca-menu>li{display:block;border-bottom:1px solid var(--bd)}
  .ca-nav .ca-menu>li>a,.ca-nav .ca-ddb{display:flex;align-items:center;justify-content:space-between;width:100%;padding:14px 20px;font-size:16px;font-weight:600;color:var(--fg,inherit);text-align:left;background:none;border:0;border-bottom:1px solid var(--bd);border-radius:0;margin:0;text-decoration:none;cursor:pointer}
  .ca-nav .ca-menu>li>a{border-bottom:0}
  .ca-nav .menu-item-has-children>a:after,.ca-nav .ca-ddb:after{content:"\25BE";margin-left:8px;transition:transform .2s;color:var(--pri)}
  .ca-nav li.open>a:after,.ca-nav .ca-ddb[aria-expanded=true]:after{transform:rotate(180deg)}
  .ca-nav .ca-ddb:after{content:none}
  .ca-nav .sub-menu{position:static!important;display:none!important;box-shadow:none;border:0;border-radius:0;background:var(--card);margin:0;padding:4px 0;min-width:0;width:100%;opacity:1;visibility:visible;transform:none}
  .ca-nav li.open>.sub-menu{display:block!important}
  .ca-nav .sub-menu a{display:block;padding:12px 20px 12px 34px;font-size:15px;color:var(--fg,inherit);text-decoration:none;border-bottom:1px solid var(--bd)}
  .ca-nav .ca-dd{position:static;width:100%}
  .ca-nav .ca-ddp{position:static!important;display:block;width:100%;max-height:none;box-shadow:none;border:0;border-radius:0;background:var(--card);padding:6px 0;columns:1;transform:none}
  .ca-nav .ca-ddp[hidden]{display:none}
  .ca-nav .ca-ddb[aria-expanded=true] span{display:inline-block;transform:rotate(180deg)}
  .ca-nav .ca-sm{width:calc(100% - 24px);margin:6px 12px 0}
  .ca-nav .ca-sml{padding:2px 6px}.ca-nav .ca-sml[hidden]{display:none}
  .ca-nav .ca-ddp a{display:block;padding:11px 20px 11px 34px;font-size:15px;text-decoration:none;color:var(--fg,inherit)}
  .ca-nav .ca-ddp h4{margin:10px 20px 2px;font-size:13px;color:var(--pri);text-transform:uppercase}
  .ca-nr{display:flex;flex-wrap:wrap;gap:10px;padding:18px 20px 0;margin:0;width:100%}.ca-nr .ca-btn{flex:1 1 140px;text-align:center;justify-content:center}
  .ca-pbar{font-size:11px}
}

/* ================= 3. TABLET (up to 900px) ================= */
@media(max-width:900px){
  .ca-wrap{padding-left:16px;padding-right:16px}
  .ca-h1{font-size:clamp(24px,5.2vw,32px)}
  .ca-hero-card{margin-top:14px}
  .ca-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
  .ca-blog-grid{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
  .ca-bk-grid{grid-template-columns:1fr}
  .ca-cc{grid-template-columns:70px 1fr}.ca-ccb{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap}
  .ca-footer .ca-ft-in{padding-left:16px;padding-right:16px}
  .ca-ftm{display:flex;flex-wrap:wrap;gap:8px 16px;padding:0;list-style:none}
  .ca-modal{width:min(520px,calc(100vw - 24px));max-height:92vh;overflow-y:auto}
}

/* ================= 4. PHONE (up to 600px) ================= */
@media(max-width:600px){
  body{font-size:16px}
  .ca-wrap{padding:16px 14px}
  .ca-h1{font-size:clamp(22px,6.6vw,28px);line-height:1.2}
  .ca-wrap h2,.ca-enr h2{font-size:clamp(19px,5.4vw,23px)}.ca-wrap h3{font-size:clamp(17px,4.8vw,20px)}
  .ca-search{flex-wrap:wrap;gap:8px}.ca-search input[type=search],.ca-search input{flex:1 1 100%;min-width:0}.ca-search .ca-btn{flex:1 1 100%}
  .ca-btn{padding:12px 16px}
  .ca-form input,.ca-form select,.ca-tool input,.ca-tool select,.ca-tool textarea,.ca-search input{font-size:16px}
  .ca-tg,.ca-fg,.ca-cmp-sel{grid-template-columns:1fr!important}
  .ca-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .ca-tile{padding:12px}.ca-tile strong{font-size:15px}
  .ca-blog-grid{grid-template-columns:1fr}
  .ca-cc{grid-template-columns:1fr}.ca-ccl{display:none}
  .ca-table{font-size:13px;min-width:0}.ca-table th,.ca-table td{padding:7px}
  .ca-tw>.ca-table:not(.ca-cutoff3),.ca-cmp-out .ca-table{min-width:520px}
  .ca-rr-big{font-size:28px}.ca-rr-next .ca-btn{flex:1 1 100%;text-align:center}.ca-rr-head,.ca-rr-hero,.ca-rr-grid,.ca-rr-know{padding-left:14px;padding-right:14px}
  .ca-bank{padding:12px}.ca-fit{margin-left:0}
  .ca-modal{width:calc(100vw - 16px);padding:16px}
  .ca-ad{max-width:100%;overflow:hidden}.ca-ad-ph{width:100%!important}
  .ca-toc{padding:10px 12px}
  .ca-footer .ca-ft-in{padding-left:14px;padding-right:14px}
  .ca-blogpost .ca-bp-body{font-size:16px}
  .ca-hero-card .ca-hero-img{width:64px;height:64px}
}

/* ================= 5. SMALL PHONE (up to 380px) ================= */
@media(max-width:380px){
  .ca-grid{grid-template-columns:1fr}
  .ca-logo img{max-height:40px}
  .ca-nav{width:92vw}
}

/* ================= 6. CUT-OFF TABLE: Course | 2025 | 2026 ================= */
.ca-cutoff3{width:100%;border-collapse:collapse}
.ca-cutoff3 th:first-child{width:46%}
.ca-cutoff3 td:first-child{background:var(--card);font-weight:600;color:var(--pri)}
.ca-cutoff3 th{text-align:center}.ca-cutoff3 td:not(:first-child){text-align:center;white-space:nowrap}
.ca-cutoff3 .ca-cn{display:block;color:var(--mut);font-weight:400;white-space:normal}
@media(max-width:600px){.ca-cutoff3 th:first-child{width:auto}.ca-cutoff3 td,.ca-cutoff3 th{padding:8px 6px}}

/* ================= 7. DESKTOP MENU (1281px and wider) =================
 * One clean line: logo, menu, Call and Counselling. Sub-menus never run off the screen. */
@media(min-width:1281px){
  .ca-header .ca-hd-sec.elementor-section-boxed>.elementor-container,.ca-header .ca-hd-sec>.elementor-container{max-width:1440px;gap:32px}
  .ca-header .ca-hd-in{gap:32px}
  .ca-header .ca-hd-c1{flex:0 0 auto;width:auto!important}
  .ca-header .ca-hd-c2{flex:1 1 0;width:auto!important;min-width:0}
  .ca-nl,.ca-menu{gap:16px}
  .ca-menu a,.ca-ddb,.ca-nr .ca-btn,.ca-allbtn,.ca-pills a{white-space:nowrap}
  .ca-menu .sub-menu{max-height:calc(100vh - 150px);overflow-y:auto;min-width:230px;max-width:min(380px,92vw)}
  .ca-menu>li:nth-last-child(-n+2)>.sub-menu{left:auto;right:0}
  .ca-ddp{max-height:calc(100vh - 150px)}
}

/* ================= 8. SHORT SCREENS (phone sideways, small laptop windows) ================= */
@media(max-height:520px){
  .ca-header{position:relative}
  .ca-nav{padding-top:56px}
}

/* ================= 9. CONTENT FIXES (found by testing every page type on phone, tablet and desktop) =================
 * Consent line, two-column fact tables, scroll hint on wide tables, button spacing. */
.ca-consent{display:block;position:relative;padding-left:26px;line-height:1.5}
.ca-consent input{position:absolute;left:0;top:3px;margin:0;padding:0;width:auto;height:auto}
@media(max-width:767px){
  .ca-tw>.ca-table.kv{min-width:0;width:100%;table-layout:auto}
  .ca-table.kv td:first-child{width:36%;min-width:90px}
  .ca-table.kv td{overflow-wrap:anywhere}
  .ca-tw{background:linear-gradient(to right,var(--bg),var(--bg)),linear-gradient(to right,var(--bg),var(--bg)),linear-gradient(to right,rgba(0,0,0,.2),rgba(0,0,0,0)),linear-gradient(to left,rgba(0,0,0,.2),rgba(0,0,0,0));background-position:left center,right center,left center,right center;background-repeat:no-repeat;background-color:var(--bg);background-size:22px 100%,22px 100%,12px 100%,12px 100%;background-attachment:local,local,scroll,scroll}
  .ca-btns .elementor-widget{margin-bottom:8px!important}
  .ca-hero.elementor-section>.elementor-container{padding-left:6px;padding-right:6px}
}

/* ================= 10. LOGGED-IN ADMIN BAR =================
 * When you are logged in, WordPress shows a black bar on top (32px, 46px on phones). The menu drawer starts below it,
 * so the close button and the first items are never hidden. Visitors never see this. */
.admin-bar .ca-nav{top:32px;bottom:0;height:auto}
.admin-bar .ca-nav-ov{top:32px}
@media(max-width:782px){.admin-bar .ca-nav{top:46px}.admin-bar .ca-nav-ov{top:46px}}
