/* ============================================================================
   TSC Affordable Home Study Chrome - v1.0 - November 2026
   Header + footer for the cacourseprovider.com back-end pages, and the
   phone layout for those pages: register, login, student home, chapter view
   and payment. Stand-alone: references no other site's stylesheet.
   ----------------------------------------------------------------------------
   PART 1  header + footer ("airmail": stamp logo, red/ink airmail stripe,
           Archivo + Source Serif 4). Colours are the site's own, copied
           from affordablehomestudy.com styles.css :root (Nov 2026): ink
           #1B2A41 for structure, --act red #C0392B for action only.
   PART 2  phone layout for the platform pages (Foundation 5 base,
           register.css, the login page's inline styles, menu/chapter
           sheets). Layout only: no colours, fonts or button styles change.

   DESKTOP IS UNTOUCHED. Part 1 only styles .ahs-* elements. Every Part 2
   rule sits inside a max-width media query.

   ISOLATION
   - Part 1: every selector starts with .ahs-chrome and every class is
     ahs-*. Nothing targets a bare element or a class the platform uses
     (.row, .columns, .button, .label, .top-bar, .nav, .brand, .foot...).
     Foundation's globals (a colour, ul margins, small at 60%, b, h-tags)
     are reset inside the chrome only.
   - Part 2: every selector starts with ":root body". The platform links
     some sheets inside <body> (register.css) or after the header record,
     so they load AFTER this one; the prefix adds (0,1,1) so these rules
     still win at the same base specificity, whatever the load order.
   ========================================================================= */

/* =========================== PART 1: CHROME =========================== */
.ahs-chrome{
  /* = styles.css :root. Structure is ink; red is action only. */
  --ahsc-ink:#1B2A41;      --ahsc-ink-soft:#5A6579;
  --ahsc-paper:#FDFBF6;    --ahsc-line:#EFE6D5;
  --ahsc-act:#C0392B;      --ahsc-act-dk:#8E2116;  --ahsc-act-hi:#D2503F;
  --ahsc-foot-text:#CFC5B5;
  --ahsc-head:"Archivo",Arial,Helvetica,sans-serif;
  --ahsc-serif:"Source Serif 4",Georgia,"Times New Roman",serif;
  --ahsc-wrap:1120px;

  display:block;width:100%;margin:0;padding:0;
  font:400 16px/1.55 var(--ahsc-serif);color:var(--ahsc-ink);
  text-align:left;letter-spacing:normal;
  -webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;
}
.ahs-chrome *,.ahs-chrome *::before,.ahs-chrome *::after{box-sizing:border-box}
.ahs-chrome ul,.ahs-chrome li{margin:0;padding:0;list-style:none}
.ahs-chrome p{margin:0}
.ahs-chrome b{font-weight:700}
.ahs-chrome small{font-size:12px;line-height:1.2}
.ahs-chrome svg{display:block;margin:0;max-width:none}
.ahs-chrome a{color:inherit;text-decoration:none}
.ahs-chrome .ahs-in{max-width:var(--ahsc-wrap);margin:0 auto;padding:0 24px}

.ahs-chrome .ahs-skip{position:absolute;left:-9999px}
.ahs-chrome .ahs-skip:focus{left:12px;top:12px;z-index:99;background:var(--ahsc-ink);color:#fff;
  padding:12px 18px;font-family:var(--ahsc-head);font-weight:700}
.ahs-chrome a:focus-visible{outline:3px solid var(--ahsc-act);outline-offset:3px}

/* ---- airmail stripe (top of footer, under header) ---- */
.ahs-chrome.ahs-airmail{height:11px;
  background:
    repeating-linear-gradient(45deg,var(--ahsc-act) 0 13px,transparent 13px 26px),
    repeating-linear-gradient(45deg,transparent 0 13px,var(--ahsc-ink) 13px 26px),
    var(--ahsc-paper)}

/* ---- header ---- */
.ahs-chrome.ahs-top{position:relative;z-index:20;background:var(--ahsc-paper);
  border-bottom:1px solid var(--ahsc-line)}
.ahs-chrome.ahs-top .ahs-in{display:grid;
  grid-template-columns:auto 1fr auto auto;grid-template-areas:"brand nav phone signin";
  align-items:center;gap:12px 24px;min-height:76px;padding-top:10px;padding-bottom:10px}

.ahs-chrome .ahs-brand{grid-area:brand;display:flex;align-items:center;gap:10px;color:var(--ahsc-ink)}
.ahs-chrome .ahs-stamp{width:44px;height:44px;flex:none;color:var(--ahsc-act);transform:rotate(-4deg);
  filter:drop-shadow(3px 4px 0 rgba(27,42,65,.11))}
.ahs-chrome .ahs-brand-name{display:flex;flex-direction:column;line-height:1.1}
.ahs-chrome .ahs-brand-name b{font:800 19px/1.1 var(--ahsc-head);letter-spacing:-.01em;color:var(--ahsc-ink)}
.ahs-chrome .ahs-brand-name span{font:600 11px/1.3 var(--ahsc-head);letter-spacing:.08em;
  text-transform:uppercase;color:var(--ahsc-ink-soft);margin-top:3px}

.ahs-chrome .ahs-nav{grid-area:nav;justify-self:center}
.ahs-chrome .ahs-nav ul{display:flex;gap:4px;align-items:center}
.ahs-chrome .ahs-nav a{display:inline-flex;align-items:center;gap:5px;padding:8px 12px;
  font:600 15px/1 var(--ahsc-head);color:var(--ahsc-ink);border-bottom:2px solid transparent}
.ahs-chrome .ahs-nav a:hover{color:var(--ahsc-ink);border-bottom-color:var(--ahsc-act)}
.ahs-chrome .ahs-nav a.ahs-lang{color:var(--ahsc-ink-soft)}
.ahs-chrome .ahs-nav a.ahs-lang svg{width:16px;height:16px}

.ahs-chrome .ahs-phone{grid-area:phone;display:flex;flex-direction:column;text-align:right;line-height:1.15}
.ahs-chrome .ahs-phone small{font-family:var(--ahsc-head);color:var(--ahsc-ink-soft)}
.ahs-chrome .ahs-phone b{font:700 18px/1.15 var(--ahsc-head);color:var(--ahsc-ink);white-space:nowrap}
/* the site's red pill: white on --act is 5.4:1 */
.ahs-chrome .ahs-signin{grid-area:signin;font:700 15px/1 var(--ahsc-head);letter-spacing:.02em;
  color:#fff;white-space:nowrap;padding:12px 18px;border-radius:999px;
  background:linear-gradient(180deg,var(--ahsc-act-hi) 0%,var(--ahsc-act) 60%,var(--ahsc-act-dk) 100%);
  box-shadow:0 2px 0 0 var(--ahsc-act-dk),inset 0 1px 0 0 rgba(255,255,255,.3);
  transition:transform .12s ease,box-shadow .12s ease}
.ahs-chrome .ahs-signin:hover{color:#fff;transform:translateY(-1px);
  box-shadow:0 3px 0 0 var(--ahsc-act-dk),inset 0 1px 0 0 rgba(255,255,255,.3)}
.ahs-chrome .ahs-signin:active{transform:translateY(1px);box-shadow:0 1px 0 0 var(--ahsc-act-dk)}

/* ---- footer ---- */
.ahs-chrome.ahs-foot{clear:both;background:var(--ahsc-ink);color:var(--ahsc-foot-text);
  padding:40px 0 28px;font-size:15px;line-height:1.6}
.ahs-chrome .ahs-foot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
.ahs-chrome .ahs-foot-grid b{display:block;margin:0 0 8px;font:800 13px/1.2 var(--ahsc-head);
  letter-spacing:.1em;text-transform:uppercase;color:#fff}
.ahs-chrome.ahs-foot a{color:#fff;text-decoration:none;border-bottom:1px solid rgba(255,255,255,.35);
  overflow-wrap:anywhere}
.ahs-chrome.ahs-foot a:hover{border-bottom-color:#fff}
.ahs-chrome .ahs-foot-base{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px 24px;
  margin-top:28px;padding-top:18px;border-top:1px solid rgba(255,255,255,.16);font-size:14px}

/* ---- header/footer responsive ---- */
@media (max-width:900px){
  /* row 1: logo + Sign in; row 2: the nav. The header phone number hides
     here (no room beside the logo); the footer keeps it as tap-to-call. */
  .ahs-chrome.ahs-top .ahs-in{grid-template-columns:1fr auto;
    grid-template-areas:"brand signin" "nav nav";min-height:0;gap:8px 12px}
  .ahs-chrome .ahs-phone{display:none}
  .ahs-chrome .ahs-nav{justify-self:stretch;border-top:1px solid var(--ahsc-line);padding-top:4px}
  .ahs-chrome .ahs-nav ul{justify-content:space-between;gap:0}
  .ahs-chrome .ahs-nav a{padding:13px 8px;min-height:44px}
  .ahs-chrome .ahs-foot-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  .ahs-chrome .ahs-in{padding:0 16px}
  .ahs-chrome .ahs-stamp{width:38px;height:38px}
  .ahs-chrome .ahs-brand-name b{font-size:16px}
  .ahs-chrome .ahs-brand-name span{font-size:10px;letter-spacing:.05em}
  .ahs-chrome .ahs-signin{padding:11px 14px;font-size:14px}
  .ahs-chrome .ahs-nav a{font-size:14px;padding:13px 4px}
  .ahs-chrome .ahs-foot-grid{grid-template-columns:1fr;gap:22px}
  /* taller tap rows; padding sits above the text so the site's thin
     underline stays tight under the words */
  .ahs-chrome.ahs-foot a{display:inline-block;padding:10px 0 1px;line-height:1.3}
  .ahs-chrome .ahs-foot-base{flex-direction:column}
}


/* ==================== PART 2: PLATFORM PAGES ON PHONES ====================
   Foundation 5 breakpoints: small <= 40em (640px), medium <= 64em (1024px).
   ========================================================================= */

/* ---- everything: no page wider than the screen ---- */
@media only screen and (max-width:64em){
  :root body img{max-width:100%;height:auto}
  :root body table[width]{max-width:100%}

  /* chapter-review pop-up and notice box: positioned for a ~900px window */
  :root body #chapreview{left:8px;right:8px;width:auto;margin-left:0;height:80vh;max-width:none}
  :root body #chapreview iframe{width:100%;height:calc(100% - 21px);box-sizing:border-box}
  :root body #reviewbar{width:auto;box-sizing:border-box}
  :root body #notice{left:8px;right:8px;margin-left:0;max-width:none;box-sizing:border-box}
}

@media only screen and (max-width:40em){
  /* any text field or select: fits, and 16px so iPhones don't zoom on tap */
  :root body input[type="text"],:root body input[type="email"],:root body input[type="password"],
  :root body input[type="tel"],:root body input[type="number"],:root body input:not([type]),
  :root body select,:root body textarea{max-width:100%;font-size:16px;box-sizing:border-box}

  /* fixed-width tables (width="600" etc.) fill the screen instead */
  :root body table[width]{width:100%}
  :root body td[width]{width:auto}

  /* Foundation rows/columns: keep inside the screen */
  :root body .row{max-width:100%}
}


/* ================================ REGISTER ================================ */
@media only screen and (max-width:40em){
  :root body #registration_left_panel,
  :root body #registration_panel,
  :root body #registration_container{
    float:none;clear:both;width:auto;max-width:100%;margin-left:0;margin-right:0;box-sizing:border-box}
  :root body #registration_panel{padding-left:0;padding-right:0}

  /* left panel: title, then the steps in one row */
  :root body #registration_left_panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;margin-bottom:16px}
  :root body #registration_left_panel > *{grid-column:1 / -1}
  :root body #registration_left_panel > br{display:none}
  :root body #registration_left_panel > #reg_bread,
  :root body #registration_left_panel > .reg_bread{grid-column:auto;width:auto;margin:0;min-width:0;overflow:hidden}
  :root body #registration_left_panel #bread_container,
  :root body #registration_left_panel .bread_container{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  :root body #registration_container .registration_subdivision{width:auto;max-width:100%;
    box-sizing:border-box;margin-left:0;margin-right:0}
  :root body #registration_container .registration_subdivision table{width:100%}

  /* each row: label on top, field full width */
  :root body #registration_container .frm_row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;
    width:auto;max-width:100%;height:auto;box-sizing:border-box;text-align:left}
  :root body #registration_container .frm_row > br{display:none}
  :root body #registration_container .frm_row label.form{float:none;display:block;flex:0 0 100%;
    width:auto;margin:0;text-align:left}
  :root body #registration_container .frm_row .desc{flex:0 0 100%}
  :root body #registration_container .frm_row .contact_field{flex:1 1 100%;width:100%;max-width:100%;
    height:auto;min-height:44px;margin:0;font-size:16px;box-sizing:border-box}
  :root body #registration_container .frm_row select{flex:1 1 0;min-width:0;width:auto;max-width:100%;
    min-height:44px;margin:0;font-size:16px;box-sizing:border-box}
  :root body #registration_container .frm_row select:only-of-type{flex-basis:100%}
  :root body #registration_container .frm_row label.form input[type="checkbox"]{width:22px;height:22px;
    margin:0 0 0 6px;vertical-align:middle}
  :root body #registration_container input[type="radio"]{width:20px;height:20px;vertical-align:middle}

  /* "Other (please specify)" */
  :root body #registration_container #refer{flex:0 0 100%;max-width:100%}
  :root body #registration_container #refer input{display:block;width:100%;max-width:100%;
    min-height:44px;margin:6px 0 0;font-size:16px;box-sizing:border-box}

  /* Next button: its own style, only kept inside the screen */
  :root body #registration_container .button,
  :root body #registration_container input[type="submit"]{max-width:100%;box-sizing:border-box}
}
@media only screen and (max-width:23.75em){ /* 380px: month gets its own line */
  :root body #registration_container .frm_row select[name="dobMonth"]{flex-basis:100%}
}


/* ============================ LOGIN (login.php) ============================
   The login page's inline <style> sets #login_panel to 350px over a 350x250
   background and its inputs to 240px: ~20px off a 360px phone.
   ========================================================================= */
@media only screen and (max-width:25em){
  :root body #login_container{margin-top:20px}
  :root body #login_container #login_panel{width:100%;max-width:350px;height:auto;min-height:250px;
    padding-bottom:16px;background-size:100% 100%;box-sizing:border-box}
  /* inputs are 70% wide and centred, so labels start 15% in to line up */
  :root body #login_container #login_panel .label{padding-left:15%}
  :root body #login_container #login_panel .login_form{width:70%;max-width:240px;margin:0 auto 10px;
    font-size:16px;min-height:44px;box-sizing:border-box}
  /* sized to its label: short and wide, not a tall square */
  :root body #login_container #login_panel input[type="submit"]{min-height:0;height:auto;width:auto;
    padding:8px 22px;line-height:1.2}
}


/* ======================== STUDENT HOME (home.php) ======================== */
@media only screen and (max-width:40em){
  :root body #menu_container,:root body #menu_header,:root body #change_reg{
    width:auto;max-width:100%;box-sizing:border-box}
  :root body #menu_header{min-height:0;height:auto;overflow:hidden}
  :root body #menu_header #stoplight_container,
  :root body #menu_header #profile_container{float:none;width:auto;height:auto;max-width:100%;box-sizing:border-box}
  :root body #menu_header #profile_container{margin-top:10px}
  :root body #red_light,:root body #yellow_light,:root body #green_light{width:auto;max-width:100%}
  /* chapter/status table: scroll sideways inside itself, never the page */
  :root body #menu_table,:root body #menu_container table{display:block;max-width:100%;
    overflow-x:auto;-webkit-overflow-scrolling:touch}
  :root body #prog_bar,:root body #prog_bar img{max-width:100%}
  :root body .change_label{text-align:left}
}


/* ========================= CHAPTER VIEW (show.php) ========================= */
@media only screen and (max-width:40em){
  :root body #content_container,:root body #template_container,
  :root body #course_content,:root body #content_chapter_container{
    max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
  :root body #course_content,:root body #content_chapter_container{padding-left:6px;padding-right:6px}

  :root body #course_content iframe,:root body #course_content video,
  :root body #course_content embed,:root body #course_content object{max-width:100%}
  :root body #course_content video{height:auto}
  :root body #course_content iframe[src*="youtube"],:root body #course_content iframe[src*="youtu.be"],
  :root body #course_content iframe[src*="vimeo"]{width:100%;height:auto;aspect-ratio:16 / 9}

  /* floated images drop above their text instead of squeezing it */
  :root body #course_content .img_lt,:root body #course_content .img_rt,
  :root body #course_content .left,:root body #course_content .right,
  :root body #course_content .img_l,:root body #course_content .img_r{
    float:none;display:block;margin-left:auto;margin-right:auto;padding-left:0;padding-right:0}

  /* content tables keep their layout and scroll inside themselves */
  :root body #course_content table{display:block;max-width:100%;overflow-x:auto;
    -webkit-overflow-scrolling:touch;overflow-wrap:normal}

  /* fixed-width boxes */
  :root body .chapter_title{width:auto;max-width:100%;height:auto;min-height:40px;box-sizing:border-box}
  :root body div#transcript1,:root body div#transcript2,:root body div#transcript3,
  :root body div#transcript4,:root body div#transcript5,:root body div#transcript6{
    width:auto;max-width:100%;box-sizing:border-box}
  :root body .one_liners,:root body .insurance_claims,:root body .real_jokes{
    float:none;width:auto;max-width:100%;box-sizing:border-box}
  :root body div.joke_container{width:auto;max-width:100%;margin-left:0;margin-right:0}
  :root body .movie_container,:root body .movie_label,:root body .movie_sub{width:auto;max-width:100%}
  :root body .joke_guy,:root body .joke_image,:root body .trivia_image,:root body .smiley_face{float:none}
  :root body .joke_time{margin-left:0;width:auto}
  :root body #course_content ul,:root body #course_content ol{margin-left:22px}

  /* bottom dock (back / next) */
  :root body #dock{width:auto;height:auto;padding:6px 10px;overflow:hidden;box-sizing:border-box}
  :root body .dock_content{width:auto;float:none;padding:4px 0}
  :root body .dock_content a{display:inline-block;min-height:44px;line-height:44px;margin:0 15px 0 0}

  /* quiz answers: bigger radio targets */
  :root body .answer input[type="radio"]{width:20px;height:20px;vertical-align:middle}
}


/* =============================== PAYMENT ===============================
   The payment pages are label/field tables and fixed-width boxes; some
   widths are written inline in the HTML, which only !important overrides.
   ========================================================================= */
@media only screen and (max-width:40em){
  /* label / field table rows stack: label above field */
  :root body td.label,:root body td.field{display:block;width:auto;text-align:left;
    padding-left:0;padding-right:0}
  :root body td.label{padding-top:10px}

  /* boxes with an inline pixel width (coupon / voucher rows) */
  :root body div[style*="width"][style*="px"]{
    width:auto!important;max-width:100%!important;box-sizing:border-box}
  :root body label.form[style*="float"],:root body input[style*="float"]{float:none!important}
  :root body label.form[style*="width"]{width:auto!important;display:block}

  /* upgrade / shipping options: image + price, then choice + description */
  :root body .shipping_option{display:grid;grid-template-columns:28px minmax(0,1fr) auto;
    grid-template-areas:"img img price" "pick text text";align-items:center;gap:8px 6px;
    max-width:100%;box-sizing:border-box}
  :root body .shipping_option > *{grid-column:1 / -1;min-width:0}
  :root body .shipping_option > .clear{display:none}
  :root body .shipping_option > .upgrade_img{grid-area:img;float:none;margin:0}
  :root body .shipping_option > .upgrade_img img{max-height:64px;width:auto;margin:0}
  :root body .shipping_option > .price{grid-area:price;float:none;margin:0;text-align:right;white-space:nowrap}
  :root body .shipping_option > input[type="radio"],
  :root body .shipping_option > input[type="checkbox"]{grid-area:pick;float:none;width:22px;height:22px;
    margin:0;align-self:start}
  :root body .shipping_option > label.form{grid-area:text;float:none;width:auto;display:block;margin:0;
    text-align:left;overflow-wrap:anywhere}

  :root body .payment_panel,:root body .pricing_panel,:root body #receipt,
  :root body #fax_email_container,:root body #discount_container,
  :root body #option_container,:root body #cert_header,:root body #lite_payment_container{
    width:auto;max-width:100%;margin-left:0;margin-right:0;box-sizing:border-box}
  :root body .title,:root body .text_form{float:none}
  :root body .text_form input,:root body .text_form select{width:100%;min-height:44px}
  :root body #payment_container{position:static;width:auto;height:auto}
}
