/* ============================================================
   BASE.CSS — Arihant Fabrics
   Role: CSS reset · custom properties · @font-face ·
         body/typography defaults · focus · skip link ·
         reduced-motion wrapper
   Load order: first on every page, before all other stylesheets
   ============================================================ */


/* ============================================================
   @FONT-FACE — PRODUCTION
   Self-hosted. Font files must be present in /fonts/ before going live.
   ============================================================ */

@font-face {
  font-family: 'League Spartan';
  src: url('/fonts/LeagueSpartan-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cardo';
  src: url('/fonts/Cardo-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cardo';
  src: url('/fonts/Cardo-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cardo';
  src: url('/fonts/Cardo-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}


/* ============================================================
   DESIGN TOKENS — CSS CUSTOM PROPERTIES
   Single source of truth. All values reference these variables.
   Declared on :root so they cascade to every element.
   ============================================================ */

:root {

  /* ── Colours ── */
  --color-navy:         #0a2575;   /* primary brand colour — text, nav, UI */
  --color-navy-dark:    #061a5e;   /* darker navy — hover states, dark surfaces */
  --color-navy-deeper:  #08205f;   /* deepest navy — footer background */
  --color-gold:         #eecc1a;   /* accent — CTA hover, active states, focus ring */
  --color-white:        #ffffff;
  --color-text-body:    #1a1a1a;   /* default body text */
  --color-text-muted:   #555555;   /* secondary/supporting text */
  --color-text-light:   rgba(255, 255, 255, 0.75); /* text on dark backgrounds */
  --color-border:       #e8e8e8;   /* dividers, input borders */
  --color-bg-light:     #f8f8f6;   /* light off-white backgrounds */
  --color-bg-advantage: #f8f7f5;   /* Our Advantage section — matched to fabric swatch image background */

  /*
     NOTE ON LOGO COLOUR:
     The AF monogram SVG uses fill="#00167a" for its letterforms.
     This is intentional — the logo was designed with a slightly
     deeper navy than the brand UI colour (#0a2575). Do not
     "correct" the SVG paths to match --color-navy. Both are correct.
  */

  /* ── Per-fabric accent colours ── */
  --accent-greige:      #707067;   /* greige page and dropdown */
  --accent-yarn:        #b47840;   /* yarn-dyed page and dropdown */
  --accent-denim:       #0a2575;   /* denim page and dropdown (same as navy) */

  /* ── Typography — families ── */
  --font-brand:    'League Spartan', sans-serif;  /* brand name only */
  --font-heading:  'Cardo', serif;                /* h1–h3, display text */
  --font-body:     'Inter', sans-serif;           /* body, nav, labels, buttons */

  /* ── Typography — size scale ── */
  --font-size-base: 1rem;
  --font-size-sm:   0.875rem;
  --font-size-xs:   0.8rem;
  --font-size-h1:   clamp(1.75rem, 4vw, 2.5rem);
  --font-size-h2:   clamp(1.35rem, 3vw, 1.85rem);
  --font-size-h3:   clamp(1.1rem, 2vw, 1.4rem);
  --font-size-h4:   1rem;
  --font-size-h5:   0.8rem;
  --font-size-h6:   0.75rem;

  /* ── Typography — line heights ── */
  --line-height-body:    1.65;
  --line-height-heading: 1.2;

  /* ── Spacing scale ── */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4.5rem;

  /* ── Layout ── */
  --max-width:       1200px;  /* page content container */
  --max-width-text:  70ch;    /* readable prose width */
  --radius:          6px;
  --radius-lg:       12px;

  /* ── Page-wide horizontal padding ──
     Single token used by both .header-inner and .container so
     content edges always align perfectly with the header at every
     viewport width. No separate breakpoint overrides needed.
     24px floor (mobile) · fluid · 80px cap (desktop 1280px+). */
  --page-padding-inline: clamp(24px, 6.25vw, 80px);

  /* ── Header ── */
  --header-height: 72px;   /* desktop — matches approved component file exactly */
  /* Note: overridden at tablet (64px) and mobile (56px) in the media query blocks below */

}


/* ── Header height responsive overrides ──
   Keeps --header-height in sync with actual rendered heights
   so hero section calc() and any future sticky-offset rules stay correct. */
@media (max-width: 1023px) {
  :root { --header-height: 64px; } /* tablet */
}
@media (max-width: 767px) {
  :root { --header-height: 56px; } /* mobile */
}


/* ============================================================
   BOX-SIZING RESET
   Apply border-box universally — eliminates width/padding
   arithmetic bugs throughout every component.
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}


/* ============================================================
   DOCUMENT & BODY DEFAULTS
   ============================================================ */

html {
  /* Smooth scroll for anchor links — respects reduced-motion below */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--color-text-body);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal overflow at every viewport width */
  overflow-x: hidden;
}


/* ============================================================
   HEADING SCALE
   h1–h3: Cardo (serif) — display, editorial
   h4–h6: Inter (sans-serif) — labels, specs, metadata
   All headings: navy, tight line-height, no margin by default
   (spacing is added at the component/page level)
   ============================================================ */

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-navy);
  margin: 0;
}

h4,
h5,
h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: var(--line-height-heading);
  color: var(--color-navy);
  margin: 0;
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

/* h5: used for spec labels — uppercase, tracked */
h5 {
  font-size: var(--font-size-h5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

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


/* ============================================================
   PARAGRAPH & INLINE TEXT
   ============================================================ */

p {
  margin: 0;
  color: var(--color-text-body);
}

strong { font-weight: 600; }
em     { font-style: italic; }

/* Use <strong> for importance, <em> for stress.
   <b> and <i> are valid for stylistic offset — carry no semantic weight here. */


/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--color-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 0.15s ease;
  }
}

a:hover {
  color: var(--color-navy-dark);
  text-decoration: none;
}

/* Nav links and CTA links override these defaults in layout.css / components.css */


/* ============================================================
   LISTS
   ============================================================ */

ul,
ol {
  margin: 0;
  padding: 0;
}

/* Navigation and UI lists reset list-style in their own context.
   Content lists inside prose sections re-add it at the page level. */


/* ============================================================
   IMAGES & MEDIA
   ============================================================ */

img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inline SVG icons (in nav, footer, contact rows) must override
   height: auto — they use explicit width/height attributes. */


/* ============================================================
   FORM ELEMENTS — INHERITANCE RESET
   Browsers do not inherit font properties for form elements by default.
   ============================================================ */

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}


/* ============================================================
   HORIZONTAL RULE
   ============================================================ */

hr {
  border: none;
  border-top: 0.5px solid var(--color-border);
  margin: 0;
}


/* ============================================================
   FOCUS STYLES — WCAG 2.2 AA
   Never remove :focus-visible without a visible replacement.
   Gold ring — high contrast against both white and navy backgrounds.
   :focus (without :focus-visible) is intentionally not styled here
   so mouse users don't see outlines on click; keyboard users always do.
   ============================================================ */

:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Remove default browser focus ring where :focus-visible is supported */
:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   SKIP LINK — ACCESSIBILITY
   First focusable element on every page.
   Visually hidden until focused by keyboard — then shown.
   WCAG 2.4.1 — Bypass Blocks (Level A)
   ============================================================ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
  /* Visible state — applied when focused */
}

.skip-link:focus,
.skip-link:focus-visible {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  overflow: visible;
  padding: 12px 20px;
  background: var(--color-navy);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
  z-index: 9999;
}


/* ============================================================
   REDUCED MOTION
   All animations and transitions that are non-essential must
   be wrapped in this media query. This is a project-wide rule —
   enforced in every CSS file, not just base.css.

   Usage pattern (in any CSS file):
   @media (prefers-reduced-motion: no-preference) {
     .element { transition: transform 0.3s ease; }
   }

   The scroll-behavior above is also gated below.
   ============================================================ */

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

  *,
  *::before,
  *::after {
    /* !important required: must override component-level values for motion-sensitive
       users — accepted accessibility exception to the no-!important rule */
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   SELECTION COLOUR
   ============================================================ */

::selection {
  background-color: var(--color-gold);
  color: var(--color-navy);
}


/* ============================================================
   UTILITY — VISUALLY HIDDEN
   For content that must be present in the DOM for screen readers
   but should not be visible. Use sparingly — prefer semantic HTML.
   ============================================================ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── End of base.css ── */
