/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Cade's Home Plan — styles.css
   Touch-optimized for wall-mount tablet (2–4 ft viewing distance)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── CSS VARIABLES ── */
:root {
  --blue:        #1565C0;
  --blue-mid:    #1976D2;
  --blue-bright: #2196F3;
  --blue-light:  #E3F2FD;
  --blue-xlight: #F0F8FF;
  --yellow:      #FFD600;
  --yellow-dark: #F9A825;
  --yellow-light:#FFFDE7;
  --dad:         #2E7D32;
  --dad-mid:     #388E3C;
  --dad-light:   #E8F5E9;
  --mom:         #C2185B;
  --mom-mid:     #D81B60;
  --mom-light:   #FCE4EC;
  --either:      #5E35B1;
  --either-light:#EDE7F6;
  --bg:          #F0F7FF;
  --card:        #FFFFFF;
  --text:        #0D1B2A;
  --muted:       #4A5568;
  --light:       #8896A8;
  --border:      rgba(21,101,192,0.13);
  --border-med:  rgba(21,101,192,0.22);
  --shadow:      0 2px 14px rgba(21,101,192,0.10);
  --shadow-lg:   0 6px 28px rgba(21,101,192,0.16);
  --r:           14px;
  --r-sm:        8px;
  --r-pill:      50px;
}

/* ── RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* Prevent accidental text selection on long-press / fat-finger */
  -webkit-user-select: none;
  user-select: none;
  /* Disable double-tap zoom on interactive areas; allow natural scroll */
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

/* Allow text selection inside content cards where reading occurs */
.card-body, .script, .doc-script, .step-text {
  -webkit-user-select: text;
  user-select: text;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  /* 17px base — readable at 2–4 ft on wall mount */
  font-size: 17px;
  line-height: 1.65;
  /* Prevent overscroll bounce on iOS */
  overscroll-behavior: none;
}

/* ── HEADER ── */
.header {
  background: linear-gradient(135deg,#0D47A1 0%,#1565C0 40%,#1976D2 70%,#1E88E5 100%);
  padding: 2.5rem 2rem 2.25rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.header::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 30%;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(255,214,0,0.07);
}
.hdr {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  /* Padding right so travel button doesn't overlap title */
  padding-right: 5.5rem;
}
.hdr-tag {
  display: inline-block;
  background: var(--yellow);
  color: #0D47A1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin-bottom: 14px;
}
.hdr h1 {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 10px;
}
.hdr h1 span { color: var(--yellow); }
.hdr-sub {
  font-size: 14px;
  color: rgba(255,255,255,.72);
  max-width: 500px;
  line-height: 1.6;
}
.hdr-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hdr-pill {
  background: rgba(255,255,255,.13);
  color: rgba(255,255,255,.9);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.2);
}

/* ── TRAVEL TOGGLE BUTTON (in header) ── */
.travel-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  background: rgba(255,255,255,0.14);
  border: 2px solid rgba(255,255,255,0.28);
  color: rgba(255,255,255,0.92);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.1s;
  touch-action: manipulation;
  white-space: nowrap;
}
.travel-btn:active {
  transform: scale(0.95);
}
.travel-btn.traveling {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #0D47A1;
  box-shadow: 0 3px 14px rgba(255,214,0,0.45);
}

/* ── GLOBAL TRAVEL BANNER ── */
.global-travel-banner {
  display: none; /* shown via JS when traveling=true */
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #0D47A1, #1565C0);
  color: #fff;
  padding: 12px 1.25rem;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  border-bottom: 3px solid var(--yellow);
}
.global-travel-banner .banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}

/* ── LEGEND ── */
.legend {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.leg-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 4px;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}
.leg-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.leg-note {
  font-size: 12px;
  color: var(--light);
  margin-left: auto;
}

/* ── LAYOUT ── */
.layout {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── TABS ── */
.tabs-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding: .9rem 0 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--yellow);
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: .75rem;
  scrollbar-width: none;
  /* Enable horizontal scroll on touch without vertical interference */
  touch-action: pan-x;
}
.tabs::-webkit-scrollbar { display: none; }

/* Touch-optimized tabs: 56px minimum height, larger font */
.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  /* min-height 56px for wall-mount touch */
  min-height: 56px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-med);
  background: var(--card);
  color: var(--muted);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
  flex-shrink: 0;
  touch-action: manipulation;
}
/* Active press feedback — replaces :hover */
.tab:active {
  background: var(--blue-light);
  border-color: var(--blue-bright);
  color: var(--blue);
  transform: scale(0.97);
}
.tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(21,101,192,.35);
}

/* ── SECTIONS ── */
.section { display: none; animation: fadeUp .28s ease; }
.section.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .65rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.72;
}
.card-blue  { border-left: 4px solid var(--blue); background: var(--blue-xlight); }
.card-blue .card-body { color: #1A3A5C; }
.card-yellow { border-left: 4px solid var(--yellow-dark); background: var(--yellow-light); }
.card-yellow .card-body { color: #5C3D00; }

/* ── SECTION HEADER ── */
.sec-hdr {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 1.25rem;
}
.sec-icon {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.sec-title { font-size: 23px; font-weight: 900; }
.sec-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ── TIMELINE BLOCKS ── */
.timeline { margin-top: 4px; }
.t-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 12px;
  margin-bottom: 10px;
  align-items: start;
}
.t-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--light);
  padding-top: 11px;
  text-align: right;
  letter-spacing: .02em;
}
.block {
  border-radius: var(--r-sm);
  padding: 10px 14px;
  border-left: 3px solid;
  flex: 1;
}
.block-title { font-size: 15px; font-weight: 800; margin-bottom: 3px; }
.block-note  { font-size: 14px; opacity: .82; line-height: 1.55; }

/* Block color variants */
.bb { background: var(--blue-light);   border-color: var(--blue-bright); color: #0D3A6E; }
.by { background: var(--yellow-light); border-color: var(--yellow-dark);  color: #4A2C00; }
.bd { background: var(--dad-light);    border-color: var(--dad-mid);      color: #1B5E20; }
.bm { background: var(--mom-light);    border-color: var(--mom-mid);      color: #880E4F; }
.be { background: var(--either-light); border-color: var(--either);       color: #311B92; }
.bw { background: #FFF8E1;            border-color: #FFB300;              color: #4A3200; }

/* ── OWNER TOGGLE BUTTON ── */
.owner-wrap { padding-top: 8px; flex-shrink: 0; }
.owner-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  /* 44×44px minimum tap target for wall use */
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  white-space: nowrap;
  touch-action: manipulation;
}
/* Press feedback replaces :hover */
.owner-btn:active    { transform: scale(0.92); }
.own-dad:active      { background: var(--dad);    color: #fff; }
.own-mom:active      { background: var(--mom);    color: #fff; }
.own-either:active   { background: var(--either); color: #fff; }

.own-dad    { background: var(--dad-light);    color: var(--dad); }
.own-mom    { background: var(--mom-light);    color: var(--mom); }
.own-either { background: var(--either-light); color: var(--either); }

/* ── STEPS ── */
.steps { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.step  { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.step-text { font-size: 15px; color: var(--muted); line-height: 1.62; }
.step-text strong { color: var(--text); font-weight: 800; }

/* ── SCRIPT / QUOTE ── */
.script {
  background: #EBF5FF;
  border-left: 3px solid var(--blue-bright);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 15px;
  font-size: 15px;
  font-style: italic;
  color: #0D3A6E;
  margin: 11px 0;
  line-height: 1.62;
  font-weight: 700;
  -webkit-user-select: text;
  user-select: text;
}
.doc-script {
  background: #EBF5FF;
  border: 2px dashed var(--blue-bright);
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  color: #0D3A6E;
  line-height: 1.75;
  margin: 12px 0;
  -webkit-user-select: text;
  user-select: text;
}

/* ── ALERT BOXES ── */
.warn {
  background: var(--yellow-light);
  border: 1px solid rgba(249,168,37,.4);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: #4A2C00;
  margin-top: 12px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  line-height: 1.6;
}
.info {
  background: var(--blue-xlight);
  border: 1px solid rgba(33,150,243,.25);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: #0D3A6E;
  margin-top: 10px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  line-height: 1.6;
}

/* ── CHOICE GRID ── */
.c-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.c-card {
  background: var(--bg);
  border: 2px solid var(--border-med);
  border-radius: var(--r);
  padding: 16px 10px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  cursor: default;
  touch-action: manipulation;
}
.c-card:active {
  border-color: var(--blue-bright);
  background: var(--blue-light);
  transform: scale(0.97);
}
.c-icon { font-size: 30px; margin-bottom: 7px; }
.c-name { font-weight: 900; font-size: 15px; color: var(--text); }
.c-desc { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ── TAGS ── */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.tag {
  font-size: 13px;
  font-weight: 800;
  padding: 5px 13px;
  border-radius: var(--r-pill);
}
.tbl { background: var(--blue-light);   color: var(--blue); }
.tyw { background: var(--yellow-light); color: #5C3D00; }
.tcr { background: #FFEBEE;            color: #B71C1C; }
.tgn { background: var(--dad-light);   color: var(--dad); }
.tpk { background: var(--mom-light);   color: var(--mom); }
.tpu { background: var(--either-light);color: var(--either); }

/* ── BADGE ── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.b-bl { background: var(--blue-light);   color: var(--blue); }
.b-yw { background: var(--yellow-light); color: #5C3D00; }
.b-gn { background: var(--dad-light);   color: var(--dad); }
.b-pk { background: var(--mom-light);   color: var(--mom); }
.b-pu { background: var(--either-light);color: var(--either); }
.b-rd { background: #FFEBEE;            color: #B71C1C; }

/* ── STAGE PILL ── */
.stage {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  margin-right: 8px;
}

/* ── REFERRAL ROWS ── */
.ref-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}
.ref-lbl { padding-top: 9px; }

hr.dv {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.1rem 0;
}

/* ── TRAVELING BANNER (static, on After School tab) ── */
.travel-banner {
  background: linear-gradient(135deg, var(--blue), var(--blue-bright));
  color: #fff;
  border-radius: var(--r);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.travel-icon  { font-size: 28px; flex-shrink: 0; }
.travel-title { font-size: 16px; font-weight: 900; margin-bottom: 3px; }
.travel-sub   { font-size: 14px; opacity: .85; line-height: 1.5; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .layout    { padding: 1.25rem 1rem 3rem; }
  .t-row     { grid-template-columns: 56px 1fr; gap: 9px; }
  .t-row .owner-wrap { display: none; }
  .ref-row   { grid-template-columns: 70px 1fr; }
  .sec-title { font-size: 20px; }
  .header    { padding: 2rem 1.25rem 1.75rem; }
  .hdr       { padding-right: 5rem; }
  .travel-btn .btn-label { display: none; }
}

@media print {
  .tabs-wrap { position: static; border-bottom: none; }
  .tab       { display: none; }
  .section   { display: block !important; page-break-before: always; }
  .section:first-of-type { page-break-before: avoid; }
  .header    { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
