/*
Theme Name: TechTrend
Theme URI: https://techtrend.com.pl
Author: Tomasz Kozak
Description: Motyw blokowy dla TechTrend Piotr Kamiński, Rzeszów. Bez page buildera, bez jQuery, bez zewnętrznych fontów.
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: techtrend
*/

/* Tokens come from theme.json. Only what blocks cannot express lives here. */

:root {
  --tt-sans: var(--wp--preset--font-family--sans);
  --tt-mono: var(--wp--preset--font-family--mono);
  --tt-ink: var(--wp--preset--color--ink);
  --tt-ink2: var(--wp--preset--color--ink-2);
  --tt-mute: var(--wp--preset--color--mute);
  --tt-line: var(--wp--preset--color--line);
  --tt-brand: var(--wp--preset--color--brand);
  --tt-acc: var(--wp--preset--color--accent);
}

body { -webkit-font-smoothing: antialiased; }

/* The width and height attributes on <img> are presentational hints, so a
   definite height wins over aspect-ratio and quietly disables it. Themes
   normally reset this; without it every ratio rule below does nothing. */
img { max-width: 100%; height: auto; }

/* ---------- shared type helpers ---------- */

.tt-eyebrow {
  font-family: var(--tt-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tt-acc);
  font-weight: 600;
  margin-bottom: 12px;
}
.tt-eyebrow.is-brand { color: var(--tt-brand); }
.tt-mono { font-family: var(--tt-mono); }
.tt-lead { font-size: 17px; line-height: 1.6; color: var(--tt-ink2); }

/* ---------- top bar ---------- */

.tt-topbar {
  background: var(--tt-ink);
  color: #C7D2DA;
  font-size: 12.5px;
}
.tt-topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 20px;
}
.tt-topbar b { color: #fff; font-weight: 600; }
.tt-topbar a { color: inherit; text-decoration: none; }
.tt-topbar a:hover { color: #fff; }
.tt-topbar__sep { opacity: .3; margin: 0 10px; }

/* ---------- header ---------- */

.tt-header {
  border-bottom: 1px solid var(--tt-line);
  background: #fff;
}
.tt-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
/* Their own circular mark. The wordmark underneath it in the original file is
   clipped and only 100px wide, so it is set as live text instead: crisp at any
   size and it keeps the grey/blue split of the original. */
.tt-logo__mark { width: 38px; height: 38px; flex: none; display: block; }
.tt-logo__name {
  font-weight: 800; font-size: 19px; letter-spacing: -.03em; line-height: 1.1;
  color: var(--wp--preset--color--grey);
}
.tt-logo__name em { font-style: normal; color: var(--tt-brand); }
.tt-logo__sub {
  display: block;
  font-family: var(--tt-mono); font-size: 9px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--tt-mute); font-weight: 500; margin-top: 2px;
}
.tt-phone {
  font-family: var(--tt-mono); font-weight: 650; font-size: 15px;
  letter-spacing: -.02em; white-space: nowrap;
  color: inherit; text-decoration: none;
}
.tt-phone:hover { color: var(--tt-brand); }
.tt-phone span {
  display: block; font-size: 9.5px; letter-spacing: .1em;
  color: var(--tt-mute); text-transform: uppercase; font-weight: 500;
}

/* navigation: no jQuery, the block's own submenu behaviour is enough */
.wp-block-navigation .wp-block-navigation-item__content {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: var(--tt-ink2);
  font-weight: 550;
}
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: var(--tt-ink);
  border-bottom-color: var(--tt-acc);
}

/* ---------- hero ---------- */

.tt-hero { position: relative; background: var(--tt-ink); color: #fff; overflow: hidden; }
.tt-hero :where(h1, h2, h3, p) { color: #fff; }
.tt-hero__media { position: absolute; inset: 0 0 0 auto; width: 58%; height: 100%; }
.tt-hero__media img { width: 100%; height: 100% !important; object-fit: cover; }
/* The scrim clears the image entirely past 78%, so the right side of the hero
   is the photograph at full strength rather than a greyed-out backdrop. */
.tt-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(97deg,
    #0D141B 0%, #0D141B 40%, rgba(13,20,27,.92) 50%,
    rgba(13,20,27,.55) 62%, rgba(13,20,27,.12) 72%, rgba(13,20,27,0) 80%);
}
.tt-hero__inner { position: relative; z-index: 2; }
.tt-hero em { font-style: normal; color: #5FB6EC; }
.tt-hero h1 { text-shadow: 0 1px 24px rgba(0,0,0,.35); }

/* ---------- stat row ---------- */

.tt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
.tt-stats > div { padding: 0 20px; border-left: 1px solid rgba(255,255,255,.16); }
.tt-stats > div:first-child { padding-left: 0; border-left: 0; }
.tt-stats b { display: block; font-family: var(--tt-mono); font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.tt-stats span { display: block; font-size: 12px; color: #9FB0BD; margin-top: 4px; line-height: 1.4; }

/* ---------- cards ---------- */

.tt-card {
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--tt-line);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tt-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tt-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px -18px rgba(16,24,32,.5); }
/* The product shots are cut-outs on white, so a soft ground stops them
   floating in a flat panel. */
.tt-card img {
  width: 100%; height: 190px; object-fit: cover; display: block;
  background: linear-gradient(163deg, #FFFFFF 0%, #FFFFFF 42%, #EAF0F5 100%);
}
.tt-card__body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tt-card h3 { font-size: 17px; color: var(--tt-ink); }
.tt-card:hover { border-color: var(--tt-brand); }
.tt-card:hover h3 { color: var(--tt-brand); }
.tt-card :where(h3, p, span) { text-decoration: none; }
.tt-card p { color: var(--tt-ink2); font-size: 14.5px; margin: 0; }
.tt-card__more { margin-top: auto; padding-top: 10px; font-weight: 650; color: var(--tt-brand); text-decoration: none; }
.tt-card__more:hover { text-decoration: underline; }

/* ---------- contact / staff ---------- */

.tt-staff { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tt-staff th, .tt-staff td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--tt-line); vertical-align: top; }
.tt-staff th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--tt-mute); font-weight: 600; }
.tt-staff td a { font-family: var(--tt-mono); font-size: 13.5px; }
.tt-staff td a[href^="tel:"] { white-space: nowrap; }
.tt-staff-wrap { overflow-x: auto; }

/* ---------- footer ---------- */

.tt-footer { background: var(--tt-ink); color: #A9B8C4; font-size: 14px; }
.tt-footer :where(h2, h3, strong, b) { color: #fff; }
.tt-footer__mark { width: 40px; height: 40px; margin-bottom: 14px; display: block; }
.tt-footer a { color: #C7D2DA; text-decoration: none; }
.tt-footer a:hover { color: #fff; text-decoration: underline; }
.tt-footer__legal {
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12.5px; color: #7E8F9C;
  font-family: var(--tt-mono);
}

/* ---------- enquiry form ---------- */

.tt-form { display: grid; gap: 16px; }
.tt-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tt-field { display: grid; gap: 6px; }
.tt-field label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--tt-mute); font-weight: 600; }
.tt-field :where(input, select, textarea) {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid #C3CED6;
  border-radius: 3px;
  background: #fff;
  color: var(--tt-ink);
  width: 100%;
}
.tt-field :where(input, select, textarea):focus-visible {
  outline: 2px solid var(--tt-brand);
  outline-offset: 1px;
  border-color: var(--tt-brand);
}
.tt-field textarea { min-height: 120px; resize: vertical; }
.tt-field__hint { font-size: 12.5px; color: var(--tt-mute); text-transform: none; letter-spacing: 0; font-weight: 400; }
.tt-form button {
  font: inherit; font-weight: 650;
  background: var(--tt-acc); color: #fff;
  border: 0; border-radius: 3px;
  padding: 14px 26px; cursor: pointer;
  justify-self: start;
}
.tt-form button:hover { background: var(--wp--preset--color--accent-d); }
.tt-form__note { font-size: 12.5px; color: var(--tt-mute); }
.tt-form__msg { padding: 14px 16px; border-radius: 3px; font-size: 14.5px; }
.tt-form__msg.is-ok { background: #E4F3EC; color: #14603F; border: 1px solid #B9DFCC; }
.tt-form__msg.is-err { background: #FCEAE4; color: #9B3510; border: 1px solid #F2C4B2; }
/* honeypot: bots fill it, people never see it */
.tt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- gallery ---------- */

.tt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tt-gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; display: block; background: var(--wp--preset--color--paper-3); }

/* ---------- accessibility ---------- */

.tt-skip {
  position: absolute; left: -9999px;
  background: var(--tt-ink); color: #fff; padding: 12px 18px; z-index: 100;
}
.tt-skip:focus { left: 8px; top: 8px; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--tt-brand);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 840px) {
  .tt-hero__media { display: none; }
  .tt-hero::after { background: linear-gradient(180deg, #101820, rgba(16,24,32,.9)); }
  .tt-stats > div { border-left: 0; padding: 0; }
  .tt-card img { height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================================
   Page components
   The visual idea is a technical catalogue: monospaced indices, hairline
   rules, and a lot of restraint. Nothing here needs a photograph to work,
   so the pages stand up before the commissioned images arrive.
   ====================================================================== */

/* ---------- page head band ---------- */

.tt-pagehead {
  position: relative;
  background: var(--tt-ink);
  color: #fff;
  overflow: hidden;
}
.tt-pagehead :where(h1, p) { color: #fff; }
.tt-pagehead__inner { position: relative; z-index: 2; padding: 54px 0 50px; }
.tt-pagehead .tt-lead { color: #B9C6D1; max-width: 62ch; margin-top: 14px; }
.tt-pagehead__crumb {
  font-family: var(--tt-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: #7E93A3; margin-bottom: 14px;
}
.tt-pagehead__crumb a { color: #7E93A3; text-decoration: none; }
.tt-pagehead__crumb a:hover { color: #fff; }
/* Decorative hairline grid, drawn in CSS so it costs no request. Stands in
   for a photograph; when one arrives it goes in .tt-pagehead__bg behind this. */
.tt-pagehead::after {
  content: ""; position: absolute; inset: 0 0 0 auto; width: 46%;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(79,168,224,.16) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg,  rgba(79,168,224,.10) 0 1px, transparent 1px 46px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 55%);
          mask-image: linear-gradient(90deg, transparent, #000 55%);
}
/* Constrained layout caps every child at the content width, including an
   absolutely positioned one, so the backdrop has to opt out explicitly. */
.tt-pagehead__bg {
  position: absolute; inset: 0; overflow: hidden;
  max-width: none !important; margin: 0 !important; padding: 0 !important;
}
.tt-pagehead__bg img { width: 100%; height: 100% !important; object-fit: cover; }
.tt-pagehead__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(94deg,
    rgba(13,20,27,.96) 0%, rgba(13,20,27,.92) 42%,
    rgba(13,20,27,.66) 62%, rgba(13,20,27,.34) 100%);
}
.tt-pagehead:has(.tt-pagehead__bg)::after { opacity: .55; }
.tt-pagehead__inner { padding: 76px 0 72px; }

/* ---------- year-grouped project archive ---------- */

.tt-year { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 28px; }
.tt-year + .tt-year { margin-top: 8px; }
.tt-year__rail { position: relative; }
.tt-year__num {
  position: sticky; top: 18px;
  font-family: var(--tt-mono); font-size: 21px; font-weight: 700;
  letter-spacing: -.03em; color: var(--tt-ink);
  padding-bottom: 8px; border-bottom: 2px solid var(--tt-brand);
  display: inline-block;
}
.tt-year__count {
  display: block; margin-top: 8px;
  font-family: var(--tt-mono); font-size: 11px; letter-spacing: .1em;
  color: var(--tt-mute); text-transform: uppercase;
}
.tt-year__items {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: 22px; padding-bottom: 52px;
}

.tt-job { display: flex; flex-direction: column; }
.tt-job__frame {
  position: relative; background: #fff;
  border: 1px solid var(--tt-line); border-radius: 3px; overflow: hidden;
}
.tt-job__frame img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  background: #fff; display: block;
}
.tt-job__date {
  position: absolute; left: 0; top: 0;
  background: var(--tt-ink); color: #fff;
  font-family: var(--tt-mono); font-size: 10.5px; letter-spacing: .06em;
  padding: 5px 9px;
}
.tt-job__title {
  margin-top: 11px; font-size: 14.5px; line-height: 1.45;
  color: var(--tt-ink2); font-weight: 550;
}

/* ---------- subcategory cards ---------- */

.tt-subcat { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 20px; }
.tt-subcat__item {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--tt-line); border-radius: 3px;
  background: #fff; overflow: hidden;
}
/* The source shots are cut-outs on white, so the frame is white too and the
   product reads as sitting on the card rather than in a grey box. */
.tt-subcat__item {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tt-subcat__item:hover {
  transform: translateY(-3px); border-color: var(--tt-brand);
  box-shadow: 0 14px 30px -18px rgba(16,24,32,.45);
}
.tt-subcat__item img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block;
  background: linear-gradient(163deg, #FFFFFF 0%, #FFFFFF 42%, #EAF0F5 100%);
}
.tt-subcat__idx {
  position: absolute; right: 10px; top: 9px;
  font-family: var(--tt-mono); font-size: 11px; letter-spacing: .08em;
  color: var(--tt-mute);
}
.tt-subcat__body { padding: 15px 16px 17px; border-top: 1px solid var(--tt-line); }
.tt-subcat__body h3 { font-size: 15.5px; line-height: 1.3; color: var(--tt-ink); }

/* ---------- spec chips ---------- */

.tt-chips { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; margin: 0; list-style: none; }
.tt-chips li {
  border: 1px solid var(--tt-line); border-left: 3px solid var(--tt-brand);
  border-radius: 2px; padding: 9px 13px;
  font-size: 14px; color: var(--tt-ink2); background: #fff;
}

/* ---------- manufacturer index ---------- */

/* Cells carry their own hairline rather than showing a grey container through
   the gaps, so a part-filled last row does not leave grey blanks. */
.tt-brands {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 1px; padding: 1px; margin: 0; list-style: none;
}
.tt-brands li {
  background: #fff; padding: 15px 16px;
  box-shadow: 0 0 0 1px var(--tt-line);
  font-family: var(--tt-mono); font-size: 13px; letter-spacing: -.01em;
  color: var(--tt-ink2); display: flex; align-items: center;
}

/* ---------- numbered process ---------- */

.tt-steps { counter-reset: step; padding: 0; margin: 0; list-style: none; }
.tt-steps li {
  counter-increment: step;
  position: relative; padding: 0 0 26px 58px;
}
.tt-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--tt-brand); color: #fff;
  font-family: var(--tt-mono); font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
/* the connecting rule, stopping short of the last step */
.tt-steps li::after {
  content: ""; position: absolute; left: 17.5px; top: 40px; bottom: 6px;
  width: 1px; background: var(--tt-line);
}
.tt-steps li:last-child { padding-bottom: 0; }
.tt-steps li:last-child::after { display: none; }
.tt-steps b { display: block; color: var(--tt-ink); margin-bottom: 3px; font-size: 15.5px; }
.tt-steps span { color: var(--tt-ink2); }

/* ---------- figures ---------- */

.tt-figure {
  border: 1px solid var(--tt-line); border-radius: 3px;
  background: #fff; padding: 24px 24px 18px;
}
.tt-figure svg { width: 100%; height: auto; display: block; }
.tt-figure figcaption {
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--tt-line);
  font-size: 12.5px; color: var(--tt-mute); line-height: 1.5;
}

@media (max-width: 720px) {
  .tt-year { grid-template-columns: 1fr; gap: 0; }
  .tt-year__num { position: static; }
  .tt-year__count { display: inline; margin-left: 10px; }
  .tt-year__items { margin-top: 18px; padding-bottom: 40px; }
  .tt-pagehead__motif { display: none; }
}

/* ---------- standards table and Q&A ---------- */

.tt-norms { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.tt-norms th, .tt-norms td {
  text-align: left; padding: 13px 14px;
  border-bottom: 1px solid var(--tt-line); vertical-align: top;
}
.tt-norms th {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tt-mute); font-weight: 600; white-space: nowrap;
}
.tt-norms td b { font-family: var(--tt-mono); font-size: 14px; color: var(--tt-brand); }
.tt-norms__old { font-family: var(--tt-mono); font-size: 13px; color: var(--tt-mute); white-space: nowrap; }

.tt-faq { margin-top: 34px; border-top: 1px solid var(--tt-line); }
.tt-faq details { border-bottom: 1px solid var(--tt-line); }
.tt-faq summary {
  cursor: pointer; padding: 16px 34px 16px 0; position: relative;
  font-weight: 650; font-size: 15.5px; color: var(--tt-ink); list-style: none;
}
.tt-faq summary::-webkit-details-marker { display: none; }
.tt-faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: var(--tt-mono); font-size: 19px; font-weight: 400; color: var(--tt-brand);
}
.tt-faq details[open] summary::after { content: "\2212"; }
.tt-faq summary:hover { color: var(--tt-brand); }
.tt-faq details > div { padding: 0 34px 18px 0; color: var(--tt-ink2); max-width: 74ch; }

/* ---------- full-bleed photo band ---------- */

.tt-mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 40px;
}
.tt-mosaic figure { position: relative; margin: 0; overflow: hidden; background: #0D141B; }
@media (max-width: 900px) { .tt-mosaic { grid-template-columns: repeat(3, 1fr); } }
.tt-mosaic img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  opacity: .82; transition: opacity .25s ease, transform .35s ease;
}
.tt-mosaic figure:hover img { opacity: 1; transform: scale(1.04); }
.tt-mosaic figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  font-size: 11.5px; line-height: 1.35; color: #fff;
  background: linear-gradient(180deg, rgba(13,20,27,0), rgba(13,20,27,.88));
  opacity: 0; transition: opacity .25s ease;
}
.tt-mosaic figure:hover figcaption { opacity: 1; }

@media (max-width: 640px) {
  .tt-mosaic { grid-template-columns: repeat(2, 1fr); }
}

/* A narrowed paragraph inside a full-width constrained section cannot simply
   opt out of the auto margins: it then aligns to the viewport edge rather than
   the content column. Lead paragraphs run the full column width instead. */
