/*
Theme Name: Arumoni Civil
Description: Site-specific theme for Arumoni Civil.
Author: Arumoni Civil
Version: 2.2.0
Requires at least: 6.6
Requires PHP: 7.4
*/

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: normal;
  font-display: swap;
  src: url("assets/fonts/inter-latin-variable.woff2") format("woff2");
}

:root {
  --color-dark-green: #203431;
  --color-mid-green: #6e7b7a;
  --color-light-green: #abb4ac;
  --color-background: #f0f0f0;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --canvas-width: 1280px;
  --canvas-padding: clamp(1.25rem, 5vw, 3rem);

  --space-30: 20px;
  --space-40: 30px;
  --space-50: clamp(30px, 5vw, 50px);
  --space-60: clamp(30px, 7vw, 70px);
  --space-70: clamp(50px, 8vw, 100px);

  --grid-gap: var(--space-50);

  --font-size-small: 0.875rem;
  --font-size-base: 1rem;
  --font-size-medium-small: 1.25rem;
  --font-size-medium: 1.5rem;
  --font-size-large: 2rem;
  --font-size-x-large: clamp(2rem, 4vw, 2.6rem);
  --font-size-xx-large: 3.15rem;
  --font-size-huge: clamp(3rem, 8vw, 5.5rem);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-dark-green);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.5em;
}

h1 {
  font-size: var(--font-size-xx-large);
  font-weight: 300;
}

h2 {
  font-size: var(--font-size-large);
}

h3 {
  font-size: var(--font-size-medium);
}

h4 {
  font-size: var(--font-size-medium-small);
}

h5 {
  font-size: var(--font-size-base);
}

h6 {
  font-size: var(--font-size-small);
}

/* Reusable weight modifier for the one heading that should run lighter
   than the regular-weight default above (h1's bold display size is the
   only other departure, set directly on the h1 rule). */
.heading-light {
  font-weight: 300;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-dark-green);
}

img {
  max-width: 100%;
  height: auto;
}

/* Constrains the whole page (header through footer) to canvas-width, once.
   Opened in header.php right after <body>, closed in footer.php. Section
   backgrounds (.site-header, .band, etc.) just fill 100% of this
   instead of each repeating their own max-width/margin-inline. */
.page-canvas {
  max-width: var(--canvas-width);
  margin-inline: auto;
}

.canvas--padded {
  padding-inline: var(--canvas-padding);
}

.canvas--padded-lg {
  padding-inline: calc(var(--canvas-padding) * 2);
}

.canvas--padded-block {
  padding-block: var(--space-60);
}

/* Header */

.site-header {
  background-color: var(--color-light-green);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: var(--space-30);
}

/* Wraps nav + social links so mobile can collapse them into one panel
   behind the hamburger. On desktop it's just the header's full-width row. */
.site-menu {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--color-mid-green);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--color-dark-green);
}

.social-links {
  display: flex;
  gap: 0.5rem;
}

.social-links a {
  display: inline-flex;
  color: var(--color-mid-green);
  transition: color 0.15s ease;
}

.social-links a:hover {
  color: var(--color-dark-green);
}

.social-links svg {
  fill: currentColor;
}

/* Mobile-only header controls: hamburger (left) + small logo (right) */

.menu-toggle,
.header-logo {
  display: none;
}

@media (max-width: 780px) {
  /* No row gap: the collapsed menu still wraps onto its own row, so any
     row gap would leave empty space under the header while it's closed. */
  .site-header__inner {
    padding-block: 1rem;
    gap: 0 1rem;
  }

  /* Two 30x2 lines, 10px tall overall. The padding enlarges the tap
     target and the matching negative margin keeps the lines themselves
     flush with the canvas padding. */
  .menu-toggle {
    display: block;
    position: relative;
    width: 30px;
    height: 10px;
    box-sizing: content-box;
    padding: 12px;
    margin: -12px;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .menu-toggle::before,
  .menu-toggle::after {
    content: "";
    position: absolute;
    left: 12px;
    width: 30px;
    height: 2px;
    background-color: var(--color-dark-green);
    transition: transform 0.2s ease;
  }

  .menu-toggle::before {
    top: 12px;
  }

  .menu-toggle::after {
    top: 20px;
  }

  .is-menu-open .menu-toggle::before {
    transform: translateY(4px) rotate(45deg);
  }

  .is-menu-open .menu-toggle::after {
    transform: translateY(-4px) rotate(-45deg);
  }

  .header-logo {
    display: block;
  }

  .header-logo img {
    display: block;
    width: 40px;
    height: auto;
  }

  /* Collapsed via max-height rather than display: none so it can
     animate open. visibility keeps the hidden links out of the tab order;
     its delay on close lets the panel finish folding up first. */
  .site-menu {
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition:
      max-height 0.3s ease,
      visibility 0s 0.3s;
  }

  .is-menu-open .site-menu {
    max-height: 20rem;
    visibility: visible;
    transition: max-height 0.35s ease;
  }

  .site-nav {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    font-size: var(--font-size-medium-small);
  }

  .social-links {
    margin-bottom: 0.5rem;
  }

  /* Each link drops in with a slight overshoot, staggered top to bottom. */
  .site-nav a,
  .social-links {
    opacity: 0;
    transform: translateY(-12px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }

  .is-menu-open .site-nav a,
  .is-menu-open .social-links {
    opacity: 1;
    transform: none;
    transition:
      opacity 0.3s ease,
      transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
      color 0.15s ease;
  }

  .is-menu-open .site-nav a {
    transition-delay: calc(var(--i, 0) * 0.04s);
  }

  .is-menu-open .social-links {
    transition-delay: 0.16s;
  }

  /* The header already carries the logo on mobile. */
  .page-header-band__inner .site-logo {
    display: none;
  }
}

@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  .site-menu,
  .site-nav a,
  .social-links,
  .menu-toggle::before,
  .menu-toggle::after {
    transition: none !important;
  }
}

/* Footer */

.site-footer {
  background-color: var(--color-background);
}

.site-footer__inner {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  padding-block: var(--space-40);
  font-size: var(--font-size-small);
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--color-dark-green);
}

.site-footer a {
  color: var(--color-dark-green);
}

/* Page header band (title + logo) */

.page-header-band {
  background-color: var(--color-light-green);
}

.page-header-band__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-block: var(--space-60);
}

.page-title {
  line-height: 1;
  color: var(--color-dark-green);
  max-width: 720px;
  margin: 0;
}

/* Hero-band titles (SVG wordmarks) run at the huge display size; plain-text
   page titles (page.php, single-project.php) fall back to h1's default
   xx-large size. */
.page-header-band__inner .page-title {
  font-size: var(--font-size-huge);
}

/* Heading SVGs (brand font, not embeddable as a web font). Each file is
   trimmed to its own ink, so viewBox height isn't comparable file-to-file
   (a descender like the "j" in "Projects." inflates it). What *is*
   comparable is the cap-height glyphs are drawn at: measuring the SVGs
   found "Our" is exactly 101.25 units tall in both ourprojects.svg and
   ourteam.svg, confirming every heading was exported at the same font
   size. --heading-svg-unit converts that shared unit to the current
   --font-size-huge, and each image is then sized off its own real
   viewBox height (in units) times that — not off an assumed line count -
   so a capital letter renders the same pixel height in every heading. */
.page-title-img {
  display: block;
  width: auto;
  max-width: none;
  --heading-svg-unit: calc(var(--font-size-huge) / 101.25);
}

.page-title-img--our-projects {
  height: calc(var(--heading-svg-unit) * 234.81);
  margin-bottom: -0.192em;
  margin-left: 0.019em;
}

.page-title-img--our-team {
  height: calc(var(--heading-svg-unit) * 213.13);
}

.page-title-img--what-we-do {
  height: calc(var(--heading-svg-unit) * 211.61);
}

.site-logo {
  width: 250px;
  max-width: 30%;
  /* margin-bottom: 0.8em; */
  display: block;
}

/* Full-bleed (within canvas) photo */

.canvas-photo {
  width: 100%;
  display: block;
}

/* Content bands (Home / What We Do)

   A .band is one full-width colour block; .band__inner pads it. Every
   multi-column layout inside a band shares --grid-gap, and the two-column
   .split puts its heading in the first third and its body across the other
   two, so body copy lines up with the second column of the three-up
   .ruled-grid beneath it. (The mockup let each section pick its own column
   widths, so paragraphs started at a different x from the cards below.) */

.band {
  background-color: var(--color-light-green);
}

.band--dark {
  background-color: var(--color-dark-green);
  color: var(--color-light-green);
}

.band--dark a {
  color: inherit;
}

.band__inner {
  padding-block: var(--space-70);
}

.band__inner--flush-top {
  padding-top: 0;
}

.band__text {
  font-size: var(--font-size-base);
}

.band__text p:last-child,
p.band__text:last-child {
  margin-bottom: 0;
}

.band__text--intro {
  max-width: 42rem;
}

.section-heading {
  font-size: var(--font-size-x-large);
  line-height: 1.1;
  margin-bottom: var(--space-30);
}

.section-heading--xx-large {
  font-size: var(--font-size-xx-large);
}

.split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-30) var(--grid-gap);
}

.split__heading {
  margin: 0;
  /* Scales with the viewport so "Your end-to-end" still fits a third of
     the canvas without breaking at its hyphens. */
  font-size: clamp(1.75rem, 3.2vw, var(--font-size-x-large));
}

.split__body {
  grid-column: 2 / -1;
}

.split--halves {
  grid-template-columns: repeat(2, 1fr);
}

/* Lets each column's heading/body rows line up across the columns, so
   both bodies start at the same height even when one heading wraps. */
.split--rows > * {
  display: grid;
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 0;
}

/* Body vertically centred on the heading, with a thin rule in the gutter
   between them (Home's dark intro band). */
.split--divided {
  align-items: center;
}

.split--divided .split__body {
  position: relative;
}

.split--divided .split__body::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: calc(var(--grid-gap) / -2);
  width: 1px;
  background-color: currentColor;
}

/* Grid of short titled blurbs, each topped with a rule. */
.ruled-grid {
  display: grid;
  gap: var(--space-50) var(--grid-gap);
  margin-top: var(--space-60);
}

.ruled-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.ruled-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

.ruled-grid__item {
  border-top: 2px solid var(--color-dark-green);
  padding-top: var(--space-30);
}

.ruled-grid__title {
  font-size: var(--font-size-medium-small);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.4em;
}

.ruled-grid__title--large {
  font-size: var(--font-size-medium);
}

/* What We Do: "Where we work" rows - photo left, text right */
.sectors {
  display: grid;
  gap: var(--space-60);
  margin-top: var(--space-50);
}

.sector {
  align-items: center;
}

.sector__photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.sector__title {
  font-size: var(--font-size-large);
}

/* Home: "Talk to us early" */
.contact-band__text {
  max-width: 42rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-30);
  margin-top: var(--space-50);
}

.contact-card__photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  display: block;
}

.contact-card p {
  margin: 0;
}

.contact-card__name {
  font-size: var(--font-size-medium-small);
  font-weight: 700;
}

.contact-card__phone {
  font-weight: 700;
  margin-top: 0.25rem !important;
}

@media (max-width: 780px) {
  .split,
  .split--halves,
  .ruled-grid--2col,
  .ruled-grid--3col {
    grid-template-columns: 1fr;
  }

  .split__body {
    grid-column: auto;
  }

  .split--divided .split__body::before {
    display: none;
  }

  /* Stacked: each column's own heading then body, with room between. */
  .split--rows > * {
    grid-row: auto;
    display: block;
  }

  .split--rows {
    row-gap: var(--space-60);
  }
}

/* Light-green content canvas (Projects / Team / What We Do) */

.main-content {
  background-color: var(--color-light-green);
  padding-block: var(--space-60);
}

/* Projects / Team / What We Do / single project open with
   .page-header-band__inner, which already carries its own
   padding-block: var(--space-60) (it's the same class the home page uses
   inside a bare, unpadded <section>). Nested inside .main-content here,
   that doubles the top gap to nav. Zero out just the top so this block
   matches the home page's header-band height. */
.main-content--band-header {
  padding-top: 0;
}

/* What We Do: its last .band__inner already pads the bottom. */
.main-content--bands {
  padding-bottom: 0;
}

.page-intro {
  font-size: var(--font-size-large);
  line-height: 1.2;
  max-width: 560px;
}

/* Placeholder box for missing photos */

.placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  background-color: var(--color-light-green);
  border: 1px dashed var(--color-mid-green);
  color: var(--color-dark-green);
  font-size: var(--font-size-small);
  text-align: center;
}

/* Project / Team grids */

.card-grid {
  display: grid;
  column-gap: var(--space-50);
  row-gap: var(--space-60);
  margin-top: var(--space-60);
}

.card-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

/* Cards fade in on load, each after its own --fade-delay (set inline by
   arumoni_fade_delay() in functions.php). "both" holds them invisible
   during the delay. */
@keyframes card-fade-in {
  from {
    opacity: 0;
  }
}

.card-grid > * {
  animation: card-fade-in 0.7s ease both;
  animation-delay: var(--fade-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .card-grid > * {
    animation: none;
  }
}

@media (max-width: 780px) {
  .card-grid--2col,
  .card-grid--3col {
    grid-template-columns: 1fr;
  }
}

.card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: white;
}

.card-photo--portrait {
  aspect-ratio: 3 / 4;
  margin-bottom: var(--space-40);
}

.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-title {
  margin: var(--space-30) 0 0;
}

.card-title a {
  text-decoration: none;
}

.card-role {
  font-size: var(--font-size-small);
  margin: 0;
}

.card-text {
  font-size: var(--font-size-small);
  margin: 0.5rem 0 0;
}

/* Single project meta row */

.project-photo,
.project-carousel {
  margin-block: var(--space-60);
}

/* Swipeable/scrollable hero carousel for a project's gallery photos.
   Native scroll-snap does the sliding (touch swipe, trackpad, and mouse
   wheel all work with zero JS - most browsers redirect vertical wheel
   input to horizontal scroll on an x-only-scrollable element). Every
   image is the same fixed height regardless of its own aspect ratio, so
   widths vary - that's also what gives the next slide a peek at the
   frame's edge, without ever cropping or shrinking an image. */
.project-carousel {
  height: clamp(280px, 44vw, 620px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.project-carousel::-webkit-scrollbar {
  display: none;
}

/* The track holds every slide and is wider than the frame above (which
   clips it via overflow-x, same as overflow:hidden would - it just also
   allows the native scroll that moves it). On desktop, hovering the frame
   plays a one-shot "nudge left, pause, settle back" animation on the
   track as a hint that it scrolls. It's a fire-and-forget animation
   rather than a hover-state transition (nudge out / bounce back on
   un-hover) on purpose: a transition tied to hover state can get out of
   sync with a real swipe/scroll that happens mid-hover (mouseleave
   firing mid-gesture used to leave the track visibly offset by 20px
   until the next hover reset it). Ending each iteration back at 0
   sidesteps that - even if the mouse leaves mid-animation, there's
   nothing to un-do. Scoped to real hover/pointer devices so it can't
   get stuck "on" after a touch tap.

   Triggered via the .is-nudging class (added on mouseenter, removed on
   animationend - see the inline script beside the carousel markup)
   rather than :hover directly: :hover stops matching the instant the
   mouse leaves, which would cut the animation off mid-flight and snap
   the track back to 0 instead of letting it finish playing out. */
.project-carousel__track {
  display: flex;
  gap: var(--space-30);
  width: max-content;
  height: 100%;
}

@keyframes project-carousel-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  60%,
  85% {
    transform: translateX(-40px);
  }
}

@media (hover: hover) and (pointer: fine) {
  .project-carousel__track.is-nudging {
    animation: project-carousel-nudge 1.1s ease-in-out;
  }
}

.project-carousel__slide {
  flex: 0 0 auto;
  height: 100%;
  scroll-snap-align: start;
}

.project-carousel__slide img {
  display: block;
  height: 100%;
  width: auto;
}

hr {
  border: none;
  height: 6px;
  background-color: var(--color-dark-green);
}
/* Back link (bottom of single project) */

.back-link {
  --back-link-icon-w: 0.6em;
  --back-link-icon-gap: 0.25em;
  display: inline-block;
  overflow: hidden;
  margin-top: calc(var(--space-60) * 2);
  font-size: var(--font-size-xx-large);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-mid-green);
  text-decoration: none;
  transition: color 500ms;
}

.back-link:hover {
  color: var(--color-dark-green);
}

/* The icon sits at the front of .back-link__inner, and at rest the whole
   group is pushed left by exactly the icon's width + gap - just enough
   to tuck the icon out past .back-link's overflow:hidden edge (clipped
   out of view) while leaving the text sitting at its normal reading
   position, unclipped. Hovering (or focusing, for keyboard users) slides
   the group back to translateX(0), revealing the icon as it slides in
   and nudging the text over to make room for it. The offset is a calc()
   off the same custom properties .back-link__icon is sized from, so the
   two can't drift out of sync. */
.back-link__inner {
  display: inline-flex;
  align-items: center;
  gap: var(--back-link-icon-gap);
  transform: translateX(calc(-1 * (var(--back-link-icon-w) + var(--back-link-icon-gap))));
  transition: transform 0.3s ease;
}

.back-link:hover .back-link__inner,
.back-link:focus-visible .back-link__inner {
  transform: translateX(0);
}

.back-link__icon {
  width: var(--back-link-icon-w);
  height: var(--back-link-icon-w);
  flex-shrink: 0;
}

.project-details {
  margin: var(--space-50) 0;
  font-size: var(--font-size-medium);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: var(--space-50) 0;
}

.project-meta__item {
  flex: 1 1 150px;
}

.project-meta__label {
  font-size: var(--font-size-small);
  color: var(--color-mid-green);
  margin: 0;
}

.project-meta__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark-green);
  margin: 0;
}
