/* ===== Theme – inspired by skraning.minjastofnun.is ===== */
:root{
  --bg:#f5fafc;
  --panel: #ffffff;
  --panel-border:#e5eef1;
  --text:#0e3f4f;
  --muted:#5a7a85;
  --brand:#005b78;
  --brand-2:#004457;
  --chip:#e6f3f6;
  --chip-text:#0e3f4f;
  --thumb-bg:#eef6f8;
  --shadow: 0 1px 6px rgba(0,0,0,.06);
}

/* Combine repeated user-select rules */
.mn-card-thumb img, .lb-img, .lb-backdrop {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
}


*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,'Noto Sans';background:var(--bg);color:var(--text)}

.mn-header{
  position:sticky;top:0;z-index:5;
  background:linear-gradient(0deg, rgba(255,255,255,.9), #fff);
  border-bottom:1px solid var(--panel-border);
  backdrop-filter:saturate(150%) blur(3px);
}
.mn-header .mn-brand{max-width:1200px;margin:0 auto;padding:12px 20px;font-size:30px;font-weight:700;color:var(--brand)}
.mn-nav{max-width:1200px;margin:0 auto;padding:0 20px 12px 20px}
.mn-link{display:inline-block;margin-right:10px;padding:6px 10px;border-radius:8px;color:var(--text);text-decoration:none;background:transparent}
.mn-link.is-active{background:var(--chip);color:var(--chip-text)}

.mn-main{max-width:1200px;margin:24px auto;padding:0 20px}

.mn-panel{background:var(--panel);border:1px solid var(--panel-border);border-radius:14px;box-shadow:var(--shadow);padding:16px 16px 18px}
.mn-title{margin:0 0 12px 0;color:var(--text);font-size:30px}

.mn-searchbar{display:flex;gap:10px;align-items:center;margin:10px 0 4px}
.mn-input{flex:1;padding:10px 12px;border:2px solid #cfe3e9;border-radius:10px;font-size:15px;color:var(--text)}
.mn-btn{background:var(--brand);color:#fff;border:0;border-radius:10px;padding:10px 14px;cursor:pointer}
.mn-btn:hover{background:var(--brand-2)}
.mn-btn--ghost{background:#fff;color:var(--brand);border:2px solid var(--brand)}
.mn-btn--ghost.is-disabled{opacity:.45;pointer-events:none;cursor:default}

.mn-muted{color:var(--muted)}

.mn-grid{display:grid;gap:14px}
.mn-grid--projects{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.mn-grid--images{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}

.mn-card{contain: layout style paint;
background:#fff;border:1px solid var(--panel-border);border-radius:12px;box-shadow:0 1px 0 rgba(0,0,0,.03);overflow:hidden}
.mn-card-link{display:block;color:inherit;text-decoration:none}
.mn-card-thumb{background:var(--thumb-bg);aspect-ratio:3/2;display:grid;place-items:center;overflow:hidden}
.mn-card-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.mn-card-meta{padding:8px 10px;border-top:1px solid var(--panel-border);display:flex;align-items:center;gap:8px;justify-content:space-between}
.mn-proj-id{font-weight:700;color:var(--text)}
.mn-filename{font-size:13px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.mn-headrow{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.mn-subtlebar{display:flex;align-items:center;justify-content:space-between;border:1px dashed var(--panel-border);border-radius:10px;padding:8px 10px;background:#fbfeff;margin:10px 0}

.mn-pager{display:flex;gap:8px;align-items:center}
.mn-pager-bottom{display:flex;gap:12px;align-items:center;justify-content:center;margin-top:16px}

@media (max-width:640px){
  .mn-grid--projects, .mn-grid--images{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
}

/* Lightbox (viewer.js) minimal hooks */
.lb-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.8);display:none;z-index:100}
.lb-backdrop.is-open{display:grid;place-items:center}
.lb-img{max-width:92vw;max-height:88vh;box-shadow:0 2px 16px rgba(0,0,0,.5);border-radius:10px;user-select:none;-webkit-user-drag:none;-webkit-user-select:none}
/* Lightbox controls */
.lb-arrow{position:fixed;top:50%;transform:translateY(-50%);background:#fff;border:0;border-radius:999px;padding:10px 14px;cursor:pointer;z-index:101}
.lb-prev{left:16px}
.lb-next{right:16px}
.lb-close{position:fixed;top:16px;right:16px;background:#fff;border:0;border-radius:999px;padding:10px 14px;cursor:pointer;z-index:101}



/* === Anti-save (CSS-only; discourages right-click/drag) === */
.mn-card-thumb img, .lb-img {
  /* Disable dragging */
  -webkit-user-drag: none;
  /* Disable selecting / touch callout */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  /* Ignore right-clicks on the image itself so the anchor/link receives the event */
  pointer-events: none;
}
.lb-backdrop {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}



/* Lightbox caption */
.lb-caption{
  position:fixed;
  top:16px;
  left:50%;
  transform:translateX(-50%);
  background:rgba(0,0,0,.55);
  color:#fff;
  padding:6px 10px;
  border-radius:10px;
  font-size:14px;
  line-height:1.2;
  max-width:80vw;
  text-align:center;
  pointer-events:none; /* don't block clicks */
  z-index:101;
}


/* project cards (root screen) */
.proj-card{background:#fff;border:1px solid var(--panel-border);border-radius:12px;box-shadow:0 1px 0 rgba(0,0,0,.03);overflow:hidden}
.proj-link{display:block;text-decoration:none;color:inherit;padding:14px}
.proj-title{font-weight:700;color:var(--text);font-size:16px;margin:0 0 6px}
.proj-meta{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:6px;font-style:italic}
.proj-sep{opacity:.45}
.proj-card:hover{box-shadow:0 2px 12px rgba(0,0,0,.06);border-color:#d5e6ea}




/* Center few images (1–4) without resizing cards) */
.mn-grid--images.is-few{
  display:flex;                 /* override grid for this case */
  flex-wrap:wrap;
  justify-content:center;
  gap:14px;
}
.mn-grid--images.is-few .mn-card{ width:220px; }


/* soft-fade subtitle under project ID */
.proj-sub{margin-top:4px;font-size:13px;color:var(--muted);opacity:.9;font-weight:600;white-space:normal;overflow:visible;text-overflow:clip}

/* vertical stack */
.nav-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.45rem;
}

/* CTA button (match Innskrá) */
.btn-cta{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.55rem .9rem;
  background:#005b78; color:#fff; text-decoration:none;
  border-radius:12px; font-weight:700; line-height:1;
  box-shadow:0 1px 0 rgba(0,0,0,.05), 0 6px 16px rgba(0,91,120,.18);
  transition:filter .15s, transform .02s;
}
.btn-cta:hover{ filter:brightness(1.06); }
.btn-cta:active{ transform:translateY(1px); }
.btn-cta svg{ margin-left:.05rem; }

/* "Heim" styled like a project card, but colored */
.btn-home{
  text-decoration:none;
  font-weight:800;
  font-size:16px;
  padding:.65rem .9rem;
  border-radius:12px;

  /* card-like foundation */
  border:1px solid var(--panel-border, #dfe9ed);
  box-shadow:0 1px 0 rgba(0,0,0,.03), 0 2px 12px rgba(0,0,0,.06);

  /* colored variant */
  background:transperent;                 /* subtle brand-tinted fill */
  color:var(--text, #0e3f4f);
}
.btn-home:hover{
  filter:brightness(1.03);
  border-color:#d5e6ea;
 background:#e6f3f6;
}

/* --- Force the title + Heim to hug the left edge --- */
.title-row{
  display:inline-flex;              /* shrink-wrap around title + button */
  gap:.5rem;
  text-align:left !important;
  justify-content:flex-start !important;  /* override flex centering */
  justify-self:start !important;          /* override grid centering */
  align-self:flex-start !important;
  margin:0 !important;
}

/* Make sure individual items don't expand or push */
.title-row .mn-title,
.title-row .btn-home{
  flex:0 0 auto !important;
  margin:0 !important;
}

/* If any ancestor centers with text-align / flex / grid, pin this row left */
header .title-row,
.mn-header .title-row,
.mn-toolbar .title-row,
.mn-top .title-row,
.mn-head .title-row{
  justify-content:flex-start !important;
  justify-self:start !important;
  text-align:left !important;
}

/* Optional: slightly tighter on small screens */
@media (max-width:640px){
  .title-row{ gap:.35rem; }
  .title-row .btn-home{ padding:.5rem .7rem; font-size:15px; }
}


/* responsive grids */
@media (min-width: 1200px){
  .mn-grid--projects{grid-template-columns:repeat(4, 1fr)}
  .mn-grid--images{grid-template-columns:repeat(5, 1fr)}
}
@media (min-width: 900px) and (max-width: 1199px){
  .mn-grid--projects{grid-template-columns:repeat(3, 1fr)}
  .mn-grid--images{grid-template-columns:repeat(4, 1fr)}
}
@media (min-width: 640px) and (max-width: 899px){
  .mn-grid--projects{grid-template-columns:repeat(2, 1fr)}
  .mn-grid--images{grid-template-columns:repeat(3, 1fr)}
}
@media (max-width: 639px){
  .mn-grid--projects{grid-template-columns:repeat(1, 1fr)}
  .mn-grid--images{grid-template-columns:repeat(2, 1fr)}
}

/* Use will-change for animated elements */
.btn-cta, .btn-home { will-change: filter, transform; }
