/*
Theme Name: Gladwell Theme
Theme URI: https://gladwell.com
Author: Isaac Scribner
Description: A new website for Malcolm, using the 2011 gladwell.com website as heavy inspiration. Georgia serif, dark-green accents, centered portrait, and an editable notice band that pulls its text from the page titled "Notice".
Version: 3.9
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: gladwell
*/

:root {
  --green-dark: #4a3626;
  --green-pale: #d3c4b0;
  --ink: #333333;
  --paper: #fffdf9;
  --sans: Helvetica, Arial, sans-serif;
}

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

body {
  background: var(--paper);
  background: linear-gradient(180deg, #fffdf9 0%, #faf6ec 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* visible to screen readers and search engines, hidden from view */
.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

/* ——— sticky masthead ——— */
.masthead {
  position: sticky; top: 0; z-index: 100;
  background: var(--green-dark); text-align: center;
  padding: 12px 20px;
}
.masthead a {
  color: #fff; text-decoration: none;
  font-family: 'Times New Roman', Times, serif;
  font-size: 26px; letter-spacing: 1px;
}
.masthead .dot { color: var(--green-pale); }

/* ——— the editable notice band (content of the "Notice" page) ——— */
.notice {
  background: var(--green-dark);
  color: #fff;
  text-align: center;
  padding: 22px 20px;
  border-bottom: 3px solid var(--green-pale);
}
.notice-label {
  display: block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green-pale);
  margin-bottom: 8px;
}
.notice-text {
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  max-width: 720px;
  margin: 0 auto;
}
.notice-text p { margin: 0; }
.notice-text a { color: var(--green-pale); }

/* ——— homepage ——— */
.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
}

.portrait img {
  height: 300px;
  width: auto;
  mix-blend-mode: multiply; /* white box vanishes into the page */
  transition: transform 0.25s ease;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
}
.portrait:hover img { transform: translateY(-3px); }

.tagline {
  margin-top: 8px;
  font-style: italic;
  font-size: 15px;
  color: #777;
}

.home-nav {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.home-nav a {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green-dark);
  padding: 10px 18px;
  border-right: 1px solid var(--green-pale);
  transition: color 0.15s ease, background 0.15s ease;
}
.home-nav a:last-child { border-right: none; }
.home-nav a:hover {
  color: #fff;
  background: var(--green-dark);
}

/* ——— new book strip ——— */
.book-strip {
  margin-top: 34px; width: 100%; max-width: 620px;
  display: flex; align-items: center; gap: 22px; text-align: left;
}
.book-cover {
  flex-shrink: 0; width: 92px;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(0,0,0,.18);
  border-radius: 2px;
  transition: transform .2s ease;
}
.book-cover img { display: block; width: 100%; height: auto; border-radius: 2px; }
.book-strip:hover .book-cover { transform: translateY(-4px) rotate(-1.5deg); }
.book-text .lbl {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--green-dark);
}
.book-text .bt-title { display: block; font-size: 19px; margin-top: 6px; line-height: 1.3; }
.book-text .bt-title em { color: var(--green-dark); }
.book-text .bt-sub { display: block; font-size: 13.5px; font-style: italic; color: #777; margin-top: 4px; }
.book-text .bt-date { display: block; font-size: 13px; color: #555; margin-top: 8px; }
.book-text .bt-links { margin-top: 10px; }
.book-text .bt-links a {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  color: var(--green-dark); border: 1px solid var(--green-pale);
  padding: 7px 12px; margin-right: 6px; display: inline-block; margin-bottom: 6px;
  transition: background .15s ease, color .15s ease;
}
.book-text .bt-links a:hover { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* ——— from Malcolm's desk (content of the "Desk" page) ——— */
.desk {
  margin-top: 30px; width: 100%; max-width: 620px; text-align: left;
  background: #fff; border: 1px solid var(--green-pale);
  border-left: 4px solid var(--green-dark);
  padding: 20px 24px; position: relative;
}
.desk .lbl {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--green-dark);
}
.desk .desk-date {
  font-family: var(--sans); font-size: 10px; letter-spacing: 1px;
  text-transform: uppercase; color: #b0a893;
  position: absolute; top: 22px; right: 24px;
}
.desk .desk-body { margin-top: 12px; font-size: 15px; line-height: 1.7; }
.desk .desk-body p { margin-bottom: 0.9em; }
.desk .desk-body p:last-child { margin-bottom: 0; }
.desk .sig { margin-top: 8px; font-style: italic; font-size: 14px; color: var(--green-dark); }


/* ——— inner pages (books, bio, …) ——— */
.page-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.page-home-link {
  display: inline-block;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--green-dark);
  margin-bottom: 28px;
}
.page-title {
  font-weight: normal;
  font-size: 34px;
  color: var(--green-dark);
  margin-bottom: 24px;
}
.page-content {
  font-size: 16px;
  line-height: 1.7;
  text-align: justify;
}
.page-content p { margin-bottom: 1.2em; }
.page-content a { color: var(--green-dark); }
.page-content img { max-width: 100%; height: auto; }
.page-content h2, .page-content h3 {
  font-weight: normal;
  color: var(--green-dark);
  margin: 1.4em 0 0.6em;
}

/* ——— books page ——— */
.books-main { max-width: 860px; }
.books-intro { margin-bottom: 32px; }

.book-feature {
  display: flex; align-items: center; gap: 30px; text-align: left;
  background: #fff; border: 1px solid var(--green-pale);
  border-left: 4px solid var(--green-dark);
  padding: 26px 30px; margin-bottom: 44px;
}
.bf-cover { flex-shrink: 0; width: 150px; transition: transform .2s ease; }
.bf-cover img {
  display: block; width: 100%; height: auto; border-radius: 2px;
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
}
.book-feature:hover .bf-cover { transform: translateY(-4px) rotate(-1.5deg); }
.bf-text .lbl {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--green-dark);
}
.bf-title { font-weight: normal; font-size: 28px; margin-top: 8px; color: var(--ink); }
.bf-sub { font-style: italic; font-size: 16px; color: #777; margin-top: 2px; }
.bf-date { font-size: 13.5px; color: #555; margin-top: 10px; }
.bf-text .bt-links { display: block; margin-top: 14px; }

.books-heading {
  font-weight: normal; font-size: 22px; color: var(--green-dark);
  margin-bottom: 24px;
}

.books-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 34px 26px;
}
.books-grid a { display: block; text-decoration: none; text-align: left; }
.books-grid img {
  display: block; width: 100%; height: auto; border-radius: 2px;
  box-shadow: 0 8px 16px rgba(0,0,0,.18);
  transition: transform .2s ease, box-shadow .2s ease;
}
.books-grid a:hover img {
  transform: translateY(-4px);
  box-shadow: 0 12px 22px rgba(0,0,0,.24);
}
.books-grid .bg-title {
  display: block; font-size: 15.5px; line-height: 1.35;
  color: var(--ink); margin-top: 12px;
  transition: color .15s ease;
}
.books-grid a:hover .bg-title { color: var(--green-dark); }
.books-grid .bg-sub {
  display: block; font-size: 12px; font-style: italic;
  color: #999; line-height: 1.45; margin-top: 3px;
}
.books-grid .bg-year {
  display: block; font-family: var(--sans); font-size: 10.5px;
  letter-spacing: 1.5px; color: #b0a893; margin-top: 6px;
}

@media (max-width: 600px) {
  .book-feature { flex-direction: column; text-align: center; }
  .book-feature .bt-links a { margin: 0 3px 6px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 26px 18px; }
}

/* ——— episode listing (Revisionist History) ——— */
.episode-search { margin-bottom: 18px; }
.episode-search input {
  width: 100%;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 16px; font-style: italic; color: var(--ink);
  background: #fff; border: 1px solid var(--green-pale);
  padding: 10px 14px; border-radius: 2px;
  transition: border-color .15s ease;
}
.episode-search input:focus {
  outline: none;
  border-color: var(--green-dark);
}
.episode-none { font-style: italic; color: #777; padding: 18px 2px; }

.episode-list { list-style: none; }
.episode-list a {
  display: block;
  padding: 14px 10px;
  text-decoration: none;
  border-bottom: 1px solid var(--green-pale);
  transition: background .15s ease;
}
.episode-list .ep-main {
  display: flex; align-items: baseline; gap: 16px;
}
.episode-list .ep-no {
  flex-shrink: 0; min-width: 54px;
  font-family: var(--sans); font-size: 11px; letter-spacing: 1px;
  color: #b0a893;
}
.episode-list .ep-title { flex: 1; }
.episode-list .ep-desc {
  display: block; font-size: 13.5px; font-style: italic;
  color: #777; line-height: 1.55; margin-top: 6px;
}
.episode-list .ep-desc[hidden] { display: none; }
.episode-list mark {
  background: rgba(211, 196, 176, 0.55);
  color: inherit;
  padding: 0 2px; border-radius: 2px;
}
.episode-list .ep-title {
  font-size: 17px; line-height: 1.4; color: var(--ink);
  transition: color .15s ease, transform .15s ease;
}
.episode-list .ep-date {
  flex-shrink: 0; font-family: var(--sans); font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; color: #999;
  transition: color .15s ease;
}
.episode-list a:hover { background: rgba(211, 196, 176, 0.22); }
.episode-list a:hover .ep-title {
  color: var(--green-dark);
  transform: translateX(4px);
}
.episode-list a:hover .ep-date { color: var(--green-dark); }

/* listen button on a single episode page */
.listen-links { margin-top: 26px; }
.listen-links a {
  font-family: var(--sans); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; text-decoration: none;
  color: var(--green-dark); border: 1px solid var(--green-pale);
  padding: 7px 12px; margin-right: 6px; display: inline-block;
  transition: background .15s ease, color .15s ease;
}
.listen-links a:hover { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }

/* date line on a single episode page */
.episode-date {
  font-family: var(--sans); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: #999;
  margin: -14px 0 24px;
}

.site-footer {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 20px;
  font-style: italic;
}

@media (max-width: 600px) {
  .portrait img { height: 220px; }
  .home-nav a { padding: 10px 12px; letter-spacing: 1px; }
  .notice-text { font-size: 17px; }
  .book-strip { flex-direction: column; text-align: center; }
  .book-text .bt-links a { margin: 0 3px 6px; }
}
