/* ==========================================================================
   ELAWADY Marine Supplies - Global Styles & Reset
   ========================================================================== */

/* Font Imports - Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* CSS Reset & Foundation */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Focus Visibility */
*:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 4px;
}

/* Selection Highlight */
::selection {
  background: rgba(var(--clr-accent-rgb), 0.3);
  color: var(--clr-txt-primary);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(var(--clr-primary-rgb), 0.08), transparent 34rem),
    linear-gradient(180deg, var(--clr-bg-abyss) 0%, var(--clr-bg-navy) 38%, var(--clr-bg-abyss) 100%);
  color: var(--clr-txt-primary);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--clr-txt-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
  letter-spacing: 0;
  text-wrap: balance;
}

h1 { font-size: var(--font-size-xxl); margin-bottom: var(--space-xl); }
h2 { font-size: var(--font-size-xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--font-size-lg); margin-bottom: var(--space-md); }
h4 { font-size: var(--font-size-md); margin-bottom: var(--space-sm); }

p {
  color: var(--clr-txt-secondary);
  margin-bottom: var(--space-md);
  max-width: 68ch;
}

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--clr-primary-hover);
}

img, video, picture {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
}

ul, ol {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width-site);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 4vw, 2rem);
  padding-right: clamp(1rem, 4vw, 2rem);
}

/* Screen Reader Only Helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--clr-primary);
  color: var(--clr-bg-abyss);
  padding: var(--space-sm) var(--space-lg);
  border-bottom-left-radius: var(--border-radius-sm);
  border-bottom-right-radius: var(--border-radius-sm);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  z-index: 9999;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: none;
  color: var(--clr-bg-abyss);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--clr-bg-abyss);
}

::-webkit-scrollbar-thumb {
  background: var(--clr-bg-surface-elevated);
  border: 2px solid var(--clr-bg-abyss);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--clr-primary-rgb), 0.4);
}

/* Section Base */
section {
  padding: var(--space-huge) 0;
  position: relative;
}

.section-dark {
  background:
    linear-gradient(180deg, rgba(2, 6, 9, 0.94), rgba(2, 6, 9, 0.98)),
    var(--clr-bg-abyss);
}

.section-marine {
  background:
    linear-gradient(180deg, rgba(6, 10, 15, 0.96), rgba(6, 10, 15, 0.9)),
    var(--clr-bg-navy);
}

.section-surface {
  background:
    linear-gradient(180deg, rgba(13, 19, 25, 0.96), rgba(9, 14, 19, 0.98)),
    var(--clr-bg-surface);
}

.lead-text {
  color: var(--clr-txt-secondary);
  font-size: var(--font-size-md);
  line-height: var(--line-height-loose);
}

.section-heading {
  max-width: 760px;
  margin-bottom: var(--space-xxl);
}

.section-heading.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-heading.centered p {
  margin-left: auto;
  margin-right: auto;
}

.page-hero {
  min-height: 52vh;
  display: flex;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  padding-top: calc(var(--header-height) + var(--space-huge));
  padding-bottom: var(--space-xxl);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 6, 9, 0.92), rgba(2, 6, 9, 0.58) 52%, rgba(2, 6, 9, 0.84)),
    url("../../images/Firefly_Gemini Flash_Ultra-realistic corporate marine services hero image for a professional industrial we 399565.webp") center / cover;
  filter: saturate(0.82) contrast(1.08);
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(var(--clr-primary-rgb), 0.014) 5px 6px),
    radial-gradient(circle at 78% 24%, rgba(var(--clr-primary-rgb), 0.13), transparent 24rem);
  pointer-events: none;
}

.page-hero .reveal {
  max-width: 760px;
}

.page-hero h1 {
  font-size: var(--font-size-huge);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

html[dir="rtl"] .page-hero h1 {
  text-transform: none;
}

/* Light theme: clean technical atmosphere without dark cinematic haze. */
[data-theme="light"] body {
  background: var(--clr-bg-abyss);
}

[data-theme="light"] p {
  color: var(--clr-txt-secondary);
}

[data-theme="light"] .section-dark {
  background: var(--clr-bg-abyss);
}

[data-theme="light"] .section-marine {
  background: var(--clr-bg-navy);
}

[data-theme="light"] .section-surface {
  background: var(--clr-bg-surface);
}

[data-theme="light"] .lead-text {
  color: var(--clr-txt-secondary);
}

[data-theme="light"] .page-hero {
  background: var(--clr-bg-abyss);
  border-bottom: 1px solid var(--clr-border-solid);
}

[data-theme="light"] .page-hero::before {
  background: url("../../images/Firefly_Gemini Flash_Ultra-realistic corporate marine services hero image for a professional industrial we 399565.webp") center / cover;
  filter: saturate(0.7) contrast(1.02) brightness(1.14);
  opacity: 0.16;
}

[data-theme="light"] .page-hero::after {
  display: none;
}

/* ==========================================================================
   PER-PAGE HERO BACKGROUNDS
   Same dark/cyan visual language as the Services hero, scoped per page so the
   approved Services page is untouched. Photographic layers use real assets.
   ========================================================================== */

/* Maintenance — commercial underwater work conveys hands-on servicing */
.hero-maintenance::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 9, 0.92), rgba(2, 6, 9, 0.6) 52%, rgba(2, 6, 9, 0.86)),
    url("../images/about/marine-environment/Underwater-welding.webp") center / cover;
  filter: saturate(0.82) contrast(1.08);
}

/* Contact — subtle marine texture, kept faint to keep focus on contact info */
.hero-contact::before {
  background:
    linear-gradient(90deg, rgba(2, 6, 9, 0.93), rgba(2, 6, 9, 0.74) 52%, rgba(2, 6, 9, 0.9)),
    url("../images/hero/underwater-texture.webp") center / cover;
  filter: saturate(0.8) contrast(1.05);
}

/* About — gradient only (kills the missing global image); the inline diver
   image below carries the visual alongside the copy. */
.hero-about::before {
  background: linear-gradient(125deg, rgba(2, 6, 9, 0.9), rgba(6, 10, 15, 0.96));
  filter: none;
}

[data-theme="light"] .hero-maintenance::before {
  filter: saturate(0.72) contrast(1.02) brightness(1.12);
  opacity: 0.18;
}

[data-theme="light"] .hero-contact::before {
  filter: saturate(0.7) contrast(1.0) brightness(1.14);
  opacity: 0.12;
}

[data-theme="light"] .hero-about::before {
  background: none;
}

/* About hero: copy + supporting image, side by side on desktop */
.about-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.about-hero-media {
  margin: 0;
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md), 0 0 30px rgba(var(--clr-primary-rgb), 0.08);
  isolation: isolate;
  max-width: 460px;
}

.about-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Cyan edge accent to match the tactical hero language */
.about-hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(2, 6, 9, 0.45));
  box-shadow: inset 0 0 0 1px rgba(var(--clr-primary-rgb), 0.18);
  border-radius: inherit;
}

@media (min-width: 860px) {
  .about-hero-grid {
    grid-template-columns: 1.35fr 0.95fr;
    gap: var(--space-xxl);
  }
  .about-hero-media {
    justify-self: end;
    max-width: 420px;
  }
}

html[dir="rtl"] .about-hero-media {
  justify-self: start;
}
