/* FOREIGN LANES · Visual articles. Shared by the reader and Gutenberg canvas.
   Body, captions, media proportions, chapter rhythm and breakpoints follow
   the Szentendre article. This file is enqueued only for FL Article — Visual. */
:is(.fl-writing, .editor-styles-wrapper) {
  --article-serif: var(--fl-serif, "Newsreader", Georgia, serif);
  --article-ink: var(--fl-ink, #363b31);
  --article-body: var(--fl-body, #4f5546);
  --article-muted: var(--fl-muted, #625f59);
  --article-rule: var(--fl-border, #e2dfd9);
  --article-limit: var(--fl-page-width, 1360px);
  --article-gutter: var(--fl-page-gutter, clamp(24px, 5.7vw, 88px));
  --photo-width: 53%;
  --portrait-photo-width: min(30%, 400px);
  --photo-gap: clamp(32px, 5vw, 76px);
  --chapter-before: clamp(38px, 3.7vw, 52px);
  --chapter-after: clamp(28px, 3vw, 40px);
  color: var(--article-body);
  font: 400 clamp(19px, 1.45vw, 21px)/1.58 var(--article-serif);
}
.fl-site .fl-writing {
  container-type: inline-size;
  width: 100%; max-width: none; margin: 0; padding: 0 0 36px;
}
.editor-styles-wrapper { container-type: inline-size; }
.fl-writing .fl-writing-band,
.editor-styles-wrapper .is-root-container,
.editor-styles-wrapper .editor-post-title__input {
  box-sizing: border-box;
  width: calc(100% - 2 * var(--article-gutter));
  max-width: var(--article-limit);
  margin-inline: auto;
}
.fl-writing .fl-breadcrumbs { padding-block: 24px 30px; }
.fl-writing .fl-article-title,
.editor-styles-wrapper .editor-post-title__input {
  color: var(--article-ink);
  font: 400 clamp(42px, 3.65vw, 62px)/1.08 var(--article-serif);
  letter-spacing: -.03em; text-wrap: wrap; overflow-wrap: break-word;
  margin-block: 0;
}
/* Post-title: match the editable content width and allow author-set breaks. */
.fl-writing .fl-article-title { max-width: var(--article-limit); }
.fl-writing .fl-visual-title-break { display: inline; }
.fl-writing .fl-article-deck { max-width: 680px; margin: 24px 0 0; }
.fl-writing .fl-article-deck p {
  margin: 0; color: var(--article-body);
  font: 400 clamp(20px, 1.65vw, 25px)/1.42 var(--article-serif);
}
.fl-writing .fl-article-reader { margin: 24px 0 0; }
/* One formatting context for the whole story. Paragraph line boxes can flow
   beside a float and resume at the text edge in the very same paragraph. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) {
  display: flow-root; color: var(--article-body); font: inherit; padding: 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > * {
  box-sizing: border-box; max-width: none; margin: 0 0 .85em;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > :is(p, ul, ol) {
  display: block; width: auto; clear: none; overflow: visible;
  color: inherit; font: inherit; margin-inline: 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > :is(h2, h3, h4) {
  clear: both; color: var(--article-ink); font-family: var(--article-serif);
  font-weight: 400; line-height: 1.08; letter-spacing: -.03em;
  overflow-wrap: break-word; text-wrap: wrap;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > h2 {
  font-size: clamp(36px, 3.6vw, 56px);
  margin: var(--chapter-before) 0 clamp(22px, 2.5vw, 34px);
}
/* H3: confident, but quieter than chapter headings (H2). */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > h3 {
  font-size: clamp(25px, 1.85vw, 30px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: -.018em;
  margin: clamp(32px, 2.8vw, 42px) 0 14px;
}
/* Match inline article links in the Cycling Story: terracotta, no underline;
   darker on hover. Keep keyboard focus indication intact. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) :is(p, li, td, blockquote) a {
  color: var(--fl-accent, #ab4907);
  text-decoration: none;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) :is(p, li, td, blockquote) a:hover {
  color: var(--fl-accent-hover, #873b08);
  text-decoration: none;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) :is(p, li, td, blockquote) a:focus-visible {
  outline: 2px solid var(--fl-accent, #ab4907);
  outline-offset: 3px;
}
:is(.fl-writing, .editor-styles-wrapper) :is(.wp-block-image, .wp-block-post-featured-image) {
  box-sizing: border-box; border: 0; border-radius: 0; box-shadow: none;
}
/* Keep intrinsic width/height attributes and WordPress responsive sources.
   Native, explicitly selected image crops retain their inline styles. */
:is(.fl-writing, .editor-styles-wrapper) :is(.wp-block-image, .wp-block-post-featured-image) img {
  display: block; width: 100%; max-width: 100%; height: auto; border-radius: 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image {
  display: block; clear: both; float: none; width: 100%; max-width: 100%; margin: 24px 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image.alignleft {
  float: left; width: var(--photo-width); margin: 0 var(--photo-gap) 22px 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image.alignright {
  float: right; width: var(--photo-width); margin: 0 0 22px var(--photo-gap);
}
/* Vertical Left / Right: original float layout, smaller width; no cropping.
   Keep 'fl-photo-portrait' for compatibility with already published blocks. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image.alignleft.fl-photo-portrait {
  width: var(--portrait-photo-width);
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image.alignright.fl-photo-portrait {
  width: var(--portrait-photo-width);
}
/* Full-width Photo uses the text area. Section Hero bleeds to both page edges. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image.is-style-fl-section-hero,
.editor-styles-wrapper .is-root-container > .wp-block-post-featured-image {
  width: 100cqw; max-width: none; margin-inline: calc((100% - 100cqw) / 2);
}
:is(.fl-writing, .editor-styles-wrapper) :is(.wp-block-image, .wp-block-video, .wp-block-post-featured-image) figcaption {
  display: block; position: static; margin: 9px 0 0; padding: 0; color: var(--article-muted);
  font: 400 11px/1.4 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  text-align: center; letter-spacing: .045em;
}
:is(.fl-writing, .editor-styles-wrapper) .wp-block-image figcaption { font-style: italic; }
:is(.fl-writing, .editor-styles-wrapper) .wp-block-post-featured-image {
  clear: both; float: none; width: 100%; max-width: 100%; margin: 0;
}
/* Editor-only Article Hero preview. The source block stores its per-post
   vertical position in a class; BlockListBlock supplies --fl-hero-y. */
.editor-styles-wrapper .wp-block-post-featured-image.fl-hero-source img,
.editor-styles-wrapper .wp-block-post-featured-image.is-style-fl-article-hero img {
  object-position: center var(--fl-hero-y, 50%);
}
/* Only the explicit Szentendre panorama style crops a cover. */
:is(.fl-writing .fl-use-panorama, .editor-styles-wrapper .is-style-fl-panorama-hero) img {
  width: 100%; height: auto; aspect-ratio: 2.25; max-height: 700px; object-fit: cover;
}
/* FOREIGN LANES · Article quotations: quiet archival text on warm paper.
   Keep About's larger italic quote untouched. Native Gutenberg Quote blocks
   share this treatment; a source/citation is optional. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-quote {
  display: flow-root; clear: none; box-sizing: border-box;
  width: auto; max-width: none; min-height: 0;
  border: 0; border-left: 2px solid #a7a49a; border-radius: 0 2px 2px 0;
  background: #fcfbf8; color: #5e625b;
  padding: 19px 24px 20px 23px;
  margin: 27px 0 31px clamp(12px, 1.8vw, 28px);
}
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote p {
  margin: 0; padding: 0; color: #5e625b;
  font: normal 400 clamp(15.5px, 1.1vw, 17px)/1.76 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: .005em;
}
/* Respect the writer's Rich Text emphasis: italic/bold formatting selected
   in Gutenberg should also be visible in the reader. No blanket reset for a
   wholly italicised quote (useful for poetry and translations). */
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote p :is(em, i) {
  font-style: italic;
}
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote p :is(strong, b) {
  font-weight: 700;
}
/* Gutenberg Quote > Add citation. Optional, quieter source line beneath text;
   supports author, work, translator, publisher and rich-text emphasis. */
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote :is(cite, .wp-block-quote__citation) {
  display: block; margin: 13px 0 0; padding: 0;
  color: #77736D;
  font: normal 400 11px/1.55 var(--fl-ui, "Source Sans 3", Arial, sans-serif);
  letter-spacing: .015em; text-transform: none;
}
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote :is(cite, .wp-block-quote__citation) :is(em, i) {
  font-style: italic;
}
:is(.fl-writing, .editor-styles-wrapper) .wp-block-quote :is(cite, .wp-block-quote__citation) :is(strong, b) {
  font-weight: 600;
}
/* FOREIGN LANES · Open editorial tables (matching the cycling article’s
   understated rules, spacing and uppercase UI labels). No enclosing frame,
   zebra bands or decorative accent line. Native Gutenberg Table blocks work
   the same in the editor and on published FL Article — Visual pages. */
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table {
  display: block; clear: both; box-sizing: border-box;
  width: 100%; max-width: 100%; margin: 28px 0 40px;
  border: 0; border-radius: 0; background: transparent;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table table {
  width: 100%; min-width: 650px; max-width: none; margin: 0;
  border: 0; border-collapse: collapse; border-spacing: 0; table-layout: auto;
  background: transparent; color: var(--article-body);
  font: 400 17px/1.52 var(--article-serif);
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table :is(th, td) {
  border: 0; border-bottom: 1px solid var(--article-rule);
  padding: 15px 16px; text-align: left; vertical-align: middle;
  overflow-wrap: break-word; word-break: normal;
  background: transparent; color: inherit;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table :is(th, td):last-child {
  padding-right: 0;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table thead,
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table tbody tr {
  border: 0; background: transparent;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table thead th {
    padding: 14px 16px;
    background: #F1E7E0;
    color: #A64F3B;
    font: 600 12px/1.5 var(--fl-ui, "Source Sans 3", Arial, sans-serif);
    letter-spacing: .17em;
    text-transform: uppercase;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table td strong {
    color: var(--article-ink);
    font-weight: 600;
}
:is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table figcaption {
  margin: 12px 0 0; color: var(--article-muted);
  font: 400 12px/1.45 var(--fl-ui, "Source Sans 3", Arial, sans-serif);
  text-align: left;
}
/* Explicit chapter tools own the rule. A regular H2 never adds a second one. */
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) .fl-chapter-divider {
  display: block; clear: both; width: 100%; max-width: none; height: 0; padding: 0;
  border: 0; border-top: 1px solid var(--article-rule); background: none; opacity: 1;
  margin: var(--chapter-before) 0 var(--chapter-after);
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) .fl-chapter-label {
  color: var(--article-muted); font: 600 11px/1.6 var(--fl-ui, "Source Sans 3", Arial, sans-serif);
  letter-spacing: .21em; text-transform: uppercase; margin: 0 0 14px;
}
:is(.fl-writing, .editor-styles-wrapper) .fl-chapter-opening {
  display: flow-root; clear: both; width: 100%; max-width: none; margin: 0 0 clamp(22px, 2.5vw, 34px);
}
:is(.fl-writing, .editor-styles-wrapper) .fl-chapter-opening h2 {
  color: var(--article-ink); font: 400 clamp(36px, 3.6vw, 56px)/1.08 var(--article-serif);
  letter-spacing: -.03em; text-wrap: wrap; margin: 0;
}
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .fl-chapter-label + h2 { margin-top: 0; }
:is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) .fl-article-pair {
  display: grid; clear: both; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start;
  width: 100%; max-width: 100%; gap: clamp(14px, 2vw, 26px);
  margin: clamp(22px, 2.6vw, 34px) 0 clamp(24px, 3vw, 42px);
}
:is(.fl-writing, .editor-styles-wrapper) .fl-article-pair > .wp-block-image { float: none; width: 100%; min-width: 0; margin: 0; }
:is(.fl-writing, .editor-styles-wrapper) .fl-postcard-player-source {
  display: block; clear: both; width: 100%; max-width: 1180px; margin: clamp(28px, 2.5vw, 36px) 0;
}
:is(.fl-writing, .editor-styles-wrapper) .fl-postcard-player-source > video { display: block; width: 100%; height: auto; }
.fl-writing .fl-article-postcard { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; }
.fl-writing .fl-article-postcard :is(.postcard-poster, video) { position: absolute; inset: 0; width: 100%; height: 100%; }
.fl-writing .fl-article-postcard :is(.postcard-poster img, video) { width: 100%; height: 100%; object-fit: contain; }
.fl-writing .fl-article-postcard .postcard-play { left: 24px; right: auto; bottom: 22px; z-index: 2; }
.fl-writing .fl-article-postcard [hidden] { display: none; }
@media (max-width: 1100px) {
  :is(.fl-writing, .editor-styles-wrapper) { --photo-gap: 36px; --chapter-before: 42px; --chapter-after: 34px; }
}
@media (max-width: 800px) {
  .fl-writing .fl-visual-title-break { display: none; }
  :is(.fl-writing, .editor-styles-wrapper) { --article-gutter: 28px; --photo-width: 50%; --portrait-photo-width: 38%; --photo-gap: 28px; --chapter-before: 34px; --chapter-after: 30px; }
  .fl-writing .fl-breadcrumbs { padding-block: 20px 28px; }
  .fl-writing .fl-article-title, .editor-styles-wrapper .editor-post-title__input { font-size: clamp(37px, 5vw, 46px); }
}
@media (max-width: 680px) {
  :is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image:is(.alignleft, .alignright) {
    float: none; width: 100%; margin: 0 0 26px;
  }
  :is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-image:is(.alignleft, .alignright).fl-photo-portrait {
    float: none; width: min(100%, 420px); max-width: 100%; margin: 0 auto 26px;
  }
}
@media (max-width: 560px) {
  :is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table {
    margin-block: 24px 32px;
  }
  :is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table table {
    min-width: 620px; font-size: 16px;
  }
  :is(.fl-writing, .editor-styles-wrapper) figure.wp-block-table :is(th, td) {
    padding: 14px 16px;
  }
  :is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) > .wp-block-quote {
    width: calc(100% - 10px); margin-left: 10px;
    padding: 16px 18px;
  }
  :is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) .fl-article-pair { grid-template-columns: 1fr; gap: 22px; }
  :is(.fl-writing .wp-block-post-content, .editor-styles-wrapper .is-root-container) .fl-chapter-label { font-size: 10px; letter-spacing: .18em; }
  .fl-writing .fl-article-postcard .postcard-play { left: 12px; bottom: 12px; }
  :is(.fl-writing, .editor-styles-wrapper) { --article-gutter: 24px; --chapter-before: 30px; --chapter-after: 26px; font-size: 19px; }
  .fl-writing .fl-breadcrumbs { padding-block: 18px 24px; }
  .fl-writing .fl-article-title, .editor-styles-wrapper .editor-post-title__input { font-size: clamp(34px, 8.5vw, 44px); }
  .fl-writing .fl-article-deck { margin-top: 20px; }
  .fl-writing .fl-article-deck p { font-size: 21px; }
  :is(.fl-writing .fl-use-panorama, .editor-styles-wrapper .is-style-fl-panorama-hero) img { aspect-ratio: 4 / 3; }
}

/* FOREIGN LANES · Moving Postcard frame v2
 * Install this same block in foreign-lanes.css and foreign-lanes-article.css.
 * First remove the old "Moving Postcard — paper-frame treatment" block.
 * The paper belongs to the FIGURE, so the native caption remains editable.
 * Player controls, video proportions and page backgrounds are not restyled.
 */

:is(body.single-post.fl-site, .editor-styles-wrapper)
figure:is(.wp-block-video, .fl-cyc-postcard) {
    --fl-postcard-edge: clamp(12px, 2.2vw, 30px);
    --fl-postcard-label-gap: clamp(12px, 1.4vw, 18px);
    --fl-postcard-caption-gap: clamp(14px, 1.6vw, 22px);

    box-sizing: border-box;
    display: block;
    min-width: 0;
    padding: clamp(16px, 1.8vw, 24px) var(--fl-postcard-edge)
             clamp(18px, 2vw, 26px);
    border: 1px solid rgba(153, 130, 106, .16);
    border-radius: 7px;
    background-color: #FFFFFF;
    /* A seamless, lightly embossed paper grain. No external image request. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.16 .32' numOctaves='3' seed='19' stitchTiles='stitch' result='grain'/%3E%3CfeDiffuseLighting in='grain' surfaceScale='1.4' diffuseConstant='1' lighting-color='%23ffffff' result='relief'%3E%3CfeDistantLight azimuth='225' elevation='65'/%3E%3C/feDiffuseLighting%3E%3CfeColorMatrix in='relief' type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' fill='%23ffffff'/%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.12'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 240px 240px;
    box-shadow: 0 14px 30px rgba(63, 48, 31, .10),
                0 3px 8px rgba(63, 48, 31, .065),
                inset 0 1px 0 rgba(255, 255, 255, .85);
}

/* A real layout row above the picture; no stripe, stamp or cancellation mark. */
:is(body.single-post.fl-site, .editor-styles-wrapper)
figure:is(.wp-block-video, .fl-cyc-postcard)::before {
    content: "MOVING POSTCARD";
    display: block;
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 var(--fl-postcard-label-gap);
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: #b8785c;
    font: 500 clamp(10px, .95vw, 13px)/1.4 var(--fl-serif, "Newsreader", Georgia, serif);
    letter-spacing: .24em;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
    pointer-events: none;
}

:is(body.single-post.fl-site, .editor-styles-wrapper)
figure.wp-block-video > video {
    display: block;
}

/* The existing caption lives on the lower paper margin and can grow freely.
 * Its font, colour, alignment and italic formatting stay with the article CSS.
 * Do not hide empty figcaptions: Gutenberg needs its editable placeholder.
 */
:is(body.single-post.fl-site, .editor-styles-wrapper)
figure:is(.wp-block-video, .fl-cyc-postcard) > figcaption {
    display: block;
    position: static;
    box-sizing: border-box;
    width: auto;
    margin: var(--fl-postcard-caption-gap) 0 0;
    padding: 0;
    overflow-wrap: anywhere;
}

/* End FOREIGN LANES · Moving Postcard frame v2 */