/* ==========================================================================
   KNT Yapı Mimarlık — refs.css
   Kategorili referans arşivi (/referanslar) ve proje detay sayfaları.
   ========================================================================== */

/* ---------------------------------------------------------------- Arşiv */
.rx {
  --rx-line: var(--line); --rx-soft: var(--text-soft); --rx-mute: var(--text-mute);
  --rx-card: #fff; --rx-bar: rgba(241, 239, 233, .82); --rx-tab: rgba(10, 12, 11, .05);
  padding-top: calc(var(--header-h) + clamp(40px, 6vw, 96px));
}
.rxd-related { --rx-line: var(--line); --rx-soft: var(--text-soft); --rx-mute: var(--text-mute); --rx-card: #fff; }
.rx--dark {
  --rx-line: var(--line-dark); --rx-soft: var(--on-dark-soft); --rx-mute: var(--on-dark-mute);
  --rx-card: var(--ink-3); --rx-bar: rgba(16, 19, 17, .82); --rx-tab: rgba(255, 255, 255, .06);
}

.rx-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px 64px; margin-bottom: clamp(40px, 5vw, 72px); }
.rx-hero__title {
  margin: 0; font-family: var(--font-display); font-stretch: 112%; font-weight: 650;
  font-size: clamp(3rem, 7.6vw, 7.8rem); line-height: .95; letter-spacing: -.035em; max-width: 12ch;
}
.rx-hero__title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-stretch: 100%; color: var(--brand); letter-spacing: -.01em; }
.rx-hero__lead { max-width: 56ch; margin: 28px 0 0; color: var(--rx-soft); font-size: clamp(1rem, 1.2vw, 1.12rem); }
.rx-hero__count { display: grid; justify-items: end; text-align: right; }
.rx-hero__num {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: clamp(6rem, 15vw, 14rem);
  line-height: .8; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.5px var(--brand);
  font-variant-numeric: tabular-nums;
}
.rx-hero__label { margin-top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.rx-hero__cats { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rx-mute); }

/* Filtre çubuğu */
.rx-bar {
  position: sticky; top: 14px; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 7px; margin-bottom: 18px;
  border-radius: 999px; border: 1px solid var(--rx-line); background: var(--rx-bar);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.rx-tabs { display: flex; gap: 4px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.rx-tabs::-webkit-scrollbar { display: none; }
.rx-tab {
  flex: none; display: inline-flex; align-items: flex-start; gap: 5px; padding: 10px 16px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: .9rem; white-space: nowrap; color: var(--rx-soft);
  transition: background-color .35s, color .35s;
}
.rx-tab sup { font-size: .68em; font-weight: 600; opacity: .7; top: -.1em; }
.rx-tab:hover { background: var(--rx-tab); color: inherit; }
.rx-tab.is-active { background: var(--brand); color: var(--ink); }
.rx-tab.is-active sup { opacity: .8; }
.rx-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.rx-search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px;
  background: var(--rx-tab); color: var(--rx-soft); transition: box-shadow .3s;
}
.rx-search:focus-within { box-shadow: inset 0 0 0 1px var(--brand); }
.rx-search input { width: clamp(150px, 16vw, 250px); border: 0; background: none; outline: none; color: inherit; font-size: .9rem; }
.rx-search input::placeholder { color: var(--rx-mute); }
.rx-views { display: flex; padding: 3px; border-radius: 999px; background: var(--rx-tab); }
.rx-views button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; color: var(--rx-mute); transition: background-color .3s, color .3s; }
.rx-views button[aria-pressed="true"] { background: var(--brand); color: var(--ink); }

.rx-result { margin: 0 0 8px; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--rx-mute); }
.rx-result b { color: var(--brand); }

/* Kategori grubu */
.rx-group { padding-top: 12px; }
.rx-group[hidden] { display: none; }
.rx-group__head {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: end; gap: 24px;
  padding: clamp(40px, 5vw, 70px) 0 28px; border-bottom: 1px solid var(--rx-line); margin-bottom: 28px;
}
.rx-group__no {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 3.6rem; line-height: .8;
  letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1px var(--rx-mute);
}
.rx-group__title { margin: 0; font-family: var(--font-display); font-stretch: 110%; font-weight: 650; font-size: clamp(1.8rem, 3.2vw, 3rem); letter-spacing: -.03em; line-height: 1; }
.rx-group__text p { max-width: 60ch; margin: 10px 0 0; color: var(--rx-soft); font-size: .95rem; }
.rx-group__count {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--rx-line); font-size: .85rem; color: var(--rx-soft); transition: .3s;
}
.rx-group__count b { color: inherit; font-family: var(--font-display); font-size: 1rem; }
.rx-group__count:hover { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.rx.is-filtered .rx-group__count { visibility: hidden; }

/* Kart */
.rx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 22px; }
.rx-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "media media" "title title" "cat year" "loc loc";
  gap: 6px 14px; align-content: start; color: inherit;
}
.rx-card[hidden] { display: none; }
.rx-card__media { grid-area: media; position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 14px; overflow: hidden; border-radius: 18px; background: var(--rx-card); }
.rx-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), filter .8s; }
.rx-card:hover .rx-card__media img { transform: scale(1.07); }
.rx-card__tag, .rx-card__photos {
  position: absolute; top: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: rgba(10, 12, 11, .55); color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .06em;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.rx-card__tag { left: 14px; text-transform: uppercase; }
.rx-card__photos { right: 14px; }
.rx-card__go {
  position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-radius: 12px; background: var(--brand); color: var(--ink); font-family: var(--font-display); font-weight: 650; font-size: .9rem;
  transform: translateY(calc(100% + 20px)); transition: transform .6s var(--ease-out);
}
.rx-card:hover .rx-card__go, .rx-card:focus-visible .rx-card__go { transform: none; }
.rx-card__no, .rx-card__arrow { display: none; }
.rx-card__title { grid-area: title; font-family: var(--font-display); font-stretch: 108%; font-weight: 650; font-size: 1.32rem; line-height: 1.15; letter-spacing: -.02em; transition: color .3s; }
.rx-card:hover .rx-card__title { color: var(--brand); }
.rx-card__cat { grid-area: cat; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.section--paper .rx-card__cat { color: var(--brand-deep); }
.rx-card__year { grid-area: year; font-size: .82rem; color: var(--rx-mute); font-variant-numeric: tabular-nums; }
.rx-card__loc { grid-area: loc; display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--rx-soft); }
.rx-card__loc .i { color: var(--brand); }
.rx-card.is-enter { animation: rxIn .7s var(--ease-out) both; animation-delay: calc(var(--k, 0) * 45ms); }
@keyframes rxIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }

/* Liste görünümü */
.rx[data-view="list"] .rx-grid { display: block; border-top: 1px solid var(--rx-line); }
.rx[data-view="list"] .rx-card {
  grid-template-columns: 56px minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1.3fr) 64px 46px;
  grid-template-areas: "no title cat loc year arrow"; align-items: center; gap: 18px;
  padding: 22px 8px; border-bottom: 1px solid var(--rx-line); transition: background-color .3s, padding .5s var(--ease-out);
}
.rx[data-view="list"] .rx-card:hover { background: var(--rx-tab); padding-left: 18px; }
.rx[data-view="list"] .rx-card__media { display: none; }
.rx[data-view="list"] .rx-card__no { display: block; grid-area: no; font-size: .8rem; letter-spacing: .1em; color: var(--rx-mute); }
.rx[data-view="list"] .rx-card__title { font-size: clamp(1.1rem, 1.7vw, 1.55rem); }
.rx[data-view="list"] .rx-card__year { text-align: right; }
.rx[data-view="list"] .rx-card__arrow {
  display: grid; grid-area: arrow; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rx-line);
  font-size: 18px; transition: background-color .3s, color .3s, transform .5s var(--ease-out), border-color .3s;
}
.rx[data-view="list"] .rx-card:hover .rx-card__arrow { background: var(--brand); border-color: var(--brand); color: var(--ink); transform: rotate(45deg); }
.rx[data-view="list"] .rx-group__head { margin-bottom: 0; border-bottom: 0; }

.rx-float {
  position: fixed; left: 0; top: 0; z-index: 70; width: 280px; aspect-ratio: 4 / 3; margin: -105px 0 0 24px;
  border-radius: 14px; overflow: hidden; pointer-events: none; opacity: 0; transform: translate3d(-50vw, -50vh, 0) scale(.85);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6); transition: opacity .3s, scale .4s var(--ease-out);
}
.rx-float.is-on { opacity: 1; scale: 1.18; }
.rx-float img { width: 100%; height: 100%; object-fit: cover; }

.rx-empty { padding: 80px 0; text-align: center; font-family: var(--font-display); font-size: 1.4rem; color: var(--rx-mute); }
.rx-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: clamp(64px, 8vw, 110px); padding: 32px; border-radius: 24px; border: 1px solid var(--rx-line);
}
.rx-foot p { margin: 0; max-width: 52ch; font-family: var(--font-display); font-size: 1.2rem; }

/* ---------------------------------------------------------------- Proje detay */
.rxd-hero { position: relative; min-height: clamp(560px, 88vh, 900px); display: flex; align-items: flex-end; overflow: hidden; background: var(--ink); color: var(--on-dark); padding: calc(var(--header-h) + 60px) 0 clamp(48px, 7vw, 100px); }
.rxd-hero__bg { position: absolute; inset: -12% 0; }
.rxd-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.js .rxd-hero__bg { clip-path: inset(0 0 100% 0); transition: clip-path 1.6s var(--ease-io); }
.js.is-ready .rxd-hero__bg { clip-path: inset(0 0 0 0); }
.rxd-hero__shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 12, 11, .96) 0%, rgba(10, 12, 11, .45) 55%, rgba(10, 12, 11, .7) 100%); }
.rxd-hero__inner { position: relative; z-index: 2; }
.rxd-hero__no { margin: 0 0 12px; font-family: var(--font-display); font-stretch: 110%; font-size: .95rem; color: var(--on-dark-mute); }
.rxd-hero__no i { margin: 0 6px; font-style: normal; color: var(--brand); }
.rxd-hero__title { margin: 0; max-width: 18ch; font-family: var(--font-display); font-stretch: 112%; font-weight: 650; font-size: clamp(2.6rem, 6.4vw, 6.6rem); line-height: .98; letter-spacing: -.035em; }
.rxd-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.rxd-hero__chips span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); font-size: .85rem; backdrop-filter: blur(6px); }
.rxd-hero__chips span:first-child { background: var(--brand); border-color: var(--brand); color: var(--ink); font-weight: 650; }
.rxd-hero__chips .i { color: var(--brand); }

.rxd-body__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: clamp(40px, 7vw, 120px); align-items: start; }
.rxd-body__lead { margin: 0 0 40px; font-family: var(--font-display); font-stretch: 105%; font-weight: 500; font-size: clamp(1.4rem, 2.4vw, 2.3rem); line-height: 1.28; letter-spacing: -.02em; }
.rxd-facts { position: sticky; top: 110px; padding: 30px; border-radius: 24px; background: #fff; box-shadow: 0 30px 60px -40px rgba(10, 12, 11, .35); }
.rxd-facts__title { margin: 0 0 12px; font-family: var(--font-display); font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-deep); }
.rxd-facts dl { margin: 0; }
.rxd-facts dl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.rxd-facts dt { font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.rxd-facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; }

.rxd-gallery__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; }
.rxd-gallery__count { font-size: .85rem; color: var(--on-dark-mute); }
.rxd-gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 16vw, 240px); grid-auto-flow: dense; gap: 12px; }
.rxd-shot { position: relative; display: block; overflow: hidden; border-radius: 14px; background: var(--ink-3); }
.rxd-shot .img-reveal { width: 100%; height: 100%; }
.rxd-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.rxd-shot:hover img { transform: scale(1.06); }
.rxd-shot--0 { grid-column: span 2; grid-row: span 2; }
.rxd-shot--3 { grid-row: span 2; }

.rxd-pager { display: grid; grid-template-columns: 1fr 1fr; background: var(--ink); color: var(--on-dark); border-top: 1px solid var(--line-dark); }
.rxd-pager__link { position: relative; overflow: hidden; display: grid; gap: 10px; padding: clamp(36px, 5vw, 70px) var(--gutter); isolation: isolate; }
.rxd-pager__link + .rxd-pager__link { border-left: 1px solid var(--line-dark); text-align: right; justify-items: end; }
.rxd-pager__link img { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity .6s, transform 1.2s var(--ease-out); }
.rxd-pager__link::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10, 12, 11, .9), rgba(10, 12, 11, .55)); opacity: 0; transition: opacity .6s; }
.rxd-pager__link:hover img { opacity: 1; transform: none; }
.rxd-pager__link:hover::after { opacity: 1; }
.rxd-pager__dir { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.rxd-pager__title { font-family: var(--font-display); font-stretch: 110%; font-weight: 650; font-size: clamp(1.4rem, 2.6vw, 2.4rem); line-height: 1.05; letter-spacing: -.025em; }

.rxd-cta__inner { display: grid; justify-items: center; text-align: center; gap: 22px; }
.rxd-cta__inner p { max-width: 56ch; margin: 0; color: var(--on-dark-soft); }

/* ---------------------------------------------------------------- Duyarlı */
@media (max-width: 1000px) {
  .rx-bar { flex-direction: column; align-items: stretch; border-radius: 24px; position: relative; top: 0; }
  .rx-tools { justify-content: space-between; }
  .rx-search { flex: 1; }
  .rx-search input { width: 100%; }
  .rx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx[data-view="list"] .rx-card { grid-template-columns: 40px minmax(0, 1fr) 44px; grid-template-areas: "no title arrow" "no cat arrow"; row-gap: 4px; }
  .rx[data-view="list"] .rx-card__loc, .rx[data-view="list"] .rx-card__year { display: none; }
  .rxd-body__grid { grid-template-columns: 1fr; }
  .rxd-facts { position: static; }
  .rxd-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .rx-hero { grid-template-columns: 1fr; }
  .rx-hero__count { justify-items: start; text-align: left; grid-template-columns: auto 1fr; align-items: end; column-gap: 14px; }
  .rx-hero__num { grid-row: span 2; font-size: 5.4rem; }
  .rx-grid { grid-template-columns: 1fr; }
  .rx-group__head { grid-template-columns: 1fr; gap: 10px; }
  .rx-group__no { font-size: 2.4rem; }
  .rx-float { display: none; }
  .rxd-pager { grid-template-columns: 1fr; }
  .rxd-pager__link + .rxd-pager__link { border-left: 0; border-top: 1px solid var(--line-dark); }
  .rxd-facts dl > div { grid-template-columns: 1fr; gap: 2px; }
}
.reduced-motion .rx-card.is-enter { animation: none; }
