/*
Theme Name: Moments
Theme URI: https://kylehale.me
Author: Kyle Hale
Description: A custom visual field-journal theme built for kylehale.me.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: moments
License: All rights reserved
*/

:root {
  --moments-orange: #ef5a29;
  --moments-orange-soft: #f48a69;
  --moments-ink: #242424;
  --moments-muted: #686868;
  --moments-line: #ececec;
  --moments-paper: #ffffff;
  --moments-tile: clamp(220px, 31vw, 520px);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--moments-paper);
  color: var(--moments-ink);
  font-family: "Uni Neue", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--moments-orange);
  text-decoration-thickness: .08em;
  text-underline-offset: .14em;
}

a:hover {
  color: var(--moments-orange-soft);
}

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

.moments-site-header {
  min-height: 96px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--moments-line);
  background: rgba(255,255,255,.96);
}

.moments-site-header .wp-block-site-title {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.02em;
}

.moments-site-header .wp-block-site-title a {
  color: var(--moments-orange);
  text-decoration: none;
}

.moments-site-header .wp-block-site-title a:hover {
  color: var(--moments-orange-soft);
}

.moments-grid,
.wp-block-query.moments-grid > ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.moments-grid .wp-block-post,
.moments-info-tile {
  position: relative;
  min-height: var(--moments-tile);
  overflow: hidden;
  border-right: 1px solid var(--moments-line);
  border-bottom: 1px solid var(--moments-line);
  background: #fff;
}

.moments-card {
  position: relative;
  height: 100%;
  min-height: var(--moments-tile);
  display: flex;
  flex-direction: column;
}

.moments-card .wp-block-post-featured-image {
  margin: 0;
  height: 100%;
  min-height: var(--moments-tile);
}

.moments-card .wp-block-post-featured-image a,
.moments-card .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: 100%;
}

.moments-card .wp-block-post-featured-image img {
  object-fit: cover;
}

.moments-card-content {
  padding: clamp(1.4rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--moments-tile);
}

.moments-card-content .wp-block-post-title {
  margin: 0 0 .8rem;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
  font-weight: 500;
}

.moments-card-content .wp-block-post-title a {
  color: var(--moments-ink);
  text-decoration: none;
}

.moments-card-content .wp-block-post-excerpt {
  color: var(--moments-muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.moments-info-tile {
  isolation: isolate;
  color: #fff;
  background:
    linear-gradient(rgba(229,78,40,.78), rgba(144,45,23,.78)),
    linear-gradient(135deg, #ff9a72, #b63c1e);
}

.moments-info-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,.24), transparent 42%);
  z-index: -1;
}

.moments-info-inner {
  min-height: var(--moments-tile);
  padding: clamp(1.4rem, 3vw, 2.8rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1.2rem, 2vw, 2rem);
  text-align: center;
}

.moments-info-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem 1.35rem;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
}

.moments-info-nav a,
.moments-info-copy a {
  color: #fff;
  text-decoration: none;
}

.moments-info-nav a:hover,
.moments-info-copy a:hover {
  color: rgba(255,255,255,.72);
}

.moments-info-copy {
  max-width: 30rem;
  margin: 0;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.45;
}

.moments-info-links {
  display: flex;
  gap: 1.25rem;
  font-size: 1.4rem;
}

.moments-main {
  margin: 0;
}

.moments-page-shell,
.moments-single-shell {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 5rem);
}

.moments-single-shell {
  width: min(100% - 2rem, 1320px);
}

.moments-single-header {
  width: min(100%, 820px);
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.moments-single-header .wp-block-post-title {
  margin: 0 0 .8rem;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  line-height: .98;
  letter-spacing: -.035em;
}

.moments-single-content {
  font-size: clamp(1.1rem, 1.4vw, 1.28rem);
  line-height: 1.65;
}

.moments-single-content > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.moments-single-content > .alignwide {
  max-width: 1200px;
}

.moments-single-content > .alignfull {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.moments-single-content .wp-block-image figcaption,
.moments-single-content .wp-block-gallery figcaption {
  color: var(--moments-muted);
  font-size: .9rem;
}

.moments-archive-header {
  padding: clamp(2rem, 6vw, 5rem) 1rem;
  text-align: center;
}

.moments-archive-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1;
}

.moments-search-form {
  width: min(100% - 2rem, 720px);
  margin: 0 auto clamp(2rem, 6vw, 4rem);
}

.moments-footer {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--moments-muted);
  border-top: 1px solid var(--moments-line);
}

.wp-block-post-navigation-link a,
.moments-back-link a {
  color: var(--moments-orange);
  text-decoration: none;
}

@media (max-width: 900px) {
  .moments-grid,
  .wp-block-query.moments-grid > ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :root {
    --moments-tile: 50vw;
  }
}

@media (max-width: 520px) {
  .moments-site-header {
    min-height: 80px;
  }

  :root {
    --moments-tile: 100vw;
  }

  .moments-info-inner {
    min-height: 100vw;
  }

  .moments-card,
  .moments-card .wp-block-post-featured-image,
  .moments-card-content {
    min-height: 100vw;
  }

  .moments-info-nav {
    max-width: 18rem;
  }

  .moments-single-shell,
  .moments-page-shell {
    width: min(100% - 1.5rem, 1320px);
  }
}
