/*
Theme Name: CTower Steel
Description: Block theme for the CTower Steel site.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.0
Text Domain: ctower
*/

/* Give both site typefaces the same monochrome arrows, including in translated
   links and generated content. Only these five characters use the icon face. */
@font-face {
  font-family: Inter;
  src: url("fonts/ctower-symbols.woff2") format("woff2");
  font-weight: 100 900;
  unicode-range: U+2190-2193, U+2197;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/ctower-symbols.woff2") format("woff2");
  font-weight: 200 800;
  unicode-range: U+2190-2193, U+2197;
}
@font-face {
  font-family: "CTower Symbols";
  src: url("fonts/ctower-symbols.woff2") format("woff2");
  unicode-range: U+2161, U+2190-2193, U+2197, U+25B6-25B7;
}

.home .home-factory-play-icon,
.film-control > [aria-hidden],
.product-detail-page .cat-gallery-video-thumb::after {
  font-family: "CTower Symbols", sans-serif;
  font-weight: 400;
  font-synthesis: none;
  font-variant-emoji: text;
}
.home .home-factory-play-icon {
  font-size: 26px;
  line-height: 1;
}

.admin-bar .top { margin-top: var(--wp-admin--admin-bar--height, 32px); }
.ctower-entry-heading { padding-top: clamp(92px, 10vw, 148px); }
.ctower-entry-heading h1 { margin-bottom: 0; }

.ed-hero-article.has-article-photo {
  overflow: hidden;
}

.ed-hero-article.has-article-photo::before {
  display: block;
  background: linear-gradient(90deg, rgb(13 31 45 / 88%) 0%, rgb(13 31 45 / 68%) 60%, rgb(13 31 45 / 35%) 100%);
}

.ed-hero-article.has-article-photo .ed-hero-photo {
  object-position: center;
}

.ctower-native-article .ctower-entry-heading,
.ctower-native-article .ctower-content {
  width: min(100% - 40px, var(--wp--style--global--content-size, 760px));
  margin-inline: auto;
}

.ctower-native-article .ctower-content {
  padding-block: 2rem 4rem;
  font: 400 1.0625rem/1.85 Inter, Arial, sans-serif;
  color: #465d6d;
  overflow-wrap: anywhere;
}

.ctower-native-article .ctower-content h2 {
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  line-height: 1.25;
  color: #13283e;
}

.ctower-native-article .ctower-content > * + * { margin-block-start: 1.2em; }
.ctower-native-article .ctower-content a { text-underline-offset: 0.16em; }
.ctower-native-article .ctower-content :is(.wp-block-image, .wp-block-video) :is(img, video) { max-width: 100%; height: auto; }

.enterprise-contact .inquiry-form label:has(> select[name="product"]) { overflow: hidden; }
.enterprise-contact .inquiry-form select[name="product"]:focus-visible { outline-offset: -3px; }

.home .applications .split > div:first-child {
  background-image: linear-gradient(180deg, #10263345 0%, #10263399 35%, #102633ed 100%), url('/assets/gallery/telecom-monopole-photo-01.webp');
}

/* The catalogue photos use square originals with padding in the WebP variants. */
.product-detail-page .cat-gallery-view > img {
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
}

.product-detail-page .cat-gallery-view > video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #101820;
}

.product-detail-page .cat-gallery-thumb:has(> img) {
  height: auto;
  aspect-ratio: 1;
}

.product-detail-page .cat-gallery-thumb > img {
  object-fit: cover;
  object-position: center;
}

.product-detail-page .cat-gallery-video-thumb {
  position: relative;
}

.product-detail-page .cat-gallery-video-thumb::after {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 1px solid #fffd;
  border-radius: 50%;
  background: #172b3ee6;
  color: #fff;
  content: "▶";
  font-size: 13px;
  pointer-events: none;
}

.product-detail-page [data-product-gallery]:has(.cat-gallery-view > img) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.product-detail-page [data-product-gallery]:has(.cat-gallery-view > img) > .cat-gallery-thumbs {
  grid-area: 2 / 1;
}

.product-detail-page [data-product-gallery]:has(.cat-gallery-view > img) > .cat-gallery-controls {
  position: static;
  grid-area: 1 / 1;
  place-self: end;
  margin: 12px;
  z-index: 1;
}

.product-detail-page [data-product-gallery].is-video-active:has(.cat-gallery-view > img) > .cat-gallery-controls {
  place-self: start end;
}

.product-detail-page [data-product-gallery] > :is(.cat-gallery-thumbs, .cat-gallery-controls)[hidden] {
  display: none;
}

@media (min-width: 961px) {
  .home .hero-copy .hero-brand { font-size: clamp(72px, 10.1vw, 147px); }
}

@media (max-width: 360px) {
  .home .hero-copy .hero-brand { font-size: clamp(40px, 13.8vw, 46px); }
}

/* Dropdowns scroll only when they outgrow the viewport. On mobile the navigation itself scrolls. */
.top :is(.nav-pop, #primary.is-open) {
  scrollbar-width: thin;
  scrollbar-color: #8da1b6 transparent;
  overscroll-behavior-y: contain;
}
.top :is(.nav-pop, #primary.is-open)::-webkit-scrollbar { width: 7px; }
.top :is(.nav-pop, #primary.is-open)::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 6px;
  background: #8da1b6;
  background-clip: padding-box;
}
@media (forced-colors: active) {
  .top :is(.nav-pop, #primary.is-open) { scrollbar-color: auto; }
}
