/*
Theme Name: APAC Steel
Author: APAC Steel
Description: Custom block theme for APAC Steel, Structural Steel Supply.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apac-steel
*/

:root {
  --apac-gutter: clamp(16px, 4vw, 64px);
  --apac-display: var(--wp--preset--font-family--display);
  --apac-navy: #002B4D;
  --apac-red: #ED0012;
  --apac-body: #3B4A57;
}

html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { overflow-x: hidden; }
img { max-width: 100%; }
p { margin: 0; }

h1, h2, h3,
.apac-display {
  margin: 0;
  font-family: var(--apac-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.apac-section { padding: clamp(64px, 7vw, 104px) var(--apac-gutter); }
.apac-section h2 { font-size: clamp(38px, 4.6vw, 66px); color: var(--apac-navy); }
.apac-eyebrow { margin-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* Buttons */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 14px; }
.wp-block-button__link {
  display: inline-block;
  border-radius: 0;
  padding: 18px 28px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: filter .2s ease;
}
.wp-block-button__link:hover { filter: brightness(1.12); }
.wp-block-button__link:focus-visible,
.apac-submit:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--apac-navy); }
.apac-btn-red .wp-block-button__link { background: var(--apac-red); color: #fff; }
.apac-btn-white .wp-block-button__link { background: #fff; color: var(--apac-navy); }

/* Header */
.apac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  height: 112px;
  padding: 8px var(--apac-gutter);
  background: #fff;
  border-bottom: 1px solid #DFE3E7;
}
.apac-header > * { margin: 0 !important; }
.apac-logo { flex: 0 0 auto; margin: 0; }
.apac-logo a { display: block; }
.apac-logo img { display: block; width: auto; height: 96px; }
.apac-nav { flex: 1 1 auto; font-size: 14px; font-weight: 500; color: var(--apac-navy); }
.apac-nav .wp-block-navigation__container { gap: 30px; }
.apac-nav a { text-decoration: none; }
.apac-nav a:hover { color: var(--apac-red); }
.apac-header .wp-block-button__link { padding: 14px 20px; font-size: 14px; white-space: nowrap; }
.apac-nav .wp-block-navigation__responsive-container-open svg,
.apac-nav .wp-block-navigation__responsive-container-close svg { width: 32px; height: 32px; }

/* Hero */
.apac-hero.wp-block-cover {
  align-items: flex-end;
  justify-content: flex-start;
  min-height: min(788px, calc(100vh - 112px));
  padding: 0;
}
.apac-hero .wp-block-cover__inner-container {
  width: 100%;
  box-sizing: border-box;
  padding: 56px var(--apac-gutter) 0;
  color: #fff;
}
.apac-rule { width: 72px; height: 6px; margin-bottom: 26px; background: var(--apac-red); }
.apac-hero h1 {
  max-width: 1180px;
  font-size: clamp(52px, 7.2vw, 112px);
  line-height: .94;
  letter-spacing: -.01em;
}
.apac-hero-sub { max-width: 640px; margin-top: 28px; font-size: clamp(17px, 1.5vw, 21px); line-height: 1.5; color: #E6EDF3; }
.apac-hero .wp-block-buttons { margin: 30px 0 44px; }
.apac-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0 calc(-1 * var(--apac-gutter));
  padding: 0 var(--apac-gutter);
  border-top: 1px solid rgba(255, 255, 255, .35);
}
.apac-strip p { padding: 22px 20px 22px 0; font-family: var(--apac-display); font-size: 23px; font-weight: 600; text-transform: uppercase; }

/* Intro */
.apac-intro { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: clamp(28px, 5vw, 80px); align-items: end; padding-top: clamp(64px, 8vw, 120px); padding-bottom: clamp(64px, 8vw, 120px); }
.apac-intro h2 { font-size: clamp(40px, 5vw, 72px); }
.apac-intro p { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; color: var(--apac-body); }

/* Stages */
.apac-stages { background: var(--apac-navy); color: #fff; }
.apac-stages h2 { margin-bottom: 44px; color: #fff; }
.apac-stages .apac-eyebrow { color: #CFD8E0; }
.apac-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.apac-stage .wp-block-image { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; }
.apac-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.apac-stage-text { margin-top: 16px; padding-top: 16px; border-top: 6px solid var(--apac-red); }
.apac-stage h3 { margin-bottom: 8px; font-size: 30px; }
.apac-stage p { color: #DBE4EB; }

/* Service cards */
.apac-services h2 { margin-bottom: 40px; }
.apac-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.apac-card.wp-block-cover { align-items: flex-end; justify-content: flex-start; min-height: 340px; padding: 22px 24px; color: #fff; overflow: hidden; }
.apac-card img.wp-block-cover__image-background { transition: transform .5s ease; }
.apac-card:hover img.wp-block-cover__image-background { transform: scale(1.04); }
.apac-card .wp-block-cover__inner-container { width: 100%; }
.apac-card h3 { margin-bottom: 6px; font-size: 34px; }
.apac-card p { line-height: 1.45; }

/* Capabilities */
.apac-capabilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); background: #F4F5F7; }
.apac-cap-image { position: relative; min-height: 420px; margin: 0; background: var(--apac-navy); }
.apac-cap-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.apac-cap-body { padding: clamp(48px, 6vw, 88px) var(--apac-gutter); }
.apac-cap-body h2 { margin-bottom: 26px; font-size: clamp(38px, 4.6vw, 66px); color: var(--apac-navy); }
.apac-cap-row { padding: 11px 0; border-top: 1px solid #C9D0D6; font-family: var(--apac-display); font-size: clamp(21px, 1.8vw, 25px); font-weight: 600; color: var(--apac-navy); }
.apac-cap-row:last-of-type { border-bottom: 1px solid #C9D0D6; }
.apac-small { margin-top: 18px; font-size: 13px; line-height: 1.5; color: #4A5560; }

/* Commitments */
.apac-commit h2 { max-width: 900px; margin-bottom: 40px; }
.apac-commit .apac-grid-4 { gap: 28px; }
.apac-commit-item { padding-top: 14px; border-top: 6px solid var(--apac-navy); }
.apac-commit-item h3 { margin-bottom: 8px; font-family: inherit; font-size: 18px; font-weight: 600; line-height: 1.3; text-transform: none; color: var(--apac-navy); }
.apac-commit-item p { color: var(--apac-body); }

/* Fabricator panel */
.apac-fabricators.wp-block-cover { justify-content: flex-start; padding: clamp(72px, 9vw, 130px) var(--apac-gutter); color: #fff; }
.apac-fabricators .wp-block-cover__inner-container { max-width: 860px; }
.apac-fabricators h2 { margin-bottom: 18px; font-size: clamp(42px, 5.6vw, 84px); line-height: .98; }
.apac-fabricators .apac-lede { margin-bottom: 28px; font-size: 18px; }

/* Philosophy */
.apac-philosophy { padding-top: clamp(72px, 9vw, 130px); padding-bottom: clamp(72px, 9vw, 130px); }
.apac-statement { max-width: 1180px; font-family: var(--apac-display); font-size: clamp(32px, 4.2vw, 62px); font-weight: 600; line-height: 1.08; color: var(--apac-navy); }
.apac-industries { max-width: 1040px; margin-top: 34px; line-height: 1.7; color: var(--apac-body); }
.apac-industries strong { color: var(--apac-navy); }

/* Enquiry */
.apac-enquire.wp-block-cover { display: block; min-height: 0; padding: 0; color: #fff; }
.apac-enquire .wp-block-cover__inner-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  box-sizing: border-box;
  width: 100%;
  padding: clamp(64px, 8vw, 120px) var(--apac-gutter);
}
.apac-enquire h2 { margin-bottom: 20px; font-size: clamp(46px, 6vw, 92px); line-height: .96; }
.apac-enquire .apac-lede { max-width: 520px; font-size: 18px; }
.apac-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  padding: clamp(20px, 3vw, 36px);
  background: #fff;
  color: #10202E;
  font-size: 14px;
  font-weight: 500;
}
.apac-form label { display: grid; gap: 6px; }
.apac-full { grid-column: 1 / -1; }
.apac-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #8A959F;
  border-radius: 0;
  background: #fff;
  color: #10202E;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.apac-field:focus { outline: 3px solid var(--apac-navy); outline-offset: 1px; }
.apac-form .apac-consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; line-height: 1.45; }
.apac-consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; }
.apac-trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.apac-submit { min-height: 56px; border: 0; background: var(--apac-red); color: #fff; font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; }
.apac-submit:hover { filter: brightness(1.12); }
.apac-note { font-size: 12px; font-weight: 400; line-height: 1.5; color: #4A5560; }
.apac-message { padding: 14px 16px; font-size: 15px; font-weight: 500; line-height: 1.45; border-left: 6px solid var(--apac-navy); background: #EEF2F5; color: #10202E; }
.apac-message.is-error { border-left-color: var(--apac-red); background: #FDECEE; }
.apac-form-unavailable { padding: clamp(20px, 3vw, 36px); background: #fff; color: #10202E; font-size: 17px; }

/* Footer */
.apac-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px var(--apac-gutter);
  background: #fff;
  color: var(--apac-body);
  font-size: 14px;
  line-height: 1.6;
}
.apac-footer .apac-logo img { height: 110px; }
.apac-footer-note { margin-top: 8px; font-size: 12px; color: #55616C; }

@media (max-width: 1080px) {
  .apac-grid-4,
  .apac-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .apac-grid-4,
  .apac-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 781px) {
  .apac-header { height: 88px; padding-top: 6px; padding-bottom: 6px; }
  .apac-logo img { height: 74px; }
  .apac-header .wp-block-button__link { padding: 12px 14px; font-size: 13px; }
  .apac-nav { flex: 0 0 auto; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .apac-card img.wp-block-cover__image-background { transition: none; }
  .apac-card:hover img.wp-block-cover__image-background { transform: none; }
}
