/*
Theme Name: Compounding Returns
Theme URI: https://compoundingreturns.com/
Author: Compounding Returns
Description: Minimalist black and white theme for compoundingreturns.com. Compound interest calculators, guides, tables, a glossary, investor profiles and a quotes library. Everything is built into the theme. No plugins required.
Version: 1.2.0
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: compounding-returns
*/

:root {
  --cr-black: #000;
  --cr-white: #fff;
  --cr-grey: #666;
  --cr-light: #e5e5e5;
  --cr-faint: #f5f5f5;
  --cr-accent: #0f8a4a;
  --cr-accent-dark: #0b6b39;
  --cr-accent-light: #e6f4ec;
  --cr-cost: #d64545;
  --cr-neutral: #b0bec5;
  --cr-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cr-max: 760px;
  --cr-wide: 1040px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--cr-font);
  font-size: 18px;
  line-height: 1.6;
  color: var(--cr-black);
  background: var(--cr-white);
}

a { color: var(--cr-black); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; margin: 0 0 16px; letter-spacing: -0.01em; }
h1 { font-size: 40px; margin-bottom: 20px; }
h2 { font-size: 26px; margin-top: 48px; }
h3 { font-size: 20px; margin-top: 32px; }
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 24px; }
li { margin-bottom: 6px; }
img { max-width: 100%; height: auto; }
code { font-family: Menlo, Consolas, monospace; font-size: 15px; background: var(--cr-faint); padding: 2px 6px; }
hr { border: 0; border-top: 1px solid var(--cr-black); margin: 48px 0; }
small, .cr-small { font-size: 15px; color: var(--cr-grey); }

.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* Layout */
.cr-wrap { max-width: var(--cr-max); margin: 0 auto; padding: 0 20px; }
.cr-wrap-wide { max-width: var(--cr-wide); margin: 0 auto; padding: 0 20px; }

/* Header */
.cr-header { border-bottom: 1px solid var(--cr-black); }
.cr-header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.cr-logo { font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.cr-logo:hover { text-decoration: underline; }
.cr-nav { display: flex; gap: 22px; }
.cr-nav a { text-decoration: none; font-size: 15px; }
.cr-nav a:hover, .cr-nav a.is-active { text-decoration: underline; }
.cr-nav-toggle { display: none; background: none; border: 1px solid var(--cr-black); font: inherit; font-size: 14px; padding: 6px 12px; cursor: pointer; }

@media (max-width: 720px) {
  .cr-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--cr-white); border-bottom: 1px solid var(--cr-black); flex-direction: column; gap: 0; padding: 8px 20px 16px; z-index: 10; }
  .cr-nav.is-open { display: flex; }
  .cr-nav a { padding: 10px 0; font-size: 17px; }
  .cr-nav-toggle { display: block; }
  .cr-header { position: relative; }
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  body { font-size: 17px; }
}

/* Main */
.cr-main { padding: 48px 0 72px; }
.cr-crumbs { font-size: 14px; color: var(--cr-grey); margin-bottom: 20px; }
.cr-crumbs a { color: var(--cr-grey); }
.cr-lead { font-size: 21px; color: var(--cr-black); }
.cr-intro p { font-size: 19px; }

/* Footer */
.cr-footer { border-top: 1px solid var(--cr-black); padding: 32px 0 40px; font-size: 14px; color: var(--cr-grey); }
.cr-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.cr-footer a { color: var(--cr-grey); }
.cr-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.cr-footer-disclaimer { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--cr-light); max-width: 760px; }
.cr-footer-disclaimer p { margin: 0 0 8px; }
.cr-footer-disclaimer strong { color: var(--cr-black); }
.cr-disclaimer { border: 1px solid var(--cr-black); padding: 16px 20px; margin: 32px 0 0; font-size: 15px; }
.cr-disclaimer p { margin: 0 0 8px; }
.cr-disclaimer p:last-child { margin-bottom: 0; }

/* Calculator */
.cr-calc { border: 1px solid var(--cr-black); padding: 28px; margin: 0 0 40px; }
.cr-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
@media (max-width: 600px) { .cr-calc-grid { grid-template-columns: 1fr; } .cr-calc { padding: 20px; } }
.cr-field { display: flex; flex-direction: column; }
.cr-field label { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.cr-field-hint { font-size: 13px; color: var(--cr-grey); margin-top: 5px; }
.cr-input { position: relative; display: flex; align-items: center; border: 1px solid var(--cr-black); background: var(--cr-white); height: 48px; }
.cr-input:focus-within { outline: 2px solid var(--cr-accent); outline-offset: 1px; border-color: var(--cr-accent); }
.cr-input input, .cr-input select { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 18px; color: var(--cr-black); padding: 0 12px; height: 100%; width: 100%; outline: none; -webkit-appearance: none; appearance: none; border-radius: 0; }
.cr-input select { padding-right: 36px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='black' stroke-width='1.5'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
.cr-input .cr-pre, .cr-input .cr-suf { font-size: 18px; color: var(--cr-black); padding: 0 0 0 12px; user-select: none; }
.cr-input .cr-suf { padding: 0 12px 0 0; }
.cr-input .cr-pre + input { padding-left: 4px; }
.cr-input input.has-suf { padding-right: 4px; text-align: right; }
.cr-input input::-webkit-outer-spin-button, .cr-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cr-input input[type=number] { -moz-appearance: textfield; }
.cr-input.is-error { border-color: #c00; }

.cr-actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.cr-btn { font: inherit; font-size: 16px; font-weight: 700; background: var(--cr-accent); color: var(--cr-white); border: 1px solid var(--cr-accent); padding: 12px 24px; cursor: pointer; text-decoration: none; }
.cr-btn:hover { background: var(--cr-accent-dark); border-color: var(--cr-accent-dark); color: var(--cr-white); }
.cr-btn-ghost { background: var(--cr-white); color: var(--cr-black); border-color: var(--cr-black); }
.cr-btn-ghost:hover { background: var(--cr-black); border-color: var(--cr-black); color: var(--cr-white); }

.cr-results { margin-top: 28px; border-top: 1px solid var(--cr-black); padding-top: 24px; }
.cr-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.cr-card { border: 1px solid var(--cr-light); padding: 16px; }
.cr-card.is-primary { border-color: var(--cr-accent); background: var(--cr-accent-light); }
.cr-card.is-primary .cr-card-value { color: var(--cr-accent-dark); }
.cr-card-label { font-size: 13px; color: var(--cr-grey); margin-bottom: 4px; }
.cr-card-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; word-break: break-word; }
.cr-card-sub { font-size: 13px; color: var(--cr-grey); margin-top: 4px; }
.cr-note { font-size: 14px; color: var(--cr-grey); margin-top: 16px; }
.cr-error { color: #c00; font-size: 15px; margin-top: 12px; }

.cr-chart { margin-top: 24px; }
.cr-chart svg { width: 100%; height: auto; display: block; }
.cr-chart-legend { display: flex; gap: 20px; font-size: 13px; color: var(--cr-grey); margin-top: 8px; flex-wrap: wrap; }
.cr-chart-legend span:before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; background: var(--cr-sw, #000); }
.cr-chart-legend span.is-line:before { height: 3px; vertical-align: 3px; }

/* Tables */
.cr-table-wrap { overflow-x: auto; margin: 24px 0; -webkit-overflow-scrolling: touch; }
table.cr-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cr-table th, .cr-table td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--cr-light); white-space: nowrap; }
.cr-table th { border-bottom: 1px solid var(--cr-black); font-weight: 700; }
.cr-table th:first-child, .cr-table td:first-child { text-align: left; }
.cr-table tr.is-total td { font-weight: 700; border-top: 1px solid var(--cr-black); }
.cr-table-toggle { margin-top: 12px; }

/* Formula box */
.cr-formula { border-left: 3px solid var(--cr-accent); padding: 12px 18px; margin: 20px 0; font-family: Menlo, Consolas, monospace; font-size: 16px; background: var(--cr-faint); overflow-x: auto; }
.cr-formula-key { font-size: 15px; color: var(--cr-grey); }

/* Lists of links */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 32px; padding: 0; margin: 0 0 24px; list-style: none; }
.cr-grid li { border-bottom: 1px solid var(--cr-light); padding: 12px 0; margin: 0; }
.cr-grid a { text-decoration: none; }
.cr-grid a:hover { text-decoration: underline; }
.cr-grid .cr-grid-desc { display: block; font-size: 14px; color: var(--cr-grey); margin-top: 2px; }
.cr-list { list-style: none; padding: 0; margin: 0 0 24px; }
.cr-list li { border-bottom: 1px solid var(--cr-light); padding: 12px 0; }
.cr-list a { text-decoration: none; }
.cr-list a:hover { text-decoration: underline; }
.cr-list .cr-small { margin-left: 8px; }

.cr-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 56px; }
.cr-section-head h2 { margin-top: 0; }
.cr-section-head a { font-size: 15px; white-space: nowrap; }

/* FAQ */
.cr-faq h3 { font-size: 18px; margin-top: 28px; }

/* Related */
.cr-related { margin-top: 56px; border-top: 1px solid var(--cr-black); padding-top: 24px; }
.cr-related h2 { margin-top: 0; font-size: 20px; }

/* Quotes */
.cr-quote-list { list-style: none; padding: 0; margin: 0; }
.cr-quote { border-bottom: 1px solid var(--cr-light); padding: 24px 0; margin: 0; }
.cr-quote figure { margin: 0; }
.cr-quote blockquote { margin: 0; font-size: 21px; line-height: 1.45; letter-spacing: -0.005em; }
.cr-quote figcaption { margin-top: 10px; font-size: 15px; color: var(--cr-grey); }
.cr-quote figcaption a { color: var(--cr-grey); }
.cr-quote-tools { font-size: 14px; color: var(--cr-grey); margin: 0 0 8px; }
.cr-letter-nav { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 15px; margin: 0 0 24px; }
.cr-letter-nav a { text-decoration: none; }
.cr-letter-nav a:hover { text-decoration: underline; }
.cr-letter { margin-top: 36px; font-size: 22px; border-bottom: 1px solid var(--cr-black); padding-bottom: 6px; }
.cr-stats { display: flex; gap: 32px; flex-wrap: wrap; margin: 0 0 32px; }
.cr-stat-value { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--cr-accent-dark); }
.cr-stat-label { font-size: 14px; color: var(--cr-grey); }

/* Home */
.cr-hero { padding: 24px 0 8px; }
.cr-hero h1 { font-size: 48px; margin-bottom: 12px; }
.cr-hero p { font-size: 21px; max-width: 640px; }
@media (max-width: 720px) { .cr-hero h1 { font-size: 34px; } .cr-hero p { font-size: 18px; } }
.cr-home-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 24px; }
.cr-home-section { border-top: 1px solid var(--cr-black); padding-top: 16px; }
.cr-home-section h3 { margin-top: 0; font-size: 18px; }
.cr-home-section p { font-size: 15px; color: var(--cr-grey); }

/* Glossary */
.cr-def dt { font-weight: 700; margin-top: 20px; }
.cr-def dd { margin: 4px 0 0; }

/* WordPress content fallbacks */
.cr-entry img { display: block; margin: 24px 0; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 24px auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 14px; color: var(--cr-grey); }
.sticky, .bypostauthor, .gallery-caption { display: inherit; }
.cr-entry blockquote { border-left: 3px solid var(--cr-black); margin: 24px 0; padding: 4px 20px; }
.cr-entry table { width: 100%; border-collapse: collapse; }
.cr-entry th, .cr-entry td { border-bottom: 1px solid var(--cr-light); padding: 8px; text-align: left; }

@media print {
  .cr-header, .cr-footer, .cr-actions, .cr-related { display: none; }
}
