/*
Theme Name: Factology Daily
Theme URI: https://thefactologydaily.com/
Author: AIetherPanel / Factology Daily
Description: Editorial desk theme for an automated daily fact publication.
Version: 0.2.0
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 8.1
Text Domain: factology-daily
*/

:root {
  --ink: #07111d;
  --ink-soft: #304457;
  --muted: #6c7b88;
  --paper: #fbfaf6;
  --paper-deep: #f0eee6;
  --surface: #ffffff;
  --line: rgba(7, 17, 29, 0.13);
  --line-strong: rgba(7, 17, 29, 0.22);
  --blue: #1466ff;
  --blue-soft: #dce9ff;
  --amber: #d7942d;
  --teal: #208d85;
  --shadow: 0 18px 48px rgba(7, 17, 29, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
}

.site-header,
.site-footer,
.desk-hero,
.section-wrap {
  margin: 0 auto;
  max-width: 1240px;
  padding-left: 28px;
  padding-right: 28px;
}

.site-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 78px;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 42px;
  width: 42px;
}

.nav-links {
  align-items: center;
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  font-weight: 900;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--blue);
}

.desk-hero {
  padding-top: 18px;
}

.edition-bar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: 0.08em;
  padding-bottom: 14px;
  text-transform: uppercase;
}

.desk-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr) minmax(240px, 0.46fr);
  padding: clamp(34px, 5vw, 58px) 0 clamp(38px, 6vw, 70px);
}

.lead-story {
  align-self: center;
}

.lead-link {
  display: block;
  text-decoration: none;
}

.lead-link h1 {
  font-size: clamp(3.4rem, 5.7vw, 6.6rem);
  line-height: 0.9;
  margin-top: 14px;
  max-width: 680px;
}

.lead-link p {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.35vw, 1.18rem);
  line-height: 1.72;
  margin-top: 22px;
  max-width: 560px;
}

.fact-meta,
.section-label {
  color: var(--blue);
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.story-note {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-top: 20px;
  text-transform: uppercase;
}

.desk-visual {
  align-self: stretch;
  margin: 0;
  min-height: 430px;
  position: relative;
}

.desk-visual::before {
  background: var(--ink);
  bottom: -12px;
  content: "";
  left: -12px;
  position: absolute;
  right: 32px;
  top: 34px;
}

.desk-visual::after {
  background: var(--amber);
  bottom: -20px;
  content: "";
  height: 72px;
  position: absolute;
  right: -14px;
  width: 72px;
}

.desk-visual img {
  display: block;
  height: 100%;
  object-fit: cover;
  position: relative;
  width: 100%;
  z-index: 1;
}

.quick-rail {
  align-self: stretch;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 22px;
}

.rail-head {
  align-items: center;
  border-bottom: 2px solid var(--ink);
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  padding-bottom: 14px;
}

.rail-head img {
  display: block;
  height: 36px;
  width: 42px;
}

.rail-head strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
}

.quick-rail p {
  color: var(--ink-soft);
  line-height: 1.6;
  padding-top: 14px;
}

.quick-item {
  border-bottom: 1px solid var(--line);
  display: block;
  padding: 16px 0;
  text-decoration: none;
}

.quick-item span {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.quick-item strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.quick-item:hover strong {
  color: var(--blue);
}

.channel-strip {
  border-top: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 18px 28px;
  grid-template-columns: minmax(220px, 0.9fr) repeat(4, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 1240px;
  padding: 0 28px clamp(58px, 8vw, 96px);
}

.channel-strip a {
  border-top: 2px solid var(--line-strong);
  min-height: 0;
  padding-top: 18px;
  text-decoration: none;
}

.channel-strip span {
  color: var(--blue);
  display: block;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.channel-strip p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 280px;
}

.channel-strip a:hover span {
  color: var(--amber);
}

.channel-intro {
  padding-right: 18px;
}

.channel-intro h2 {
  font-size: clamp(1.75rem, 2.5vw, 2.8rem);
  line-height: 0.98;
  margin-top: 10px;
}

.section-wrap {
  padding-bottom: clamp(58px, 8vw, 100px);
  padding-top: clamp(48px, 7vw, 86px);
}

.section-head {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(2.15rem, 4.4vw, 4.8rem);
  line-height: 0.96;
  margin-top: 10px;
}

.section-deck {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
  margin-top: 12px;
  max-width: 560px;
}

.text-link {
  border-bottom: 2px solid var(--blue);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  padding-bottom: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.fact-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.fact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 360px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.fact-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.fact-card img,
.fact-thumb {
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  width: 100%;
}

.fact-thumb {
  background:
    linear-gradient(135deg, rgba(20, 102, 255, 0.24), rgba(215, 148, 45, 0.28)),
    url("assets/factology-logo-512.png") center / 88px no-repeat,
    var(--paper-deep);
}

.fact-thumb-science {
  background:
    linear-gradient(135deg, rgba(20, 102, 255, 0.22), rgba(32, 141, 133, 0.2)),
    url("screenshot.jpg") right center / cover;
}

.fact-thumb-history {
  background:
    linear-gradient(135deg, rgba(7, 17, 29, 0.08), rgba(215, 148, 45, 0.26)),
    url("screenshot.jpg") center / cover;
}

.fact-thumb-psychology {
  background:
    linear-gradient(135deg, rgba(20, 102, 255, 0.18), rgba(255, 255, 255, 0.28)),
    url("assets/factology-logo-512.png") center / 116px no-repeat,
    var(--blue-soft);
}

.fact-thumb-bizarre {
  background:
    linear-gradient(135deg, rgba(215, 148, 45, 0.2), rgba(7, 17, 29, 0.14)),
    url("screenshot.jpg") left bottom / cover;
}

.fact-card .fact-meta {
  margin: 20px 20px 0;
}

.fact-card h3 {
  font-size: clamp(1.28rem, 1.9vw, 2.05rem);
  line-height: 1.03;
  margin: 10px 20px 12px;
}

.fact-card p {
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.62;
  margin: 0 20px;
}

.fact-card .story-note {
  margin: auto 20px 20px;
}

.single-article {
  margin: 0 auto;
  max-width: 900px;
  padding: clamp(54px, 8vw, 92px) 28px 100px;
}

.single-article h1 {
  font-size: clamp(3.1rem, 7vw, 6.4rem);
  line-height: 0.92;
  margin: 14px 0 28px;
}

.single-content {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.5vw, 1.18rem);
  line-height: 1.82;
  margin-top: 30px;
}

.single-content p {
  margin-bottom: 1.15em;
}

.source-list {
  border-top: 1px solid var(--line);
  margin-top: 42px;
  padding-top: 24px;
}

.source-list ol {
  margin-bottom: 0;
  margin-top: 14px;
  padding-left: 22px;
}

.source-list li {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 34px;
}

.empty-state h3 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.site-footer {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  display: flex;
  font-size: 0.92rem;
  font-weight: 900;
  gap: 28px;
  justify-content: space-between;
  padding-bottom: 34px;
  padding-top: 24px;
}

.footer-brand {
  display: grid;
  gap: 6px;
  max-width: 360px;
}

.footer-brand strong {
  color: var(--ink);
  font-size: 1rem;
}

.footer-brand span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.footer-social {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  justify-content: flex-end;
  max-width: 660px;
}

.footer-social a,
.planned-social {
  align-items: center;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.social-icon-link svg {
  display: block;
  fill: currentColor;
  height: 22px;
  width: 22px;
}

.footer-social a {
  color: var(--ink);
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.footer-social a:hover {
  color: var(--blue);
  transform: translateY(-1px);
}

.planned-social {
  color: var(--muted);
  opacity: 0.54;
}

@media (max-width: 1080px) {
  .desk-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  }

  .quick-rail {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
    padding-left: 0;
    padding-top: 20px;
  }

  .quick-rail {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-head {
    align-self: start;
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .quick-item {
    border-bottom: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 16px;
  }

  .fact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .channel-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channel-intro {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}

@media (max-width: 760px) {
  .site-header,
  .site-footer,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    gap: 18px;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .site-header {
    gap: 10px;
    padding-bottom: 16px;
    padding-top: 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 16px;
  }

  .edition-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .desk-grid {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .lead-link h1 {
    font-size: clamp(3.05rem, 16vw, 5.3rem);
  }

  .desk-visual {
    min-height: 300px;
  }

  .quick-rail {
    grid-template-columns: 1fr;
  }

  .quick-item {
    border-bottom: 1px solid var(--line);
    border-left: 0;
    padding: 14px 0;
  }

  .channel-strip {
    grid-template-columns: 1fr;
  }

  .channel-strip a {
    min-height: 0;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }

  .fact-card {
    min-height: 0;
  }

  .text-link {
    margin-top: 4px;
  }
}
