/* The Coin Daily — clean editorial styling
   Designed to read like a news site, not a tech blog. */

:root {
  --c-bg: #ffffff;
  --c-fg: #15171a;
  --c-muted: #5b6470;
  --c-accent: #c8511f;
  --c-rule: #e6e9ef;
  --c-card: #fafbfc;
  --c-link: #1a4ca0;
  --c-link-hover: #c8511f;
  --c-banner-bg: #fff8f1;
  --c-banner-border: #ffd9b8;

  --f-serif: Georgia, "Times New Roman", "DejaVu Serif", serif;
  --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --w-content: 720px;
  --w-wide: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--c-fg);
  background: var(--c-bg);
}

a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

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

.container { max-width: var(--w-wide); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--c-muted); }
.small { font-size: 0.875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

ul.bare { list-style: none; padding: 0; margin: 0; }
ul.bare li { margin: 0.25rem 0; }

/* ---------------- Header ---------------- */

.site-header {
  border-bottom: 1px solid var(--c-rule);
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--c-fg);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--c-fg); text-decoration: none; }
.brand-name { font-family: var(--f-serif); font-size: 1.375rem; }

.primary-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.primary-nav a {
  color: var(--c-fg);
  font-size: 0.95rem;
  font-weight: 500;
}
.primary-nav a:hover { color: var(--c-accent); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--c-rule);
  padding: 0.375rem 0.625rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.125rem;
}

@media (max-width: 720px) {
  .primary-nav { display: none; }
  .nav-toggle { display: inline-block; }
  body.nav-open .primary-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--c-bg);
    padding: 1rem 1.25rem;
    border: 1px solid var(--c-rule);
    border-top: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }
}

/* ---------------- Hero / homepage ---------------- */

.hero {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--c-rule);
  margin-bottom: 2rem;
}
.hero h1 {
  font-family: var(--f-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.hero-tagline {
  font-size: 1.125rem;
  color: var(--c-muted);
  margin: 0 0 0.75rem;
}
.hero-disclosure {
  color: var(--c-muted);
  margin: 0;
}

/* ---------------- Section header ---------------- */

.section-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--c-rule);
  margin-bottom: 2rem;
}
.section-header h1 {
  font-family: var(--f-serif);
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

/* ---------------- Article grid ---------------- */

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 0 0 3rem;
}

.article-card {
  border-bottom: 1px solid var(--c-rule);
  padding-bottom: 1.5rem;
}
.article-card .card-meta {
  font-size: 0.8rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}
.article-card .card-meta a { color: var(--c-accent); font-weight: 600; }
.article-card h3 {
  font-family: var(--f-serif);
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
.article-card h3 a { color: var(--c-fg); }
.article-card h3 a:hover { color: var(--c-accent); text-decoration: none; }
.article-card .card-deck {
  margin: 0 0 0.75rem;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.article-card .card-byline { margin: 0; }

/* ---------------- Article page ---------------- */

.article {
  max-width: var(--w-content);
  margin: 2rem auto 4rem;
}

.article-header { margin-bottom: 1.5rem; }
.article-meta {
  font-size: 0.85rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}
.article-meta a { color: var(--c-accent); font-weight: 600; }
.article-header h1 {
  font-family: var(--f-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.article-deck {
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--c-muted);
  margin: 0 0 1rem;
}
.byline { margin: 0; font-size: 0.95rem; }

.ai-disclosure-banner {
  background: var(--c-banner-bg);
  border: 1px solid var(--c-banner-border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* Contact form on /contact/. Adapted from Formspree's reference example —
   rounded pill inputs, soft 1px inset border, brand-orange accents on
   focus and submit. Using the site's existing font stack rather than
   pulling in Figtree/Poppins to keep page weight down and avoid
   typography clashes with the rest of the publication. */
.fs-form {
  display: grid;
  row-gap: 1.5rem;
  max-width: 600px;
  margin: 2rem 0 3rem;
}
.fs-field {
  display: flex;
  flex-direction: column;
  row-gap: 0.5rem;
}
.fs-label {
  color: #15171a;
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25rem;
}
.fs-optional {
  font-weight: 400;
  color: #6b7177;
  font-size: 0.85rem;
  margin-left: 0.4rem;
}
.fs-description {
  color: #6b7177;
  display: block;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}
.fs-input,
.fs-select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 9999px;
  border-width: 0;
  box-shadow: #d1d1d1 0 0 0 1px inset;
  color: #15171a;
  font-size: 1rem;
  font-family: inherit;
  height: 3rem;
  line-height: 1.5rem;
  outline: none;
  padding: 0 1rem;
  background-color: #fff;
  transition: box-shadow 0.15s;
  box-sizing: border-box;
  width: 100%;
}
.fs-input:focus-visible,
.fs-select:focus-visible {
  box-shadow: #c8511f 0 0 0 2px inset;
}
.fs-input::placeholder,
.fs-textarea::placeholder {
  color: #6b7177;
}
.fs-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.625em 1.625em;
  padding-right: 2.875rem;
}
.fs-textarea {
  appearance: none;
  border-radius: 0.75rem;
  border-width: 0;
  box-shadow: #d1d1d1 0 0 0 1px inset;
  color: #15171a;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5rem;
  outline: none;
  padding: 0.75rem 1rem;
  resize: vertical;
  min-height: 9rem;
  transition: box-shadow 0.15s;
  box-sizing: border-box;
  width: 100%;
  background-color: #fff;
}
.fs-textarea:focus-visible {
  box-shadow: #c8511f 0 0 0 2px inset;
}
.fs-honeypot {
  position: absolute;
  left: -9999px;
}
.fs-button-group {
  display: flex;
  flex-direction: row-reverse;
  column-gap: 1rem;
  margin-top: 0.25rem;
}
.fs-button {
  background-color: #c8511f;
  border-radius: 9999px;
  border: 0;
  color: white;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.5rem;
  padding: 0.75rem 2rem;
  transition: background-color 200ms;
}
.fs-button:hover {
  background-color: #b04719;
}
.fs-button:focus-visible {
  background-color: #b04719;
  outline: 4px solid #fdcf4c;
}

/* AI badge next to a synthetic author's byline. Renders as a subtle
   uppercase tag — the goal is at-glance disclosure, not visual noise. */
.ai-badge {
  display: inline-block;
  font-size: 0.7em;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.05em 0.4em;
  margin: 0 0.25em;
  border: 1px solid currentColor;
  border-radius: 3px;
  vertical-align: 0.1em;
  opacity: 0.75;
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0 2rem;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-body {
  font-size: 1.075rem;
  line-height: 1.7;
}
.article-body h2 {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-family: var(--f-serif);
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}
.article-body p { margin: 0 0 1.1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.1rem 1.25rem; padding: 0; }
.article-body li { margin: 0.35rem 0; }
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--c-accent);
  font-style: italic;
  color: var(--c-muted);
}

.sources {
  margin: 2.5rem 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}
.sources h2 {
  font-family: var(--f-serif);
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
}
.sources ul { margin: 0; padding-left: 1.25rem; }
.sources li { margin: 0.4rem 0; font-size: 0.95rem; }

.article-footer { margin-top: 2rem; }
.disclaimer {
  background: #f7f8fa;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 0 0 1rem;
  color: var(--c-muted);
  line-height: 1.5;
}

/* ---------------- Page (static) ---------------- */

.page {
  max-width: var(--w-content);
  margin: 2rem auto 4rem;
}
.page-header h1 {
  font-family: var(--f-serif);
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
.page-body {
  font-size: 1.05rem;
  line-height: 1.7;
}
.page-body h2 { font-family: var(--f-serif); font-size: 1.5rem; margin: 1.75rem 0 0.5rem; }
.page-body h3 { font-family: var(--f-serif); font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.page-body p { margin: 0 0 1rem; }
.page-body ul, .page-body ol { margin: 0 0 1rem 1.25rem; }

/* ---------------- Author page ---------------- */

.author-page {
  max-width: var(--w-wide);
  margin: 2rem auto 4rem;
}
.author-header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.author-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--c-rule);
}
.author-header h1 {
  font-family: var(--f-serif);
  font-size: 2rem;
  margin: 0 0 0.25rem;
}
.author-links {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.author-bio { max-width: var(--w-content); margin: 1.5rem 0 2rem; }
.author-articles h2 {
  font-family: var(--f-serif);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--c-rule);
  margin-top: 3rem;
  background: #fafbfc;
  padding: 2.5rem 0 1rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
}
.footer-grid h3 {
  font-family: var(--f-serif);
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}
.footer-grid h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-fg);
}
.footer-grid a { color: var(--c-fg); }
.footer-grid a:hover { color: var(--c-accent); }
.footer-base {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-rule);
}

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
