/* ============================================================
 * projects-library.css
 * /projeler — tam liste sayfası (istatistikler, kulvar sekmeleri,
 * yazılım kart grid'i, Ar-Ge program seçici ve portföy grid'i). Kartların ve
 * detay modalının kendisi anasayfa "Projelerimiz" vitriniyle ORTAK
 * (.ps-card / .ps-modal — home-projects-showcase.css), burada sadece
 * bu sayfaya özgü grid/raf yerleşimi tanımlanır.
 * ============================================================ */

/* ── İstatistik şeridi ─────────────────────────────────────── */
.library-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 40px;
}

.library-stat {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 200px;
  padding: 20px 24px;
  border: 1px solid #e4ecf2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px -26px rgba(10, 37, 64, .3);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), box-shadow .22s;
}

.library-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0e9faa, #2bc6d2);
}

.library-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -24px rgba(10, 37, 64, .38);
}

.library-stat__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(14, 159, 170, .1);
  color: #0e9faa;
}

.library-stat__icon svg {
  width: 20px;
  height: 20px;
}

.library-stat strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 3px;
  background: linear-gradient(135deg, #0e9faa, #0a2540);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.library-stat span {
  font-size: 0.83rem;
  color: #5a6f86;
  font-weight: 650;
}

/* ── Kulvar sekmeleri ──────────────────────────────────────── */
.library-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 6px;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #e4ecf2;
  border-radius: 13px;
  margin-bottom: 40px;
}

.library-tabs__trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 52px;
  border: 1px solid transparent;
  background: transparent;
  padding: 11px 46px 11px 22px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #5a6f86;
  cursor: pointer;
  overflow: hidden;
  transition: background .25s cubic-bezier(.16, 1, .3, 1), border-color .25s, color .25s, box-shadow .25s, transform .15s;
}

.library-tabs__trigger::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background .25s, inset .25s;
}

.library-tabs__trigger::after {
  content: "\2192";
  position: absolute;
  right: 20px;
  color: #9babbc;
  font-size: 1rem;
  transform: translateX(-3px);
  opacity: .7;
  transition: color .25s, opacity .25s, transform .25s;
}

.library-tabs__trigger svg {
  width: 16px;
  height: 16px;
  opacity: .7;
  transition: opacity .2s;
}

.library-tabs__trigger:hover:not(.is-active) {
  color: #0a2540;
  background: rgba(255, 255, 255, .88);
  border-color: #d9e5ed;
  box-shadow: 0 8px 18px -16px rgba(10, 37, 64, .55);
  transform: translateY(-1px);
}

.library-tabs__trigger:hover:not(.is-active)::before {
  inset-block: 7px;
  background: linear-gradient(180deg, #16b6c1, #0e9faa);
}

.library-tabs__trigger:hover::after,
.library-tabs__trigger:focus-visible::after {
  color: #0e9faa;
  opacity: 1;
  transform: translateX(0);
}

.library-tabs__trigger.is-active {
  background: linear-gradient(135deg, #0e2e4a, #0a2540);
  color: #fff;
  border-color: #0a2540;
  box-shadow: 0 8px 20px -8px rgba(10, 37, 64, .45);
}

.library-tabs__trigger.is-active::before {
  inset-block: 7px;
  background: linear-gradient(180deg, #2dd4dc, #0e9faa);
}

.library-tabs__trigger.is-active::after {
  color: #7ee4e8;
  opacity: 1;
  transform: translateX(0);
}

.library-tabs__trigger.is-active svg {
  opacity: 1;
}

.library-tabs__trigger:active {
  transform: scale(.97);
}

.library-tabs__trigger:focus-visible {
  outline: 3px solid rgba(14, 159, 170, .2);
  outline-offset: 2px;
}

/* ── Paneller ──────────────────────────────────────────────── */
.library-panel {
  display: none;
}

.library-panel.is-active {
  display: block;
}

.library-panel__intro {
  max-width: 640px;
  margin-bottom: 28px;
}

.library-panel__intro > span {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0e9faa;
  margin-bottom: 10px;
}

.library-panel__intro--arge > span {
  color: #b3232c;
}

.library-panel__intro h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0a2540;
  margin: 0 0 10px;
  line-height: 1.3;
}

.library-panel__intro p {
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

/* ── Filtre pilleri ────────────────────────────────────────── */
.library-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.library-filter button {
  border: 1px solid #dce7f0;
  background: #fff;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.library-filter button:hover {
  border-color: #0e9faa;
  color: #0e9faa;
}

.library-filter button.is-active {
  background: #0e9faa;
  border-color: #0e9faa;
  color: #fff;
}

.library-filter--arge button.is-active {
  background: #b3232c;
  border-color: #b3232c;
}

/* ── Yazılım kart grid'i ───────────────────────────────────────
   Kartın kendisi .ps-card (home-projects-showcase.css); orada carousel
   bağlamında sabit genişlik (flex:0 0 340px) alır, burada grid hücresini
   doldurması için genişliği serbest bırakıyoruz. */
.software-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 8px;
}

.software-project-grid .ps-card {
  flex: none;
  width: 100%;
  height: 100%;
}

/* ── Ar-Ge seçki alanı: program navigasyonu + standart grid ─── */
.grant-portfolio {
  --grant-red: #c92532;
  --grant-orange: #dd5c16;
  --grant-rose: #b91f4c;
  --grant-blue: #145da0;
  --grant-slate: #566579;
  display: grid;
  gap: 18px;
}

.grant-programs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  padding: 9px;
  border: 1px solid #dde7ef;
  border-radius: 15px;
  background: #f5f8fb;
}

.grant-program {
  --program-accent: #0a2540;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 92px;
  padding: 14px 15px 13px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #405369;
  text-align: left;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.16, 1, .3, 1), border-color .22s, background-color .22s, box-shadow .22s, color .22s;
}

.grant-program--red { --program-accent: var(--grant-red); }
.grant-program--orange { --program-accent: var(--grant-orange); }
.grant-program--rose { --program-accent: var(--grant-rose); }
.grant-program--blue { --program-accent: var(--grant-blue); }
.grant-program--slate { --program-accent: var(--grant-slate); }

.grant-program::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: var(--program-accent);
  opacity: 0;
  transform: scaleY(.35);
  transition: opacity .22s, transform .22s;
}

.grant-program::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 88px;
  height: 88px;
  top: -50px;
  right: -45px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--program-accent) 10%, transparent);
  transform: scale(.75);
  opacity: 0;
  transition: opacity .22s, transform .3s cubic-bezier(.16, 1, .3, 1);
}

.grant-program:hover {
  border-color: color-mix(in srgb, var(--program-accent) 24%, #dce7f0);
  background: rgba(255,255,255,.88);
  color: #0a2540;
  transform: translateY(-1px);
}

.grant-program:hover::after,
.grant-program.is-active::after {
  opacity: 1;
  transform: scale(1);
}

.grant-program.is-active {
  border-color: color-mix(in srgb, var(--program-accent) 28%, #d8e4ec);
  background: #fff;
  color: #0a2540;
  box-shadow: 0 12px 26px -20px color-mix(in srgb, var(--program-accent) 75%, #0a2540);
}

.grant-program.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.grant-program:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--program-accent) 20%, transparent);
  outline-offset: 2px;
}

.grant-program__eyebrow {
  color: #8a9bad;
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.grant-program strong {
  overflow: hidden;
  color: inherit;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grant-program__count {
  color: var(--program-accent);
  font-size: .68rem;
  font-weight: 700;
}

.grant-program-summary {
  --summary-accent: #0a2540;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 92px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid #dce7f0;
  border-radius: 13px;
  background: linear-gradient(110deg, #fff, color-mix(in srgb, var(--summary-accent) 4%, #fff));
}

.grant-program-summary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--summary-accent), color-mix(in srgb, var(--summary-accent) 22%, transparent) 55%, transparent);
}

.grant-program-summary__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--summary-accent) 8%, #fff);
  color: var(--summary-accent);
}

.grant-program-summary__icon svg {
  width: 20px;
  height: 20px;
}

.grant-program-summary__copy {
  min-width: 0;
}

.grant-program-summary__copy > span {
  display: block;
  margin-bottom: 3px;
  color: var(--summary-accent);
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.grant-program-summary h3 {
  margin: 0 0 3px;
  color: #0a2540;
  font-size: 1rem;
  font-weight: 780;
  line-height: 1.3;
}

.grant-program-summary p {
  margin: 0;
  color: #66798d;
  font-size: .78rem;
  line-height: 1.5;
}

.grant-program-summary__metric {
  display: grid;
  justify-items: end;
  min-width: 76px;
  padding-left: 16px;
  border-left: 1px solid #e4ebf1;
}

.grant-program-summary__metric strong {
  color: var(--summary-accent);
  font-size: 1.55rem;
  font-weight: 820;
  line-height: 1;
}

.grant-program-summary__metric span {
  margin-top: 3px;
  color: #8293a5;
  font-size: .65rem;
  font-weight: 650;
}

.grant-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 26px);
  align-items: stretch;
  padding-top: 4px;
}

.grant-project {
  --project-accent: var(--grant-slate);
  display: flex;
  min-width: 0;
  animation: grant-card-in .32s cubic-bezier(.16, 1, .3, 1) both;
}

.grant-project[data-library-shelf="1501"] { --project-accent: var(--grant-red); }
.grant-project[data-library-shelf="1507"] { --project-accent: var(--grant-orange); }
.grant-project[data-library-shelf="1711"] { --project-accent: var(--grant-rose); }
.grant-project[data-library-shelf="KOSGEB"],
.grant-project[data-library-shelf="kosgeb"] { --project-accent: var(--grant-blue); }

.grant-project[hidden] {
  display: none;
}

.grant-project-grid .ps-card--dossier {
  flex: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding-left: 15px;
  border-color: #dce6ee;
  border-radius: 12px;
  box-shadow: 0 16px 34px -28px rgba(10,37,64,.5);
}

.grant-project-grid .ps-card--dossier::before {
  width: 10px;
  border-radius: 12px 0 0 12px;
  background-color: var(--project-accent);
  background-size: 100% 25px, 100% 100%;
}

.grant-project-grid .ps-card--dossier:hover {
  border-color: color-mix(in srgb, var(--project-accent) 36%, #dce6ee);
  box-shadow: 0 22px 44px -26px color-mix(in srgb, var(--project-accent) 35%, rgba(10,37,64,.55));
}

.grant-project-grid .ps-card__media {
  height: 190px;
  background: #f7f9fb;
}

.grant-project-grid .ps-card__media img {
  object-fit: contain;
  object-position: center;
}

.grant-project-grid .ps-card__number--dossier {
  top: 158px;
}

.grant-project-grid .ps-card__stamp {
  color: var(--project-accent);
}

.grant-project-grid .ps-card__body {
  align-items: flex-start;
  min-height: 308px;
  padding: 22px 21px 20px;
  text-align: left;
}

.grant-project-grid .ps-card__eyebrow {
  width: 100%;
  margin-inline: 0;
  color: var(--project-accent);
}

.grant-project-grid .ps-card__title {
  width: 100%;
  height: 4.05em;
  -webkit-line-clamp: 3;
}

.grant-project-grid .ps-card__divider {
  margin-left: 0;
  background: linear-gradient(90deg, var(--project-accent), transparent);
}

.grant-project-grid .ps-card__desc-line {
  width: 100%;
  min-height: 4.5em;
  -webkit-line-clamp: 3;
}

.grant-project-grid .ps-card__meta-line {
  width: 100%;
}

.grant-project-grid .ps-card__stage-line {
  color: var(--project-accent);
}

.grant-project-grid .ps-card__action {
  justify-content: space-between;
  color: var(--project-accent);
  text-align: left;
}

.grant-portfolio__empty {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 42px 20px;
  border: 1px dashed #d7e2eb;
  border-radius: 12px;
  background: #fafcfd;
  text-align: center;
}

.grant-portfolio__empty[hidden] { display: none; }
.grant-portfolio__empty strong { color: #17324e; font-size: .92rem; }
.grant-portfolio__empty span { color: #718397; font-size: .78rem; }

@keyframes grant-card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .grant-programs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grant-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grant-programs {
    display: flex;
    gap: 8px;
    margin-inline: -1px;
    padding: 7px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .grant-programs::-webkit-scrollbar { display: none; }

  .grant-program {
    flex: 0 0 156px;
    min-height: 78px;
    padding: 11px 12px;
    scroll-snap-align: start;
  }

  .grant-program-summary {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .grant-program-summary__metric {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 5px;
    min-width: 0;
    padding: 10px 0 0;
    border-top: 1px solid #e4ebf1;
    border-left: 0;
  }

  .grant-program-summary__metric strong { font-size: 1.15rem; }
  .grant-program-summary__metric span { margin: 0; }

  .grant-project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ── Boş durum ──────────────────────────────────────────────── */
.pi-empty-state {
  text-align: center;
  padding: 80px 20px;
}

.pi-empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0a2540;
  margin: 0 0 8px;
}

.pi-empty-state p {
  color: #64748b;
  margin: 0;
}

@media (max-width: 640px) {
  /* Kartlar alt alta ama içerik yüksekliğinde kompakt satırlar olsun —
     flex:1 1 200px column yönünde basis'i yüksekliğe uygulayıp dev
     bloklar üretiyordu; flex:0 0 auto ile yükseklik içeriğe döner. */
  .library-stats { flex-direction: column; gap: 10px; margin-bottom: 28px; }
  .library-stat { flex: 0 0 auto; padding: 15px 18px; gap: 14px; }
  .library-stat__icon { width: 38px; height: 38px; }
  .library-stat strong { font-size: 1.55rem; margin-bottom: 1px; }
  .library-stat span { font-size: 0.8rem; }

  .library-tabs { display: grid; width: 100%; max-width: 100%; gap: 4px; padding: 4px; }
  .library-tabs__trigger {
    min-width: 0;
    justify-content: center;
    min-height: 46px;
    padding: 9px 27px 9px 8px;
    font-size: .76rem;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
  }
  .library-tabs__trigger::after { right: 10px; font-size: .88rem; }

  /* Filtre çipleri sarınca ortalansın */
  .library-filter { justify-content: center; }
}
.grant-program-summary__copy [data-program-summary-link]{display:inline-flex;margin-top:7px;color:var(--summary-accent,#0b91a0);font-size:.7rem;font-weight:750;text-decoration:none}.grant-program-summary__copy [data-program-summary-link][hidden]{display:none}
