/* ==========================================================================
   pages.css — page-specific styles. Keep small: everything reusable belongs in components.css.
   Phase 2: error page (404). Later phases add their page blocks below, one section per page.
   ========================================================================== */

/* ---- 404 (Figma 84:330) ---------------------------------------------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
  text-align: center;
}

.error-page__code {
  color: var(--color-placeholder);
  font-size: clamp(7.5rem, 4.1rem + 14.5vw, 12.5rem);
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: -0.02em;
  user-select: none;
}

/* decorative numeral: drawn by CSS so it stays out of the accessibility tree and the contrast audit */
.error-page__code::before {
  content: attr(data-code);
}

.error-page__lead {
  color: var(--color-navy-800);
  font-size: var(--text-title-size);
  font-weight: var(--weight-medium);
  line-height: var(--text-title-lh);
  text-wrap: balance;
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-12);
}

.error-page__links {
  width: 100%;
  max-width: 1000px;
  padding-top: var(--space-24);
  text-align: left;
}

@media (min-width: 1024px) {
  .error-page {
    gap: var(--space-40);
  }
}

/* ---- Home on phones (Figma 202:188): section order. The DOM keeps the desktop order; below 768 .home-flow re-orders it:
   slider · news (then announcements) · intro · quick access · companies · stakeholders · banner · contact. ------------- */
@media (max-width: 767.98px) {
  .home-flow {
    display: flex;
    flex-direction: column;
  }

  .home-stage { order: 0; }
  .home-news { order: 1; border-top: 0; }
  .home-intro { order: 2; }
  .home-mosaic { order: 3; }
  .home-companies { order: 4; }
  .home-partners { order: 5; }
  .home-contact { order: 7; }
}

/* ---- Home (Figma 46:200, version of 5 Oct 2026) -----------------------------------------------------------------
   Section rhythm at 1440 (Figma y): slider 250–870 · news + announcements 956–1682 · mosaic 1682–2464 (no title) ·
   companies 2464–2873 · intro 2873–3536 · stakeholders 3547–3851 · contact 4272–4950 (the Atatürk banner between them was removed on 7 Oct 2026).
   Vertical padding is fluid: mobile values first, the Figma numbers from 1024/1280 up.                              */
.home-intro {
  padding: var(--space-40) var(--gutter) var(--space-64);
}

.home-intro__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-24);
  max-width: 752px;
  margin-inline: auto;
  text-align: center;
}

.home-intro__mark {
  width: 56px;
  height: auto;
  margin-bottom: calc(var(--space-4) * -1);
}

.home-intro__title {
  margin: 0;
}

.home-intro__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  color: var(--color-slate-600);
}

.home-intro__text p {
  margin: 0;
}

.home-intro__wordmark {
  width: min(298px, 80%);
  height: auto;
}

.home-intro__actions {
  justify-content: center;
  padding-top: var(--space-8);
}

/* the phone design (202:188) titles the mosaic; from 768 the design has no title, it stays for screen readers */
.home-mosaic__title {
  max-width: calc(12.5em + 2 * var(--gutter));
  margin: 0 auto var(--space-32);
  padding-inline: var(--gutter);
  color: var(--color-navy-800);
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
  letter-spacing: var(--text-h2-tracking);
  text-align: center;
  text-wrap: balance;
}

.home-companies {
  padding: var(--space-64) 0 var(--space-48);
}

.home-companies .section-heading {
  margin-bottom: var(--space-32);
}

.home-companies .section-heading {
  gap: var(--space-16);
}

.home-companies .section-heading__lead {
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
}

.home-companies .section-heading__lead p {
  margin: 0;
}

.home-news {
  padding: var(--space-40) 0;
  border-top: 1px solid var(--color-border);
}

.home-news__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-40);
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.home-news__column {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.home-news__title {
  margin: 0;
  color: var(--color-navy-800);
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
  letter-spacing: var(--text-h2-tracking);
}

/* the title is the link to the news list; on phones it reads as a plain heading (the "all news" link sits below).
   At least 44 px tap height without moving anything: a whole-pixel padding is taken back by an equal negative margin
   (0 once the line itself is that tall), so no fractional offset reaches the sections below. */
.home-news__title-link {
  --title-tap-pad: max(0px, round(up, calc((44px - var(--text-h2-size) * var(--text-h2-lh)) / 2), 1px));
  display: inline-flex;
  align-items: center;
  gap: var(--space-16);
  padding-block: var(--title-tap-pad);
  margin-block: calc(var(--title-tap-pad) * -1);
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

.home-news__title-arrow {
  display: none;
  width: 10px;
  height: 16px;
  transition: transform var(--dur-fast) var(--ease-out);
}

@media (max-width: 767.98px) {
  .home-news .news-carousel {
    display: none;
  }
}

.home-news__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-32);
}

.home-news__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  min-width: 0;
}

.home-news__side .news-row--sm:first-child {
  padding-top: 0;
}

.home-news__side .news-row--sm:last-child {
  border-bottom: 0;
}

/* the contact section follows directly (banner removed 7 Oct 2026): its own top padding makes the gap */
.home-partners {
  padding: var(--space-32) 0 var(--space-16);
}

.home-partners__title {
  margin: 0 0 var(--space-24);
  color: var(--color-navy-800);
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
  letter-spacing: var(--text-h2-tracking);
  text-align: center;
}

.home-contact {
  padding: var(--space-48) 0;
}

.home-contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-32);
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.home-contact__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.home-contact__title {
  margin: 0;
  color: var(--color-navy-800);
  font-size: var(--text-h2-size);
  font-weight: var(--text-h2-weight);
  line-height: var(--text-h2-lh);
  letter-spacing: var(--text-h2-tracking);
  text-wrap: balance;
}

.home-contact__lead {
  color: var(--color-slate-600);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
}

.home-contact__lead p {
  margin: 0;
}

.home-contact__map {
  aspect-ratio: 4 / 3;
  min-height: 0;
  border: 1px solid var(--color-tile);
}

@media (min-width: 768px) {
  .home-intro {
    padding: var(--space-56) var(--gutter) var(--space-80);
  }

  .home-intro__inner {
    gap: var(--space-28);
  }

  .home-intro__text {
    gap: var(--space-28);
  }

  .home-intro__mark {
    width: 68px;
    margin-bottom: calc(var(--space-8) * -1);
  }

  .home-mosaic__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .home-companies {
    padding: var(--space-80) 0 calc(var(--space-48) + var(--space-4));
  }

  .home-companies .section-heading {
    margin-bottom: var(--space-48);
  }

  .home-news {
    padding: calc(var(--space-48) + var(--space-4)) 0;
  }

  .home-news__inner {
    gap: var(--space-48);
  }

  .home-news__column {
    gap: var(--space-28);
  }

  .home-news__grid {
    display: none;
  }

  .home-news__title-arrow {
    display: block;
  }

  .home-news__title-link:hover {
    color: var(--color-blue-600);
  }

  .home-partners {
    padding: var(--space-32) 0 var(--space-24);
  }

  .home-partners__title {
    margin-bottom: var(--space-22);
  }

  .home-contact {
    padding: var(--space-80) 0;
  }

  .home-contact__content {
    gap: var(--space-28);
  }

  .home-contact__map {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

@media (min-width: 1024px) {
  .home-intro {
    padding: calc(var(--space-80) + var(--space-6)) var(--gutter) var(--space-96);
  }

  .home-contact__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-80);
    align-items: stretch;
  }

  .home-contact__map {
    aspect-ratio: auto;
    min-height: 320px;
  }
}

@media (hover: hover) and (min-width: 768px) {
  .home-news__title-link:hover .home-news__title-arrow {
    transform: translateX(3px);
  }
}

/* news | announcements side by side from 1280 (Figma 1440: 821 + 64 + 440); narrower screens stack them, news first */
@media (min-width: 1280px) {
  .home-news__inner {
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: var(--space-64);
    align-items: start;
  }
}

@media (min-width: 1440px) {
  .home-intro {
    padding-bottom: calc(var(--space-96) + var(--space-8));
  }

  .home-companies {
    padding-top: calc(var(--space-96) + var(--space-8));
    padding-bottom: calc(var(--space-48) + var(--space-4));
  }

  .home-contact {
    padding: calc(var(--space-96) + var(--space-8)) 0;
  }
}

/* ==========================================================================
   Phase 5 · stream A · lists — pages
   ========================================================================== */

/* stream A · lists — pages
   Route-specific rules of news, news-detail, announcements, announcement-detail, tenders, tender-specs, trainings, statements. */

/* ---- long titles: Figma sets the hero title 46 px (short), 40 px (news / notice titles) and 34 px (very long tender titles) ---- */
.page--title-md .page-hero__title {
  font-size: clamp(1.625rem, 1.3rem + 1.333vw, 2.5rem);
  line-height: 1.25;
}

.page--title-lg .page-hero__title {
  font-size: clamp(1.5rem, 1.44rem + 0.76vw, 2.125rem);
  line-height: 1.265;
}

.page--title-md .page-hero__inner,
.page--title-lg .page-hero__inner {
  --hero-title-width: 68.75rem;
}

.page--title-md .page-hero__title,
.page--title-lg .page-hero__title {
  max-width: var(--hero-title-width);
}

/* news detail: the "date · category" line under the title reads like Figma's lead (18/31 on-image) */
.page--news-detail .page-hero__meta {
  color: var(--color-on-image);
  font-size: var(--text-lead-size);
  line-height: var(--text-lead-lh);
}

/* tender specifications: the optional page picture is a 964 × 360 band on desktop */
.page--tender-specs .page-figure__media {
  --media-ratio: 16 / 10;
}

@media (min-width: 768px) {
  .page--tender-specs .page-figure__media {
    --media-ratio: 964 / 360;
  }
}

/* news detail / notice pages: one column of blocks 40 px apart (page-sections), the share row keeps its own rule */
.news-page .share {
  margin-top: calc(var(--space-8) * -1);
}

/* ==========================================================================
   Phase 5 · stream B · hub — pages
   ========================================================================== */

/* stream B · hub — pages */

/* ---- gallery (Figma 64:2): chips, grid and hint stack with the page rhythm; no sidebar ---- */
.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

.gallery__panels {
  min-width: 0;
  scroll-margin-top: var(--space-24);
}

.gallery__note {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-small-size);
  line-height: var(--text-small-lh);
}

@media (min-width: 768px) {
  .gallery {
    gap: var(--space-40);
  }
}

/* ---- companies (Figma 62:2): toolbar and grid ---- */
.company-filter {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

@media (min-width: 768px) {
  .company-filter {
    gap: var(--space-40);
  }
}

/* ---- application documents (Figma 63:2): chip index + group grid, no sidebar ---- */
.doc-index {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  min-width: 0;
}

@media (min-width: 768px) {
  .doc-index {
    gap: var(--space-40);
  }
}

/*
 * The chip index stays below the compact header (< 1024 px) or at the top of the viewport (the desktop header scrolls away) while the
 * long list passes, so the current-group highlight of documents.js is always visible. It has a white ground and keeps its natural
 * position (the negative margin cancels the padding).
 */
.doc-index__nav {
  position: sticky;
  top: 65px;
  z-index: 20;
  margin: calc(-1 * var(--space-8)) 0;
  padding: var(--space-8) 0;
  background: var(--color-white);
}

@media (min-width: 1024px) {
  .doc-index__nav {
    top: 0;
  }
}

/* the sticky bar stays one row below 1280 px (six group names do not fit a tablet): the chips scroll sideways instead of wrapping */
@media (min-width: 768px) and (max-width: 1279px) {
  .doc-index__nav .chip-list--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block: var(--space-4);
    margin-block: calc(-1 * var(--space-4));
  }
}

/* ==========================================================================
   Phase 5 · stream C · forms — pages
   ========================================================================== */

/* stream C · forms — pages
   Contact page layout (Figma 64:272): info column + form panel side by side, map below.
   Mobile-first: one column → info cards 2×2 (768) → 460 / 820 split (1024, the Figma proportions) . */

/* ---- contact: info column + form ------------------------------------------------------------------------------------------ */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-24);
  align-items: start;
}

.contact-info__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12);
}

/* phones: compact cards, the long KEP address may wrap anywhere instead of overflowing */
.contact-info__list .info-card {
  --card-pad: var(--space-16) var(--space-20);
}

.contact-info__list .info-card__value {
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
}

.contact-info__address {
  font-style: normal;
}

@media (min-width: 768px) {
  .contact-layout {
    gap: var(--space-32);
  }

  .contact-info__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
  }

  .contact-info__list .info-card {
    --card-pad: calc(var(--space-20) + var(--space-2)) var(--space-24);
  }

  .contact-info__list .info-card__value {
    font-size: var(--text-title-size);
    line-height: var(--text-title-lh);
  }
}

@media (min-width: 1024px) {
  .contact-layout {
    grid-template-columns: minmax(0, 460fr) minmax(0, 820fr);
    gap: var(--space-40);
  }

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

/* ---- contact: map + directions --------------------------------------------------------------------------------------------- */
.contact-map {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

/* Figma: 1320 × 420 rounded block; the shared embed is 16:9 / 3:1, so this page fixes its height instead */
.contact-map__embed {
  aspect-ratio: auto;
  min-height: 0;
  height: 280px;
}

.contact-map__bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-12);
}

.contact-map__caption {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-small-size);
  line-height: var(--text-small-lh);
}

@media (min-width: 768px) {
  .contact-map__embed {
    height: 340px;
  }

  .contact-map__bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
  }
}

@media (min-width: 1024px) {
  .contact-map__embed {
    height: 420px;
  }
}

/* ==========================================================================
   Phase 5 · stream D · search — pages
   ========================================================================== */

/* stream D · search — pages (loaded after pages.css; merged into it at the end of phase 5)
   Page-level adjustments of the search page, the legal pages and the 404 page. Reusable pieces live in search.components.css. */

/* ---- search (Figma 84:19) ---- */
.page--search .page-hero__inner {
  padding-bottom: var(--space-32);
}

@media (min-width: 768px) {
  .page--search .page-hero__inner {
    padding-bottom: var(--space-48);
  }
}

@media (min-width: 1024px) {
  .page--search .page-hero__inner {
    padding-bottom: var(--space-64);
  }
}
