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

html,
body {
  margin: 0;
  padding: 0;
}

/* VARIABLES */
:root {
  --max-width: 1100px;
  --side-gap: 32px;
  --section-gap: 20px;
  --border-color: #000;
  --text-color: #000;
  --link-color: #1a4fa3;
  --link-hover-color: #0f3d85;
}

/* BASE TYPOGRAPHY */
html {
  font-size: 18px;
}

body {
  background: #fff;
  color: var(--text-color);
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.65;
}

/* MAIN PAGE WRAPPERS */
.top-header,
.top-nav,
.below-header,
.container,
.above-footer,
.footer {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--side-gap);
  padding-right: var(--side-gap);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

/* REMOVE INTERNAL DUPLICATE LINES INSIDE PARTIALS */
.top-header hr,
.top-nav hr,
.below-header hr,
.container hr,
.above-footer hr,
.footer hr {
  display: none;
}

.top-header > *,
.top-nav > *,
.below-header > *,
.above-footer > *,
.footer > * {
  border-top: 0;
  border-bottom: 0;
}

/* VERTICAL SPACING */
.top-header,
.below-header,
.above-footer,
.footer {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

.container {
  padding-top: 34px;
  padding-bottom: 34px;
}

.top-nav {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* SINGLE SECTION DIVIDERS */
.top-header {
  border-top: 2px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.top-nav {
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

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

.above-footer {
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.footer {
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

/* HEADER */
.top-header h1,
.top-header .site-title {
  margin: 0;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.top-header a {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 0;
}

.top-header a:hover {
  color: var(--text-color);
  border-bottom: 0;
}

/* NAVIGATION */
.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
}

.top-nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}

.top-nav li {
  margin: 0;
  padding: 0;
}

.top-nav a {
  display: inline-block;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 0;
}

.top-nav a:hover {
  color: var(--link-hover-color);
  border-bottom: 0;
  text-decoration: underline;
}

/* TEXT */
p {
  font-size: 1rem;
  line-height: 1.75;
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 1.25rem;
}

li {
  font-size: 1rem;
  line-height: 1.7;
}

/* RESET ONLY HEADINGS */
main.container h1,
main.container h2,
main.container h3 {
  margin-top: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-color);
}

main.container h1 {
  font-size: 2rem;
}

main.container h2 {
  font-size: 1.6rem;
}

main.container h3 {
  font-size: 1.3rem;
}

/* BASE FLOW */
main.container > * + * {
  margin-top: 18px;
}

/* EXTRA SPACE BEFORE HEADINGS */
main.container h1:not(:first-child),
main.container h2:not(:first-child),
main.container h3:not(:first-child) {
  margin-top: 34px;
}

/* FOOTER */
.footer p,
.footer small,
.footer div {
  margin: 0;
}

.footer small {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* LINKS */
a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--link-hover-color);
  border-bottom: 1px solid var(--link-hover-color);
}

/* HAMBURGER BUTTON */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-color);
  font-family: inherit;
}

/* HEADER STRUCTURE */
.header h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
}

/* SLOGAN */
.site-slogan {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-color);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* TWO-COLUMN AND THREE-COLUMN SUPPORT */
.two-col,
.three-col {
  display: grid;
  width: 100%;
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* COLUMN ITEMS */
.two-col > *,
.three-col > * {
  min-width: 0;
  padding: 18px;
  margin: 0;
  border: 1px solid var(--border-color);
  background: #fff;
}

/* INTERNAL SPACING INSIDE COLUMN BOXES */
.two-col > * > *:first-child,
.three-col > * > *:first-child {
  margin-top: 0;
}

.two-col > * > *:last-child,
.three-col > * > *:last-child {
  margin-bottom: 0;
}

.two-col > * + *,
.three-col > * + * {
  margin-top: 0;
}

/* OPTIONAL COLUMN VARIANTS WITHOUT BOX BORDER */
.two-col.clean > *,
.three-col.clean > * {
  padding: 0;
  border: 0;
  background: transparent;
}

/* COLUMN WRAPPERS INSIDE MAIN SECTIONS */
.below-header .two-col,
.below-header .three-col,
.container .two-col,
.container .three-col,
.above-footer .two-col,
.above-footer .three-col {
  margin-top: 0;
  margin-bottom: 0;
}

/* RESPONSIVE STACKING */
@media (max-width: 900px) {
  .three-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --side-gap: 20px;
    --section-gap: 18px;
  }

  html {
    font-size: 17px;
  }

  .top-header h1,
  .top-header .site-title {
    font-size: 2.3rem;
  }

  .header h1 {
    font-size: 1.7rem;
  }

  .nav-toggle {
    display: block;
    margin: 0 auto 12px auto;
  }

  .top-nav {
    display: block;
    text-align: center;
  }

  .top-nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    gap: 0;
  }

  .top-nav.open ul {
    display: flex;
  }

  .top-nav li {
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .top-nav li:last-child {
    border-bottom: none;
  }

  .top-nav a {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 0.98rem;
  }

  p,
  li {
    font-size: 1rem;
  }

  main.container h1 {
    font-size: 1.7rem;
  }

  main.container h2 {
    font-size: 1.4rem;
  }

  main.container h3 {
    font-size: 1.18rem;
  }

  .two-col,
  .three-col {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .two-col > *,
  .three-col > * {
    padding: 16px;
  }
}

