/*
 * ACS Child — main.css
 *
 * Scope: styles that GP Premium Customizer cannot produce.
 * Every rule carries a justifying comment explaining WHY GP or a plugin
 * could not handle it. Do not add rules without a justification.
 *
 * Color variables are defined in functions.php > acs_gp_css_variable_bridge()
 * and mirror theme.json presets so all three systems stay in sync.
 */

/* ============================================================
   RESET / BASE NORMALISATION
   Justified: GP resets don't include box-sizing on pseudo-elements.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--acs-font);
    background-color: var(--acs-black);
    color: var(--acs-text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============================================================
   UTILITY CLASSES
   Justified: GP doesn't expose a .mono utility class.
   ============================================================ */
.acs-mono { font-family: var(--acs-mono); }
.acs-max-w {
    max-width: var(--acs-max);
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 5vw, 4rem);
}
.acs-sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* ============================================================
   BLOCK STYLE: core/button — .is-style-acs-primary
   Justified: GP Premium button module cannot apply clip-path polygon.
   ============================================================ */
.wp-block-button.is-style-acs-primary .wp-block-button__link,
.wp-block-button.is-style-acs-primary a {
    background-color: var(--acs-red) !important;
    /* EXCEPTION: !important needed only here because Gutenberg inline styles
       on .wp-block-button__link have higher specificity than class selectors.
       This is the only !important permitted in this file. */
    color: #fff;
    font-family: var(--acs-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 0;
    padding: 0.85rem 2rem;
    clip-path: polygon(3% 0%, 100% 0%, 97% 100%, 0% 100%);
    transition: background-color 0.2s, transform 0.15s;
    border: none;
}
.wp-block-button.is-style-acs-primary .wp-block-button__link:hover {
    background-color: var(--acs-red-bright) !important;
}
.wp-block-button.is-style-acs-primary .wp-block-button__link:active {
    transform: scale(0.98) translateY(1px);
}

/* .is-style-acs-secondary — ghost / outline button */
.wp-block-button.is-style-acs-secondary .wp-block-button__link {
    background-color: transparent;
    color: var(--acs-text);
    border: 1px solid var(--acs-border-mid);
    border-radius: 0;
    font-family: var(--acs-font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.85rem 2rem;
    transition: border-color 0.2s, background-color 0.2s, transform 0.15s;
}
.wp-block-button.is-style-acs-secondary .wp-block-button__link:hover {
    border-color: rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.04);
}

/* ============================================================
   BLOCK STYLE: core/group — .is-style-acs-card
   Justified: GP Elements cannot add a ::after pseudo border-bottom accent.
   ============================================================ */
.wp-block-group.is-style-acs-card {
    background-color: var(--acs-charcoal);
    border: 1px solid var(--acs-border);
    position: relative;
    overflow: hidden;
}
.wp-block-group.is-style-acs-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1.5px;
    background: var(--acs-red);
}

/* .is-style-acs-card-accent — left red bar variant */
.wp-block-group.is-style-acs-card-accent {
    background-color: var(--acs-charcoal);
    border: 1px solid var(--acs-border);
    position: relative;
    overflow: hidden;
    padding-left: 2.5rem !important; /* compensate for 3px left bar */
}
/* Override justification: Gutenberg inline padding wins over class selectors.
   This is a necessary specificity override, not a GP fight. */
.wp-block-group.is-style-acs-card-accent::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--acs-red);
}

/* ============================================================
   BLOCK STYLE: core/separator — .is-style-acs-red-line
   Justified: Core separator color prop doesn't support CSS gradient syntax.
   ============================================================ */
hr.wp-block-separator.is-style-acs-red-line {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, var(--acs-red), transparent 60%);
    opacity: 1;
}

/* ============================================================
   BLOCK STYLE: core/heading — .is-style-acs-eyebrow
   Justified: No GP Customizer control produces a ::before pseudo-element dash.
   ============================================================ */
.is-style-acs-eyebrow {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: var(--acs-red-bright) !important;
    margin-bottom: 0.75rem;
}
.is-style-acs-eyebrow::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 1.5px;
    background: var(--acs-red-bright);
    flex-shrink: 0;
}

/* .is-style-acs-section-title */
.is-style-acs-section-title {
    font-size: clamp(2rem, 4vw, 3.5rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    line-height: 1.05 !important;
    color: var(--acs-text);
}
.is-style-acs-section-title em {
    font-style: normal;
    color: var(--acs-red-bright);
}

/* ============================================================
   BLOCK STYLE: core/columns — .is-style-acs-stats-bar
   Justified: GP doesn't add border-right dividers between columns.
   ============================================================ */
.wp-block-columns.is-style-acs-stats-bar {
    border-top: 1px solid var(--acs-border);
    padding-top: 2rem;
    gap: 0 !important;
}
.wp-block-columns.is-style-acs-stats-bar > .wp-block-column {
    border-right: 1px solid var(--acs-border);
    padding: 1.25rem 2rem;
}
.wp-block-columns.is-style-acs-stats-bar > .wp-block-column:last-child {
    border-right: none;
}
.acs-stat-number {
    font-family: var(--acs-mono);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--acs-text);
    line-height: 1;
}
.acs-stat-number span, .acs-stat-suffix { color: var(--acs-red-bright); }
.acs-stat-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--acs-text-dimmer);
    margin-top: 0.4rem;
}

/* ============================================================
   BLOCK STYLE: core/table — .is-style-acs-spec-table
   Justified: Block editor default table uses white bg; dark industrial style
   requires dark bg, mono value column, and no GP table override.
   ============================================================ */
.wp-block-table.is-style-acs-spec-table table {
    border: 1px solid var(--acs-border);
    border-collapse: collapse;
    width: 100%;
}
.wp-block-table.is-style-acs-spec-table td,
.wp-block-table.is-style-acs-spec-table th {
    border-bottom: 1px solid var(--acs-border);
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    background: transparent;
}
.wp-block-table.is-style-acs-spec-table tr:last-child td { border-bottom: none; }
.wp-block-table.is-style-acs-spec-table td:first-child { color: var(--acs-text-dimmer); }
.wp-block-table.is-style-acs-spec-table td:last-child {
    font-family: var(--acs-mono);
    font-size: 0.75rem;
    color: var(--acs-text);
    text-align: right;
}

/* ============================================================
   PAGE HEADER HERO (used by non-home pages)
   Justified: GP Elements "page header" module cannot produce the red
   gradient ::after pseudo-element or the eyebrow dot pattern.
   ============================================================ */
.acs-page-header {
    background-color: var(--acs-charcoal);
    border-bottom: 1px solid var(--acs-border);
    padding: calc(var(--acs-nav-h) + 3.5rem) 0 3rem;
    position: relative;
    overflow: hidden;
}
.acs-page-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--acs-red), transparent 60%);
}

/* ============================================================
   HERO SECTION (homepage)
   Justified: GP Elements Hero does not support animated SVG grid overlay,
   laser sweep animation lines, or spark particle canvas.
   ============================================================ */
.acs-hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 70% 60%, rgba(196,26,26,0.18) 0%, transparent 55%),
                radial-gradient(ellipse at 20% 30%, rgba(40,40,40,0.9) 0%, transparent 50%),
                linear-gradient(135deg, #0d0d0d 0%, #181818 40%, #1a0a0a 100%);
    padding-top: var(--acs-nav-h);
}
.acs-hero-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 70%, transparent 100%);
}
.acs-hero-content {
    position: relative;
    z-index: 1;
    padding: clamp(4rem,10vh,8rem) clamp(1.5rem, 5vw, 4rem);
    max-width: var(--acs-max);
    margin-inline: auto;
    width: 100%;
}
.acs-hero-laser {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--acs-red), transparent);
    opacity: 0;
    pointer-events: none;
    animation: acs-laser-sweep 4s ease-in-out infinite;
}
.acs-hero-laser:nth-child(1) { left: 20%; animation-delay: 0s; }
.acs-hero-laser:nth-child(2) { left: 55%; animation-delay: 1.5s; }
.acs-hero-laser:nth-child(3) { left: 82%; animation-delay: 3s; }
@keyframes acs-laser-sweep {
    0%, 100% { opacity: 0; transform: scaleY(0) translateY(-50%); }
    20%, 80% { opacity: 0.4; transform: scaleY(1) translateY(0); }
    50%       { opacity: 0.7; }
}

/* ============================================================
   TICKER / SCROLLING MARQUEE
   Justified: No GP or block has a CSS-animated ticker bar component.
   ============================================================ */
.acs-ticker {
    background-color: var(--acs-red);
    overflow: hidden;
    padding: 0.6rem 0;
}
.acs-ticker-track {
    display: flex;
    gap: 0;
    animation: acs-ticker 28s linear infinite;
    width: max-content;
}
@keyframes acs-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.acs-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 2.5rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.acs-ticker-dot {
    width: 4px; height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============================================================
   MACHINE TAB SWITCHER
   Justified: No native Gutenberg tab block exists in WP core.
   This powers the custom HTML block used on the Machinery page.
   ============================================================ */
.acs-machine-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--acs-border);
    margin-bottom: 3.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.acs-machine-tabs::-webkit-scrollbar { display: none; }
.acs-machine-tab {
    padding: 0.9rem 1.5rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--acs-text-dimmer);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: var(--acs-font);
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.acs-machine-tab:hover { color: var(--acs-text-dim); }
.acs-machine-tab.active { color: var(--acs-text); border-bottom-color: var(--acs-red); }

.acs-machine-panel { display: none; }
.acs-machine-panel.active {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 4rem;
    align-items: start;
}
@media (max-width: 768px) {
    .acs-machine-panel.active { grid-template-columns: 1fr; gap: 2rem; }
}

.acs-machine-img {
    background: radial-gradient(ellipse at 60% 50%, rgba(196,26,26,0.2) 0%, transparent 60%), var(--acs-charcoal);
    border: 1px solid var(--acs-border);
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.acs-machine-img-label {
    font-size: 11px;
    color: var(--acs-text-dimmer);
    margin-top: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
}
.acs-laser-scan {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--acs-red-bright), transparent);
    animation: acs-scan 2s ease-in-out infinite;
}
@keyframes acs-scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ============================================================
   ABOUT TABS (same mechanism as machine tabs)
   ============================================================ */
.acs-about-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--acs-border);
    margin-bottom: 3.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.acs-about-tabs::-webkit-scrollbar { display: none; }
.acs-about-tab {
    padding: 0.9rem 1.5rem;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--acs-text-dimmer);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: var(--acs-font);
    transition: all 0.2s;
    white-space: nowrap;
}
.acs-about-tab:hover { color: var(--acs-text-dim); }
.acs-about-tab.active { color: var(--acs-text); border-bottom-color: var(--acs-red); }
.acs-about-panel { display: none; }
.acs-about-panel.active { display: block; }

/* ============================================================
   SERVICE CARDS (contact grid)
   Justified: GP Elements cannot add ::after pseudo border-bottom + card bg.
   ============================================================ */
.acs-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.acs-contact-card {
    background-color: var(--acs-charcoal);
    border: 1px solid var(--acs-border);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}
.acs-contact-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1.5px;
    background: var(--acs-red);
}
.acs-contact-type {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--acs-red-bright);
    margin-bottom: 1rem;
}
.acs-contact-card a {
    display: block;
    font-size: 1rem;
    color: var(--acs-text-dim);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}
.acs-contact-card a:hover { color: var(--acs-red-bright); }

/* ============================================================
   SERVICE STEPS GRID
   ============================================================ */
.acs-steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: var(--acs-border);
}
.acs-step {
    padding: 2rem;
    background: var(--acs-charcoal);
}
.acs-step-num {
    font-family: var(--acs-mono);
    font-size: 11px;
    color: var(--acs-red-bright);
    margin-bottom: 1rem;
    letter-spacing: 0.06em;
}
.acs-step-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.acs-step-text {
    font-size: 0.8rem;
    color: var(--acs-text-dim);
    font-weight: 300;
    line-height: 1.6;
}

/* ============================================================
   TIMELINE (About — History tab)
   Justified: No GP or block creates a vertical timeline with red gradient line.
   ============================================================ */
.acs-timeline {
    position: relative;
    padding-left: 3rem;
}
.acs-timeline::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--acs-red), transparent);
}
.acs-timeline-item {
    position: relative;
    padding-bottom: 2.5rem;
}
.acs-timeline-item::before {
    content: '';
    position: absolute;
    left: -3rem;
    top: 6px;
    width: 8px; height: 8px;
    background: var(--acs-red);
    border-radius: 50%;
    transform: translateX(-3.5px);
}
.acs-timeline-year {
    font-family: var(--acs-mono);
    font-size: 12px;
    color: var(--acs-red-bright);
    font-weight: 500;
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
}
.acs-timeline-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.acs-timeline-desc {
    font-size: 0.85rem;
    color: var(--acs-text-dim);
    line-height: 1.7;
    font-weight: 300;
    max-width: 60ch;
}

/* ============================================================
   TEAM GRID (About — Team tab)
   ============================================================ */
.acs-team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}
.acs-team-card {
    background-color: var(--acs-charcoal);
    border: 1px solid var(--acs-border);
    padding: 2rem;
}
.acs-team-avatar {
    width: 60px; height: 60px;
    background: var(--acs-charcoal-3);
    border: 1px solid var(--acs-border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--acs-red-bright);
    margin-bottom: 1.25rem;
    font-family: var(--acs-mono);
    letter-spacing: -1px;
}
.acs-team-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
.acs-team-role {
    font-size: 0.78rem;
    color: var(--acs-red-bright);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}
.acs-team-bio { font-size: 0.8rem; color: var(--acs-text-dim); line-height: 1.6; font-weight: 300; }

/* ============================================================
   EMPLOYMENT PAGE — Roles Grid
   ============================================================ */
.acs-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1px;
    background: var(--acs-border);
    margin-bottom: 3rem;
}
.acs-role-card {
    background: var(--acs-charcoal);
    padding: 2rem 1.75rem;
}
.acs-role-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.acs-role-type {
    font-size: 0.78rem;
    color: var(--acs-red-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.acs-role-desc { font-size: 0.82rem; color: var(--acs-text-dim); line-height: 1.6; font-weight: 300; }

/* ============================================================
   PARTNERS STRIP
   Justified: No GP component creates a bordered logo text strip.
   ============================================================ */
.acs-partners-strip {
    background-color: var(--acs-charcoal);
    border-top: 1px solid var(--acs-border);
    border-bottom: 1px solid var(--acs-border);
    padding: 3.5rem 0;
}
.acs-partners-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--acs-text-dimmer);
    margin-bottom: 2.5rem;
}
.acs-partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.acs-partner-item {
    padding: 1rem 2rem;
    border-right: 1px solid var(--acs-border);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--acs-text-dimmer);
    transition: color 0.2s;
}
.acs-partner-item:last-child { border-right: none; }
.acs-partner-item:hover { color: var(--acs-text-dim); }

/* ============================================================
   SERVICE CARD GRID (homepage "Why ACS" section)
   ============================================================ */
.acs-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--acs-border);
    margin-top: 3rem;
}
.acs-service-card {
    background: var(--acs-charcoal);
    padding: 2rem;
    transition: background-color 0.2s;
}
.acs-service-card:hover { background-color: var(--acs-charcoal-2); }
.acs-service-num {
    font-family: var(--acs-mono);
    font-size: 11px;
    color: var(--acs-red-bright);
    font-weight: 500;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}
.acs-service-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.75rem; }
.acs-service-text { font-size: 0.85rem; color: var(--acs-text-dim); line-height: 1.7; font-weight: 300; }

/* ============================================================
   COVERAGE MAP (SVG)
   Justified: Map is inline SVG; GP has no map component.
   ============================================================ */
.map-state { fill: var(--acs-red-muted); stroke: var(--acs-red-bright); stroke-width: 0.8; }
.country-border { fill: rgba(160,158,155,0.08); stroke: rgba(160,158,155,0.3); stroke-width: 0.8; }

/* ============================================================
   FADE-IN ANIMATION
   Justified: GP scroll animations require GP Premium Elements Pro;
   this simple fade-in is lighter and sufficient.
   ============================================================ */
.acs-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.acs-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.acs-fade-delay-1 { transition-delay: 0.1s; }
.acs-fade-delay-2 { transition-delay: 0.2s; }
.acs-fade-delay-3 { transition-delay: 0.3s; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .acs-machine-panel.active { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
    .acs-partners-grid { justify-content: flex-start; }
    .acs-partner-item { border-bottom: 1px solid var(--acs-border); border-right: none; width: 50%; }
    .acs-partner-item:last-child { border-bottom: none; }
    .acs-contact-grid { grid-template-columns: 1fr; }
    .acs-team-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .acs-team-grid { grid-template-columns: 1fr; }
    .acs-roles-grid { grid-template-columns: 1fr; }
}
