/*
Theme Name: Space & Time Journal
Theme URI: https://byevgeniya.com.au
Author: Evgeniya | Space & Time
Author URI: https://byevgeniya.com.au
Description: The Calm Journal, a serene editorial WordPress theme matching the Space & Time by Evgeniya brand. Cormorant Garamond headings, Montserrat body, sage-and-forest palette, liquid-glass touches and gentle motion. Just write a post, add an image or paste a video link, and press Publish.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: space-and-time-journal
*/

/* ============================================================
   BRAND TOKENS  (matches the main website)
   ============================================================ */
:root {
  --forest-dark: #1A3328;
  --forest: #2C4F42;
  --forest-mid: #3D6B58;
  --sage: #7AA888;
  --sage-light: #A8C4B2;
  --sage-pale: #D4E8DC;
  --sage-mist: #EDF5F0;
  --navy: #1E3547;
  --champagne: #D4B896;
  --cream: #FAF7F3;
  --warm: #F5F0EA;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', system-ui, sans-serif;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--navy);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  color: var(--forest-dark);
  margin: 0 0 0.5em;
}

::selection { background: var(--sage-pale); color: var(--forest-dark); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(212,232,220,0.6);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__logo {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; background: #fff; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(44,79,66,0.15);
}
.brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.brand__name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--forest);
  white-space: nowrap;
}
.brand__name .sep { color: var(--sage); font-weight: 300; margin: 0 4px; }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 9999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { background: var(--sage-mist); color: var(--forest); }
.site-nav a.cta {
  background: linear-gradient(160deg, var(--forest-mid), var(--forest));
  color: #fff;
  box-shadow: 0 4px 16px rgba(44,79,66,0.3);
}
.site-nav a.cta:hover { color: #fff; transform: translateY(-1px); }

/* ============================================================
   JOURNAL HEADER (archive hero)
   ============================================================ */
.journal-hero {
  background: var(--sage-mist);
  padding: 80px 0 64px;
  position: relative;
  overflow: hidden;
}
.journal-hero__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--sage);
  display: block;
  margin-bottom: 16px;
}
.journal-hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  margin-bottom: 18px;
}
.journal-hero p {
  max-width: 540px;
  font-size: 1.05rem;
  color: rgba(30,53,71,0.65);
}
.journal-hero__infinity {
  position: absolute;
  right: -60px; top: 50%;
  transform: translateY(-50%);
  width: 420px; opacity: 0.06;
  pointer-events: none;
}

/* ============================================================
   POST GRID (archive / home)
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 64px 0;
}
.post-card { display: flex; flex-direction: column; }
.post-card__thumb {
  position: relative;
  width: 100%; aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 18px;
  background: var(--sage-pale);
}
.post-card__thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.7s ease;
}
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.75rem; color: rgba(30,53,71,0.55);
  margin-bottom: 12px;
}
.post-card__cat { color: var(--forest-mid); font-weight: 600; }
.post-card__title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--navy);
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: var(--forest); }
.post-card__excerpt {
  font-size: 0.9rem;
  color: rgba(30,53,71,0.6);
  margin: 0;
}
.post-card__more {
  margin-top: 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sage);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-hero {
  position: relative;
  min-height: 420px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.single-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.single-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,51,40,0.85) 0%, rgba(26,51,40,0.35) 55%, rgba(26,51,40,0.45) 100%);
}
.single-hero__inner {
  position: relative; z-index: 2;
  max-width: 760px; margin: 0 auto;
  padding: 0 24px 56px; width: 100%;
}
.single-hero__meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.single-hero__cat {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600; font-size: 0.72rem;
  padding: 6px 14px; border-radius: 9999px;
}
.single-hero__date { color: rgba(255,255,255,0.75); font-size: 0.78rem; }
.single-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3rem);
}

.single-body { padding: 56px 0 24px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 0.85rem;
  margin-bottom: 40px;
}

/* WordPress post content typography */
.entry-content { font-size: 1.08rem; line-height: 1.85; color: rgba(30,53,71,0.82); }
.entry-content p { margin: 0 0 1.4em; }
.entry-content h2 { font-size: clamp(1.6rem, 4vw, 2rem); margin: 1.6em 0 0.5em; }
.entry-content h3 { font-size: 1.4rem; margin: 1.4em 0 0.5em; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--sage-light); }
.entry-content img,
.entry-content .wp-block-image { border-radius: 16px; margin: 2em 0; }
.entry-content blockquote {
  margin: 2.2em 0;
  padding: 24px 28px;
  background: var(--sage-mist);
  border-left: 3px solid var(--sage);
  border-radius: 16px;
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--forest);
}
.entry-content blockquote p { margin: 0; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.entry-content li { margin-bottom: 0.5em; }

/* Responsive video embeds (YouTube / Vimeo via oEmbed) */
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content iframe,
.entry-content .wp-block-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 16px;
  margin: 2em 0;
}
.entry-content figure { margin: 2em 0; }
.entry-content figcaption {
  text-align: center; font-size: 0.85rem;
  color: rgba(30,53,71,0.5); margin-top: 0.6em;
}

/* In-article CTA */
.article-cta {
  margin: 56px 0 16px;
  background: var(--sage-mist);
  border: 1px solid rgba(122,168,136,0.25);
  border-radius: 18px;
  padding: 36px;
  text-align: center;
}
.article-cta h3 { font-size: 1.6rem; margin-bottom: 12px; }
.article-cta p { font-size: 0.9rem; color: rgba(30,53,71,0.6); max-width: 380px; margin: 0 auto 22px; }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: 9999px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  background: linear-gradient(160deg, var(--forest-mid), var(--forest));
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(44,79,66,0.35);
}
.btn-primary:hover { transform: translateY(-1px); color: #fff; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; gap: 8px;
  padding: 0 0 80px;
}
.pagination .page-numbers {
  padding: 10px 16px; border-radius: 9999px;
  background: #fff; border: 1px solid rgba(122,168,136,0.3);
  font-weight: 500; font-size: 0.85rem; color: var(--forest);
}
.pagination .page-numbers.current { background: var(--forest); color: #fff; border-color: var(--forest); }
.pagination .page-numbers:hover { background: var(--sage-mist); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--forest-dark);
  color: rgba(212,232,220,0.7);
  padding: 56px 0 32px;
  margin-top: 40px;
}
.site-footer__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; flex-wrap: wrap; gap: 24px;
  align-items: center; justify-content: space-between;
}
.site-footer__brand {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 1.3rem; color: #fff;
}
.site-footer__brand .sep { color: var(--sage); font-weight: 300; }
.site-footer a { color: var(--sage-light); }
.site-footer a:hover { color: #fff; }
.site-footer__links { display: flex; gap: 24px; font-size: 0.85rem; }
.site-footer__copy {
  width: 100%; border-top: 1px solid rgba(122,168,136,0.15);
  margin-top: 24px; padding-top: 20px;
  font-size: 0.75rem; color: rgba(168,196,178,0.5);
  letter-spacing: 0.05em;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .site-nav { display: none; }       /* keep header clean on mobile */
  .post-grid { grid-template-columns: 1fr; gap: 28px; padding: 40px 0; }
  .journal-hero { padding: 56px 0 44px; }
  .single-hero { min-height: 320px; }
  .article-cta { padding: 28px 20px; }
}

/* ============================================================
   ENHANCEMENTS & GENTLE MOTION  (v1.1)
   ============================================================ */

/* Reading progress bar (top of single posts) */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--sage), var(--forest));
  z-index: 200;
  transition: width 0.1s linear;
}

/* Header gains a soft shadow once you scroll */
.site-header {
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.site-header.is-scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 24px rgba(26,51,40,0.08);
  border-bottom-color: transparent;
}

/* Animated underline on nav + footer links */
.site-nav a:not(.cta),
.site-footer__links a {
  position: relative;
}
.site-nav a:not(.cta)::after,
.site-footer__links a::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65,0,0.35,1);
}
.site-footer__links a::after { left: 0; right: 0; bottom: -3px; }
.site-nav a:not(.cta):hover::after,
.site-footer__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Button sheen sweep */
.btn-sheen { position: relative; overflow: hidden; }
.btn-sheen::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,0.30), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s ease;
}
.btn-sheen:hover::before { left: 140%; }

/* ---- Journal hero ---- */
.journal-hero {
  background: linear-gradient(120deg, var(--sage-mist), var(--cream), var(--sage-pale));
  background-size: 180% 180%;
  animation: stGradient 18s ease infinite;
}
@keyframes stGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.journal-hero__content > * {
  opacity: 0;
  animation: stHeroIn 0.9s cubic-bezier(0.22,1,0.36,1) forwards;
}
.journal-hero__content > *:nth-child(1) { animation-delay: 0.10s; }
.journal-hero__content > *:nth-child(2) { animation-delay: 0.22s; }
.journal-hero__content > *:nth-child(3) { animation-delay: 0.34s; }
@keyframes stHeroIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.journal-hero__infinity { animation: stFloat 9s ease-in-out infinite; }
@keyframes stFloat {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(calc(-50% - 16px)) translateX(-10px); }
}

/* ---- Scroll reveal (cards, CTA) ---- */
.st-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
              transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.st-reveal.is-visible { opacity: 1; transform: translateY(0); }
/* Stagger cards within the grid */
.post-grid .st-reveal:nth-child(2) { transition-delay: 0.08s; }
.post-grid .st-reveal:nth-child(3) { transition-delay: 0.16s; }
.post-grid .st-reveal:nth-child(4) { transition-delay: 0.08s; }
.post-grid .st-reveal:nth-child(5) { transition-delay: 0.16s; }
.post-grid .st-reveal:nth-child(6) { transition-delay: 0.24s; }

/* ---- Post cards: richer hover ---- */
.post-card__thumb {
  box-shadow: 0 6px 20px rgba(26,51,40,0.06);
  transition: box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
}
.post-card__thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,51,40,0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.post-card:hover .post-card__thumb {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(26,51,40,0.16);
}
.post-card:hover .post-card__thumb::after { opacity: 1; }
.post-card__thumb img { transition: transform 0.9s cubic-bezier(0.2,0.8,0.2,1); }
.post-card:hover .post-card__thumb img { transform: scale(1.07); }
.post-card__title a { transition: color 0.25s ease; }
.post-card__more svg, .post-card__more { transition: gap 0.25s ease, color 0.25s ease; }
.post-card__more {
  position: relative;
}
.post-card:hover .post-card__more { gap: 11px; color: var(--forest); }

/* ---- Single post hero: slow ken-burns zoom ---- */
.single-hero img {
  animation: stKenBurns 16s ease-out forwards;
  transform-origin: center;
}
@keyframes stKenBurns {
  from { transform: scale(1.12); }
  to   { transform: scale(1); }
}
.single-hero__inner > * {
  opacity: 0;
  animation: stHeroIn 0.9s cubic-bezier(0.22,1,0.36,1) forwards;
}
.single-hero__inner > *:nth-child(1) { animation-delay: 0.25s; }
.single-hero__inner > *:nth-child(2) { animation-delay: 0.40s; }
.back-link { transition: gap 0.25s ease, color 0.2s ease; }
.back-link:hover { gap: 12px; }

/* ---- Pagination hover ---- */
.pagination .page-numbers {
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.pagination a.page-numbers:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44,79,66,0.14);
}

/* ---- Article CTA flourish ---- */
.article-cta { position: relative; overflow: hidden; }
.article-cta::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(122,168,136,0.22), transparent 70%);
  pointer-events: none;
  animation: stFloatBlob 12s ease-in-out infinite;
}
@keyframes stFloatBlob {
  0%, 100% { transform: translate(0,0); }
  50%      { transform: translate(-14px, 14px); }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .journal-hero,
  .journal-hero__infinity,
  .single-hero img,
  .article-cta::before { animation: none !important; }
  .journal-hero__content > *,
  .single-hero__inner > * { opacity: 1 !important; animation: none !important; }
  .st-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
