/* =========================================
   CHESS MEMORY PALACE — SHARED STYLES
   ========================================= */

/* Design variables */

:root {
  /* Typography */
  --font-body: "DM Sans", sans-serif;
  --font-display: "Young Serif", serif;

  /* Colours */
  --color-background: #faf9f6;
  --color-surface: #ffffff;
  --color-text: #252923;
  --color-muted: #626960;
  --color-accent: #365c49;
  --color-accent-hover: #254334;
  --color-border: #dedfd8;

  /* Layout */
  --content-width: 1120px;
  --reading-width: 740px;
  --page-padding: 28px;
  --section-spacing: 80px;

  /* Components */
  --button-radius: 5px;
}


/* =========================================
   RESET AND FOUNDATIONS
   ========================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent-hover);
}

button,
input,
textarea {
  font: inherit;
}


/* =========================================
   SHARED LAYOUT
   ========================================= */

/*
  Use .container on any element that should
  share the site's maximum content width.
*/

.container {
  width: min(
    calc(100% - 2 * var(--page-padding)),
    var(--content-width)
  );
  margin-inline: auto;
}

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

/* Reusable section spacing */

.section {
  padding-block: var(--section-spacing);
}

.section--compact {
  padding-block: calc(var(--section-spacing) * 0.6);
}

main {
  min-height: 60vh;
}


/* =========================================
   TYPOGRAPHY
   ========================================= */

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 400;
}

h1,
h2 {
  font-family: var(--font-display);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

p {
  margin: 0 0 1.3em;
}

.page-title {
  margin: 0 0 0.7em;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.muted {
  color: var(--color-muted);
}


/* =========================================
   BUTTONS
   ========================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--button-radius);

  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;

  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.button--primary {
  background: var(--color-accent);
  color: #ffffff;
}

.button--primary:hover {
  background: var(--color-accent-hover);
  color: #ffffff;
}

.button--secondary {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.button--secondary:hover {
  background: var(--color-accent);
  color: #ffffff;
}


/* =========================================
   HEADER
   ========================================= */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.header-inner {
  padding-block: 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.site-nav a {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}


/* =========================================
   FOOTER
   ========================================= */

.site-footer {
  margin-top: var(--section-spacing);
  padding-block: 42px;
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.footer-copyright {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.8rem;
}


/* =========================================
   STANDARD CONTENT PAGES
   ========================================= */

.page {
  padding-block: var(--section-spacing);
}

.prose {
  max-width: var(--reading-width);
}

.prose p {
  margin-bottom: 1.5em;
}

.prose h2 {
  margin-top: 1.8em;
}

.prose img {
  margin: 32px 0;
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 700px) {

  :root {
    --page-padding: 20px;
    --section-spacing: 48px;
  }

  body {
    font-size: 16px;
  }

  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-block: 18px;
  }

  .site-brand {
    font-size: 1.2rem;
    text-align: center;
  }

  .site-nav {
    justify-content: center;
    gap: 12px 18px;
  }

  .site-nav a {
    font-size: 0.85rem;
  }

  .site-footer {
    padding-block: 32px;
  }

  .footer-links {
    gap: 20px;
  }

  .button {
    padding: 12px 20px;
  }
}


/* =========================================
   ACCESSIBILITY
   ========================================= */

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

  .button {
    transition: none;
  }
}





/*  legal link beside copyright */
.footer-copyright a {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
}

.footer-copyright a:hover {
  opacity: 1;
  text-decoration: underline;
}
