/* ────────────────────────────────────────────────────────────────────────
   Café & Negocios — public site styles
   McKinsey palette + Morning Brew warmth. Mobile-first.
──────────────────────────────────────────────────────────────────────── */

:root {
  --deep-blue:     #051C2C;
  --electric-blue: #2251FF;
  --cyan:          #00A9F4;
  --cream:         #faf8f4;
  --bg:            #ffffff;
  --ink:           #051C2C;
  --ink-soft:      #42526e;
  --muted:         #8c98a4;
  --rule:          #e6e6e6;
  --rule-soft:     #f0f0f0;
  --tint:          #f8f9fb;
  --tint-blue:     #eef2ff;
  --tint-cyan:     #e3f5fe;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { display: block; }

a { color: var(--electric-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ───────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 28px;
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--deep-blue);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-style: italic;
  font-size: 16px;
  border-radius: 8px;
  letter-spacing: -0.02em;
}

.brand-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.12s;
}
.nav-link:hover {
  color: var(--electric-blue);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--electric-blue);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.12s;
  flex-shrink: 0;
}
.nav-cta:hover {
  background: #1a45e0;
  color: #fff;
  text-decoration: none;
}

/* ── Hero + subscribe form ────────────────────────────────────────────── */

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 28px 48px;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--electric-blue);
  margin: 0 0 24px;
}

.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--electric-blue);
  box-shadow: 0 0 0 0 rgba(34, 81, 255, 0.4);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 81, 255, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(34, 81, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 81, 255, 0); }
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--deep-blue);
}
.hero h1 em {
  font-style: italic;
  color: var(--electric-blue);
  font-weight: 500;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 auto 36px;
  max-width: 560px;
}

.subscribe-form {
  max-width: 480px;
  margin: 0 auto;
  text-align: left;
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 24px;
}

.form-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  color: var(--deep-blue);
  text-align: center;
}

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.req { color: var(--electric-blue); }
.optional { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 2px; }

.form-row input,
.form-row select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
  appearance: none;
}
.form-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2342526e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 7px;
  padding-right: 38px;
}
.form-row input:focus,
.form-row select:focus {
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(34, 81, 255, 0.12);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid-2 .form-row { margin-bottom: 14px; }

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.form-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  background: var(--electric-blue);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, transform 0.04s;
  letter-spacing: 0.01em;
}
.form-submit:hover  { background: #1a45e0; }
.form-submit:active { transform: translateY(1px); }
.form-submit:disabled { background: var(--muted); cursor: not-allowed; transform: none; }

.subscribe-msg {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}
.subscribe-msg.ok    { color: #0a7c4a; }
.subscribe-msg.error { color: #b4392f; }

.subscribe-fine {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Latest issue iframe ──────────────────────────────────────────────── */

.latest, .recent-stories, .issue-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px 48px;
}

.latest-header {
  border-top: 2px solid var(--deep-blue);
  margin-bottom: 24px;
  padding-top: 28px;
}
.latest-header h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--deep-blue);
}

.latest-frame {
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}

.latest-loading, .latest-empty {
  margin: 0;
  padding: 60px 28px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.latest-iframe {
  width: 100%;
  border: none;
  display: block;
  background: var(--bg);
}

/* ── Historias recientes grid ─────────────────────────────────────────── */

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

.story-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.story-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(5, 28, 44, 0.08);
  border-color: rgba(34, 81, 255, 0.25);
  text-decoration: none;
}

.story-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--tint);
  overflow: hidden;
}
.story-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 36px;
  color: var(--muted);
}
.story-card-image.no-image::after { content: '☕'; }

.story-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-block;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  color: #fff;
}
.story-cat-global { background: var(--electric-blue); }
.story-cat-local  { background: var(--cyan); }

.story-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.story-card-date {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.story-card-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--deep-blue);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stories-loading, .stories-empty, .stories-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.stories-error { color: #b4392f; }

/* ── Individual story page ────────────────────────────────────────────── */

.story-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}

.story-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.story-breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}
.story-breadcrumb a:hover {
  color: var(--electric-blue);
  border-bottom-color: var(--electric-blue);
}
.story-breadcrumb-sep { color: var(--muted); }

.story-cat {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  color: #fff;
}

.story-content {
  /* The chunk we render here is the original table-based email HTML for the
     story (card with image, body, "why it matters" callout, social row).
     We constrain its width and let its own inline styles do the rest. */
  max-width: 100%;
  margin: 0;
}
.story-content table { max-width: 100% !important; }
.story-content img   { max-width: 100% !important; height: auto !important; }

.story-cta {
  margin-top: 40px;
  padding: 32px 28px;
  background: linear-gradient(135deg, var(--electric-blue) 0%, #1a45e0 100%);
  border-radius: 14px;
  text-align: center;
  color: #fff;
}
.story-cta h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.story-cta p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}
.story-cta .status-action {
  background: #fff;
  color: var(--electric-blue);
}
.story-cta .status-action:hover {
  background: #f0f4ff;
}

/* ── Status / unsubscribe / 404 page ─────────────────────────────────── */

.status-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 28px 64px;
}
.status-card {
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 40px 32px;
  text-align: center;
}
.status-icon {
  display: inline-block;
  font-size: 38px;
  margin-bottom: 14px;
}
.status-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--deep-blue);
}
.status-message {
  margin: 0 0 22px;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
}
.status-action {
  display: inline-block;
  padding: 12px 22px;
  background: var(--electric-blue);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.12s;
}
.status-action:hover { background: #1a45e0; text-decoration: none; }
.status-loading {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.footer {
  margin-top: 48px;
  padding: 28px;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.footer p { margin: 0; }

/* ── Reviews ─────────────────────────────────────────────────────────── */

.reviews {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 56px;
}

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

.review-card {
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-stars {
  font-size: 16px;
  letter-spacing: 0.18em;
  color: var(--cyan);
  line-height: 1;
}

.review-quote {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.review-person {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}

.review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--electric-blue);
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.review-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-name {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.review-role {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* ── Advertise form ─────────────────────────────────────────────────── */

.advertise {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px 56px;
}

.advertise-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}

.advertise-panel {
  background: linear-gradient(160deg, var(--deep-blue) 0%, #0b2540 100%);
  color: #fff;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.advertise-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 14px;
}

.advertise-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: #fff;
}

.advertise-copy {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.86);
  margin: 0;
}

.advertise-form {
  background: var(--bg);
  padding: 36px 36px 32px;
  display: flex;
  flex-direction: column;
}

.advertise-form textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.advertise-form textarea:focus {
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(34, 81, 255, 0.12);
}

/* ── Smooth scroll + anchor offset for sticky nav ───────────────────── */

html { scroll-behavior: smooth; }
:target, [id] { scroll-margin-top: 88px; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .advertise-grid { grid-template-columns: 1fr; }
  .advertise-panel { padding: 32px 28px; }
}

@media (max-width: 600px) {
  .nav { padding: 12px 18px; }
  .hero { padding: 44px 20px 36px; }
  .hero h1 { font-size: 34px; }
  .lede { font-size: 16px; margin-bottom: 28px; }
  .subscribe-form { padding: 20px; }
  .form-grid-2 { grid-template-columns: 1fr; gap: 0; }

  .latest, .recent-stories, .issue-page, .reviews, .advertise { padding: 0 20px 36px; }
  .latest-header h2 { font-size: 22px; }

  .stories-grid { grid-template-columns: 1fr; gap: 18px; }
  .story-card-image { aspect-ratio: 16 / 9; }
  .story-card-title { font-size: 16px; -webkit-line-clamp: 4; }

  .story-page { padding: 24px 20px 36px; }
  .story-cta { padding: 28px 22px; }
  .story-cta h2 { font-size: 20px; }

  .status-page { padding: 60px 20px 48px; }
  .status-card { padding: 32px 24px; }
  .status-title { font-size: 22px; }

  .reviews-grid { grid-template-columns: 1fr; gap: 16px; }
  .review-card { padding: 24px 22px 22px; }
  .review-quote { font-size: 16px; }

  .advertise-panel { padding: 28px 22px; }
  .advertise-title { font-size: 26px; }
  .advertise-form { padding: 24px 22px 22px; }

  .nav-cta { padding: 9px 14px; font-size: 13px; }
  .brand-text { font-size: 17px; }
}
