/*
Theme Name: Marlow Ledger
Author: Elian Row Studio
Description: A classic editorial WordPress theme with a refined two-column hero, responsive dynamic navigation, and Customizer-controlled colors, typography, and homepage copy.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: apx-theme
*/

:root {
  --apx-color-bg: #f7f7f8;
  --apx-color-surface: #edeef1;
  --apx-color-surface-end: #c9cdd2;
  --apx-color-text: #121218;
  --apx-color-muted: #44454c;
  --apx-color-line: #d3d5da;
  --apx-color-accent: #15151b;
  --apx-color-soft: #ffffff;
  --apx-font-body: "Instrument Sans", Arial, sans-serif;
  --apx-font-heading: "Lora", Georgia, serif;
  --apx-hero-title-size: 56px;
  --apx-body-size: 16px;
  --apx-card-title-size: 24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--apx-color-text);
  background-color: var(--apx-color-bg);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(18, 18, 24, 0.035) 0,
    rgba(18, 18, 24, 0.035) 1px,
    transparent 1px,
    transparent 6px
  );
  font-family: var(--apx-font-body);
  font-size: var(--apx-body-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.apx-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.apx-skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-150%);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--apx-color-accent);
  transition: transform 180ms ease;
}

.apx-skip-link:focus {
  transform: translateY(0);
}

.apx-site-header {
  position: relative;
  z-index: 50;
  min-height: 84px;
}

.apx-header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1152px, calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
}

.apx-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  color: var(--apx-color-text);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.apx-brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--apx-color-text);
  font-family: var(--apx-font-heading);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.apx-brand-text {
  white-space: nowrap;
}

.apx-logo-image {
  max-height: 32px;
  width: auto;
}

.apx-nav {
  justify-self: center;
}

.apx-nav-list {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apx-nav-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 999px;
  padding: 8px 14px;
  color: #1b1b21;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: background-color 180ms ease, color 180ms ease;
}

.apx-nav-link:hover,
.apx-nav-link:focus {
  background: rgba(18, 18, 24, 0.06);
  outline: none;
}

.apx-header-actions {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.apx-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.apx-button:hover,
.apx-button:focus {
  transform: translateY(-1px);
  outline: none;
}

.apx-button-primary {
  color: #ffffff;
  background:
    radial-gradient(circle at 84% 50%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.12), transparent 28%),
    var(--apx-color-accent);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 2px 4px rgba(25, 25, 31, 0.22),
    0 8px 18px rgba(25, 25, 31, 0.18);
}

.apx-button-secondary {
  color: var(--apx-color-text);
  background: var(--apx-color-surface);
  border-color: var(--apx-color-line);
}

.apx-header-cta {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 14px;
}

.apx-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--apx-color-line);
  border-radius: 10px;
  padding: 0;
  color: var(--apx-color-text);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.apx-menu-toggle-lines,
.apx-menu-toggle-lines::before,
.apx-menu-toggle-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.apx-menu-toggle-lines {
  position: relative;
}

.apx-menu-toggle-lines::before,
.apx-menu-toggle-lines::after {
  position: absolute;
  left: 0;
  content: "";
}

.apx-menu-toggle-lines::before {
  top: -6px;
}

.apx-menu-toggle-lines::after {
  top: 6px;
}

.apx-menu-open .apx-menu-toggle-lines {
  transform: rotate(45deg);
}

.apx-menu-open .apx-menu-toggle-lines::before {
  transform: translateY(6px) rotate(90deg);
}

.apx-menu-open .apx-menu-toggle-lines::after {
  opacity: 0;
}

.apx-mobile-panel {
  display: none;
}

.apx-main {
  min-height: 60vh;
}

.apx-container {
  width: min(1152px, calc(100% - 48px));
  margin-right: auto;
  margin-left: auto;
}

.apx-hero {
  padding: 64px 0 80px;
}

.apx-hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 616px;
  border-radius: 32px;
  padding: 96px;
  background:
    linear-gradient(90deg, var(--apx-color-surface) 60%, var(--apx-color-surface-end) 100%);
  overflow: visible;
}

.apx-hero-copy {
  position: relative;
  z-index: 3;
  align-self: center;
  max-width: 480px;
}

.apx-hero-title {
  margin: 0;
  color: var(--apx-color-text);
  font-family: var(--apx-font-heading);
  font-size: var(--apx-hero-title-size);
  font-weight: 600;
  line-height: 1.142857;
  letter-spacing: 0;
}

.apx-hero-title-accent {
  display: block;
  color: rgba(18, 18, 24, 0.42);
}

.apx-hero-intro {
  max-width: 480px;
  margin: 18px 0 0;
  color: var(--apx-color-muted);
  font-size: 18px;
  line-height: 28px;
}

.apx-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.apx-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 40px;
  margin-top: 88px;
}

.apx-stat-value {
  display: block;
  color: var(--apx-color-text);
  font-family: var(--apx-font-heading);
  font-size: 36px;
  font-weight: 500;
  line-height: 1.1;
}

.apx-stat-label {
  display: block;
  margin-top: 6px;
  color: var(--apx-color-muted);
  font-size: 16px;
  line-height: 22px;
}

.apx-hero-media {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  width: 50%;
  height: calc(100% + 90px);
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.apx-hero-media img {
  width: min(100%, 576px);
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  filter: grayscale(1) contrast(1.03);
}

.apx-hero-media-placeholder {
  width: min(100%, 576px);
  height: 100%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 58% 30%, rgba(18, 18, 24, 0.18), transparent 22%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(18, 18, 24, 0.16));
}

.apx-hero-floating {
  position: absolute;
  right: 48px;
  bottom: 48px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  width: min(360px, calc(100% - 96px));
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  padding: 28px 32px;
  color: #ffffff;
  background: rgba(20, 20, 26, 0.84);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}

.apx-floating-eyebrow {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  line-height: 20px;
}

.apx-floating-title {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

.apx-floating-text {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 20px;
}

.apx-floating-link {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  align-self: end;
  border-radius: 12px;
  color: var(--apx-color-text);
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.apx-section {
  padding: 72px 0;
}

.apx-section-head {
  max-width: 620px;
  margin: 0 auto 40px;
  text-align: center;
}

.apx-eyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--apx-color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.apx-section-title {
  margin: 0;
  color: var(--apx-color-text);
  font-family: var(--apx-font-heading);
  font-size: 36px;
  font-weight: 600;
  line-height: 48px;
  letter-spacing: 0;
}

.apx-section-text {
  margin: 14px 0 0;
  color: var(--apx-color-muted);
  font-size: 18px;
  line-height: 28px;
}

.apx-about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.apx-about-card {
  min-height: 220px;
  border: 1px solid rgba(18, 18, 24, 0.08);
  border-radius: 20px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 18px 45px rgba(18, 18, 24, 0.05);
}

.apx-about-card-title {
  margin: 0;
  color: var(--apx-color-text);
  font-size: var(--apx-card-title-size);
  font-weight: 600;
  line-height: 32px;
}

.apx-about-card-text {
  margin: 12px 0 0;
  color: var(--apx-color-muted);
  font-size: 16px;
  line-height: 24px;
}

.apx-post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.apx-post-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border-radius: 24px;
  color: var(--apx-color-text);
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(18, 18, 24, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.apx-post-card:hover,
.apx-post-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 26px 58px rgba(18, 18, 24, 0.1);
}

.apx-post-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(237, 238, 241, 0.95), rgba(201, 205, 210, 0.95));
  overflow: hidden;
}

.apx-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apx-post-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px 28px 28px;
}

.apx-post-date {
  margin-bottom: 12px;
  color: var(--apx-color-muted);
  font-size: 14px;
  line-height: 20px;
}

.apx-post-title {
  margin: 0;
  color: var(--apx-color-text);
  font-size: var(--apx-card-title-size);
  font-weight: 600;
  line-height: 32px;
}

.apx-post-title a {
  display: inline;
}

.apx-post-excerpt {
  margin: 12px 0 0;
  color: var(--apx-color-muted);
  font-size: 16px;
  line-height: 24px;
}

.apx-post-more {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--apx-color-text);
  font-size: 14px;
  font-weight: 700;
}

.apx-topic-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apx-topic-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--apx-color-line);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--apx-color-text);
  background: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 600;
}

.apx-empty-state {
  border: 1px solid var(--apx-color-line);
  border-radius: 20px;
  padding: 32px;
  color: var(--apx-color-muted);
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
}

.apx-single {
  padding: 72px 0 96px;
}

.apx-single-shell {
  width: min(820px, calc(100% - 48px));
  margin: 0 auto;
}

.apx-single-header {
  margin-bottom: 44px;
  text-align: center;
}

.apx-single-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-bottom: 18px;
  color: var(--apx-color-muted);
  font-size: 14px;
  line-height: 20px;
}

.apx-single-title {
  margin: 0;
  color: var(--apx-color-text);
  font-family: var(--apx-font-heading);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0;
}

.apx-content {
  color: var(--apx-color-text);
  font-size: 18px;
  line-height: 1.75;
}

.apx-content > * {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.apx-content h2,
.apx-content h3,
.apx-content h4 {
  margin-top: 1.6em;
  color: var(--apx-color-text);
  line-height: 1.2;
}

.apx-content h2 {
  font-family: var(--apx-font-heading);
  font-size: 36px;
  font-weight: 600;
}

.apx-content h3 {
  font-size: 28px;
  font-weight: 600;
}

.apx-content a {
  color: var(--apx-color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.apx-content blockquote {
  margin-right: 0;
  margin-left: 0;
  border-left: 3px solid var(--apx-color-text);
  padding-left: 24px;
  color: var(--apx-color-muted);
  font-family: var(--apx-font-heading);
  font-size: 24px;
  line-height: 1.45;
}

.apx-content img {
  border-radius: 20px;
}

.apx-content table {
  width: 100%;
  border-collapse: collapse;
}

.apx-content th,
.apx-content td {
  border-bottom: 1px solid var(--apx-color-line);
  padding: 12px;
  text-align: left;
}

.apx-post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 56px;
}

.apx-post-nav a {
  display: block;
  min-height: 96px;
  border: 1px solid var(--apx-color-line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.apx-post-nav-label {
  display: block;
  color: var(--apx-color-muted);
  font-size: 13px;
  line-height: 18px;
}

.apx-post-nav-title {
  display: block;
  margin-top: 8px;
  color: var(--apx-color-text);
  font-weight: 700;
  line-height: 22px;
}

.apx-site-footer {
  padding: 72px 0 28px;
}

.apx-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr);
  gap: 32px;
  border-top: 1px solid rgba(18, 18, 24, 0.1);
  padding-top: 32px;
}

.apx-footer-text {
  max-width: 420px;
  margin: 14px 0 0;
  color: var(--apx-color-muted);
  font-size: 16px;
  line-height: 24px;
}

.apx-footer-title {
  margin: 0 0 12px;
  color: var(--apx-color-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.apx-footer-nav .apx-nav-list {
  display: grid;
  gap: 6px;
}

.apx-footer-nav .apx-nav-link {
  min-height: 30px;
  padding: 4px 0;
}

.apx-footer-bottom {
  margin-top: 40px;
  color: var(--apx-color-muted);
  font-size: 14px;
  line-height: 20px;
}

.apx-footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.apx-widget {
  border: 1px solid rgba(18, 18, 24, 0.08);
  border-radius: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.58);
}

.apx-widget-title {
  margin: 0 0 12px;
  color: var(--apx-color-text);
  font-size: 18px;
  line-height: 24px;
}

@media (max-width: 1024px) {
  .apx-header-inner,
  .apx-container {
    width: min(100% - 40px, 940px);
  }

  .apx-hero-card {
    padding: 72px 56px;
  }

  .apx-hero-title {
    font-size: clamp(44px, 6vw, var(--apx-hero-title-size));
  }

  .apx-hero-floating {
    right: 32px;
    bottom: 32px;
  }
}

@media (max-width: 820px) {
  .apx-site-header {
    min-height: 72px;
  }

  .apx-header-inner {
    grid-template-columns: 1fr auto;
    min-height: 72px;
  }

  .apx-desktop-nav,
  .apx-header-cta {
    display: none;
  }

  .apx-menu-toggle {
    display: inline-flex;
  }

  .apx-mobile-panel {
    position: fixed;
    inset: 72px 16px auto;
    z-index: 45;
    display: block;
    max-height: calc(100vh - 96px);
    border: 1px solid var(--apx-color-line);
    border-radius: 20px;
    padding: 14px;
    background: rgba(247, 247, 248, 0.96);
    box-shadow: 0 24px 60px rgba(18, 18, 24, 0.16);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    overflow: auto;
    backdrop-filter: blur(14px);
  }

  .apx-menu-open .apx-mobile-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .apx-mobile-panel .apx-nav-list {
    display: grid;
    gap: 4px;
  }

  .apx-mobile-panel .apx-nav-link {
    width: 100%;
    justify-content: space-between;
    border-radius: 12px;
    padding: 12px 14px;
  }

  .apx-mobile-panel .apx-button {
    width: 100%;
    margin-top: 12px;
  }

  .apx-hero {
    padding: 28px 0 52px;
  }

  .apx-hero-card {
    display: flex;
    min-height: 760px;
    flex-direction: column;
    justify-content: flex-start;
    border-radius: 28px;
    padding: 32px 24px 0;
    overflow: hidden;
  }

  .apx-hero-copy {
    max-width: none;
  }

  .apx-hero-title {
    font-size: clamp(36px, 12vw, 48px);
    line-height: 1.08;
  }

  .apx-hero-intro {
    font-size: 16px;
    line-height: 24px;
  }

  .apx-hero-actions {
    display: grid;
    gap: 8px;
    margin-top: 24px;
  }

  .apx-hero-actions .apx-button {
    width: 100%;
  }

  .apx-hero-stats {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 36px;
  }

  .apx-stat-value {
    font-size: 30px;
  }

  .apx-hero-media {
    position: relative;
    right: auto;
    bottom: auto;
    width: calc(100% + 48px);
    height: 340px;
    margin: auto -24px 0;
    justify-content: center;
  }

  .apx-hero-media img,
  .apx-hero-media-placeholder {
    width: 100%;
    height: 100%;
  }

  .apx-hero-floating {
    right: 24px;
    bottom: 24px;
    width: calc(100% - 48px);
    padding: 22px 24px;
  }

  .apx-section {
    padding: 52px 0;
  }

  .apx-section-title {
    font-size: 32px;
    line-height: 40px;
  }

  .apx-about-grid,
  .apx-post-grid,
  .apx-footer-grid,
  .apx-footer-widgets,
  .apx-post-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .apx-header-inner,
  .apx-container,
  .apx-single-shell {
    width: calc(100% - 32px);
  }

  .apx-brand-text {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .apx-hero-card {
    min-height: 790px;
    padding: 28px 16px 0;
  }

  .apx-hero-media {
    width: calc(100% + 32px);
    margin-right: -16px;
    margin-left: -16px;
  }

  .apx-hero-floating {
    right: 16px;
    bottom: 16px;
    width: calc(100% - 32px);
  }

  .apx-post-body,
  .apx-about-card {
    padding: 22px;
  }
}
