/* =====================================================
   GIOTSASTECH — PORTFOLIO PAGES
   Loaded by the /portfolio pages, after style.css
   ===================================================== */

/* Picture sizes. Every screenshot is shown in the same fixed frame and cropped from the top, whatever its own shape. */
:root {
  --shot-max-width: 560px;   /* screenshot on a project page */
  --shot-ratio: 2 / 1;       /* 560 x 280 at full width */
  --thumb-ratio: 2 / 1;      /* screenshot on a project card */
  --thumb-max-height: 190px;
}

.portfolio--alt { background: var(--bg-secondary); }

/* ==================
   PROJECT GRID
   The admin can add any number of projects, so the columns fill themselves.
   ================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ==================
   PROJECT CARD
   ================== */
.project-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--transition), border-color var(--transition);
}
.project-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}
.project-card:hover { background: var(--bg-card-hover); border-color: var(--border-accent); }
.project-card:hover::after { transform: scaleX(1); }

.project-card__thumb {
  margin: -40px -36px 28px;
  aspect-ratio: var(--thumb-ratio);
  max-height: var(--thumb-max-height);
  overflow: hidden;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.project-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.project-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.project-card__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  border-radius: var(--radius);
}
.project-card__icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-card__title {
  font-size: 1.45rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.project-card__meta {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.project-card__desc {
  flex: 1;
  font-size: 0.93rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 24px;
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.project-tag {
  padding: 4px 12px;
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  background: var(--accent-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* The link's ::before stretches over the whole card, so the entire card is one big link. */
.project-card__link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  transition: gap var(--transition);
}
.project-card__link::before {
  content: '';
  position: absolute;
  inset: 0;
}
.project-card:hover .project-card__link { gap: 14px; }

/* ==================
   STATUS PILL
   ================== */
.project-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.project-status--live {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
.project-status--live::before { animation: projectPulse 2.4s ease-in-out infinite; }
.project-status--wip { color: var(--text-secondary); }

[data-theme="light"] .project-status--live { color: #007A33; }

@keyframes projectPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .project-status--live::before { animation: none; }
}

/* ==================
   PROJECT PAGE
   ================== */
.project-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
}
.project-detail__main > * + * { margin-top: 48px; }

.project-shot {
  width: 100%;
  max-width: var(--shot-max-width);
  aspect-ratio: var(--shot-ratio);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.project-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-detail__heading {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 18px;
}
.project-detail__text p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 68ch;
}
.project-detail__text p + p { margin-top: 18px; }

.project-list { display: grid; gap: 12px; }
.project-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.project-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.project-facts {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* A white tile keeps any logo readable, whatever its colours and whichever theme is on. */
.project-facts__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  margin-bottom: 28px;
  padding: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.project-facts__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.project-facts__list { display: grid; gap: 22px; margin-bottom: 28px; }
.project-facts__list dt {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.project-facts__list dd { color: var(--text-primary); overflow-wrap: anywhere; }
.project-facts__list .project-card__tags { margin-bottom: 0; }
.project-facts .btn { width: 100%; justify-content: center; }

/* ==================
   RESPONSIVE
   ================== */
@media (max-width: 1024px) {
  .project-detail__grid { grid-template-columns: 1fr; gap: 40px; }
  .project-facts        { position: static; }
}

@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-card { padding: 32px 24px; }
  .project-card__thumb { margin: -32px -24px 24px; }
}
