/*
 * T.G.T. visual balance layer — 2026-08-02
 * Loaded last so card hierarchy and responsive behaviour stay predictable.
 */

:root {
  --tgt-card-radius: 16px;
  --tgt-card-line: #d9e2ee;
  --tgt-card-shadow: 0 12px 28px rgba(16, 33, 63, .07);
  --tgt-card-shadow-hover: 0 18px 38px rgba(16, 33, 63, .12);
}

/* Final conversion actions: equal widths, even rhythm and a recognisable
 * WhatsApp action in every public language. */
.tgt-home .tgt-final-cta__actions {
  width: min(100%, 310px);
  align-items: stretch;
  gap: 14px;
}

.tgt-home .tgt-final-cta__actions .tgt-button {
  width: 100%;
  min-height: 52px;
}

.tgt-home .tgt-final-cta__actions small {
  width: 100%;
  margin-top: 2px;
}

/* Prevent long Turkish labels from forcing grid items outside their columns. */
.tgt-commercial-actions > a,
.tgt-commercial-type,
.tgt-commercial-search-results > a,
.tgt-property-term__related-grid > a,
.tgt-home .tgt-commercial-focus__grid > a,
.tgt-footer__grid > * {
  min-width: 0;
}

.tgt-commercial-actions strong,
.tgt-commercial-type strong,
.tgt-commercial-search-results strong,
.tgt-property-term__related-grid strong,
.tgt-footer a {
  overflow-wrap: anywhere;
}

/* The HTML hidden state must always win over grid display declarations. */
.tgt-commercial-types[hidden],
.tgt-commercial-search-results[hidden],
.tgt-commercial-search-results > a[hidden],
.tgt-commercial-no-result[hidden] {
  display: none !important;
}

/* Keep the dedicated hub full-width and outside generic inner-page typography. */
.tgt-commercial-center-page #tgt-main-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 !important;
}

.tgt-commercial-center {
  width: 100%;
  max-width: none;
  overflow: clip;
}

.tgt-commercial-center__hero h1 {
  margin: .7rem 0 1.25rem;
  color: #fff;
  font-size: clamp(2.65rem, 5.6vw, 5.35rem);
  line-height: .98;
}

.tgt-commercial-center__lead {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(1.08rem, 1.65vw, 1.28rem);
  line-height: 1.65;
}

.tgt-commercial-center__heading h2,
.tgt-commercial-investment h2 {
  margin: .55rem 0 .9rem;
  color: var(--tgt-navy);
  font-size: clamp(2rem, 3.8vw, 3.35rem);
  line-height: 1.04;
}

.tgt-commercial-center__heading > p:last-child,
.tgt-commercial-investment > div > p:last-child {
  margin: 0;
  color: var(--tgt-muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

/* Action cards are a separate decision layer, not taxonomy cards. */
.tgt-commercial-actions {
  grid-auto-rows: 1fr;
  gap: 16px;
}

.tgt-commercial-actions > a {
  height: 100%;
  border-color: var(--tgt-card-line);
  border-radius: var(--tgt-card-radius);
  box-shadow: var(--tgt-card-shadow);
}

.tgt-commercial-actions > a:hover,
.tgt-commercial-actions > a:focus-visible {
  box-shadow: var(--tgt-card-shadow-hover);
}

/* Parent categories: deliberately larger and more prominent than children. */
.tgt-commercial-types {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 16px;
}

.tgt-commercial-type {
  grid-column: span 2;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 152px;
  height: 100%;
  align-content: center;
  gap: .38rem .9rem;
  padding: 1.35rem 3.25rem 1.3rem 1.25rem;
  border-color: var(--tgt-card-line);
  border-radius: var(--tgt-card-radius);
  box-shadow: var(--tgt-card-shadow);
}

.tgt-commercial-type > span {
  width: 42px;
  height: 42px;
}

.tgt-commercial-type strong {
  align-self: auto;
  font-size: 1.08rem;
  line-height: 1.3;
}

.tgt-commercial-type small {
  align-self: auto;
  font-size: .81rem;
  line-height: 1.35;
}

.tgt-commercial-type:hover,
.tgt-commercial-type:focus-visible {
  box-shadow: var(--tgt-card-shadow-hover);
}

/* Centre incomplete final rows instead of leaving a card stranded at left. */
.tgt-commercial-type:last-child:nth-child(3n + 1) {
  grid-column: 3 / span 2;
}

.tgt-commercial-type:nth-last-child(2):nth-child(3n + 1) {
  grid-column: 2 / span 2;
}

.tgt-commercial-type:nth-last-child(2):nth-child(3n + 1) + .tgt-commercial-type {
  grid-column: 4 / span 2;
}

/* Search results and child categories remain compact secondary choices. */
.tgt-commercial-search-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
}

.tgt-commercial-search-results > a {
  min-height: 94px;
  height: 100%;
  border-radius: 14px;
}

.tgt-property-term__related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
}

.tgt-property-term__related-grid > a {
  min-height: 96px;
  height: 100%;
  padding: 1rem 2.65rem 1rem 1rem;
  border-color: var(--tgt-card-line);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(16, 33, 63, .045);
}

.tgt-property-term__related-grid > a strong {
  font-size: .95rem;
  line-height: 1.3;
}

.tgt-property-term__related-grid > a span {
  margin-top: .3rem;
  font-size: .78rem;
  line-height: 1.4;
}

.tgt-property-term__related-grid > a:hover,
.tgt-property-term__related-grid > a:focus-visible {
  box-shadow: 0 14px 28px rgba(16, 33, 63, .1);
}

/* Existing homepage cards keep equal rows without changing their content. */
.tgt-home .tgt-commercial-focus__grid {
  grid-auto-rows: 1fr;
}

.tgt-home .tgt-commercial-focus__grid > a {
  height: 100%;
}

/* Contact strip: keep every contact method available without tablet overflow. */
.tgt-header__utility-inner,
.tgt-header__utility-actions {
  min-width: 0;
}

.tgt-header__utility-actions a,
.tgt-language-menu summary {
  white-space: nowrap;
}

.tgt-header__utility.is-language-open {
  overflow: visible;
}

.tgt-language-menu {
  z-index: 12;
}

.tgt-language-menu summary {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .35rem .15rem;
}

.tgt-language-menu summary::after {
  display: inline-block;
  color: #f0b66e;
  content: '⌄';
  font-size: .9em;
  transition: transform .18s ease;
}

.tgt-language-menu[open] summary::after {
  transform: rotate(180deg);
}

.tgt-language-menu__panel {
  z-index: 30;
  top: calc(100% + 7px);
  min-width: 190px;
  gap: .58rem;
  padding: .9rem 1rem;
  border-color: #d9e2ee;
  color: var(--tgt-navy);
  background: #fff;
  box-shadow: 0 20px 44px rgba(4, 20, 47, .2);
}

.tgt-language-menu__panel span,
.tgt-language-menu__panel a {
  display: block;
  padding: .2rem 0;
  color: var(--tgt-navy);
  text-decoration: none;
}

.tgt-language-menu__panel .is-current {
  color: #9a652d;
  font-weight: 800;
}

.tgt-language-menu__panel a:hover,
.tgt-language-menu__panel a:focus-visible {
  color: #176f9f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

html[dir="rtl"] .tgt-header__utility-actions,
html[dir="rtl"] .tgt-primary-nav,
html[dir="rtl"] .tgt-commercial-center__hero-actions,
html[dir="rtl"] .tgt-commercial-investment__actions {
  direction: rtl;
}

html[dir="rtl"] body,
html[dir="rtl"] main,
html[dir="rtl"] .tgt-footer,
html[dir="rtl"] .tgt-application-form,
html[dir="rtl"] .tgt-program-public,
html[dir="rtl"] .tgt-program-detail {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .tgt-actions,
html[dir="rtl"] .tgt-final-cta__actions,
html[dir="rtl"] .tgt-international-card__actions,
html[dir="rtl"] .tgt-program-detail__hero-grid,
html[dir="rtl"] .tgt-program-detail__fact-grid {
  direction: rtl;
}

html[dir="rtl"] .tgt-language-menu__panel {
  right: auto;
  left: 0;
  text-align: right;
}

html[dir="rtl"] .tgt-commercial-actions a,
html[dir="rtl"] .tgt-commercial-type,
html[dir="rtl"] .tgt-commercial-search-results a,
html[dir="rtl"] .tgt-property-term__related-grid a {
  padding-right: 1.25rem;
  padding-left: 3.25rem;
  text-align: right;
}

html[dir="rtl"] .tgt-commercial-actions a b,
html[dir="rtl"] .tgt-commercial-type b,
html[dir="rtl"] .tgt-commercial-search-results a b,
html[dir="rtl"] .tgt-property-term__related-grid a b {
  right: auto;
  left: 1.25rem;
  transform: translateY(-50%) scaleX(-1);
}

@media (min-width: 681px) {
  body.tgt-lang-de .tgt-primary-nav,
  body.tgt-lang-fr .tgt-primary-nav {
    gap: clamp(.35rem, .7vw, .7rem);
  }

  body.tgt-lang-de .tgt-primary-nav summary,
  body.tgt-lang-de .tgt-primary-nav a,
  body.tgt-lang-fr .tgt-primary-nav summary,
  body.tgt-lang-fr .tgt-primary-nav a {
    font-size: .79rem;
  }
}

/* Footer follows a predictable 5 / 2 / 1 column rhythm. */
.tgt-footer__grid {
  align-items: start;
}

@media (max-width: 1100px) {
  .tgt-header__utility-inner > span {
    display: none;
  }

  .tgt-header__utility-inner {
    justify-content: center;
  }

  .tgt-header__utility-actions {
    width: 100%;
    justify-content: center;
    gap: clamp(.65rem, 2.2vw, 1.35rem);
  }

  .tgt-commercial-types,
  .tgt-commercial-search-results,
  .tgt-property-term__related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tgt-commercial-types {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tgt-commercial-type,
  .tgt-commercial-type:last-child:nth-child(3n + 1),
  .tgt-commercial-type:nth-last-child(2):nth-child(3n + 1),
  .tgt-commercial-type:nth-last-child(2):nth-child(3n + 1) + .tgt-commercial-type {
    grid-column: span 2;
  }

  .tgt-commercial-type:last-child:nth-child(2n + 1) {
    grid-column: 2 / span 2;
  }

  .tgt-commercial-actions--owner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tgt-property-term__inner,
  .tgt-content-single__inner {
    padding: clamp(30px, 4.5vw, 48px);
  }
}

@media (max-width: 760px) {
  .tgt-commercial-types,
  .tgt-commercial-search-results,
  .tgt-property-term__related-grid,
  .tgt-commercial-actions--owner,
  .tgt-commercial-actions--compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .tgt-commercial-type,
  .tgt-commercial-type:last-child:nth-child(3n + 1),
  .tgt-commercial-type:nth-last-child(2):nth-child(3n + 1),
  .tgt-commercial-type:nth-last-child(2):nth-child(3n + 1) + .tgt-commercial-type,
  .tgt-commercial-type:last-child:nth-child(2n + 1) {
    grid-column: 1;
  }

  .tgt-commercial-type {
    min-height: 136px;
  }

  .tgt-commercial-actions > a {
    min-height: 0;
  }

  .tgt-header__utility-actions {
    justify-content: space-between;
    gap: .65rem;
  }

  .tgt-header__utility-actions a {
    font-size: .7rem;
  }

  /* GSM remains visible in the footer; phone and WhatsApp are primary here. */
  .tgt-header__utility-actions > a:nth-of-type(2) {
    display: none;
  }
}

@media (max-width: 620px) {
  .tgt-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .tgt-footer__brand {
    grid-column: auto;
  }

  .tgt-commercial-type {
    min-height: 126px;
    padding: 1.15rem 3rem 1.1rem 1rem;
  }

  .tgt-property-term__related-grid > a,
  .tgt-commercial-search-results > a {
    min-height: 88px;
  }
}

@media (max-width: 440px) {
  .tgt-header__utility-actions > a:first-of-type {
    display: none;
  }

  .tgt-header__utility-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tgt-commercial-actions > a,
  .tgt-commercial-type,
  .tgt-commercial-search-results > a,
  .tgt-property-term__related-grid > a {
    transition: none;
  }
}
