/* GitHub aktivitesi — ÖNİZLEME. */

#github {
  padding-bottom: 88px;
}

.gh-card {
  padding: 40px;
  background: #fff;
  border-color: rgba(20, 24, 31, 0.12);
}

.gh-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.gh-title {
  margin: 0;
}

.gh-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid rgba(20, 24, 31, 0.12);
  border-radius: 999px;
  background: #f8f9fb;
  color: var(--premium-ink, #14181f);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

.gh-profile:hover {
  border-color: rgba(49, 86, 232, 0.35);
  background: #fff;
}

.gh-total {
  margin: 28px 0 14px;
  color: #5d6572;
  font-size: 14px;
}

.gh-total b {
  color: var(--premium-ink, #14181f);
}

/* ─── Takvim: 7 satır, hafta başına bir sütun ─── */
.gh-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.gh-calendar {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  min-width: 640px;
}

.gh-calendar i,
.gh-legend i {
  display: block;
  aspect-ratio: 1;
  border-radius: 3px;
  background: #eef1f6;
}

.gh-calendar i.pad { visibility: hidden; }

.gh-calendar i[data-l="1"], .gh-legend i[data-l="1"] { background: #c9d5fb; }
.gh-calendar i[data-l="2"], .gh-legend i[data-l="2"] { background: #8ea6f5; }
.gh-calendar i[data-l="3"], .gh-legend i[data-l="3"] { background: #5577ec; }
.gh-calendar i[data-l="4"], .gh-legend i[data-l="4"] { background: #3156e8; }

/* Bölüm görününce kareler soldan sağa, hafta hafta belirir. */
#github:not(.is-visible) .gh-calendar i {
  opacity: 0;
  transform: scale(.4);
}

.gh-calendar i {
  transition: opacity .35s ease, transform .35s ease;
  transition-delay: calc(var(--w, 0) * 18ms);
}

.gh-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 10px;
  color: #8a929e;
  font-size: 11px;
}

.gh-legend i {
  width: 11px;
}

.gh-legend span:first-child { margin-right: 4px; }
.gh-legend span:last-child { margin-left: 4px; }

/* ─── Son çalışılan repolar ─── */
.gh-recent-label {
  margin: 28px 0 12px;
  color: var(--premium-ink, #14181f);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.gh-recent {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gh-recent a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "dot name arrow"
    ".   meta meta";
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e3e6eb;
  border-radius: 15px;
  background: #f8f9fb;
  color: inherit;
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

.gh-recent a:hover {
  border-color: #d4d9e1;
  background: #fff;
  transform: translateY(-2px);
}

.gh-dot {
  grid-area: dot;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.gh-name {
  grid-area: name;
  overflow: hidden;
  color: var(--premium-ink, #14181f);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-lang,
.gh-time {
  color: #8a929e;
  font-size: 12px;
}

.gh-lang { grid-area: meta; }

.gh-time {
  grid-area: meta;
  justify-self: end;
}

.gh-arrow {
  grid-area: arrow;
  color: #9aa3b2;
  font-size: 13px;
  transition: transform .25s ease, color .25s ease;
}

.gh-recent a:hover .gh-arrow {
  color: #3156e8;
  transform: translate(2px, -2px);
}

@media (max-width: 900px) {
  .gh-card { padding: 28px 22px; }
  .gh-recent { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  #github { padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  #github:not(.is-visible) .gh-calendar i { opacity: 1; transform: none; }
  .gh-calendar i { transition: none; }
}

/* GitHub bölümü iletişim kartının hemen altına gelsin; aradaki büyük boşluk kalksın. */
#contactRow .contact-row {
  padding-bottom: 22px;
}

@media (max-width: 900px) {
  #contactRow .contact-row { padding-bottom: 32px; }
}

/* Repolar her ekranda ince, tek satırlık satırlar */
.gh-recent {
  grid-template-columns: 1fr;
  gap: 8px;
}

.gh-recent a {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "dot name lang time arrow";
  column-gap: 12px;
  padding: 11px 14px;
}

.gh-lang { grid-area: lang; }
.gh-time { grid-area: time; justify-self: auto; }

/* Dar telefonda dil adı gizlenir, satır tek satıra sığsın */
@media (max-width: 520px) {
  .gh-recent a { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "dot name time arrow"; }
  .gh-lang { display: none; }
}

/* Geniş ekranda: solda takvim, sağda son çalışılan repolar */
@media (min-width: 901px) {
  .gh-card {
    display: grid;
    /* Takvim alanı büyük, repolar sağda sabit genişlikte */
    grid-template-columns: minmax(0, 1fr) 290px;
    column-gap: 32px;
    align-items: start;
  }

  .gh-head { grid-column: 1 / -1; }

  .gh-calendar-block { grid-column: 1; }

  .gh-recent-block { grid-column: 2; }

  /* İki parçadan biri gelmezse diğeri tüm genişliği kullanır */
  .gh-calendar-block[hidden] + .gh-recent-block,
  .gh-card:has(.gh-recent-block[hidden]) .gh-calendar-block { grid-column: 1 / -1; }

  .gh-recent-label {
    margin: 28px 0 14px;
  }

  /* Dar sağ sütunda dil adı gizli; dilin rengi noktada duruyor */
  .gh-recent a {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "dot name time arrow";
  }

  .gh-lang { display: none; }

  .gh-calendar {
    min-width: 0;
    gap: 3px;
  }

  /* Takvim tamamen sığıyor; yuvarlama payından çıkan kaydırma çubuğu görünmesin */
  .gh-scroll {
    overflow-x: hidden;
  }
}

/* ─── Kompakt kart: tek satır başlık, küçük kareli tam yıl takvim, repolar yanında ─── */
.gh-card { padding: 28px 32px; }

.gh-head {
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.gh-head > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 4px;
}

.gh-head .card-label { margin: 0; }

.gh-title { font-size: clamp(20px, 2.2vw, 24px); }

.gh-profile { padding: 8px 14px; }

.gh-calendar {
  grid-template-rows: repeat(7, 11px);
  grid-auto-columns: 11px;
  gap: 2px;
  width: max-content;
  min-width: 0;
}

.gh-calendar i,
.gh-legend i { border-radius: 2px; }

.gh-legend i { width: 10px; }

.gh-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gh-total {
  margin: 0;
  font-size: 13px;
}

.gh-legend { margin: 0; }

.gh-recent-label { margin: 24px 0 10px; }

.gh-recent { gap: 6px; }
.gh-recent a { padding: 8px 12px; }

@media (min-width: 901px) {
  .gh-card {
    grid-template-columns: minmax(0, max-content) minmax(240px, 1fr);
    column-gap: 36px;
  }

  .gh-calendar { gap: 2px; }

  /* Dar masaüstünde takvim sığmazsa kendi içinde kayar */
  .gh-scroll { overflow-x: auto; scrollbar-width: none; }
  .gh-scroll::-webkit-scrollbar { display: none; }

  .gh-recent-label { margin: 0 0 8px; }
}

@media (max-width: 680px) {
  .gh-card { padding: 22px 18px; }
  .gh-calendar {
    grid-template-rows: repeat(7, 9px);
    grid-auto-columns: 9px;
  }
}

@media (max-width: 900px) {
  .gh-scroll { scrollbar-width: none; }
  .gh-scroll::-webkit-scrollbar { display: none; }
}

/* katkı sayısı kaldırıldı: renk göstergesi sağda tek başına durur */
.gh-foot { justify-content: flex-end; }
