/* WePersuadeMen.org
   Hand-written replacement for the WordPress "Untitled" theme.
   Same look, no framework, no JavaScript. */

/* ---------- Fonts (self-hosted, latin subset) ---------- */

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

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

/* ---------- Settings ---------- */

:root {
  --black: #000;
  --white: #fff;
  --text: #262626;
  --link: #767676;        /* links on white (was #999; darkened a little so it is readable) */
  --link-hover: #000;
  --grey: #999;           /* menu and "Continue" on black */
  --orange: #f05000;
  --page-width: 1000px;
  --content-width: 700px;
  --sidebar-width: 250px;
  --gap: 30px;
  --fire-height: 332px;   /* natural height of the lake-of-fire image (1920 x 332) */
}

/* ---------- Base ---------- */

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

html {
  overflow-y: scroll; /* keeps the page centred whether or not it scrolls */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--text);
  font: 400 1.25rem/1.5 Georgia, "Times New Roman", serif;
  overflow-wrap: break-word;
}

/* The lake of fire: pinned to the bottom of the window while the page scrolls.
   A fixed layer is used instead of background-attachment: fixed, which phones ignore. */
body::before {
  content: "";
  position: fixed;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 0;
  height: max(var(--fire-height), 100vw * 332 / 1920);
  background: url("../img/lake-of-fire.jpg") center bottom / cover no-repeat;
  pointer-events: none;
}

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus-visible,
a:active {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

b,
strong {
  font-weight: 700;
}

/* Present for screen readers and search engines, not shown on screen */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--white);
  color: var(--black);
  font: 600 0.9375rem/1.5 "Raleway", Arial, sans-serif;
}

.skip-link:focus {
  left: 8px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--black);
  color: var(--white);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  max-width: var(--page-width);
  margin: 0 auto;
}

.site-title {
  margin: 0;
  padding: 5px 2px 5px 20px;
  font: 700 1.25rem/1.7 "Arvo", Georgia, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.site-title a {
  color: var(--white);
}

.site-title a:hover {
  color: var(--grey);
}

.site-nav {
  padding-top: 2px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 25px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 9px 0;
  color: var(--grey);
  font: 700 0.75rem/1.5 "Arvo", Georgia, serif;
  text-transform: uppercase;
}

.site-nav a:hover {
  color: #818181;
}

.site-nav a[aria-current="page"],
.site-nav a[aria-current="page"]:hover {
  color: var(--white);
}

/* ---------- White page box: content + sidebar ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, var(--content-width)) var(--sidebar-width);
  justify-content: space-between;
  align-items: start;
  max-width: calc(var(--page-width) + 30px);
  margin: 0 auto var(--gap);
  padding: 10px 10px 10px 20px;
  border-radius: 10px;
  background: var(--white);
}

.content {
  padding-bottom: 70px;
}

/* ---------- Articles and pages ---------- */

.entry {
  padding-top: var(--gap);
}

.entry--post {
  border-bottom: 8px solid var(--black);
}

.entry p {
  margin: 0 0 var(--gap);
}

.entry-title,
.subhead {
  margin: 0;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.entry-title {
  text-align: center;
}

.subhead--indent,
.lead-in {
  text-indent: 1em;
}

.entry .lead-in {
  margin-bottom: calc(var(--gap) * 2);
  font-weight: 700;
}

.entry .intro--center {
  text-align: center;
}

.entry .indent {
  text-indent: 1.2em;
}

.entry blockquote {
  margin: 0 3em;
}

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

.entry-image {
  display: block;
  margin: var(--gap) 0;
}

.entry-image img {
  display: block;
}

/* Black "previous / next article" bar */

.post-nav {
  display: flex;
  justify-content: space-between;
  margin: var(--gap) 0;
  background: var(--black);
  font: 600 0.9375rem/1.5 "Raleway", Arial, sans-serif;
}

.post-nav a {
  display: block;
  padding: 20px;
  color: var(--white);
}

.post-nav a:hover,
.post-nav a:focus-visible {
  color: var(--white);
  text-decoration: underline;
}

.post-nav__next {
  margin-left: auto;
  text-align: right;
}

/* ---------- Sidebar ---------- */

.sidebar {
  margin: var(--gap) 0 25px;
  padding: 2px;
  font-size: 0.9375rem;
}

.sidebar__title {
  margin: 0 0 1.5em;
  color: var(--black);
  font: 600 0.9375rem/1.5 "Raleway", Arial, sans-serif;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.sidebar:hover .sidebar__title {
  color: var(--grey);
}

.sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar li {
  margin-bottom: 3px;
}

/* ---------- Home ---------- */

.home {
  padding: 60px 16px 40px;
  font-family: "Times New Roman", Times, serif;
  text-align: center;
  text-shadow: 2px 2px var(--black);
}

.home-verse {
  margin: 0;
}

.home-verse p {
  margin: 0;
  color: var(--orange);
  font-size: clamp(1.25rem, 6.6vw, 3rem); /* 48px on desktop, shrinks so each line still fits on a phone */
  font-style: italic;
}

.home-verse cite {
  display: block;
  margin-top: var(--gap);
  color: var(--white);
  font-size: 1.5rem;
  font-style: normal;
}

.home-continue {
  margin: 40px clamp(0px, 10.7vw - 16px, 134px) 2px 2px; /* 150px from the right edge on desktop */
  font-size: 1.5rem;
  text-align: right;
}

.home-continue a {
  color: var(--grey);
}

.home-continue a:hover,
.home-continue a:focus-visible,
.home-continue a:active {
  color: #666;
  text-decoration: underline;
}

/* ---------- Narrower screens ---------- */

/* Window narrower than the page box: keep the menu off the right edge */
@media (max-width: 1040px) {
  .site-nav {
    padding-right: 20px;
  }
}

/* Sidebar drops below the content */
@media (max-width: 965px) {
  .page {
    grid-template-columns: minmax(0, var(--content-width));
    justify-content: center;
  }

  .content {
    padding-bottom: 20px;
  }

  .sidebar a {
    display: inline-block;
    padding: 5px 0;
  }
}

/* Phones: centred title with the menu underneath */
@media (max-width: 700px) {
  .site-header__inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px 2px;
  }

  .site-title {
    padding: 0;
    text-align: center;
  }

  .site-nav {
    padding-right: 0;
  }

  .site-nav ul {
    justify-content: center;
    gap: 0 22px;
  }

  .site-nav a {
    padding: 12px 0;
    font-size: 0.8125rem;
  }

  .page {
    padding: 0 16px 10px;
  }

  .entry blockquote {
    margin: 0 1.5em;
  }

  .post-nav a {
    padding: 16px;
  }
}

@media (max-width: 400px) {
  body {
    font-size: 1.125rem;
  }

  .site-title {
    font-size: 1.125rem;
  }

  .site-nav ul {
    gap: 0 18px;
  }
}

/* ---------- Preferences and print ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

@media print {
  body {
    background: none;
    font-size: 12pt;
  }

  body::before,
  .site-nav,
  .sidebar,
  .post-nav,
  .skip-link {
    display: none;
  }

  .site-title a {
    color: #000;
  }

  .page {
    display: block;
    padding: 0;
  }
}
