/*
Theme Name: PrepayDesk Yield Maintenance
Theme URI: https://prepaydesk.example.com
Author: PrepayDesk Editorial & Engineering
Description: Zero-plugin, mobile-first WordPress theme featuring an institutional-grade Yield Maintenance Calculator, native SEO/Schema engine, AdSense-ready zero-CLS layout, and pre-published commercial real estate finance guides.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: prepaydesk
*/

:root {
  --pd-bg: #F7F5F0;
  --pd-surface: #FFFFFF;
  --pd-surface-alt: #EFECE4;
  --pd-border: #DDD7CB;
  --pd-border-strong: #C5BDB0;
  --pd-ink: #14221C;
  --pd-ink-muted: #4A5851;
  --pd-accent: #1B5E42;
  --pd-accent-hover: #134631;
  --pd-accent-soft: #E9F3EE;
  --pd-alert: #B85D19;
  --pd-alert-soft: #FDF3EB;
  --pd-danger: #A62626;
  --pd-danger-soft: #FDECEC;
  --pd-radius: 12px;
  --pd-radius-sm: 8px;
  --pd-shadow: 0 2px 10px rgba(20, 34, 28, 0.05);
  --pd-font-heading: 'Fraunces', Georgia, serif;
  --pd-font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pd-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --pd-container: 1200px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background-color: var(--pd-bg);
  color: var(--pd-ink);
  font-family: var(--pd-font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--pd-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover, a:focus-visible {
  color: var(--pd-accent-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--pd-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--pd-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--pd-radius-sm);
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}

.pd-container {
  width: 100%;
  max-width: var(--pd-container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.pd-header {
  background: var(--pd-surface);
  border-bottom: 1px solid var(--pd-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 16px;
}

.pd-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--pd-font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pd-ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.pd-brand:hover {
  text-decoration: none;
  color: var(--pd-accent);
}
.pd-brand-mark {
  width: 32px;
  height: 32px;
  background: var(--pd-accent);
  color: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pd-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.pd-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--pd-ink-muted);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--pd-radius-sm);
  text-decoration: none;
}

.pd-nav a:hover,
.pd-nav li.current-menu-item > a:not([href*="#"]),
.pd-nav a.is-active {
  color: var(--pd-accent);
  background: var(--pd-accent-soft);
}

.pd-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--pd-accent);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--pd-radius-sm);
  text-decoration: none !important;
  white-space: nowrap;
}
.pd-header-cta:hover {
  background: var(--pd-accent-hover);
}

.pd-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-sm);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--pd-ink);
  cursor: pointer;
}

@media (max-width: 900px) {
  .pd-menu-toggle {
    display: inline-flex;
  }
  .pd-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--pd-surface);
    border-bottom: 1px solid var(--pd-border);
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 0 12px 24px rgba(20, 34, 28, 0.08);
  }
  .pd-nav.is-open {
    display: flex;
  }
  .pd-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .pd-nav a {
    width: 100%;
  }
  .pd-header-cta {
    margin-top: 8px;
    width: 100%;
  }
}

/* AdSense Zero-CLS Slots */
.pd-ad-slot {
  margin: 20px auto;
  text-align: center;
  overflow: hidden;
  transition: none;
}
.pd-ad-slot:empty {
  display: none;
  margin: 0;
  height: 0;
}
.pd-ad-slot.has-ad {
  min-height: 90px;
  padding: 8px 0;
}
.pd-ad-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pd-ink-muted);
  margin-bottom: 4px;
}

/* Hero Section */
.pd-hero {
  padding: 32px 0 20px;
}
.pd-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pd-accent);
  background: var(--pd-accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.pd-hero h1 {
  font-family: var(--pd-font-heading);
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.025em;
  color: var(--pd-ink);
}
.pd-hero p {
  font-size: 1.05rem;
  color: var(--pd-ink-muted);
  max-width: 740px;
  margin: 0;
}

/* Content & Typography */
.pd-section {
  padding: 40px 0;
}
.pd-section-title {
  font-family: var(--pd-font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.pd-section-sub {
  color: var(--pd-ink-muted);
  margin: 0 0 24px;
  max-width: 720px;
}

.pd-card {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: 24px;
  box-shadow: var(--pd-shadow);
}

/* Articles Grid */
.pd-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}
.pd-article-card {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.pd-article-card:hover {
  border-color: var(--pd-accent);
  transform: translateY(-2px);
}
.pd-article-meta {
  font-size: 0.78rem;
  color: var(--pd-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-weight: 600;
}
.pd-article-card h3 {
  font-family: var(--pd-font-heading);
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 10px;
}
.pd-article-card h3 a {
  color: var(--pd-ink);
  text-decoration: none;
}
.pd-article-card h3 a:hover {
  color: var(--pd-accent);
}
.pd-article-card p {
  font-size: 0.93rem;
  color: var(--pd-ink-muted);
  margin: 0 0 16px;
}
.pd-read-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--pd-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Single Post / Page */
.pd-prose-wrap {
  max-width: 820px;
  margin: 32px auto 56px;
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
  padding: clamp(22px, 4vw, 44px);
}
.pd-breadcrumbs {
  font-size: 0.84rem;
  color: var(--pd-ink-muted);
  margin-bottom: 16px;
}
.pd-prose h1 {
  font-family: var(--pd-font-heading);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.2;
  margin: 0 0 14px;
}
.pd-prose h2 {
  font-family: var(--pd-font-heading);
  font-size: 1.45rem;
  margin: 28px 0 10px;
}
.pd-prose h3 {
  font-size: 1.15rem;
  margin: 22px 0 8px;
}
.pd-prose p, .pd-prose li {
  font-size: 1.02rem;
  color: var(--pd-ink);
}
.pd-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
}
.pd-prose th, .pd-prose td {
  border: 1px solid var(--pd-border);
  padding: 10px 12px;
  text-align: left;
}
.pd-prose th {
  background: var(--pd-surface-alt);
  font-weight: 700;
}

/* FAQ Accordion */
.pd-faq-list {
  display: grid;
  gap: 12px;
}
.pd-faq-item {
  background: var(--pd-surface);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-sm);
  overflow: hidden;
}
.pd-faq-item summary {
  padding: 16px 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}
.pd-faq-item summary::-webkit-details-marker {
  display: none;
}
.pd-faq-item summary::after {
  content: "+";
  font-family: var(--pd-font-mono);
  font-size: 1.2rem;
  color: var(--pd-accent);
  flex-shrink: 0;
}
.pd-faq-item[open] summary::after {
  content: "−";
}
.pd-faq-body {
  padding: 0 20px 18px;
  color: var(--pd-ink-muted);
  font-size: 0.95rem;
}

/* Contact Form */
.pd-form-grid {
  display: grid;
  gap: 16px;
}
.pd-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.pd-field input,
.pd-field textarea,
.pd-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--pd-border-strong);
  border-radius: var(--pd-radius-sm);
  font-family: var(--pd-font-body);
  font-size: 0.96rem;
  background: #fff;
  color: var(--pd-ink);
}
.pd-field textarea {
  min-height: 130px;
  resize: vertical;
}
.pd-hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.pd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--pd-radius-sm);
  font-family: var(--pd-font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pd-btn-primary {
  background: var(--pd-accent);
  color: #fff;
}
.pd-btn-primary:hover {
  background: var(--pd-accent-hover);
}
.pd-btn-secondary {
  background: var(--pd-surface);
  color: var(--pd-ink);
  border-color: var(--pd-border-strong);
}
.pd-btn-secondary:hover {
  background: var(--pd-surface-alt);
}

.pd-alert-box {
  padding: 14px 16px;
  border-radius: var(--pd-radius-sm);
  margin-bottom: 18px;
  font-size: 0.94rem;
  font-weight: 500;
}
.pd-alert-success {
  background: var(--pd-accent-soft);
  color: var(--pd-accent-hover);
  border: 1px solid var(--pd-accent);
}
.pd-alert-error {
  background: var(--pd-danger-soft);
  color: var(--pd-danger);
  border: 1px solid var(--pd-danger);
}

/* Footer */
.pd-footer {
  background: var(--pd-ink);
  color: #D7DFDA;
  padding: 48px 0 28px;
  margin-top: 48px;
}
.pd-footer a {
  color: #D7DFDA;
}
.pd-footer a:hover {
  color: #FFFFFF;
}
.pd-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
@media (max-width: 768px) {
  .pd-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.pd-footer-title {
  font-family: var(--pd-font-heading);
  color: #FFFFFF;
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.pd-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
}
.pd-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  color: #A4B2AA;
}

/* Cookie Bar */
.pd-cookie-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 680px;
  margin: 0 auto;
  background: var(--pd-ink);
  color: #F4F7F5;
  padding: 16px 20px;
  border-radius: var(--pd-radius);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 999;
  font-size: 0.88rem;
}
.pd-cookie-bar.is-visible {
  display: flex;
}
.pd-cookie-bar a {
  color: #9EE3C0;
  text-decoration: underline;
}
.pd-cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .pd-cookie-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print Stylesheet */
@media print {
  .pd-header, .pd-footer, .pd-ad-slot, .pd-cookie-bar, .pd-no-print, .pd-presets-bar, .pd-action-bar {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .pd-card, .pd-kpi-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  .pd-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
}
