/*
Theme Name: Cyber Code Academy Tutorials
Theme URI: https://learn.cybercodeacademy.com/
Author: Cyber Code Academy
Description: Lightweight W3Schools-inspired tutorial/documentation theme with two-level navigation.
Version: 1.9.0
License: GPL-2.0-or-later
Text Domain: cca-tutorial
*/

:root{
  --cca-green:#04aa6d;
  --cca-green-dark:#087f54;
  --cca-black:#111827;
  --cca-text:#1f2937;
  --cca-muted:#64748b;
  --cca-border:#e2e8f0;
  --cca-soft:#f8fafc;
  --cca-code:#0b1220;
  --cca-white:#fff;
  --cca-sidebar:260px;
  --cca-right:300px;
  --cca-header:64px;
  --cca-topics:48px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--cca-text);background:#fff;line-height:1.7}
a{color:var(--cca-green-dark);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto}
button,input{font:inherit}

.cca-header{
  position:sticky;top:0;z-index:1100;background:#fff;
  border-bottom:1px solid var(--cca-border);
}
.cca-header-inner{
  height:var(--cca-header);display:flex;align-items:center;gap:22px;
  padding:0 22px;max-width:1600px;margin:auto;
}
.cca-brand{display:flex;align-items:center;gap:10px;color:var(--cca-black);font-weight:800;white-space:nowrap}
.cca-brand:hover{text-decoration:none}
.cca-logo{
  width:38px;height:38px;border:2px solid var(--cca-green);display:grid;
  place-items:center;border-radius:9px;color:var(--cca-green);font-weight:900
}
.cca-nav{display:flex;align-items:center;gap:18px}
.cca-nav a{color:#334155;font-weight:650;font-size:14px}
.cca-search{
  margin-left:auto;display:flex;align-items:center;border:1px solid #cbd5e1;
  border-radius:9px;overflow:hidden;max-width:370px;width:100%;background:#fff
}
.cca-search input{border:0;outline:0;padding:10px 12px;width:100%;min-width:0}
.cca-search button{border:0;background:var(--cca-green);color:#fff;padding:10px 14px;cursor:pointer;display:grid;place-items:center}.cca-search button svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cca-menu-btn{display:none;border:1px solid var(--cca-border);background:#fff;border-radius:8px;padding:8px 10px;cursor:pointer}
.cca-search-toggle{display:none;border:0;background:transparent;color:#111827;width:42px;height:42px;border-radius:8px;align-items:center;justify-content:center;cursor:pointer;padding:8px}.cca-search-toggle svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.cca-search-toggle:hover{background:#f1f5f9}
.cca-mobile-overlay{display:none}
.cca-primary-mobile{display:none}
.cca-topic-menu-btn{display:none}
.cca-topic-links{display:flex;align-items:stretch;min-width:max-content}

/* Second horizontal topic navigation */
.cca-topicbar{
  position:sticky;top:var(--cca-header);z-index:1050;height:var(--cca-topics);
  background:#282a35;border-bottom:1px solid #20222c;
}
.cca-topicbar-inner{
  max-width:1600px;margin:auto;height:100%;display:flex;align-items:stretch;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
}
.cca-topicbar-inner::-webkit-scrollbar{display:none}
.cca-topic-link{
  flex:0 0 auto;display:flex;align-items:center;padding:0 18px;
  color:#f8fafc;font-size:14px;font-weight:700;white-space:nowrap;
  border-bottom:3px solid transparent;
}
.cca-topic-link:hover{background:#000;color:#fff;text-decoration:none}
.cca-topic-link.current{background:var(--cca-green);color:#fff;border-bottom-color:#fff}
.cca-topicbar-arrow{
  position:absolute;top:0;bottom:0;width:38px;border:0;background:#282a35;color:#fff;
  cursor:pointer;display:none
}
.cca-topicbar-arrow.left{left:0}
.cca-topicbar-arrow.right{right:0}

.cca-layout{
  display:grid;grid-template-columns:var(--cca-sidebar) minmax(0,1fr) var(--cca-right);
  max-width:1600px;margin:auto;
}
.cca-left,.cca-right{
  position:sticky;top:calc(var(--cca-header) + var(--cca-topics));
  height:calc(100vh - var(--cca-header) - var(--cca-topics));
  overflow:auto;background:#fff;
}
.cca-left{border-right:1px solid #dbe3ec;padding:18px 0;background:#eef3f8}
.cca-right{border-left:1px solid var(--cca-border);padding:20px}

.cca-sidebar-title{
  font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;
  font-weight:800;padding:0 18px 7px
}
.cca-sidebar-subtitle{
  padding:0 18px 12px;color:var(--cca-black);font-size:18px;font-weight:800
}
.cca-topic-list{list-style:none;padding:0;margin:0;background:transparent}
.cca-topic-list li{margin:0;padding:0}
.cca-topic-list li a{
  display:flex;align-items:center;gap:7px;padding:9px 14px 9px 18px;color:#334155;font-size:14px;
  border-left:3px solid transparent;background:transparent;line-height:1.45
}
.cca-topic-list li a:hover{
  background:#e1e8f0;color:var(--cca-green-dark);text-decoration:none
}
.cca-topic-list li.current>a{
  background:#dff7ec;color:#087f54;font-weight:750;border-left-color:var(--cca-green)
}
.cca-topic-parent>a{font-weight:800}
.cca-topic-child>a{padding-left:34px;font-size:13px;color:#475569}
.cca-topic-child.current>a{background:#dff7ec;color:#087f54;font-weight:750;border-left-color:var(--cca-green)}
.cca-topic-icon{width:14px;flex:0 0 14px;font-size:18px;line-height:1;text-align:center;color:#94a3b8}
.cca-tutorial-sublist{padding:2px 0 8px 0}
.cca-tutorial-sublist ul{list-style:none;margin:0;padding:0}
.cca-tutorial-sublist li a{padding:7px 12px 7px 52px;font-size:13px;color:#64748b;border-left-color:transparent}
.cca-tutorial-sublist li.current a{background:#dff7ec;color:#087f54;font-weight:750;border-left-color:var(--cca-green)}
.cca-sidebar-empty{padding:12px 18px;color:var(--cca-muted);font-size:13px}

.cca-main{min-width:0;padding:42px clamp(24px,4vw,64px)}
.cca-breadcrumbs{font-size:13px;color:var(--cca-muted);margin-bottom:22px}
.cca-breadcrumbs a{color:var(--cca-muted)}
.cca-main h1{
  font-size:clamp(30px,4vw,46px);line-height:1.15;letter-spacing:-.03em;
  color:var(--cca-black);margin:0 0 18px;font-weight:800
}
.cca-main h2{font-size:30px;line-height:1.25;margin:40px 0 14px;color:var(--cca-black)}
.cca-main h3{font-size:22px;margin:30px 0 12px;color:var(--cca-black)}
.cca-main p{margin:0 0 18px}
.cca-main ul,.cca-main ol{padding-left:25px}
.cca-main table{border-collapse:collapse;width:100%;margin:24px 0}
.cca-main th,.cca-main td{border:1px solid var(--cca-border);padding:10px;text-align:left}
.cca-main th{background:#f1f5f9}
.cca-main blockquote{margin:24px 0;padding:14px 18px;border-left:4px solid var(--cca-green);background:#f0fdf8}

.cca-code{position:relative;margin:22px 0;background:var(--cca-code);color:#e5e7eb;border-radius:10px;overflow:auto}
.cca-code pre{margin:0;padding:20px;font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace;font-size:14px;line-height:1.7}
.cca-copy{
  position:absolute;right:10px;top:10px;border:1px solid #334155;background:#111827;
  color:#fff;border-radius:7px;padding:6px 10px;cursor:pointer;font-size:12px
}
.cca-copy:hover{background:#1f2937}

.cca-prevnext{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:45px 0 10px}
.cca-prevnext a{border:1px solid var(--cca-border);padding:16px;border-radius:10px;background:#fff;color:var(--cca-black)}
.cca-prevnext a:last-child{text-align:right}
.cca-prevnext small{display:block;color:var(--cca-muted);margin-bottom:4px}

.cca-hero-card{border:1px solid var(--cca-border);border-radius:14px;padding:28px;background:#fff;margin-bottom:28px}
.cca-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cca-card{border:1px solid var(--cca-border);border-radius:12px;padding:18px;background:#fff}
.cca-card h3{margin:0 0 6px;font-size:19px}
.cca-card p{color:var(--cca-muted);font-size:14px}

.cca-cta{border:1px solid var(--cca-border);border-radius:12px;padding:20px;background:#0f172a;color:#fff;margin-bottom:22px}
.cca-cta h3{color:#fff;margin:0 0 8px}
.cca-cta p{color:#cbd5e1;font-size:14px}
.cca-cta a{display:inline-block;background:var(--cca-green);color:#fff;padding:9px 13px;border-radius:8px;font-weight:700}
.cca-ad{border:1px dashed #cbd5e1;border-radius:10px;padding:24px;text-align:center;color:#94a3b8;font-size:13px;margin-bottom:20px}

.cca-footer{border-top:1px solid var(--cca-border);padding:28px 20px;text-align:center;color:var(--cca-muted);font-size:13px}
.cca-pagination{display:flex;gap:8px;flex-wrap:wrap;margin-top:30px}
.cca-pagination a,.cca-pagination span{border:1px solid var(--cca-border);padding:8px 12px;border-radius:7px}
.cca-pagination .current{background:var(--cca-green);color:#fff;border-color:var(--cca-green)}

@media(max-width:1100px){
  :root{--cca-sidebar:230px;--cca-right:0px}
  .cca-layout{grid-template-columns:var(--cca-sidebar) minmax(0,1fr)}
  .cca-right{display:none}
}
@media(max-width:800px){
  :root{--cca-header:58px;--cca-topics:46px}
  .cca-header-inner{height:var(--cca-header);padding:0 12px;gap:9px}
  .cca-menu-btn{display:block}
  .cca-nav{display:none}
  .cca-primary-mobile{
    display:none;position:fixed;left:0;top:var(--cca-header);width:min(86vw,320px);
    background:#fff;border-right:1px solid var(--cca-border);border-bottom:1px solid var(--cca-border);
    z-index:1250;box-shadow:10px 0 30px rgba(15,23,42,.12);padding:8px 0;
  }
  .cca-primary-mobile a{display:block;padding:13px 18px;color:#111827;font-weight:700;border-bottom:1px solid #f1f5f9}
  .cca-primary-mobile a:hover{background:#f8fafc;text-decoration:none}
  body.cca-primary-open .cca-primary-mobile{display:block}
  .cca-topic-menu-btn{display:flex;flex:0 0 48px;width:48px;height:46px;border:0;background:#282a35;color:#fff;align-items:center;justify-content:center;font-size:20px;cursor:pointer;position:sticky;left:0;z-index:2}
  .cca-topicbar-inner{margin:0;max-width:none}
  .cca-topic-links{overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
  .cca-topic-links::-webkit-scrollbar{display:none}
  .cca-brand-text{display:none}
  .cca-search-toggle{display:flex}
  .cca-search{position:fixed;left:0;right:0;top:var(--cca-header);width:100%;max-width:none;display:none;z-index:1300;padding:10px 12px;background:#fff;border:0;border-top:1px solid var(--cca-border);border-bottom:1px solid var(--cca-border);border-radius:0;box-shadow:0 8px 24px rgba(15,23,42,.12)}
  body.cca-search-open .cca-search{display:flex}
  .cca-search input{padding:11px 12px;font-size:16px;height:42px}
  .cca-search button{padding:10px 15px;height:42px}
  .cca-topic-link{padding:0 15px;font-size:13px}
  .cca-layout{display:block}
  .cca-left{
    position:fixed;left:-100%;top:calc(var(--cca-header) + var(--cca-topics));
    width:min(86vw,320px);height:calc(100vh - var(--cca-header) - var(--cca-topics));
    z-index:1000;transition:left .2s ease;box-shadow:10px 0 30px rgba(15,23,42,.12)
  }
  body.cca-primary-open .cca-mobile-overlay{display:block;top:var(--cca-header)}
  body.cca-topic-open .cca-mobile-overlay{display:block;top:calc(var(--cca-header) + var(--cca-topics))}
  body.cca-topic-open .cca-left{left:0}
  .cca-main{padding:28px 18px}
  .cca-prevnext{grid-template-columns:1fr}
  .cca-card-grid{grid-template-columns:1fr}
  .cca-mobile-overlay{position:fixed;inset:calc(var(--cca-header) + var(--cca-topics)) 0 0 0;background:rgba(15,23,42,.28);z-index:900}
}
@media(max-width:500px){
  .cca-header-inner{padding:0 9px;gap:5px}
  .cca-menu-btn{padding:7px 9px;font-size:18px}
  .cca-logo{width:34px;height:34px;border-radius:8px}
  .cca-search-toggle{margin-left:auto}
  .cca-main{padding:26px 14px}
}

/* v1.10 topic tree: always show all topics, expand the active branch */
.cca-left{background:#eef3f8 !important;}
.cca-topic-tree{margin:0 !important;padding:0 !important;}
.cca-topic-parent{display:block;}
.cca-topic-children{display:block;list-style:none;margin:0;padding:0 0 4px 12px;border-left:1px solid #d6dee8;}
.cca-topic-children.is-visible{display:block;}
.cca-topic-child{list-style:none;margin:0;padding:0;}
.cca-topic-child>a{padding-left:22px !important;font-size:13px;}
.cca-tutorial-sublist{display:block;list-style:none;margin:0 0 4px 24px;padding:0 0 0 12px;border-left:1px dashed #cbd5e1;}
.cca-tutorial-sublist li{list-style:none;}
.cca-tutorial-sublist a{font-size:12px !important;padding:7px 12px !important;color:#475569 !important;}
.cca-tutorial-sublist li.current>a{background:#dff7ec !important;color:#087f54 !important;font-weight:700;}
.cca-topic-parent.is-open>a,.cca-topic-child.is-open>a{font-weight:800;}


/* CCA v1.11 contextual sidebar */
.cca-current-topic-tree { margin-top: 8px; }
.cca-current-topic-tree > li { margin-bottom: 2px; }
.cca-current-topic-tree .cca-topic-back { margin-bottom: 12px; }
.cca-current-topic-tree .cca-topic-back a { color: #64748b; font-size: 13px; }
.cca-current-topic-tree .cca-topic-child > a { font-weight: 700; }
.cca-current-topic-tree .cca-topic-children { margin: 4px 0 8px 14px; padding-left: 12px; border-left: 1px solid #dbe3ee; }
.cca-current-topic-tree .cca-topic-grandchild a { font-size: 13px; font-weight: 600; }
.cca-current-topic-tree .cca-topic-tutorial-heading { margin-top: 12px; padding: 8px 0 5px; color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.cca-current-topic-tree .cca-tutorial-sublist { margin: 0 0 10px 14px; padding-left: 12px; border-left: 1px solid #dbe3ee; }
.cca-current-topic-tree .cca-tutorial-sublist li.current a { color: #059669; font-weight: 800; }
