/*
 * Public profil sayfası (/c/{code}).
 * Fikir: ekranın tepesinde, az önce dokunulan fiziksel kartın birebir oranlı (85.6 × 54 mm) kopyası durur.
 * Tüm tonlar firmanın iki renginden türetilir (--brand, --accent; layout'ta satır içi tanımlanır),
 * böylece başka bir firmanın renkleriyle de uyumlu kalır.
 */

:root {
  --brand: #1f3a5f;
  --on-brand: #ffffff;
  --accent: #e8a33d;
  --on-accent: #000000;

  --ink: color-mix(in srgb, var(--brand) 22%, #000);
  --brand-strong: var(--brand);
  --page: color-mix(in srgb, var(--brand) 7%, #fff);
  --surface: #fff;
  --muted: color-mix(in srgb, var(--ink) 64%, #fff);
  --line: color-mix(in srgb, var(--ink) 11%, #fff);
  --press: color-mix(in srgb, var(--brand) 8%, #fff);

  --radius: 16px;
  --column: 440px;
}

/* color-mix desteklemeyen eski tarayıcılar için sabit tonlar */
@supports not (color: color-mix(in srgb, red, blue)) {
  :root {
    --ink: #17202b;
    --page: #f1f4f7;
    --muted: #5d6672;
    --line: #e2e6ea;
    --press: #edf1f5;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { -webkit-tap-highlight-color: transparent; }

a:focus-visible {
  outline: 3px solid var(--brand-strong);
  outline-offset: 2px;
  border-radius: 12px;
}

.profile {
  max-width: var(--column);
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.profile.has-savebar { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---- Kart (sayfanın tek gösterişli öğesi) ---- */

.card {
  position: relative;
  isolation: isolate;
  /* clip: köşeleri kırpar ama kaydırma kutusu yapmaz → oranlı kart, uzun ad/e-postada içerik kadar uzar (hidden'da kesilirdi) */
  overflow: hidden;
  overflow: clip;
  aspect-ratio: 85.6 / 54;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 22px;
  border-radius: 18px;
  background: var(--brand);
  color: var(--on-brand);
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--brand) 35%, transparent),
    0 22px 44px -20px color-mix(in srgb, var(--brand) 60%, transparent);
  transform-origin: 50% 100%;
  animation: card-in 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* PVC kartın parlaklığı */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.16) 0%, rgb(255 255 255 / 0) 40%);
  pointer-events: none;
}

/* Kartın alt kenarında ikinci kurumsal renk */
.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: var(--accent);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-logo {
  display: inline-flex;
  max-width: 70%;
  padding: 7px 12px;
  border-radius: 11px;
  background: #fff;
}

.card-logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.card-company {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-nfc {
  width: 26px;
  height: 26px;
  flex: none;
  opacity: 0.7;
}

/* Gövde: solda ad + iletişim + departman, sağda fotoğraf (dikey ortalı) */
.card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.card-text { flex: 1; min-width: 0; }

.card-name {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
  font-weight: 720;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.card-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* sütun içerik kadar büyümesin: uzun e-posta "…" ile kesilsin */
  gap: 0;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.card-contact a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 24px; /* dokunma hedefi (WCAG 2.2: en az 24 px) */
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.94;
}

/* Uzun e-posta tek satırda kalır, sonu "…" ile kesilir */
.card-contact span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-contact-icon {
  flex: none;
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.card-dept {
  margin: 8px 0 0;
  font-size: 13px;
  opacity: 0.74;
}

.card-photo {
  width: 80px;
  height: 80px;
  flex: none;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--on-brand) 70%, transparent);
}

/* Fotoğraf yoksa baş harfler: kartın kendi tonunda, ismin önüne geçmeyecek kadar sakin */
.card-initials {
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--on-brand) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--on-brand) 28%, transparent);
  color: var(--on-brand);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: perspective(900px) translateY(18px) rotateX(14deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Hızlı iletişim: tek parça, bölmeli şerit ---- */

.quick {
  display: flex;
  margin-top: 20px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.quick-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.quick-item + .quick-item { border-left: 1px solid var(--line); }

.quick-item .icon {
  width: 22px;
  height: 22px;
  color: var(--brand-strong);
}

.quick-item:active { background: var(--press); }

.quick-item:focus-visible {
  outline-offset: -3px;
  border-radius: 0;
}

/* ---- Hakkımda kutusu: başlık → unvan (küçük) → yazı ---- */

.about {
  margin-top: 20px;
  padding: 16px 18px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.about-title {
  margin: 0 0 4px;
  color: var(--brand-strong);
  font-size: 15px;
  font-weight: 700;
}

.about-role {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.about-role:last-child { margin-bottom: 0; }

.about-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-line;
}

/* ---- İletişim satırları ---- */

.rows {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.rows li + li .row { border-top: 1px solid var(--line); }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 11px 16px;
  color: inherit;
  text-decoration: none;
}

.row:active { background: var(--press); }

.row:focus-visible {
  outline-offset: -3px;
  border-radius: 0;
}

.row-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--brand-strong);
}

.row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.row-label {
  font-size: 13px;
  color: var(--muted);
}

.row-value {
  font-size: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ---- Rehbere kaydet (başparmak bölgesinde sabit) ---- */

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(var(--column) - 32px);
  height: 54px;
  margin: 0 auto;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 120ms ease;
}

.save .icon {
  width: 22px;
  height: 22px;
}

.save:active { transform: scale(0.985); }

.save:focus-visible {
  outline-offset: 3px;
  border-radius: 14px;
}

/* ---- Kart aktif değil / tanınmadı ---- */

.notice {
  padding-top: 40px;
  text-align: center;
}

.blank-card {
  display: grid;
  place-items: center;
  aspect-ratio: 85.6 / 54;
  margin-bottom: 28px;
  border: 2px dashed color-mix(in srgb, var(--ink) 22%, #fff);
  border-radius: 18px;
  color: var(--muted);
}

.blank-card-nfc {
  width: 40px;
  height: 40px;
}

.notice-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.notice-body {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.5;
}

.notice .company { text-align: left; }

.notice-action { margin-top: 28px; }

@media (min-width: 600px) {
  .profile { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }

  .save { transition: none; }
}
