/*
Theme Name: Worldform Journal
Theme URI: https://worldform.dev/
Author: Worldform
Description: Minimal single-page journal theme for Worldform. Combines native WordPress posts with imported Steam, YouTube and X feed items.
Version: 1.4.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: worldform-journal
*/

:root {
  --wf-bg: #ffffff;
  --wf-month: #555555;
  --wf-post: #757575;
  --wf-italic: #777777;
  --wf-heading: #555555;
  --wf-body: #777777;
  --wf-rule: #b8b8b8;
  --wf-font: Verdana, Geneva, sans-serif;
  --wf-feed-size: 14px;
  --wf-month-size: 15px;
  --wf-title-size: 20px;
  --wf-body-size: 14px;
  --wf-content-width: 680px;
  --wf-icon-size: 33px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wf-bg);
  color: var(--wf-body);
  font-family: var(--wf-font);
  font-size: var(--wf-body-size);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; }

.wf-site {
  min-height: 100vh;
  background: var(--wf-bg);
}

.wf-masthead {
  width: min(var(--wf-content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 12px;
  text-align: center;
}

.wf-logo {
  display: inline-block;
  width: 72px;
  max-width: 25vw;
}

.wf-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--wf-bg) 96%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wf-sticky-inner {
  position: relative;
  width: min(var(--wf-content-width), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--wf-rule);
}

.wf-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.wf-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--wf-icon-size);
  height: var(--wf-icon-size);
  text-decoration: none;
}
.wf-social-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wf-social-link:hover,
.wf-social-link:focus-visible,
.wf-filter-toggle:hover,
.wf-filter-toggle:focus-visible { opacity: .62; }

.wf-filter-wrap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.wf-filter-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--wf-heading);
  width: 34px;
  height: 34px;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wf-filter-toggle svg { width: 26px; height: 26px; }

.wf-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  padding: 12px 14px;
  background: var(--wf-bg);
  border: 1px solid var(--wf-rule);
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
}
.wf-filter-panel[hidden] { display: none; }
.wf-filter-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: var(--wf-post);
  cursor: pointer;
}
.wf-filter-clear {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wf-heading);
  text-decoration: underline;
  cursor: pointer;
}

.wf-feed {
  width: min(var(--wf-content-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.wf-month {
  margin: 0 0 32px;
}
.wf-month[hidden] { display: none; }
.wf-month-title {
  margin: 0 0 8px;
  color: var(--wf-month);
  font-size: var(--wf-month-size);
  line-height: 1.4;
  font-weight: 700;
}

.wf-entry {
  margin: 0;
  color: var(--wf-post);
}
.wf-entry[hidden] { display: none; }

.wf-entry-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 100%;
  padding: 1px 0;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px;
  align-items: start;
  font-size: var(--wf-feed-size);
}
.wf-entry-toggle:hover .wf-entry-title,
.wf-entry-toggle:focus-visible .wf-entry-title { text-decoration: underline; }
.wf-entry-symbol {
  display: inline-block;
  min-width: 23px;
  color: var(--wf-post);
  white-space: nowrap;
}
.wf-entry-line { min-width: 0; }
.wf-entry-title { font-style: italic; color: var(--wf-italic); }
.wf-entry-source { white-space: nowrap; }

.wf-entry-content {
  padding: 18px 0 26px 28px;
  color: var(--wf-body);
  font-size: var(--wf-body-size);
  overflow: hidden;
}
.wf-entry-content[hidden] { display: none; }
.wf-entry-content > :first-child { margin-top: 0; }
.wf-entry-content > :last-child { margin-bottom: 0; }
.wf-entry-content h1,
.wf-entry-content h2,
.wf-entry-content h3,
.wf-entry-content h4,
.wf-entry-content h5,
.wf-entry-content h6 {
  color: var(--wf-heading);
  font-weight: 400;
  line-height: 1.3;
}
.wf-entry-content h1,
.wf-entry-content > h2:first-child,
.wf-blog-title { font-size: var(--wf-title-size); }
.wf-entry-content h2 { font-size: calc(var(--wf-body-size) + 4px); }
.wf-entry-content h3 { font-size: calc(var(--wf-body-size) + 2px); }
.wf-entry-content p { margin: 0 0 1em; }
.wf-entry-content a { text-decoration: underline; }
.wf-entry-content iframe,
.wf-entry-content video {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}
.wf-youtube-frame {
  aspect-ratio: 16 / 9;
  margin: 0 0 14px;
}
.wf-external-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--wf-heading);
}
.wf-twitter-tweet { margin-left: 0 !important; }

.wf-empty {
  color: var(--wf-post);
}

@media (max-width: 600px) {
  body { font-size: max(11px, calc(var(--wf-body-size) - 1.5px)); }
  .wf-masthead,
  .wf-sticky-inner,
  .wf-feed { width: calc(100% - 24px); }
  .wf-masthead { padding-top: 14px; }
  .wf-logo { width: 64px; }
  .wf-sticky-inner { min-height: 54px; }
  .wf-socials { gap: 20px; }
  :root { --wf-icon-size: 28px; }
  .wf-feed { padding-top: 24px; }
  .wf-month { margin-bottom: 28px; }
  .wf-month-title { font-size: max(12px, calc(var(--wf-month-size) - 1.5px)); }
  .wf-entry-toggle { font-size: max(11px, calc(var(--wf-feed-size) - 1.5px)); }
  .wf-entry-content { font-size: max(11px, calc(var(--wf-body-size) - 1px)); }
  .wf-entry-content { padding-left: 23px; }
  .wf-entry-line { overflow-wrap: anywhere; }
}
