/*
Theme Name: Ridgecast
Description: Dark industrial theme for Ridgecast Ltd — crushing, screening and conveying plants for hard-rock mines and quarries.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: ridgecast
*/

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--rc-ink-900); color: var(--rc-paper-100);
  font: 400 var(--rc-fs-body)/1.65 var(--rc-font-body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
.wrap { max-width: var(--rc-max); margin: 0 auto; padding: 0 var(--rc-s-4); }
main { display: block; }

/* Accessibility: skip link and screen-reader text. */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--rc-amber-500); color: var(--rc-ink-950);
  font: 600 12px/1 var(--rc-font-mono); letter-spacing: .14em; text-transform: uppercase; padding: 14px 20px; text-decoration: none; }
.skip-link:focus { left: var(--rc-s-2); top: var(--rc-s-2); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--rc-amber-500); outline-offset: 2px; }

/* —— Typography —— */
.display { font-family: var(--rc-font-display); font-weight: var(--rc-fw-display); text-transform: uppercase;
  letter-spacing: var(--rc-track-display); line-height: var(--rc-lead-display); color: var(--rc-paper-50); margin: 0; }
.display em { font-style: normal; color: var(--rc-amber-500); }
.kicker { font: 500 12px/1 var(--rc-font-mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--rc-amber-deep); display: inline-flex; align-items: center; }
/* The hero kicker keeps its rule; measured against the sample site the text is bright amber and the rule deep amber. */
.hero .kicker { color: var(--rc-amber-500); gap: 12px; }
.hero .kicker::before { content: ""; width: 34px; height: 2px; background: var(--rc-amber-deep); flex: none; }
.label { font: 500 var(--rc-fs-label)/1.3 var(--rc-font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--rc-steel-300); }
.muted { color: var(--rc-steel-300); }

/* —— Buttons —— */
.btn { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 24px; border: 1px solid transparent;
  font: 600 12px/1 var(--rc-font-mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; border-radius: var(--rc-radius); }
.btn-primary { background: var(--rc-amber-500); color: var(--rc-ink-950); }
.btn-primary:hover { background: var(--rc-amber-600); }
.btn-ghost { border-color: var(--rc-steel-500); color: var(--rc-paper-50); background: transparent; }
.btn-ghost:hover { border-color: var(--rc-paper-50); }
.btn-text { color: var(--rc-amber-deep); padding: 0; height: auto; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* —— Top strip + header —— */
.topstrip { background: var(--rc-ink-950); border-bottom: var(--rc-line); font: 400 12px/1 var(--rc-font-mono); color: var(--rc-steel-300); }
.topstrip .wrap { display: flex; justify-content: space-between; height: 36px; align-items: center; gap: 16px; }
.topstrip b { color: var(--rc-paper-50); font-weight: 500; }
.topstrip a { text-decoration: none; }
.topstrip a:hover { color: var(--rc-amber-500); }
/* The bar pins to the top edge while the page scrolls: the info strip goes first, the header stays.
   Pinned with CSS, not the sticky-header behaviour, because that one hides the bar on downward scroll. */
.site-header { background: var(--rc-ink-950); border-bottom: var(--rc-line); position: sticky; top: 0; z-index: 40; }
body.admin-bar .site-header { top: 32px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 24px; }
.brand { text-decoration: none; display: block; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: block; width: 36px; height: 36px; flex: none; }
.brand-text { display: block; }
.brand small { display: block; font: 500 9px/1 var(--rc-font-mono); letter-spacing: .2em; color: var(--rc-steel-300); margin-top: 7px; text-transform: uppercase; }
.wordmark { font: 800 27px/1 var(--rc-font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--rc-paper-50); }
.wordmark b { color: var(--rc-amber-500); font-weight: 800; }
.navwrap { display: flex; gap: 28px; align-items: center; }
.nav { display: flex; gap: 28px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav li { list-style: none; }
.nav a { font: 600 12px/1 var(--rc-font-mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--rc-paper-100); }
.nav a:hover { color: var(--rc-amber-500); }
.nav a[aria-current] { color: var(--rc-amber-500); }
.lang { display: inline-flex; border: var(--rc-line); }
.lang a { display: block; font: 500 10px/1 var(--rc-font-mono); letter-spacing: .12em; padding: 9px 10px; text-decoration: none; color: var(--rc-steel-300); }
.lang a[aria-current] { background: var(--rc-ink-800); color: var(--rc-paper-50); }

/* —— Hero —— */
.hero { position: relative; background: var(--rc-ink-950); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, var(--rc-ink-800) 0 14px, var(--rc-ink-850) 14px 28px); opacity: .55; }
.hero--photo::before { display: none; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg .hero-photo { width: 100%; height: 100%; object-fit: cover; opacity: .85; filter: saturate(.9) contrast(1.02) brightness(1.04); }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(16,12,8,.9) 0%, rgba(16,12,8,.6) 48%, rgba(16,12,8,.16) 100%); }
.hero .wrap { position: relative; z-index: 1; padding-top: var(--rc-s-16); padding-bottom: var(--rc-s-12); }
.hero h1 { font-family: var(--rc-font-hero); font-weight: var(--rc-fw-hero);
  letter-spacing: var(--rc-track-hero); line-height: var(--rc-lead-hero);
  font-size: var(--rc-fs-hero); max-width: 6.4em;
  /* The kicker-to-headline gap is held in em (≈0.64 cap heights, as the original sets it),
     so the short rise scales with the headline instead of staying a fixed 96px block. */
  margin: .22em 0 var(--rc-s-4); }
.hero p { max-width: 560px; font-size: 17px; }
.hero .actions { display: flex; gap: 12px; margin-top: var(--rc-s-4); flex-wrap: wrap; }
.hero .meta { margin-top: var(--rc-s-8); display: flex; gap: 40px; flex-wrap: wrap; }
.hero .meta a { text-decoration: none; }
.hero .meta a:hover { color: var(--rc-amber-500); }

/* —— Metric bar —— */
/* Metrics band: two hairlines and four columns on the content grid — no dividers, no panel,
   every number flush with the column edge, as the original site sets it. */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: var(--rc-line); border-bottom: var(--rc-line); background: var(--rc-ink-900);
	padding-inline: max(var(--rc-s-4), calc((100% - var(--rc-max)) / 2 + var(--rc-s-4))); }
.metric { padding: 26px 0 30px; }
.metric b { display: block; font: 800 29px/1 var(--rc-font-display); color: var(--rc-paper-50); }
.metric span { display: block; margin-top: 12px; }

/* —— Section head —— */
/* Head: heading column is wide enough to hold the line unbroken, aside sits in the right fifth. */
.sec-head { display: grid; grid-template-columns: 1.9fr 1fr; gap: var(--rc-s-6); align-items: end; margin-bottom: var(--rc-s-6); }
.sec-head h2 { font-size: var(--rc-fs-h1); font-weight: var(--rc-fw-display-soft); margin-top: 16px; }
.sec-head .aside { border-left: 2px solid var(--rc-amber-deep); padding-left: 18px; color: var(--rc-steel-300); font-size: 14.5px; line-height: 1.66; margin: 0; }
.sec { padding: var(--rc-s-12) 0; }
.sec--alt { background: var(--rc-ink-850); border-top: var(--rc-line); border-bottom: var(--rc-line); }

/* —— Numbered rows ("how we work") —— */
.rows { border-top: var(--rc-line); }
/* Rows: number, heading, then one wide body column that also carries the link inline. */
.row { display: grid; grid-template-columns: 64px 1fr 1.21fr; gap: 24px; padding: 28px 0; border-bottom: var(--rc-line); align-items: baseline; }
.row .no { font: 500 14px/1 var(--rc-font-mono); color: var(--rc-amber-deep); }
.row h3 { font: var(--rc-fw-display-soft) var(--rc-fs-h3)/1.1 var(--rc-font-display); text-transform: uppercase; margin: 0; color: var(--rc-paper-50); }
.row p { margin: 0; color: var(--rc-paper-100); font-size: 14px; line-height: 1.78; }
/* In the sample the in-row link is the body colour, set apart by the mono face and the arrow, not by hue. */
.row .btn-text { white-space: nowrap; vertical-align: baseline; color: var(--rc-paper-100); }

/* —— Catalogue cards —— */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.cards--three { grid-template-columns: repeat(3, 1fr); }
.card { border: var(--rc-line); background: var(--rc-ink-800); display: flex; flex-direction: column; text-decoration: none; }
.card .media { aspect-ratio: 16/9; overflow: hidden; background: var(--rc-ink-950); }
.card .media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); transition: transform .4s; }
.card:hover .media img { transform: scale(1.04); }
.card .body { padding: 26px 24px 24px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.card h3 { font: 800 26px/1.04 var(--rc-font-display); letter-spacing: -.005em; text-transform: uppercase; margin: 0; color: var(--rc-paper-50); }
/* Card copy is the paper tone at full strength in the sample, not a dimmed body colour. */
.card p { margin: 0; font-size: 14.5px; line-height: 1.66; color: var(--rc-paper-50); }
/* The spec line flows after the copy (its dashed rule moves card to card); only the link is pinned to the bottom. */
.card .spec { margin-top: 5px; padding-top: 13px; border-top: 1px dashed rgba(237,228,213,.11); font-size: 12.5px; line-height: 1.6; letter-spacing: .055em; color: var(--rc-steel-300); }
.card .spec b { color: var(--rc-amber-500); font-weight: 500; }
.card .spec .note { color: var(--rc-steel-300); }
.card .more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--rc-amber-500); font-size: 12px; letter-spacing: .19em; }
.card .more svg { width: 12px; height: 12px; }
.card .stage { color: var(--rc-amber-deep); font-size: 10.5px; }
/* Service cards use the same frame as a catalogue card, but their copy sits one step dimmer. */
.card--service p { color: var(--rc-paper-100); }

/* —— Image placeholder board (used until photography is supplied) —— */
.plate { aspect-ratio: 16/9; display: grid; place-items: center;
  background: repeating-linear-gradient(135deg, var(--rc-ink-800) 0 14px, var(--rc-ink-850) 14px 28px); }
.card .plate { aspect-ratio: 16/9; border: 0; }

/* —— Production lines: heading with the photograph beside it, then ruled rows —— */
.lines-head { display: grid; grid-template-columns: 1fr 380px; column-gap: 56px; align-items: start; }
.lines-head h2 { font-size: var(--rc-fs-h1); font-weight: var(--rc-fw-display-soft); line-height: 1; margin: 16px 0 0; }
.lines-head .lede { margin: 44px 0 0; font-size: 15px; line-height: 1.83; color: var(--rc-paper-100); }
.lines-figure { margin: 0; }
/* height:auto beats the width/height attributes WordPress prints, so the plate stays a 16:9 landscape. */
.lines-figure img, .lines-figure .plate { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
/* Each row carries a rule above and below, so two rows read as two rules 57px apart. */
.lines .line { display: grid; grid-template-columns: 86px 295px 330px; align-items: start;
  padding: 32px 0; border-top: var(--rc-line); border-bottom: var(--rc-line); text-decoration: none; }
.lines .line + .line { margin-top: 57px; }
.lines .line .code { font: 500 13px/1 var(--rc-font-mono); color: var(--rc-amber-deep); }
.lines .line h3 { font: 700 27px/1.06 var(--rc-font-display); text-transform: uppercase; letter-spacing: var(--rc-track-display); margin: 0; color: var(--rc-paper-50); }
.lines .line p { margin: 0; font-size: 14px; line-height: 1.79; color: var(--rc-paper-100); }

/* —— Closing call to action —— */
.cta { position: relative; background: linear-gradient(120deg, #1C150D 0%, var(--rc-ink-950) 60%); border-top: 1px solid rgba(224,112,57,.35); }
.cta .wrap { padding-top: var(--rc-s-12); padding-bottom: var(--rc-s-12); }
.cta h2 { font-size: var(--rc-fs-h1); max-width: 820px; }
.cta p { max-width: 560px; margin: 20px 0 32px; }

/* —— Footer —— */
.footer { background: var(--rc-ink-950); border-top: var(--rc-line); }
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-top: var(--rc-s-8); padding-bottom: var(--rc-s-8); }
.footer h5 { margin: 0 0 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--rc-amber-500); }
.footer .base { border-top: var(--rc-line); }
.footer .base .wrap { display: flex; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; grid-template-columns: none; }

/* —— Content fallbacks (archives, single records) —— */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--rc-s-6); }
.post-list h2 { margin: 0 0 .4em; font: 800 28px/1.1 var(--rc-font-display); text-transform: uppercase; }
.post-list h2 a { text-decoration: none; }
.post-list__image { display: block; margin-bottom: 1rem; }
.pagination { display: flex; gap: 1rem; margin-top: var(--rc-s-6); }
.zeroy-breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5em; padding: 0; margin: 0 0 1.5rem; font-size: .9rem; color: var(--rc-steel-300); }
.zeroy-breadcrumbs li+li::before { content: "/"; margin-right: .5em; color: var(--rc-steel-500); }
.page-body { padding: var(--rc-s-12) 0; }

/* —— Responsive —— */
@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr 1fr; column-gap: var(--rc-s-4); }
  .sec-head, .footer .wrap { grid-template-columns: 1fr !important; }
  .lines-head { grid-template-columns: 1fr !important; row-gap: 28px; }
  .lines .line { grid-template-columns: 56px 1fr; row-gap: 12px; }
  .lines .line h3, .lines .line p { grid-column: 2; }
  .row { grid-template-columns: 40px 1fr; }
  .row p { grid-column: 2; }
  .site-header .wrap { flex-wrap: wrap; padding-top: var(--rc-s-2); padding-bottom: var(--rc-s-2); }
  .navwrap { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .cards--three { grid-template-columns: 1fr !important; }
  .topstrip .wrap { height: auto; padding-top: 8px; padding-bottom: 8px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .lines-head .lede { margin-top: 24px; }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

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

@media (max-width: 640px) {
  .cards, .cards--three { grid-template-columns: 1fr !important; }
  .card h3 { font-size: 24px; }
  .card .body { padding: 20px 20px 22px; }
}
