/* ============================================================
   Durban Oil & Gas - components
   Floating glass header, pill buttons, rounded media, cards,
   forms, notices, footer.
   ============================================================ */

/* ------------------------------------------------------------
   Header - floating glass bar over any surface
   ------------------------------------------------------------ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-top: 0.9rem;
  pointer-events: none;
}

.site-header__bar {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  height: var(--header-h);
  padding-inline: 1.1rem 0.6rem;
  border-radius: var(--r-pill);
  box-shadow: 0 10px 34px -18px rgba(12, 18, 23, 0.4);
  transition: box-shadow var(--dur-med) ease;
}

/* Glass surface lives on a pseudo-element so the fixed mobile
   panel inside the bar is not trapped by backdrop-filter's
   containing block. */

.site-header__bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: inherit;
}

.site-header.is-condensed .site-header__bar {
  box-shadow: 0 14px 40px -18px rgba(12, 18, 23, 0.55);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  width: auto;
  height: 2.15rem;
}

/* Desktop nav */

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 0.3rem + 1.1vw, 1.9rem);
  list-style: none;
  padding: 0;
}

.site-nav__link {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--c-ink);
  text-decoration: none;
  padding: 0.45rem 0.15rem;
}

.site-nav__link:hover {
  color: var(--c-blue-ink);
}

.site-nav__link:active {
  color: var(--c-blue-deep);
}

.site-nav__link[aria-current="page"] {
  color: var(--c-blue-ink);
  font-weight: 600;
}

.site-header__cta {
  flex-shrink: 0;
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0.8rem;
  background: var(--c-ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle__line {
  display: block;
  height: 2px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-fast) ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel */

@media (max-width: 48em) {
  .nav-toggle {
    display: flex;
  }

  .site-header__cta {
    display: none;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: -1;               /* below the bar within the header's stacking context */
    background: var(--c-card);
    height: 100vh;
    height: 100svh;
    padding: calc(var(--header-h) + 3rem) var(--sp-gutter) var(--sp-8);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition:
      opacity var(--dur-med) var(--ease-out),
      transform var(--dur-med) var(--ease-out),
      visibility 0s linear var(--dur-med);
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition-delay: 0s;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__list > li {
    border-bottom: 1px solid var(--c-line);
  }

  .site-nav__link {
    display: block;
    padding: 1.1rem 0.25rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  .site-nav__panel-cta {
    margin-top: var(--sp-6);
  }

  body.nav-locked {
    overflow: hidden;
  }
}

@media (min-width: 48.0625em) {
  .site-nav__panel-cta {
    display: none;
  }
}

/* ------------------------------------------------------------
   Buttons - solid pills with a sliding arrow
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.8em 1.6em;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform var(--dur-fast) ease;
}

.btn:active {
  transform: scale(0.98);
}

/* Plain arrow that slides on hover */

.btn__arrow {
  display: inline-block;
  transition: transform var(--dur-med) var(--ease-out);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* Primary: ink pill */

.btn--primary {
  background: var(--c-ink);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-blue-deep);
  color: #fff;
}

/* Light pill for dark surfaces */

.btn--light {
  background: #fff;
  color: var(--c-ink);
}

.btn--light:hover {
  background: var(--c-orange-wash);
  color: var(--c-ink);
}

/* Secondary: outline on light */

.btn--secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: rgba(19, 26, 32, 0.25);
}

.btn--secondary:hover {
  border-color: var(--c-ink);
  color: var(--c-ink);
}

/* Ghost on dark */

.btn--ghost-on-dark {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn--ghost-on-dark:hover {
  border-color: #fff;
  color: #fff;
}

/* Disabled */

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--c-line);
  border-color: var(--c-line);
  color: var(--c-slate);
  cursor: not-allowed;
  transform: none;
}

.btn:disabled .btn__arrow,
.btn[aria-disabled="true"] .btn__arrow {
  transform: none;
}

/* Text link with arrow */

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  color: var(--c-blue-ink);
}

.link-more::after {
  content: "→";
  color: var(--c-brand-orange);
  transition: transform var(--dur-fast) var(--ease-out);
}

.link-more:hover {
  color: var(--c-ink);
}

.link-more:hover::after {
  transform: translateX(4px);
}

/* ------------------------------------------------------------
   Media - rounded photography, optional zoom-on-hover
   ------------------------------------------------------------ */

.media {
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--c-line);
}

.media img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.media--32 img  { aspect-ratio: 3 / 2; }
.media--43 img  { aspect-ratio: 4 / 3; }
.media--169 img { aspect-ratio: 16 / 9; }
.media--11 img  { aspect-ratio: 1 / 1; }
.media--45 img  { aspect-ratio: 4 / 5; }

/* ------------------------------------------------------------
   Notice - enquiry boundary panel (no placeholder language)
   ------------------------------------------------------------ */

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding: var(--sp-5) var(--sp-6);
  background: var(--c-blue-wash);
  border-radius: var(--r-lg);
}

.notice p {
  font-size: var(--fs-small);
  color: var(--c-blue-deep);
  max-width: 52ch;
}

/* ------------------------------------------------------------
   Forms - enquiry prototype
   ------------------------------------------------------------ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--c-ink);
}

.form-field .optional {
  font-weight: 400;
  color: var(--c-slate);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.8em 1em;
  background: var(--c-bg);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 8.5rem;
}

.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: var(--c-line);
}

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: 2px solid var(--c-brand-blue);
  outline-offset: 0;
  border-color: var(--c-brand-blue);
  background: #fff;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--c-error);
  background: var(--c-error-wash);
}

.form-field__error {
  display: none;
  font-size: var(--fs-small);
  color: var(--c-error);
}

.form-field.has-error .form-field__error {
  display: block;
}

/* Consent row */

.consent-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-bg);
  border-radius: var(--r-md);
}

.consent-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--c-brand-blue);
  flex-shrink: 0;
}

.consent-row label {
  font-size: var(--fs-small);
  color: var(--c-slate);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.form-hint {
  font-size: var(--fs-small);
  color: var(--c-slate);
}

/* Post-submit panel (prototype transmits nothing) */

.form-callback {
  grid-column: 1 / -1;
  padding: var(--sp-5) var(--sp-6);
  background: var(--c-orange-wash);
  border-radius: var(--r-lg);
}

.form-callback h3 {
  font-size: 1.1rem;
  margin-bottom: var(--sp-2);
}

.form-callback p {
  font-size: var(--fs-small);
  color: var(--c-slate);
}

@media (max-width: 40em) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   Footer - opens with a CTA row, then columns, then legal
   ------------------------------------------------------------ */

.site-footer {
  background: var(--c-night);
  color: var(--c-mist);
  padding-block: var(--sp-8) var(--sp-6);
  margin-top: var(--sp-section);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.site-footer__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
  padding-bottom: var(--sp-7);
}

.site-footer__cta h2 {
  font-size: var(--fs-h2);
  color: #fff;
  max-width: 15em;
}

.site-footer__cta-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* Retained raster logo is dark-on-transparent: it sits on a light
   plate on dark surfaces rather than being redrawn or inverted. */

.site-footer__brandplate {
  display: inline-block;
  background: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-md);
}

.site-footer__brandplate img {
  height: 2rem;
  width: auto;
}

.site-footer__statement {
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
  max-width: 26em;
  line-height: 1.7;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-7);
  padding-block: var(--sp-7);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__grid h2 {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--sp-4);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* Scoped to the link columns so footer buttons keep their own colors */

.site-footer__grid a {
  color: var(--c-mist);
  text-decoration: none;
  font-size: var(--fs-small);
}

.site-footer__grid a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer address {
  font-style: normal;
  font-size: var(--fs-small);
  line-height: 1.8;
}

.site-footer__legal {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-top: var(--sp-5);
  font-size: var(--fs-micro);
  color: var(--c-mist);
}

@media (max-width: 64em) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40em) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
}

/* ------------------------------------------------------------
   Brand devices built from the logo mark
   The mark is the two petals of the supplied vector logo. Used
   three ways: a small solid accent, a large low-contrast wash
   behind plain surfaces, and as image windows (masks).
   ------------------------------------------------------------ */

/* 1. Wash: an oversized mark bleeding off a section corner.
   Decorative only, very low contrast, never behind body copy. */

.mark-wash {
  position: relative;
  isolation: isolate;
  /* Clip so the wash can only ever bleed off its OWN section edge;
     without this it floats into neighbouring sections as a stray shape. */
  overflow: clip;
}

.mark-wash::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: clamp(17rem, 30vw, 34rem);
  aspect-ratio: 1;
  background: var(--c-line);
  -webkit-mask: url("../assets/brand/durban-mark-solid.svg") center / contain no-repeat;
  mask: url("../assets/brand/durban-mark-solid.svg") center / contain no-repeat;
  /* Whisper-level: reads as brand texture, never as a filled shape */
  opacity: 0.45;
}

/* Corner placement variants */

/* Corner placement: most of the mark stays visible so it reads as the
   logo shape rather than an anonymous blob. */

.mark-wash--tr::before {
  top: clamp(-2.5rem, -2vw, -1rem);
  right: clamp(-3.5rem, -3vw, -1.5rem);
}

.mark-wash--bl::before {
  bottom: clamp(-2.5rem, -2vw, -1rem);
  left: clamp(-3.5rem, -3vw, -1.5rem);
}

/* On dark surfaces the wash is a lightening, not a darkening */

.mark-wash--on-dark::before {
  background: #fff;
  opacity: 0.045;
}

@media (max-width: 48em) {
  /* Too small to read as the mark on phones: drop it entirely */
  .mark-wash::before {
    display: none;
  }
}

/* 2. Petal windows: the two mark shapes hold photography.
   Both masks share the logo's own canvas, so the shapes sit in exact
   register and keep the gap the logo has between them. */

.petals {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.petals__cell {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.petals__cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.petals__cell--a {
  -webkit-mask: url("../assets/brand/petal-a.svg") center / contain no-repeat;
  mask: url("../assets/brand/petal-a.svg") center / contain no-repeat;
}

.petals__cell--b {
  -webkit-mask: url("../assets/brand/petal-b.svg") center / contain no-repeat;
  mask: url("../assets/brand/petal-b.svg") center / contain no-repeat;
}

/* Each photograph is framed inside its own petal rather than filling the
   whole square, so the subject reads within the shape. */

.petals__cell--a img {
  object-position: 30% 45%;
}

.petals__cell--b img {
  object-position: 65% 55%;
}

@supports not (mask: url("#x")) {
  /* Without mask support the photographs still show as plain blocks */
  .petals__cell--a,
  .petals__cell--b {
    border-radius: var(--r-lg);
  }
}
