/* CFO Day — global layout and theme (static news site) */

:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --ink: #141821;
  --muted: #5c6370;
  --line: #e2e0da;
  --accent: #b45309;
  --accent-soft: #fff7ed;
  --link: #1d4ed8;
  --link-hover: #1e3a8a;
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06);
  --radius: 10px;
  --font: "Source Serif 4", "Georgia", serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --narrow: 42rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--link-hover);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.header-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-subscribe {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.42rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.btn-subscribe:hover {
  border-color: #2d5a43;
  color: #2d5a43;
}

.btn-subscribe:focus-visible {
  outline: 2px solid #2d5a43;
  outline-offset: 2px;
}

.brand:hover {
  color: var(--ink);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

/* Primary nav — desktop */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

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

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink);
}

.nav-toggle-bar::before {
  top: -6px;
}

.nav-toggle-bar::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

@media (min-width: 861px) {
  .header-end {
    gap: 1.25rem;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
    z-index: 2;
  }

  .site-nav.is-open {
    max-height: 420px;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1.25rem 1rem;
    gap: 0;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav li:last-child a {
    border-bottom: none;
  }
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}

.hero {
  margin-bottom: 2.5rem;
}

.hero-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36rem;
  margin: 0;
}

.section-title {
  font-family: var(--font);
  font-size: 1.5rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-thumb img {
  transform: scale(1.03);
}

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

.card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.card h2 {
  font-family: var(--font);
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

.card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.card h2 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: auto;
}

.category-block {
  margin-bottom: 2.75rem;
}

.category-block .grid-cards {
  margin-top: 1rem;
}

/* Article page */
.article-page header {
  margin-bottom: 1.5rem;
}

.article-page .eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.article-page h1 {
  font-family: var(--font);
  font-size: clamp(1.65rem, 3.5vw, 2.1rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.article-byline {
  font-size: 0.9rem;
  color: var(--muted);
}

.article-media {
  margin: 0 0 1.5rem;
  max-width: min(100%, 52rem);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.article-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  vertical-align: middle;
}

.article-body {
  font-family: var(--font);
  font-size: 1.08rem;
  max-width: var(--narrow);
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

/* Legal pages */
.legal-page h1 {
  font-family: var(--font);
  font-size: 1.85rem;
  margin-bottom: 0.25rem;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-family: var(--sans);
  font-size: 1.15rem;
  margin: 1.75rem 0 0.65rem;
}

.legal-page p,
.legal-page li {
  max-width: 48rem;
}

.legal-page ul {
  padding-left: 1.25rem;
}

.legal-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.legal-page th,
.legal-page td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.legal-page th {
  background: var(--accent-soft);
}

/* Footer */
.site-footer {
  background: #121826;
  color: #e8eaef;
  margin-top: 3rem;
  padding: 2.5rem 1.25rem 2rem;
  font-family: var(--sans);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.footer-disclaimer {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.footer-disclaimer-icon {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: #fbbf24;
}

.footer-disclaimer-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #9ca3af;
  max-width: 52rem;
}

.footer-disclaimer-text strong {
  color: #e5e7eb;
  font-weight: 600;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (min-width: 780px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
    align-items: flex-start;
  }
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer-logo-row:hover {
  color: #fff;
}

.footer-logo-row img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.footer-logo-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.footer-about-text {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #9ca3af;
  max-width: 28rem;
}

.footer-rule {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 0 0 1rem;
}

.footer-entity {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #9ca3af;
}

.footer-entity p {
  margin: 0 0 0.5rem;
}

.footer-entity strong {
  color: #fff;
  font-size: 0.95rem;
}

.footer-entity a {
  color: #9ca3af;
  text-decoration: none;
}

.footer-entity a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-col-title {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.footer-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.footer-link-list a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-link-list a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.footer-link-accent {
  color: var(--accent);
  font-weight: 600;
}

a.footer-link-accent:hover {
  color: #d97706;
}

.site-footer a {
  text-underline-offset: 3px;
}

.footer-bottom {
  padding-top: 1.35rem;
  font-size: 0.78rem;
  color: #8b939f;
  line-height: 1.5;
}

.footer-bottom a {
  color: #9ca3af;
}

.footer-bottom a:hover {
  color: #fff;
}

/* Subscribe modal */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.subscribe-modal-open {
  overflow: hidden;
}

.subscribe-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.subscribe-modal[hidden] {
  display: none !important;
}

.subscribe-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 33, 0.55);
  cursor: pointer;
}

.subscribe-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #f5f5f0;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(20, 24, 33, 0.2);
}

.subscribe-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.subscribe-modal-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.subscribe-modal-inner {
  padding: 2rem 1.75rem 2.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .subscribe-modal-inner {
    padding: 2.5rem 2rem 2.75rem;
  }
}

.subscribe-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: #2d5a43;
  border-radius: 4px;
}

.subscribe-modal-title {
  font-family: var(--font);
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  font-weight: 700;
  color: #141821;
  margin: 0 0 0.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.subscribe-modal-lede {
  font-family: var(--sans);
  font-size: 1rem;
  color: #5c6370;
  margin: 0 0 1.75rem;
}

.subscribe-plans {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
  text-align: left;
}

@media (min-width: 720px) {
  .subscribe-plans {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.subscribe-plan {
  display: block;
  position: relative;
  margin: 0;
  padding: 1.15rem 1rem 1.25rem;
  border: 1px solid #d1d1c8;
  border-radius: 10px;
  background: #fff;
  font-family: var(--sans);
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  user-select: none;
}

.subscribe-plan:hover {
  border-color: #2d5a43;
}

.subscribe-plan:focus-visible {
  outline: 2px solid #2d5a43;
  outline-offset: 2px;
}

.subscribe-plan.is-selected {
  border-color: #2d5a43;
  box-shadow: 0 0 0 1px #2d5a43;
}

.subscribe-plan--featured {
  border-width: 2px;
  border-color: #2d5a43;
  padding-top: 1.75rem;
}

.subscribe-plan-ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.3rem 0.65rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: #2d5a43;
  border-radius: 4px;
  white-space: nowrap;
}

.subscribe-plan-name {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #141821;
  margin-bottom: 0.35rem;
}

.subscribe-plan-price {
  display: block;
  font-size: 0.95rem;
  color: #5c6370;
  margin-bottom: 0.75rem;
}

.subscribe-price-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: #c5a059;
}

.subscribe-plan-save {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d5a43;
  margin-top: -0.35rem;
  margin-bottom: 0.5rem;
}

.subscribe-plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  color: #5c6370;
  line-height: 1.45;
}

.subscribe-plan-features li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.35rem;
}

.subscribe-coming-soon {
  font-size: 0.8rem;
  color: #7a8f85;
  text-align: center;
  margin: 0.5rem 0 0.75rem;
  font-style: italic;
}

.subscribe-plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #7a8f85;
  font-size: 0.75rem;
}

.subscribe-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 520px;
  margin: 0 auto;
}

@media (min-width: 520px) {
  .subscribe-form-row {
    flex-direction: row;
    align-items: stretch;
  }
}

.subscribe-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-family: var(--sans);
  font-size: 1rem;
  border: 1px solid #d1d1c8;
  border-radius: 8px;
  background: #fff;
}

.subscribe-input:focus {
  outline: 2px solid #2d5a43;
  outline-offset: 1px;
  border-color: #2d5a43;
}

.subscribe-submit {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: #2d5a43;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.subscribe-submit:hover {
  background: #244836;
}

.subscribe-submit:focus-visible {
  outline: 2px solid #141821;
  outline-offset: 2px;
}

.subscribe-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.subscribe-form-note {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: #8b939f;
}

.subscribe-form-error {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #b91c1c;
}

.subscribe-success {
  padding: 1rem 0;
}

.subscribe-success-text {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: #2d5a43;
  font-weight: 600;
  margin: 0;
  line-height: 1.5;
}

a.footer-link-accent[data-open-subscribe] {
  cursor: pointer;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 24px rgba(20, 24, 33, 0.12);
  padding: 1rem 1.25rem 1.15rem;
  display: none;
}

.cookie-banner.is-visible {
  display: block;
}

.cookie-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .cookie-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.cookie-banner p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.cookie-banner strong {
  color: var(--ink);
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #2a3140;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--link);
  border: none;
  text-decoration: underline;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.cookie-panel {
  display: none;
  margin-top: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.cookie-panel.is-open {
  display: block;
}

.cookie-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.cookie-toggle-row:last-of-type {
  border-bottom: none;
}

.cookie-toggle-row span {
  font-size: 0.9rem;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.switch input:checked + .slider {
  background: var(--accent);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .slider {
  opacity: 0.55;
  cursor: not-allowed;
}
