/* ==========================================================================
   BASE.CSS
   Reset · CSS Variables · Typography · Layout · Utilities
   Replaces: frameBase.css, generic.css, flexbox.css
   Colors are injected as CSS custom properties by code-head.php — do not
   hardcode brand colors here; use var(--clr-*) throughout.
   ========================================================================== */


/* ==========================================================================
   1. MODERN CSS RESET
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
}

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

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

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--clr-links);
  text-decoration: none;
  line-height: inherit;
}

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

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

figure {
  margin: 0;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid var(--clr-border);
  margin: var(--space-md) 0;
  padding: 0;
}

textarea {
  resize: vertical;
  overflow: auto;
}

nav ul,
nav ol {
  list-style: none;
}

[hidden] {
  display: none;
}

/* Improve readability of pre-formatted text */
pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 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;
  }
}


/* ==========================================================================
   2. TYPOGRAPHY
   Fonts loaded in code-head.php: Cormorant Garamond (display) · Jost (UI/body)
   The scale below was written for a geometric sans. It is retuned for the
   serif in css/fosterandlengths.css, which loads last. Read both together.
   ========================================================================== */

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* ~17px */
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: var(--clr-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--clr-headings);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0.875rem;
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 1.25rem 0 0.75rem;
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  margin: 1rem 0 0.625rem;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0.875rem 0 0.5rem;
}

h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0.875rem 0 0.5rem;
}

h6 {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

p {
  margin-bottom: 1em;
}

strong, b {
  font-weight: 600;
}

em, dfn {
  font-style: italic;
}

small {
  font-size: 0.875em;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--clr-accent);
  font-style: italic;
  color: var(--clr-muted);
}

abbr[title] {
  border-bottom: 1px dotted;
  cursor: help;
}

code, kbd, samp, pre {
  font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9em;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }

mark {
  background: #fff3cd;
  color: inherit;
  padding: 0 0.2em;
}


/* ==========================================================================
   3. LINKS
   ========================================================================== */

a:visited {
  color: var(--clr-links);
}

a:hover {
  color: var(--clr-links-hover);
  text-decoration: underline;
}

a:active,
a:focus {
  color: var(--clr-links);
}

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

a[href^="tel"] {
  color: inherit;
  text-decoration: none;
}

.link-appeal {
  color: var(--clr-links);
  cursor: pointer;
}


/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
}

.btn.btn-primary {
  background-color: var(--clr-accent);
  color: #fff;
  border-color: var(--clr-accent);
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background-color: var(--clr-links-hover);
  border-color: var(--clr-links-hover);
  color: #fff;
  text-decoration: none;
}

.btn.btn-outline {
  background-color: transparent;
  color: var(--clr-accent);
  border-color: var(--clr-accent);
}

.btn.btn-outline:hover,
.btn.btn-outline:focus {
  background-color: var(--clr-accent);
  color: #fff;
  text-decoration: none;
}

.btn.btn-dark {
  background-color: var(--clr-dark);
  color: #fff;
  border-color: var(--clr-dark);
}

.btn.btn-dark:hover,
.btn.btn-dark:focus {
  background-color: var(--clr-text);
  border-color: var(--clr-text);
  color: #fff;
  text-decoration: none;
}

.btn.btn-white {
  background-color: #fff;
  color: var(--clr-dark);
  border-color: #fff;
}

.btn.btn-white:hover,
.btn.btn-white:focus {
  background-color: var(--clr-base);
  color: var(--clr-dark);
  text-decoration: none;
}

.btn.btn-white-outline {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}

.btn.btn-white-outline:hover,
.btn.btn-white-outline:focus {
  background-color: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff;
  text-decoration: none;
}

.btn-sm {
  padding: 0.5rem 1.125rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.0625rem;
}


/* ==========================================================================
   5. LAYOUT — CONTAINERS & WRAPPERS
   ========================================================================== */

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

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

.container-narrow {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}


/* Page wrapper (keeps page above fixed background) */
.page-wrap {
  position: relative;
  z-index: 1;
  overflow: visible;
}


/* ==========================================================================
   6. GRID UTILITIES
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

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

/* Flexbox 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-wrap    { flex-wrap: wrap; }
.flex-col     { flex-direction: column; }
.flex-gap-sm  { gap: var(--space-sm); }
.flex-gap-md  { gap: var(--space-md); }


/* ==========================================================================
   7. SECTION SPACING
   ========================================================================== */

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

.section-sm {
  padding: var(--space-md) 0;
}

.section-xl {
  padding: var(--space-xl) 0;
}

.section-dark {
  background-color: var(--clr-dark);
  color: #fff;
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: #fff;
}

.section-base {
  background-color: var(--clr-base);
}

.section-white {
  background-color: #fff;
}

.section-brun {
  background-color: #e3ddd2
;
}

.section-accent {
  background-color: var(--clr-accent);
  color: #fff;
}

.section-accent h1,
.section-accent h2,
.section-accent h3 {
  color: #fff;
}


/* ==========================================================================
   8. SECTION HEADERS (reusable title block above sections)
   ========================================================================== */

.section-header {
  margin-bottom: 3rem;
}

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

.section-label {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-bottom: 0.625rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  color: var(--clr-dark);
  margin-bottom: 0.875rem;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--clr-muted);
  max-width: 600px;
  line-height: 1.6;
}

.section-header--center .section-subtitle {
  margin-inline: auto;
}


/* ==========================================================================
   9. BACK TO TOP
   ========================================================================== */

#back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--clr-dark);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), background-color var(--transition);
  box-shadow: var(--shadow-md);
}

#back-to-top:hover {
  background-color: var(--clr-accent);
  text-decoration: none;
}

#back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:focus-visible {
  outline: 2px solid var(--clr-accent);
  outline-offset: 3px;
}


/* ==========================================================================
   10. UTILITY CLASSES
   Keep these — they're used throughout pages and includes.
   ========================================================================== */

/* Display */
/* Text alignment */
.text-center,
.center,
.cent,
.textCent,
.centText { text-align: center; }

.text-left  { text-align: left; }
.text-right { text-align: right; }

/* Object centering */
.centerObj,
.centerObject,
.centObject { margin-left: auto; margin-right: auto; }

/* Borders (utility) */
.nb { border: none; }

/* Margins */
.nm  { margin: 0; }
.np  { padding: 0; }
.m5  { margin: 0.3125rem; }
.m10 { margin: 0.625rem; }
.m20 { margin: 1.25rem; }
.m30 { margin: 1.875rem; }
.m40 { margin: 2.5rem; }
.m50 { margin: 3.125rem; }


/* Visibility */
.hide       { display: none; }
.hidden     { display: none !important; visibility: hidden; }
.invisible  { visibility: hidden; }


/* Responsive hide */
@media (max-width: 1200px) { .hide1200 { display: none; } }
@media (max-width: 900px)  { .hide900  { display: none; } }
@media (max-width: 600px)  { .hide600  { display: none; } }


/* Text colour utilities */
.text-muted   { color: var(--clr-muted); }
.text-accent  { color: var(--clr-accent); }
.text-dark    { color: var(--clr-dark); }
.text-white   { color: #fff; }

/* Spacing helpers */
.mt-0  { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-0  { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Divider */
.divider {
  width: 3rem;
  height: 3px;
  background-color: var(--clr-accent);
  margin: 0.875rem 0 1.5rem;
  border: none;
}

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


/* ==========================================================================
   11. IMAGES
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

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

.img-rounded { border-radius: var(--radius-md); }
.img-circle  { border-radius: 50%; }

/* Image with overlay container */
.img-wrap {
  position: relative;
  overflow: hidden;
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.img-wrap:hover img {
  transform: scale(1.04);
}


/* ==========================================================================
   12. SELECTION & MISC
   ========================================================================== */

::selection {
  background: var(--clr-accent-light, #eef3ff);
  color: var(--clr-dark);
  text-shadow: none;
}

/* Print */
@media print {
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  a[href^="javascript:"]::after,
  a[href^="#"]::after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }

  h2, h3 {
    page-break-after: avoid;
  }
}
