:root{
  --top:#0b4f73;
  --top2:#083f5b;
  --bg:#f4f6f8;
  --card:#ffffff;
  --line:#e6e9ee;
  --text:#0f172a;
  --muted:#5b6777;
  --accent:#0ea5e9;
  --shadow: 0 10px 30px rgba(15,23,42,.08);
  --radius: 14px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* -----------------------------
   TOPBAR (Piping-like)
------------------------------ */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--top), var(--top2));
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.topbar-inner{
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 300px;
}

.logo-sw{
  height: 34px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.18));
}

.logo-app{
  height: 28px;
  width: auto;
  object-fit: contain;
  opacity: .95;
}

.brand-text{ color:#fff; line-height: 1; }
.brand-name{ font-weight: 800; font-size: 18px; }

/* Centered white search */
.search{
  flex: 1;
  display:flex;
  justify-content:center;
}

.search input{
  width: clamp(320px, 46vw, 560px);
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: #ffffff;
  color: #0f172a;
  padding: 0 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.search input::placeholder{
  color: rgba(15,23,42,.55);
}

.top-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

.pill{
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.10);
  color:#fff;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 800;
  cursor:pointer;
}

.pill:hover{ border-color: rgba(255,255,255,.55); }
.pill.active{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.70);
}

/* -----------------------------
   LAYOUT
------------------------------ */
.layout{
  max-width: 1220px;
  margin: 18px auto 40px;
  padding: 0 14px;
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:18px;
}

.sidebar{
  position: sticky;
  top: 72px;
  align-self:start;
}

/* -----------------------------
   SIDEBAR (Scheduler-like)
------------------------------ */
.side-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.side-title{
  font-weight: 800;
  margin-bottom: 12px;
  color: #1f2a37;
}

.menu-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.side-item{
  width:100%;
  text-align:left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 600;
  color: #1f2a37;
}

.side-item:hover{
  border-color: rgba(14,165,233,.45);
  box-shadow: 0 6px 14px rgba(14,165,233,.10);
}

.side-item.active{
  border-color: rgba(14,165,233,.65);
  box-shadow: 0 0 0 3px rgba(14,165,233,.14);
}

.side-item.big{
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 12px;
}

/* Tree headers (▶ Menu, ▶ Videos) */
.side-group-toggle{
  margin-top: 10px;
  width:100%;
  text-align:left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 800;
  color: #1f2a37;
  display:flex;
  align-items:center;
  gap:10px;
}

.side-group-toggle:hover{
  border-color: rgba(14,165,233,.45);
  box-shadow: 0 6px 14px rgba(14,165,233,.10);
}

.caret{
  width: 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
}

.side-group{
  margin-top: 10px;
  padding-left: 8px;
  border-left: 2px solid rgba(14,165,233,.18);
}

.hidden{ display:none !important; }

/* -----------------------------
   CONTENT
------------------------------ */
.content-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

h1{margin: 0 0 6px; font-size: 28px;}
h2{margin: 0 0 10px; font-size: 18px;}
.muted{color: var(--muted)}
.small{font-size: 12px}

/* Image block */
.img-wrap{
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.images-stack{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.img-item{
  display:flex;
}

/* alignment per image */
.align-left{ justify-content:flex-start; }
.align-center{ justify-content:center; }
.align-right{ justify-content:flex-end; }

/* width controller */
.img-width{
  width: 100%;
  max-width: 920px; /* default, JS may override per image */
}

/* image link + image */
.img-link{
  display:block;
}

.img-link img{
  display:block;
  width: 100%;        /* uses wrapper width */
  height:auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.img-caption{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.img-hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* Text */
.text-block{
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

ul{margin:0; padding-left: 18px}
li{margin: 7px 0}

/* -----------------------------
   YOUTUBE EMBED
------------------------------ */
.video-embed{
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.video-title{ margin-bottom: 10px; }

.yt-box{
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.yt-box iframe{
  width: 100%;
  height: 100%;
  display: block;
}

/* -----------------------------
   RESPONSIVE
------------------------------ */
@media (max-width: 980px){
  .topbar-inner{ flex-wrap: wrap; }
  .brand{ min-width: 0; }
  .search{ width: 100%; order: 3; }
  .search input{ width: 100%; }

  .layout{ grid-template-columns: 1fr; }
  .sidebar{ position: relative; top: 0; }
}
