/* ==========================================================
   SafarBandhu — Shared Foundation
   File: assets/css/style.css

   Common colours, typography, reset and layout utilities.
   Component and page-specific styling belongs in other files.
   ========================================================== */


/* 1. Design tokens */

:root {
  /* Brand colours */
  --color-primary: #174f52;
  --color-primary-dark: #103b3f;
  --color-primary-light: #edf3ef;

  --color-accent: #e17d43;
  --color-accent-hover: #f19157;
  --color-accent-text: #a34f24;
  --color-accent-light: #fff0df;

  /* Backgrounds */
  --color-background: #fbf8f2;
  --color-surface: #ffffff;
  --color-surface-muted: #f3f1e9;

  /* Text */
  --color-text: #173d40;
  --color-text-muted: #5e726f;
  --color-text-inverse: #ffffff;

  /* Borders and focus */
  --color-border: #dfe7e2;
  --color-border-strong: #b8cbc1;
  --color-focus: #a34f24;

  /* Status colours */
  --color-success: #216744;
  --color-success-light: #edf7ef;

  --color-danger: #aa3029;
  --color-danger-light: #fff0ed;

  --color-warning: #80580f;
  --color-warning-light: #fff7df;

  /* Font families */
  --font-body: Arial, Helvetica, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --container-width: 77.5rem;
  --container-narrow-width: 48rem;
  --page-gutter: clamp(1rem, 5vw, 4rem);

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 14px rgb(16 59 63 / 5%);
  --shadow-md: 0 10px 30px rgb(16 59 63 / 9%);
  --shadow-lg: 0 20px 60px rgb(16 59 63 / 16%);

  /* Animation */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  /* Layer order */
  --z-header: 100;
  --z-dropdown: 200;
  --z-floating: 300;
  --z-modal: 500;
}


/* 2. Browser reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

iframe {
  max-width: 100%;
  border: 0;
}

table {
  border-collapse: collapse;
}

a {
  color: inherit;
  text-decoration: none;
}

a,
button,
input,
select,
textarea {
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}


/* 3. Shared typography */

h1,
h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.4;
}

h4,
h5,
h6 {
  font-size: 1rem;
  line-height: 1.5;
}

p {
  overflow-wrap: break-word;
}

small {
  font-size: var(--text-xs);
}

strong,
b {
  font-weight: 700;
}

address {
  font-style: normal;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-accent {
  color: var(--color-accent-text);
}

.text-center {
  text-align: center;
}

.text-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.text-link:hover {
  color: var(--color-accent-text);
}


/* 4. Shared layout */

.container {
  width: 100%;
  max-width: calc(
    var(--container-width) + var(--page-gutter) * 2
  );
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.container--narrow {
  max-width: calc(
    var(--container-narrow-width) + var(--page-gutter) * 2
  );
}

/* Prevent grid and flex children from forcing overflow. */
.min-width-0 {
  min-width: 0;
}

/* Apply consistent spacing between neighbouring elements. */
.flow > * + * {
  margin-block-start: var(--flow-space, 1rem);
}

.section {
  padding-block: var(--space-20);
}

.section--small {
  padding-block: var(--space-12);
}


/* 5. Keyboard accessibility */

:where(
  a,
  button,
  input,
  select,
  textarea,
  summary,
  [tabindex]
):focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

/* Visually hidden text remains available to screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -10rem;
  left: 1rem;
  z-index: calc(var(--z-modal) + 1);
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  color: var(--color-primary-dark);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}


/* 6. Shared responsive adjustments */

@media (max-width: 48rem) {
  html {
    scroll-padding-top: 6rem;
  }

  .section {
    padding-block: var(--space-12);
  }

  .section--small {
    padding-block: var(--space-8);
  }
}


/* 7. Respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}