/* === PROJEKTI (projekti.html) ===
   Virsraksts, pogas, vietturi (.img-slot) — style.css */


.proj-wrap {
  max-width: 1365px;
  margin: 32px auto 56px;
  padding: 0 24px;
}

/* ── FILTRU JOSLA ────────────────────────────────────── */
.proj-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.proj-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.proj-chip {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all .15s;
}

.proj-chip:hover { border-color: var(--blue); color: var(--blue); }

.proj-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.proj-chip .count { opacity: .7; font-weight: 500; margin-left: 2px; }

.proj-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 0 12px;
  width: 320px;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(2, 2, 2, .1);
}

.proj-search svg { color: var(--muted); flex-shrink: 0; }

.proj-search input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 0;
  width: 100%;
  background: transparent;
}

/* ── DIVU KOLONNU IZKĀRTOJUMS ────────────────────────── */
.proj-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 28px;
  align-items: start;
}

/* ── SARAKSTS ────────────────────────────────────────── */
.proj-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 20px 0 10px;
}

.proj-group-title:first-child { margin-top: 0; }

.proj-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, background .15s;
}

.proj-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  border-color: #c0d0e8;
}

.proj-item.is-active { border-left-color: var(--blue); }
.proj-item.is-active:hover { border-left-color: var(--blue); }

.proj-item.selected {
  background: #eef2fa;
  border-color: var(--blue);
}

.proj-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
}

.proj-item.selected .proj-item-title { color: var(--blue); }

.proj-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.proj-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  border-radius: 4px;
  padding: 2px 7px;
  background: var(--light-bg);
  color: var(--navy);
}

.proj-status {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}

.proj-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0b7c6;
}

.proj-status.active { color: var(--tag); }
.proj-status.active::before { background: var(--tag); }

.proj-empty {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 30px 0;
}

.proj-more {
  display: block;
  margin: 12px auto 0;
}

/* ── DETAĻU PANELIS ──────────────────────────────────── */
/* Apraksts atveras blakus izvēlētajam projektam (margin-top iestata JS),
   visā garumā — bez atsevišķas ritjoslas */
.proj-detail {
  position: relative;
  transition: margin-top .25s ease;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.proj-detail-close { display: none; }

/* logo rinda */
.proj-logos {
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  min-height: 96px;
}

.proj-logos .img-slot-label {
  width: 100%;
  height: 60px;
  font-size: 12px;
}

.proj-logos img {
  max-height: 60px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.proj-logos .img-slot { flex: 1; display: flex; justify-content: center; }
.proj-logos .img-slot:has(img) { flex: 0 1 auto; }

.proj-body { padding: 22px 26px 26px; }

.proj-body-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.proj-title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
  color: #111;
  margin-bottom: 18px;
}

/* galvenā info */
.proj-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.proj-fact {
  background: var(--light-bg);
  padding: 11px 14px;
}

.proj-fact.wide,
.proj-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }

.proj-fact label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.proj-fact span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* apraksta sadaļas */
.proj-section { margin-bottom: 20px; }

.proj-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

.proj-section p,
.proj-section li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}

.proj-section ul { list-style: none; }

.proj-section li {
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.proj-section li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.proj-section a { color: var(--blue); font-weight: 600; }

/* pielikumi */
.proj-files {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 8px;
}

.proj-files h3 {
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin-bottom: 12px;
}

.proj-file {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: border-color .15s, box-shadow .15s;
}

.proj-file:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(26, 92, 176, .1);
}

.proj-file-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  flex-shrink: 0;
  background: var(--muted);
}

.proj-file-icon.pdf  { background: #d93838; }
.proj-file-icon.img  { background: #2e8b57; }
.proj-file-icon.doc  { background: #2b5fb4; }
.proj-file-icon.xls  { background: #1d7a45; }

.proj-file-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.proj-file-name small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj-file-dl { color: var(--blue); flex-shrink: 0; }

.proj-no-desc {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ── UZNIROŠAIS LOGS (šaurākiem ekrāniem) ────────────── */
.proj-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 33, 85, .45);
  z-index: 9500;
}

@media (max-width: 1000px) {
  .proj-layout { grid-template-columns: 1fr; }

  .proj-detail {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
    max-width: 760px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    margin-top: 0 !important;
    transition: none;
    z-index: 9600;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  }

  body.proj-modal-open { overflow: hidden; }
  body.proj-modal-open .proj-detail,
  body.proj-modal-open .proj-backdrop { display: block; }

  .proj-detail-close {
    display: flex;
    position: sticky;
    top: 10px;
    margin: 10px 10px -46px auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--navy);
    cursor: pointer;
    z-index: 2;
  }

  .proj-item.selected { background: #fff; border-color: #e5e7eb; }
  .proj-item.selected .proj-item-title { color: var(--text); }
}

@media (max-width: 600px) {
  .proj-wrap { padding: 0 16px; }
  .proj-search { width: 100%; }
  .proj-facts { grid-template-columns: 1fr; }
  .proj-body { padding: 18px; }
  .proj-title { font-size: 18px; }
}

/* ── PHP versijas papildinājumi ─────────────────────── */
a.proj-item { text-decoration: none; color: inherit; }
.proj-item.proj-hidden { display: none; }
.proj-logos img { max-height: 110px; }
.proj-detail.loading #projDetailInner { opacity: .45; transition: opacity .15s; }
@media (min-width: 1001px) {
  .proj-detail { position: sticky; top: 104px; max-height: calc(100vh - 120px); overflow-y: auto; }   /* zem lipīgās izvēlnes */
}

/* apraksts no vecās DB (brīvs HTML) */
.proj-desc { font-size: 14px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.proj-desc img { max-width: 100%; height: auto; }
.proj-desc ul { list-style: none; margin: 0 0 12px; }
.proj-desc ol { padding-left: 20px; margin: 0 0 12px; }
.proj-desc p { margin: 0 0 10px; }
.proj-desc h2, .proj-desc h3, .proj-desc h4 { font-size: 14px; font-weight: 700; color: var(--navy, #0a2155); margin: 16px 0 6px; }

/* saistītie raksti */
.proj-act {
  display: flex; align-items: baseline; gap: 12px;
  padding: 9px 4px; border-bottom: 1px solid #eef1f6;
  text-decoration: none; color: var(--text); font-size: 13.5px; line-height: 1.45;
}
.proj-act:hover .proj-act-name { color: var(--blue); }
.proj-act-date { flex-shrink: 0; width: 82px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.proj-act-name { flex: 1; font-weight: 600; }
.proj-act-arrow { color: var(--blue); font-weight: 700; }
.proj-acts-more summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 13px; padding: 10px 4px; list-style: none; }
.proj-acts-more summary::-webkit-details-marker { display: none; }
.proj-acts-more[open] summary { display: none; }
.proj-file-icon.ppt   { background: #c55a11; }
.proj-file-icon.other { background: #6b7488; }
.proj-acts { margin-top: 22px; }
.proj-desc img[src*="icon" i], .proj-desc img[src*="ikon" i] { max-width: 40px; }
.proj-fact a { color: var(--blue); }
