/* ============================================================
   Ashley D. Zhang — shared styles
   Palette and type scale taken from the original site.
   ============================================================ */

@font-face {
  font-family: 'Domaine Text';
  src: url('fonts/DomaineText-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream:    #ffefdd;  /* page background      */
  --rust:     #ad4b32;  /* body copy and links  */
  --terra:    #bb593c;  /* display type         */
  --navy:     #00274a;  /* default text colour  */
  --rule:     rgba(173, 75, 50, 0.22);
  --serif: 'Domaine Text', Palatino, 'Palatino Linotype', 'Book Antiqua',
           Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  background-color: var(--cream);
  color: var(--navy);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--rust); text-decoration: underline; }
a:hover { opacity: 0.68; }

/* ------------------------------------------------------------
   Home — two column split
   ------------------------------------------------------------ */

.container { display: flex; height: 100%; }

.image-section {
  position: relative;
  flex: 0 1 auto;
  order: -1;
  width: 45%;
  height: 100%;
  padding-top: 4vw;
  padding-left: 4vw;
  background-image: url('images/portrait.jpg');
  background-position: 50% center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Second portrait, crossfading in on hover. It is declared here rather than
   inside :hover so the browser loads it up front and the fade is smooth. */
.image-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('images/portrait-hover.jpg');
  background-position: 50% center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}

.image-section:hover::before { opacity: 1; }

/* Keep the name above the crossfading layer. */
.image-section .title { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .image-section::before { transition: none; }
}

.text-section {
  display: flex;
  flex: 1 1 0%;
  order: -1;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
  width: auto;
  height: 100%;
  max-height: 100%;
  padding: 6vw;
  overflow: auto;
  color: var(--terra);
}

.title {
  margin: 20px 0 10px;
  color: var(--terra);
  font-size: 64px;
  font-weight: 400;
  line-height: 120%;
}

.text {
  display: block;
  color: var(--rust);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 150%;
  text-align: left;
}

/* The three subpage links sitting under the blurb */
.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6em;
  margin-top: 2.1em;
  font-size: 17px;
  line-height: 150%;
}

.pages a {
  color: var(--rust);
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* ------------------------------------------------------------
   Subpages — Notes, Writing, Reading
   ------------------------------------------------------------ */

body.page { height: auto; }

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 5vw 6vw 8vw;
  color: var(--rust);
}

.masthead { margin-bottom: 3.4em; }

.masthead .home {
  display: inline-block;
  color: var(--terra);
  font-size: 30px;
  line-height: 120%;
  text-decoration: none;
}
.masthead .home:hover { opacity: 0.68; }

/* The subpage masthead stays upright; the homepage heading keeps its italic. */
.masthead .home em { font-style: normal; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
  margin-top: 1.1em;
  font-size: 17px;
}

.nav a { color: var(--rust); font-style: italic; text-decoration: underline; text-underline-offset: 0.18em; }
.nav a[aria-current='page'] { text-decoration: none; opacity: 0.6; cursor: default; }

.page-intro {
  margin-bottom: 3.2em;
  font-size: 17px;
  line-height: 160%;
  color: var(--rust);
}

/* ------------------------------------------------------------
   Feed (Notes) and lists (Writing, Reading)
   ------------------------------------------------------------ */

.feed { font-size: 17px; line-height: 160%; }

.entry { padding-bottom: 2.9em; margin-bottom: 2.9em; border-bottom: 1px solid var(--rule); }
.entry:last-child { border-bottom: 0; margin-bottom: 0; }

.entry-head {
  margin-bottom: 0.85em;
  font-size: 15px;
  letter-spacing: 0.02em;
  opacity: 0.75;
}

.entry-head .date { color: var(--rust); text-decoration: none; }
.entry-head .date:hover { text-decoration: underline; }

.entry-head .permalink {
  margin-left: 0.45em;
  color: var(--rust);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.entry:hover .entry-head .permalink,
.entry-head .permalink:focus { opacity: 0.8; }

.entry-title {
  margin: 0 0 0.5em;
  color: var(--terra);
  font-size: 22px;
  font-weight: 400;
  line-height: 130%;
}

.entry-body > *:first-child { margin-top: 0; }
.entry-body > *:last-child  { margin-bottom: 0; }
.entry-body p { margin: 0 0 1em; }

.entry-body blockquote {
  margin: 1.2em 0;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 2px solid var(--rule);
  opacity: 0.92;
}

.entry-body ul, .entry-body ol { margin: 0 0 1em; padding-left: 1.3em; }
.entry-body li { margin-bottom: 0.35em; }
.entry-body img { max-width: 100%; height: auto; margin: 0.6em 0; display: block; }
.entry-body hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6em 0; }

.entry-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(173, 75, 50, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.entry:target { background: rgba(173, 75, 50, 0.055); }

/* Writing / Reading section headings */
.section-title {
  margin: 0 0 0.45em;
  color: var(--terra);
  font-size: 26px;
  font-weight: 400;
  line-height: 130%;
}

/* Writing / Reading list rows */
.row { display: block; padding: 1.15em 0; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: 0; }
.row .row-title { color: var(--terra); font-size: 19px; line-height: 135%; }
.row .row-meta { margin-top: 0.3em; font-size: 15px; opacity: 0.75; }

/* Image or text sitting between a section heading and its list */
.entry-intro { margin: 0 0 2em; }
.entry-intro img {
  display: block;
  width: 100%;
  height: auto;
}
.entry-intro p { margin: 0 0 1em; }
.entry-intro > *:last-child { margin-bottom: 0; }

/* One-line summary sitting under an item */
.row-note {
  margin-top: 0.4em;
  font-size: 16px;
  line-height: 165%;
  opacity: 0.88;
}

/* Pull quote sitting under a Writing / Reading item */
.row-quote {
  margin: 0.75em 0 0;
  padding: 0.15em 0 0.15em 1.1em;
  border-left: 2px solid var(--rule);
  font-size: 16px;
  line-height: 168%;
  opacity: 0.92;
}
.row-quote p { margin: 0 0 0.7em; }
.row-quote p:last-child { margin-bottom: 0; }

.status { font-size: 17px; line-height: 160%; opacity: 0.8; }
.status code { font-size: 0.9em; }

.foot { margin-top: 4.5em; font-size: 15px; opacity: 0.7; }
.foot a { color: var(--rust); }

/* ------------------------------------------------------------
   Breakpoints — matched to the original
   ------------------------------------------------------------ */

@media screen and (min-width: 1280px) {
  .text { line-height: 160%; }
}

@media screen and (min-width: 1440px) {
  .text-section { padding-left: 8vw; padding-right: 8vw; }
  .text, .pages { font-size: 18px; line-height: 160%; }
}

@media screen and (min-width: 1920px) {
  .text, .pages { font-size: 22px; }
  .title { font-size: 80px; }
}

@media screen and (max-width: 991px) {
  .text-section { justify-content: flex-start; }
  .text { line-height: 160%; }
}

@media screen and (max-width: 767px) {
  body { height: auto; }
  .container { flex-direction: column; height: auto; }
  .image-section { width: 100%; height: 100vw; }
  .text, .pages { font-size: 18px; line-height: 170%; }
  .wrap { padding: 9vw 7vw 14vw; }
  .masthead { margin-bottom: 2.6em; }
}

@media screen and (max-width: 479px) {
  .image-section { height: 140vw; }
  .text, .pages { font-size: 17px; }
  .title { font-size: 50px; }
  .pages { gap: 1.2em; }
}
