/*
Theme Name:  Northwest Dental Academy
Theme URI:   https://northwestdentalacademy.com
Author:      Northwest Dental Academy
Author URI:  https://northwestdentalacademy.com
Description: Bespoke premium theme for Northwest Dental Academy — Manchester's leading dental CPD provider, led by Dr. Nadeem Younis, President of the British Academy of Aesthetic Dentistry.
Version:     1.0.1
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.1
License:     Private
Text Domain: nwda
*/

/* ============================================================
   TABLE OF CONTENTS
   1.  CSS Custom Properties (Design Tokens)
   2.  CSS Reset & Base
   3.  Typography Base
   4.  Layout Utilities
   5.  Global Link & Focus Styles
   6.  Accessibility Utilities
   7.  Screen Reader Text
   8.  Clearfix
   ============================================================ */


/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {

  /* --- Colours --- */
  --color-primary:       #1A2B3C;
  --color-accent:        #C9A96E;
  --color-accent-light:  #E8D5B0;
  --color-accent-dark:   #A8833A;
  --color-bg:            #FAFAF8;
  --color-bg-dark:       #0F1C2A;
  --color-text:          #1A1A1A;
  --color-text-muted:    #5A6470;
  --color-text-light:    #8A9099;
  --color-border:        #E2E2DC;
  --color-border-dark:   #2A3D50;
  --color-white:         #FFFFFF;
  --color-surface:       #F0EDE8;
  --color-surface-dark:  #162536;
  --color-success:       #2D6A4F;
  --color-sold-out:      #8B1A1A;
  --color-limited:       #B45309;
  --color-coming-soon:   #5A6470;
  --color-overlay:       rgba(15, 28, 42, 0.65);

  /* --- Typography --- */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* --- Type Scale --- */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  2.75rem;
  --text-5xl:  3.5rem;
  --text-hero: clamp(2.5rem, 5vw, 4.5rem);

  /* --- Font Weights --- */
  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* --- Line Heights --- */
  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.6;
  --leading-relaxed:1.75;

  /* --- Letter Spacing --- */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.05em;
  --tracking-wider:   0.1em;
  --tracking-widest:  0.15em;

  /* --- Spacing Scale --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-7:  1.75rem;
  --space-8:  2rem;
  --space-9:  2.25rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Layout --- */
  --container-max:    1200px;
  --container-wide:   1400px;
  --container-narrow: 800px;
  --container-px:     1.5rem;

  /* --- Borders --- */
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --radius-full: 9999px;
  --border-width: 1px;

  /* --- Shadows --- */
  --shadow-xs:  0 1px 2px rgba(26, 43, 60, 0.06);
  --shadow-sm:  0 2px 8px rgba(26, 43, 60, 0.08);
  --shadow-md:  0 4px 16px rgba(26, 43, 60, 0.10);
  --shadow-lg:  0 8px 32px rgba(26, 43, 60, 0.14);
  --shadow-xl:  0 16px 48px rgba(26, 43, 60, 0.18);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* --- Z-index Scale --- */
  --z-below:   -1;
  --z-base:     0;
  --z-raised:   10;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-toast:    500;

  /* --- Header height (for offset calculations) --- */
  --header-height: 80px;
  --header-height-sticky: 64px;

  /* --------------------------------------------------------
     ALIASES — main.css / components.css / templates.css use
     these shorthand names. Defined here once as canonical.
     -------------------------------------------------------- */

  /* Colour aliases */
  --color-navy:        #1A2B3C;
  --color-navy-deep:   #0F1C2A;
  --color-navy-light:  #2A3D50;
  --color-gold:        #C9A96E;
  --color-gold-dark:   #A8833A;
  --color-gold-light:  #E8D5B0;
  --color-body:        #1A1A1A;
  --color-body-light:  #5A6470;

  /* Typography aliases */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:  'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;

  /* Layout aliases */
  --header-h:      80px;
  --container-pad: 1.5rem;
  --container-max: 1200px;

  /* Spacing extras */
  --space-px: 1px;
  --space-28: 7rem;

  /* Border-radius extras */
  --radius-xl: 1rem;

  /* Z-index aliases */
  --z-header:     200;
  --z-mobile-nav: 300;
}


/* ============================================================
   2. CSS RESET & BASE
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul,
ol {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

table {
  border-collapse: collapse;
  border-spacing: 0;
}

address {
  font-style: normal;
}

hr {
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-8) 0;
}


/* ============================================================
   3. TYPOGRAPHY BASE
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-primary);
}

h1 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 2vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); font-family: var(--font-body); font-weight: var(--weight-semibold); }
h6 { font-size: var(--text-base); font-family: var(--font-body); font-weight: var(--weight-semibold); }

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  max-width: 70ch;
}

p + p {
  margin-top: var(--space-4);
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  max-width: 65ch;
}

strong, b {
  font-weight: var(--weight-semibold);
}

em, i {
  font-style: italic;
}

small {
  font-size: var(--text-sm);
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-primary);
  line-height: var(--leading-snug);
}

blockquote cite {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-top: var(--space-4);
}

/* Label / eyebrow text — used above headings */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent);
  display: block;
  margin-bottom: var(--space-3);
}

.eyebrow--light {
  color: var(--color-accent-light);
}

/* Section headings with gold rule */
.heading-ruled {
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

/* On dark backgrounds */
.on-dark h1,
.on-dark h2,
.on-dark h3,
.on-dark h4 {
  color: var(--color-white);
}

.on-dark p,
.on-dark .lead {
  color: rgba(255, 255, 255, 0.8);
}


/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-px);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* Sections */
.section {
  padding-block: var(--space-20);
}

.section--sm {
  padding-block: var(--space-12);
}

.section--lg {
  padding-block: var(--space-32);
}

.section--flush {
  padding-block: 0;
}

/* Background variants */
.bg-white       { background-color: var(--color-white); }
.bg-surface     { background-color: var(--color-surface); }
.bg-primary     { background-color: var(--color-primary); }
.bg-dark        { background-color: var(--color-bg-dark); }
.bg-accent      { background-color: var(--color-accent); }

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Flex utilities */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2   { gap: var(--space-2); }
.flex-gap-4   { gap: var(--space-4); }
.flex-gap-6   { gap: var(--space-6); }
.flex-wrap    { flex-wrap: wrap; }
.flex-col     { flex-direction: column; }

/* Spacing helpers */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Max-width prose limiter */
.prose { max-width: 70ch; }
.prose--centered { max-width: 60ch; margin-inline: auto; text-align: center; }

/* Section header — centred heading + lead */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--center {
  text-align: center;
}

.section-header--center p,
.section-header--center .lead {
  margin-inline: auto;
}


/* ============================================================
   5. GLOBAL LINK & FOCUS STYLES
   ============================================================ */

a:not([class]) {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-light);
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:not([class]):hover {
  color: var(--color-primary);
  text-decoration-color: var(--color-accent);
}

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

:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   6. ACCESSIBILITY UTILITIES
   ============================================================ */

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-toast);
  background: var(--color-accent);
  color: var(--color-primary);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   7. WORDPRESS CORE ALIGNMENT CLASSES
   ============================================================ */

.alignleft  { float: left; margin-right: var(--space-6); margin-bottom: var(--space-4); }
.alignright { float: right; margin-left: var(--space-6); margin-bottom: var(--space-4); }
.aligncenter { display: block; margin-inline: auto; }
.alignwide  { max-width: 1400px; margin-inline: auto; }
.alignfull  { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }

/* WordPress gallery */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-2); }

/* Sticky post */
.sticky { /* handled in card styles */ }


/* ============================================================
   8. UTILITY: DIVIDER LINE
   ============================================================ */

.divider {
  width: 48px;
  height: 2px;
  background-color: var(--color-accent);
  display: block;
  margin: var(--space-6) 0;
}

.divider--center {
  margin-inline: auto;
}

.divider--full {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
}
