/* assets/css/layout.css — TCM Study (submap-proof via url('/assets/css/layout.css'))
   Theme: white background, black text, orange accent stays, header bar = #4d6639
*/

:root{
  --bg:#ffffff;
  --card:#ffffff;
  --line:#d6dbe0;
  --field:#ffffff;
  --text:#0b0b0b;
  --text-dim: rgba(11,11,11,.70);
  --accent:#f57c1f;
  --header:#7dab48;
  --shadow: 0 12px 40px rgba(0,0,0,.10);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  margin:0;
  color:var(--text);
}

a{color:inherit}
code{background:#f3f5f7;padding:2px 6px;border-radius:6px}

/* Shared layout */
.wrap{max-width:1100px;margin:0 auto;padding:18px}
.h1{margin:0 0 14px;font-size:22px}

/* Top bar */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid rgba(255,255,255,.20);
  background:var(--header);
  position:sticky;
  top:0;
  color:#fff;
  z-index:100;
  flex-wrap:wrap;
}
.brand{
  font-weight:900;
  letter-spacing:.2px;
  margin-right:auto;
  min-width:0;
}
.top__title{
  margin-bottom:6px;
}
.top__sub{
  color:rgba(255,255,255,.90);
}

.tabs,
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:0;
}

.nav a,
.tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  text-decoration:none;
  padding:10px 12px;
  min-height:48px;
  border-radius:12px;
  font-size:10px;
  line-height:1.15;
  font-weight:900;
  white-space:normal;
}

.nav a{
  border:1px solid rgba(255,255,255,.30);
  background:rgba(0,0,0,.10);
  color:#fff;
  min-width:90px;
}

.tab{
  width:90px;
  min-width:90px;
  border:1px solid rgba(255,255,255,.25);
  background:#fff;
  color:#000;
}

.tab.is-active{
  background:var(--accent);
  border-color:#111;
  color:#111;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  text-decoration:none;
  background:#fff;
  color:var(--text);
}
.btn--accent{
  border:1px solid #111;
  background:var(--accent);
  color:#111;
  font-weight:900;
}
.btn--ghost{
  border:1px solid rgba(255,255,255,.30);
  background:rgba(0,0,0,.10);
  color:#fff;
}

/* Cards */
.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:var(--shadow);
}

/* Dashboard grid */
.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
@media (max-width: 980px){.grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 620px){.grid{grid-template-columns:1fr;}}
.cardlink{display:block;text-decoration:none}
.title{font-size:18px;font-weight:900;margin:0 0 6px}
.sub{
  margin:0;
  color:var(--text-dim);
  font-size:x-small;
  line-height:1.3;
}
.hint{margin:14px 0 0;color:var(--text-dim);font-size:13px}

/* Login page */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px}
.login-card{width:min(520px,100%);}

label{display:block;font-weight:800;margin:10px 0 6px}
input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--field);
  color:var(--text);
  outline:none;
}
input:focus{border-color: rgba(245,124,31,.65); box-shadow: 0 0 0 3px rgba(245,124,31,.15);}
.err{margin:10px 0 0;color:#b00020}
.small{margin-top:10px;font-size:13px;color:var(--text-dim)}

/* Study page */
.hero{margin-bottom:14px}
.week{margin:12px 0;padding:14px}
.weekhead{display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.wkno{font-weight:900;color:var(--accent)}
.wktitle{font-weight:900}
.intro{margin:8px 0 0;color:var(--text-dim)}
.items{margin-top:12px;display:grid;gap:10px}
.item{border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}
.itemtop{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap}
.ititle{font-weight:900;margin:0}
.meta{display:flex;gap:8px;align-items:center;color:var(--text-dim);font-size:13px}
.pill{display:inline-block;padding:4px 10px;border-radius:999px;border:1px solid var(--line);background:#f6f7f8;font-size:12px}
.content{margin:8px 0 0;color:var(--text);white-space:pre-wrap}
.url{margin-top:8px}
.url a{text-decoration:underline}

/* TOC / content */
.toc-list{display:grid;gap:10px}
.toc-item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
.toc-item a{text-decoration:none}
.toc-meta{color:var(--text-dim);font-size:13px}

/* Content pages shown under each other */
.content-pages{display:grid;gap:14px}
.content-pages .card{padding:12px}

/* FIX: afbeeldingen altijd binnen card/wrap houden */
.wrap, .card, .content-pages, .toc-list, .toc-item, .pageimg { min-width: 0; }

img{
  max-width:100%;
  height:auto;
  display:block;
}

/* Screenshot-box */
.pageimg{
  width:100%;
  max-width:100%;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}

.pageimg img{
  width:100%;
  max-width:100%;
  height:auto;
  object-fit:contain;
}

@media (max-width: 700px){
  .wrap{
    padding:12px;
  }

  .top{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:start;
    gap:8px;
    padding:14px 12px;
  }

  .brand{
    grid-column:1 / -1;
    margin-right:0;
  }

  .top .h1{
    font-size:16px;
    margin-bottom:4px;
  }

  .top .sub{
    font-size:x-small;
  }

  .tabs,
  .nav{
    width:auto;
    min-width:0;
    justify-content:flex-start;
    gap:8px;
    flex-wrap:nowrap;
  }

  .nav a,
  .tab{
    width:70px;
    min-width:70px;
    min-height:48px;
    padding:10px 8px;
  }
	
	H1 {font-size:14px !important;}
}

@media (max-width: 330px){
  .top{
    grid-template-columns:1fr;
  }

  .tabs,
  .nav{
    width:100%;
    flex-wrap:wrap;
  }
}

article h1,
.article-content h1,
article h2,
.article-content h2 {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 16px;
}