/* ===========================================================
   Two Shores — theme editorial náutico
   =========================================================== */

:root {
  --navy: #16304F;
  --oxblood: #5B0F1F;
  --cream: #F2EBDC;
  --parchment: #EAE1CC;
  --rust: #B65431;
  --rust-dim: #8C4227;
  --line: #D9CDAE;
  --graphite: #4A4038;

  --font-serif: 'Domine', Georgia, serif;
  --font-sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--graphite);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--rust-dim); }

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

/* ---------- Top bar (global) ---------- */

.ts-topbar {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ts-topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.ts-lockup {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-weight: 700; font-size: 17px;
  color: #fff; letter-spacing: 0.01em;
}
.ts-lockup:hover { color: var(--parchment); }

.ts-lockup-badge {
  width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ts-topbar-right { display: flex; align-items: center; gap: 22px; }

.ts-pillars {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--parchment); text-transform: uppercase; white-space: nowrap;
}

.ts-lang-switch {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  display: flex; align-items: center; gap: 6px;
}
.ts-lang-switch a { color: var(--parchment); }
.ts-lang-switch a:hover { color: #fff; }
.ts-lang-sep { color: #556E8C; }

/* ---------- Secondary nav row (global) ---------- */

.ts-nav { background: var(--parchment); border-bottom: 1px solid var(--line); }
.ts-nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.ts-nav ul.nav {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 26px;
  justify-content: center;
}
.ts-nav ul.nav li { margin: 0; }
.ts-nav ul.nav a {
  display: block; padding: 13px 0; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy);
}
.ts-nav ul.nav a:hover { color: var(--rust); }

/* ---------- Masthead (home) ---------- */

.ts-masthead {
  position: relative; padding: 108px 32px 84px; overflow: hidden;
  background-image: linear-gradient(180deg, rgba(22,48,79,0.58) 0%, rgba(22,48,79,0.86) 100%), url("../images/masthead-bg.jpg");
  background-size: cover; background-position: center 62%; background-repeat: no-repeat;
}
.ts-masthead-inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.ts-masthead-claim {
  font-family: var(--font-serif); font-weight: 700; font-size: 46px; line-height: 1.14;
  color: var(--cream); letter-spacing: -0.01em; margin: 0 0 20px; max-width: 760px;
}
.ts-masthead-sub {
  font-size: 16.5px; color: rgba(242,235,220,0.85); margin: 0 0 28px; max-width: 560px; line-height: 1.6;
}
.ts-masthead-sub strong { color: var(--cream); }
.ts-masthead-btn { font-size: 12.5px; padding: 14px 30px; }

/* ---------- Shared section width ---------- */

.ts-featured-inner, .ts-latest-inner, .ts-newsletter-inner, .ts-tag-header-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 32px;
}

.ts-eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: var(--rust); text-transform: uppercase; margin-bottom: 16px;
}
.ts-eyebrow-rule { padding-bottom: 12px; }

/* ---------- Tag / section archive header ---------- */

.ts-tag-header { padding: 48px 0 8px; }
.ts-tag-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 32px;
  color: var(--navy); margin: 0 0 10px;
}
.ts-tag-desc { font-size: 15px; line-height: 1.6; color: var(--graphite); margin: 0 0 8px; max-width: 640px; }
.ts-tag-empty { font-size: 14px; color: var(--graphite); grid-column: 1 / -1; }

/* ---------- Featured post ---------- */

.ts-featured { padding: 44px 0; border-bottom: 1px solid var(--line); }
.ts-featured-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center;
}
.ts-featured-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 34px; line-height: 1.2;
  color: var(--navy); margin: 0 0 14px;
}
.ts-featured-title:hover { color: var(--rust-dim); }
.ts-featured-excerpt { font-size: 15px; line-height: 1.6; color: var(--graphite); margin: 0 0 16px; }
.ts-readmore {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em;
  color: var(--rust); text-transform: uppercase;
}
.ts-featured-image-link { justify-self: end; width: 100%; }
.ts-featured-image {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 18px; display: block;
}

/* ---------- Latest grid ---------- */

.ts-latest { padding: 44px 0; border-bottom: 1px solid var(--line); }
.ts-latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.ts-card { display: block; }
.ts-card-image {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; margin-bottom: 14px; display: block;
}
.ts-card-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--navy); background: var(--parchment); border: 1px solid var(--navy);
  padding: 4px 9px; margin-bottom: 12px; text-transform: uppercase;
}
.ts-card-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 18px; line-height: 1.3;
  color: var(--navy); margin: 0 0 8px;
}
.ts-card:hover .ts-card-title { color: var(--rust-dim); }
.ts-card-excerpt { font-size: 13px; color: #7A6F60; line-height: 1.5; margin: 0; }

/* ---------- Newsletter CTA ---------- */

.ts-newsletter-cta { background: var(--oxblood); padding: 44px 0; }
.ts-newsletter-cta-inline { margin-top: 56px; }
.ts-newsletter-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap;
}
.ts-newsletter-copy h2 {
  font-family: var(--font-serif); font-weight: 700; font-size: 24px; color: #fff; margin: 0 0 8px;
}
.ts-newsletter-copy p {
  font-size: 13.5px; color: var(--parchment); line-height: 1.55; max-width: 440px; margin: 0;
}
.ts-newsletter-form { min-width: 200px; }
.ts-subscribe-btn {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; background: var(--rust); color: #fff !important; border: 1px solid var(--rust);
  padding: 13px 26px; border-radius: 2px; cursor: pointer;
}
.ts-subscribe-btn:hover { background: var(--rust-dim); border-color: var(--rust-dim); color: #fff !important; }

/* ---------- Post ---------- */

.ts-post { max-width: 720px; margin: 0 auto; padding: 0 32px 64px; }

.ts-post-editionbar {
  display: flex; justify-content: space-between; font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.1em; color: #9A8F7C; text-transform: uppercase;
  padding: 24px 0 20px;
}

.ts-post-header { padding-bottom: 8px; }
.ts-post-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 40px; line-height: 1.15;
  color: var(--navy); margin: 0 0 16px; letter-spacing: -0.01em;
}
.ts-post-standfirst { font-size: 18px; line-height: 1.55; color: var(--graphite); margin: 0 0 18px; }
.ts-post-byline {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; color: #9A8F7C;
  display: flex; gap: 8px; align-items: center; text-transform: uppercase;
}
.ts-byline-sep { color: var(--line); }

.ts-post-feature-image { margin: 28px 0; }
.ts-post-feature-image img { width: 100%; height: auto; display: block; border-radius: 16px; }
.ts-post-feature-image figcaption { font-size: 12.5px; color: #9A8F7C; margin-top: 8px; text-align: center; }

/* ---------- Article body typography ---------- */

.ts-post-content { font-size: 17.5px; line-height: 1.75; color: var(--graphite); margin-top: 24px; }
.ts-post-content h2 {
  font-family: var(--font-serif); font-weight: 700; font-size: 27px; color: var(--navy);
  margin: 44px 0 16px; line-height: 1.28;
}
.ts-post-content h3 {
  font-family: var(--font-serif); font-weight: 700; font-size: 21px; color: var(--navy);
  margin: 36px 0 12px;
}
.ts-post-content p { margin: 0 0 22px; }
.ts-post-content a { border-bottom: 1px solid var(--rust); }
.ts-post-content a:hover { border-color: var(--rust-dim); }
.ts-post-content strong { color: var(--navy); }
.ts-post-content ul, .ts-post-content ol { margin: 0 0 22px; padding-left: 24px; }
.ts-post-content li { margin-bottom: 8px; }
.ts-post-content img { border-radius: 2px; margin: 8px 0; }
.ts-post-content figcaption { font-size: 13px; color: #9A8F7C; margin-top: 8px; }
.ts-post-content hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }

/* Koenig editor width options: images/cards can break out of the narrow text column */
.ts-post-content .kg-width-wide {
  width: 1040px; max-width: 1040px; margin-top: 32px; margin-bottom: 32px;
  position: relative; left: 50%; right: 50%; margin-left: -520px; margin-right: -520px;
}
@media (max-width: 1100px) {
  .ts-post-content .kg-width-wide { width: 100%; max-width: 100%; left: auto; right: auto; margin-left: 0; margin-right: 0; }
}
.ts-post-content .kg-width-full {
  width: 100vw; margin-top: 32px; margin-bottom: 32px;
  position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
}

/* Oxblood data-highlight box — used to emphasize a key stat (e.g. "1 de cada 3
   empresas ya traslada al consumidor..."). Mapped onto the native <blockquote>
   element so it can be inserted simply by writing/pasting a quote block in
   Koenig — no card-menu interaction required. No hardcoded label — language-neutral,
   works on ES and EN posts alike. */
.ts-post-content blockquote {
  margin: 32px 0; padding: 22px 26px; border-left: 4px solid var(--rust);
  background: var(--oxblood); border-radius: 2px;
  font-family: var(--font-serif); font-style: normal; font-weight: 600;
  font-size: 19px; line-height: 1.45; color: #fff;
}
.ts-post-content blockquote strong { color: #fff; text-decoration: underline; text-decoration-color: var(--rust); text-underline-offset: 3px; }

/* Ghost's built-in Callout card — same oxblood treatment, kept for cases where
   Álvaro inserts one manually via the "+" card menu → Callout in the editor. */
.ts-post-content .kg-callout-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--oxblood); color: #fff; padding: 24px 28px; margin: 36px 0; border-radius: 2px;
  border-left: 4px solid var(--rust);
}
.ts-post-content .kg-callout-emoji { display: none; }
.ts-post-content .kg-callout-text {
  font-family: var(--font-serif); font-weight: 600; font-size: 19px; line-height: 1.45;
  color: #fff; margin: 0;
}
.ts-post-content .kg-callout-text strong { color: #fff; text-decoration: underline; text-decoration-color: var(--rust); text-underline-offset: 3px; }

/* "EN 30 SEGUNDOS" / "IN 30 SECONDS" — TL;DR box. Content rule: the very first
   block of every post body must be <h3>EN 30 SEGUNDOS</h3> (or the EN label)
   immediately followed by a <ul> of 3-5 bullets — no class attributes needed,
   Koenig strips them on paste anyway. Targets only the FIRST h3 so a normal h3
   used later in the body (see .ts-post-content h3 above) is unaffected. */
.ts-post-content > h3:first-child {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--oxblood);
  margin: 0; padding: 0; border: none;
}
.ts-post-content > h3:first-child + ul {
  list-style: none; margin: 14px 0 36px; padding: 22px 26px 22px 40px;
  background: var(--parchment); border-left: 4px solid var(--oxblood); border-radius: 2px;
}
.ts-post-content > h3:first-child + ul li {
  position: relative; font-family: var(--font-serif); font-size: 16px;
  line-height: 1.55; color: var(--graphite); margin: 0 0 12px;
}
.ts-post-content > h3:first-child + ul li:last-child { margin-bottom: 0; }
.ts-post-content > h3:first-child + ul li::before {
  content: ""; position: absolute; left: -18px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--rust);
}

/* Ghost bookmark / other kg-cards: keep readable within our column */
.ts-post-content .kg-card { margin: 32px 0; }
.ts-post-content .kg-bookmark-card a { border: 1px solid var(--line); border-radius: 3px; display: flex; text-decoration: none; overflow: hidden; }
.ts-post-content .kg-bookmark-title { font-family: var(--font-serif); color: var(--navy); font-weight: 700; }

.ts-ad-slot {
  margin: 40px 0 0; padding: 22px 24px; background: var(--parchment); border: 1px solid var(--line);
  border-radius: 2px;
}
.ts-ad-label {
  display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #9A8F7C; margin-bottom: 8px;
}
.ts-ad-brand {
  font-family: var(--font-serif); font-weight: 700; font-size: 18px; color: var(--navy);
}
.ts-ad-copy { font-size: 13.5px; color: var(--graphite); margin: 6px 0 0; line-height: 1.55; max-width: 520px; }

.ts-post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.ts-tag-pill {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--navy); background: var(--parchment); border: 1px solid var(--navy); padding: 5px 11px;
}

/* ---------- Eventos (page-eventos.hbs) ---------- */

.ts-events-hero { background: var(--navy); padding: 56px 32px 40px; }
.ts-events-hero-inner { max-width: 1120px; margin: 0 auto; }
.ts-events-hero .ts-eyebrow { color: var(--rust); }
.ts-events-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 38px; line-height: 1.18;
  color: var(--cream); margin: 0 0 12px; max-width: 760px; letter-spacing: -0.01em;
}
.ts-events-sub { font-size: 15px; color: var(--parchment); margin: 0; }

.ts-events-section { padding: 40px 32px; border-bottom: 1px solid var(--line); }
.ts-events-section-inner { max-width: 1120px; margin: 0 auto; }
.ts-events-section-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ts-events-section-title {
  font-family: var(--font-serif); font-weight: 700; font-size: 28px; margin: 0;
  letter-spacing: -0.01em;
}
.ts-events-section-sub {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #9A8F7C;
}
.ts-events-mx .ts-events-section-title { color: var(--navy); }
.ts-events-eu .ts-events-section-title { color: var(--oxblood); }
.ts-events-world .ts-events-section-title { color: var(--rust-dim); }

.ts-events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ts-events-card {
  background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 20px 20px 22px;
  border-top: 4px solid var(--line);
}
.ts-events-mx .ts-events-card { border-top-color: var(--navy); }
.ts-events-eu .ts-events-card { border-top-color: var(--oxblood); }
.ts-events-world .ts-events-card { border-top-color: var(--rust); }
.ts-events-date {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; color: var(--rust); margin-bottom: 10px;
}
.ts-events-name {
  font-family: var(--font-serif); font-weight: 700; font-size: 17px; line-height: 1.32;
  color: var(--navy); margin: 0 0 10px;
}
.ts-events-place {
  display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: #7A6F60;
}

.ts-events-note { padding: 28px 32px 48px; }
.ts-events-note-inner {
  max-width: 1120px; margin: 0 auto; font-size: 13px; color: #7A6F60;
  font-style: italic;
}

@media (max-width: 860px) {
  .ts-events-title { font-size: 28px; }
  .ts-events-grid { grid-template-columns: 1fr; }
  .ts-events-section-head { flex-direction: column; gap: 4px; }
}

/* ---------- Pagination ---------- */

.ts-pagination { text-align: center; padding: 40px 32px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; }

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

.ts-footer { background: var(--navy); margin-top: 0; }
.ts-footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 26px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.ts-footer-brand { font-family: var(--font-serif); font-weight: 700; color: #fff; font-size: 15px; }
.ts-footer-nav { display: flex; gap: 18px; }
.ts-footer-nav a {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--parchment);
  text-transform: uppercase;
}
.ts-footer-nav a:hover { color: #fff; }
.ts-footer-meta { display: flex; align-items: center; gap: 18px; font-family: var(--font-mono); font-size: 10.5px; color: var(--parchment); letter-spacing: 0.05em; }
.ts-footer-meta .ts-lang-switch a { color: var(--parchment); }

/* ---------- Bilingual nav/pillars/footer toggle ----------
   Ghost's {{navigation}} helper is not locale-aware, so the secondary
   nav, header pillars and footer nav are hardcoded in default.hbs as
   duplicate .ts-i18n-es / .ts-i18n-en blocks. By default (Spanish
   pages) the ES block shows and the EN block is hidden. On English
   pages the EN block shows instead, detected two ways:
   - body.tag-en — Ghost's automatic class for any post/page tagged "en".
   - body.lang-en — NOT an automatic Ghost class. routes.yaml's /en/
     collection route (filter tag:en, template custom-en) never gets a
     "template-custom-en" body class from Ghost's body_class helper
     (that only fires for post/page custom templates, not routes.yaml
     collections), so the /en/ homepage's real signal is injected
     explicitly: custom-en.hbs sets {{#contentFor "body_lang"}}lang-en
     {{/contentFor}}, and default.hbs's <body> tag renders it via
     {{{block "body_lang"}}}. Confirmed via a live body-class dump
     (07-sep-2026): the /en/ homepage rendered body class "" before
     this fix, which is why the toggle silently failed there while
     working fine on individual EN posts (tag-en). */

.ts-i18n-en { display: none; }

body.tag-en .ts-pillars.ts-i18n-en,
body.lang-en .ts-pillars.ts-i18n-en { display: inline; }
body.tag-en .ts-pillars.ts-i18n-es,
body.lang-en .ts-pillars.ts-i18n-es { display: none; }

body.tag-en .ts-nav-inner.ts-i18n-en,
body.lang-en .ts-nav-inner.ts-i18n-en { display: block; }
body.tag-en .ts-nav-inner.ts-i18n-es,
body.lang-en .ts-nav-inner.ts-i18n-es { display: none; }

body.tag-en .ts-footer-nav.ts-i18n-en,
body.lang-en .ts-footer-nav.ts-i18n-en { display: flex; }
body.tag-en .ts-footer-nav.ts-i18n-es,
body.lang-en .ts-footer-nav.ts-i18n-es { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .ts-featured-grid { grid-template-columns: 1fr; }
  .ts-featured-image-link { justify-self: stretch; order: -1; }
  .ts-latest-grid { grid-template-columns: 1fr 1fr; }
  .ts-masthead-claim { font-size: 34px; }
  .ts-post-title { font-size: 32px; }
  .ts-pillars,
  body.tag-en .ts-pillars.ts-i18n-en,
  body.lang-en .ts-pillars.ts-i18n-en,
  body.tag-en .ts-pillars.ts-i18n-es,
  body.lang-en .ts-pillars.ts-i18n-es { display: none; }
  .ts-nav ul.nav { gap: 18px; }
}

@media (max-width: 560px) {
  .ts-latest-grid { grid-template-columns: 1fr; }
  .ts-topbar-inner { padding: 12px 20px; }
  .ts-nav-inner { padding: 0 20px; }
  .ts-nav ul.nav { gap: 14px; overflow-x: auto; }
  .ts-masthead { padding: 48px 20px 36px; }
  .ts-masthead-claim { font-size: 28px; }
  .ts-featured-inner, .ts-latest-inner, .ts-newsletter-inner, .ts-footer-inner { padding: 0 20px; }
  .ts-post { padding: 0 20px 48px; }
  .ts-newsletter-inner { flex-direction: column; align-items: flex-start; }
  .ts-post-title { font-size: 28px; }
  .ts-post-content { font-size: 16.5px; }
}
