/* Sourov Living Map Repair — paper-card.css (2026-11-12, t87u)
 * Paper card for single posts and pages. Original CSS, no framework.
 * Loaded only when body has .sd-has-card (see functions.php sourov_card_active()).
 * Sizes are in rem so the header A- / A / A+ / A++ controls (html font-size) scale the card text.
 * No transform/filter on the card: fixed-position widgets inside posts (OTT aura, capsules,
 * floating buttons) must stay fixed to the viewport.
 */
.sd-has-card{
  --sdc-sheet:#fffbf2;
  --sdc-sheet-top:#f5eedd;
  --sdc-ink:#1b1712;
  --sdc-muted:#5c5650;
  --sdc-line:rgba(92,87,82,.5);
  --sdc-line-soft:rgba(92,87,82,.28);
  --sdc-link:#1c4cff;
  --sdc-serif:Palatino,"Palatino Linotype","Book Antiqua","URW Palladio L",Georgia,serif;
  --sdc-px:.75rem;
  --sdc-strip:0px;
  --sdc-header:var(--soh-h,96px);
  --sdc-hole:var(--paper,#fff); /* site page colour (white sitewide) shows through the punched holes */
}
@media (min-width:640px){.sd-has-card{--sdc-px:1rem}}

/* Stage: centres the card under the sticky site header */
.sd-has-card .site-main{min-height:0}
.sd-card-stage{
  box-sizing:border-box;
  display:flex;justify-content:center;
  width:100%;max-width:100%;
  padding:.75rem .5rem 1rem;
}
.sd-card-wrap{position:relative;width:100%;max-width:56rem;min-width:0}

/* Card */
.sd-card.entry{
  box-sizing:border-box;
  position:relative;
  display:flex;flex-direction:column;
  width:100%;max-width:none;min-width:0;
  margin:0;padding:0;
  color:var(--sdc-ink);
  background:linear-gradient(180deg,var(--sdc-sheet-top) 0,var(--sdc-sheet) 7rem,var(--sdc-sheet) 100%);
  border:1px solid var(--sdc-line-soft);
  border-radius:0;
  box-shadow:0 10px 30px rgba(0,0,0,.16),0 2px 5px rgba(0,0,0,.06);
  animation:sdc-fade-in .3s ease-out both;
}
@keyframes sdc-fade-in{from{opacity:0}to{opacity:1}}

/* Fixed-height card (default): body scrolls inside; footer always visible.
 * Phone: fills the screen under the header. */
.sd-card--fixed{
  height:calc(100vh - var(--sdc-header) - 1.75rem);
  min-height:18rem;
}
@supports (height:100svh){
  .sd-card--fixed{height:calc(100svh - var(--sdc-header) - 1.75rem)}
}

/* Torn top edge (decorative, pure CSS) */
.sd-card--torn::before{
  content:"";position:absolute;left:-1px;right:-1px;top:-7px;height:8px;pointer-events:none;
  background:var(--sdc-sheet-top);
  clip-path:polygon(0 100%,0.0% 3px,1.04% 0.5px,2.08% 1.7px,3.12% 2.9px,4.17% 4.0px,5.21% 1.0px,6.25% 2.7px,7.29% 1.9px,8.33% 2.6px,9.38% 2.5px,10.42% 1.3px,11.46% 1.3px,12.5% 2.3px,13.54% 2.6px,14.58% 5.9px,15.62% 1.8px,16.67% 6.3px,17.71% 0.2px,18.75% 4.9px,19.79% 0.9px,20.83% 1.7px,21.88% 1.9px,22.92% 1.0px,23.96% 0.1px,25.0% 2.3px,26.04% 2.1px,27.08% 4.7px,28.12% 2.8px,29.17% 2.6px,30.21% 2.3px,31.25% 6.8px,32.29% 3.3px,33.33% 1.8px,34.38% 1.2px,35.42% 1.8px,36.46% 2.1px,37.5% 3.6px,38.54% 2.0px,39.58% 2.4px,40.62% 3.2px,41.67% 1.2px,42.71% 3.5px,43.75% 5.9px,44.79% 2.6px,45.83% 4.6px,46.88% 3.4px,47.92% 3.6px,48.96% 3.3px,50.0% 6.6px,51.04% 0.2px,52.08% 4.0px,53.12% 0.4px,54.17% 5.1px,55.21% 0.2px,56.25% 6.6px,57.29% 0.7px,58.33% 3.3px,59.38% 0.1px,60.42% 4.1px,61.46% 2.7px,62.5% 6.3px,63.54% 0.4px,64.58% 2.4px,65.62% 1.4px,66.67% 2.0px,67.71% 0.8px,68.75% 2.8px,69.79% 2.3px,70.83% 1.8px,71.88% 3.4px,72.92% 0.8px,73.96% 1.0px,75.0% 4.9px,76.04% 0.8px,77.08% 4.0px,78.12% 1.5px,79.17% 2.5px,80.21% 1.4px,81.25% 2.1px,82.29% 2.1px,83.33% 2.6px,84.38% 0.1px,85.42% 5.5px,86.46% 0.7px,87.5% 2.8px,88.54% 0.1px,89.58% 4.4px,90.62% 0.0px,91.67% 3.9px,92.71% 3.1px,93.75% 0.7px,94.79% 0.7px,95.83% 5.6px,96.88% 0.8px,97.92% 6.5px,98.96% 2.0px,100.0% 3px,100% 100%);
}

/* Header */
.sd-card__head{
  flex:0 0 auto;
  display:flex;flex-direction:column;gap:.5rem;
  padding:.75rem var(--sdc-px);
  border-bottom:1px dashed var(--sdc-line);
}
.sd-card__meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem 1rem;min-width:0}
.sd-card__meta .entry-meta{margin:0;color:var(--sdc-muted)}
.sd-card .sd-card__title.entry-title{
  margin:0;
  font-family:var(--sdc-serif);
  font-style:italic;font-weight:400;
  font-size:1.5rem;line-height:1.15;letter-spacing:-.015em;
  overflow-wrap:break-word;
  color:var(--sdc-ink);
}

/* Body (scroll area) */
.sd-card__body{
  flex:1 1 auto;min-height:0;min-width:0;
  overflow-x:clip;overflow-y:auto;
  padding:.75rem var(--sdc-px) 1rem;
  /* scroll shadow above the footer while more text is below */
  background:
    linear-gradient(to top,var(--sdc-sheet) 35%,rgba(255,251,242,0)) center bottom/100% 1.5rem no-repeat local,
    linear-gradient(to top,rgba(0,0,0,.13),rgba(0,0,0,0)) center bottom/100% .8rem no-repeat scroll;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}
@media (min-width:640px){.sd-card__body{padding-top:1.25rem;padding-bottom:1.25rem}}
.sd-card__body:focus{outline:none}
.sd-card__body:focus-visible{outline:2px solid var(--sdc-link);outline-offset:-2px}

/* Prose */
.sd-card .sd-prose.entry-content{
  max-width:none;
  font-family:var(--sdc-serif);
  font-size:1.0625rem;line-height:1.7;
  color:var(--sdc-ink);
  overflow-x:visible;
}
@media (min-width:640px){.sd-card .sd-prose.entry-content{font-size:1.125rem;line-height:1.75}}
html.sd-reading .sd-card .sd-prose.entry-content{font-size:1.1875rem;line-height:1.8}
/* Embedded labs that set their own px size: same size at default, but follow A- / A+ / A++ */
.sd-card .sd-prose #sd-reading-room,.sd-card .sd-prose .sdr26{font-size:1.125rem}
.sd-prose > :first-child{margin-top:0}
.sd-prose > :last-child{margin-bottom:0}
.sd-prose p{margin:0 0 1.1em}
.sd-prose h1,.sd-prose h2,.sd-prose h3{font-family:var(--sdc-serif);font-style:italic;font-weight:400;letter-spacing:-.01em;color:var(--sdc-ink)}
.sd-card .sd-prose h1{font-size:1.75em;line-height:1.15;margin:1.6em 0 .6em}
.sd-card .sd-prose h2{font-size:1.45em;line-height:1.2;margin:1.8em 0 .6em}
.sd-card .sd-prose h3{font-size:1.2em;line-height:1.3;margin:1.5em 0 .5em}
.sd-card .sd-prose h4{font-size:1.05em;line-height:1.35;margin:1.4em 0 .4em}
.sd-prose strong,.sd-prose b{font-weight:600;font-style:normal}
.sd-prose a{color:var(--sdc-link);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.sd-prose a:hover{color:var(--sdc-ink)}
.sd-prose ul,.sd-prose ol{padding-left:1.4em;margin:0 0 1.1em}
.sd-prose li{margin:.3em 0}
.sd-prose blockquote{margin:1.4em 0;padding:.2em 0 .2em 1em;border-left:2px solid var(--sdc-line);font-style:italic}
.sd-prose hr{border:0;border-top:1px dashed var(--sdc-line);margin:2em 0}
/* Media and wide blocks stay inside the card */
.sd-prose img,.sd-prose video,.sd-prose canvas{max-width:100%;height:auto}
.sd-prose figure{max-width:100%;margin-left:0;margin-right:0}
.sd-prose iframe{max-width:100%}
.sd-prose .alignwide,.sd-prose .alignfull{width:auto;max-width:100%;margin-left:0;margin-right:0}
.sd-prose .wp-block-table,.sd-prose table{max-width:100%}
.sd-prose .wp-block-table{overflow-x:auto}
/* Bare tables (not in a Gutenberg table block or an existing scroll wrapper) scroll sideways instead of being cut off */
.sd-prose > table,.sd-prose section > table,.sd-prose article > table,.sd-prose div:not([style*="overflow"]) > table{display:block;max-width:100%;overflow-x:auto}
.sd-prose pre{max-width:100%;overflow-x:auto}

/* Post terms at the end of the body */
.sd-card .entry-terms{margin-top:2rem;padding-top:.75rem;border-top:1px dashed var(--sdc-line)}

/* Footer: always visible at the bottom of the card */
.sd-card__foot{
  flex:0 0 auto;
  position:sticky;bottom:0;z-index:2;
  display:flex;flex-wrap:wrap;align-items:center;
  padding:.125rem var(--sdc-px);
  border-top:1px dashed var(--sdc-line);
  background:var(--sdc-sheet);
  font-size:.875rem;
}
@media (min-width:640px){.sd-card__foot{padding-top:.375rem;padding-bottom:.375rem}}
.sd-card__home{display:inline-flex;align-items:center;min-height:44px;padding:0 .25rem;margin-left:-.25rem;color:var(--sdc-muted);text-decoration:none;font-family:var(--sdc-serif);transition:color .15s}
.sd-card__home:hover,.sd-card__home:focus-visible{color:var(--sdc-ink);text-decoration:underline;text-underline-offset:3px}

/* Flow card: page scrolls normally (long apps / pages that read window scroll) */
.sd-card--flow{height:auto;min-height:0}
.sd-card--flow .sd-card__body{overflow:visible;background:none}

/* Tablet and desktop: continuous-feed paper (side strips with punched holes, dashed tear lines) */
@media (min-width:768px){
  .sd-has-card{--sdc-strip:40px}
  .sd-card-stage{padding:clamp(1rem,4vh,2.5rem) 1.25rem clamp(1rem,4vh,2.5rem)}
  /* About 100vh - 14rem, but never taller than the space left under the (sometimes tall) site header */
  .sd-card--fixed{height:min(calc(100vh - 14rem),calc(100vh - var(--sdc-header) - 3rem));min-height:16rem}
  .sd-card.entry{
    padding-left:var(--sdc-strip);padding-right:var(--sdc-strip);
    border:0;
    box-shadow:0 2px 5px rgba(0,0,0,.06),0 10px 18px rgba(0,0,0,.12);
    background:
      repeating-linear-gradient(to bottom,var(--sdc-line-soft) 0 6px,transparent 6px 8px) left var(--sdc-strip) top/1px 100% no-repeat,
      repeating-linear-gradient(to bottom,var(--sdc-line-soft) 0 6px,transparent 6px 8px) right var(--sdc-strip) top/1px 100% no-repeat,
      radial-gradient(circle at 50% 50%,var(--sdc-hole) 0 7px,var(--sdc-line-soft) 7.5px 8.4px,transparent 9px) left top 21px/var(--sdc-strip) 42px repeat-y,
      radial-gradient(circle at 50% 50%,var(--sdc-hole) 0 7px,var(--sdc-line-soft) 7.5px 8.4px,transparent 9px) right top 21px/var(--sdc-strip) 42px repeat-y,
      linear-gradient(180deg,var(--sdc-sheet-top) 0,var(--sdc-sheet) 7rem,var(--sdc-sheet) 100%);
  }
  .sd-card--torn::before{left:0;right:0}
  .sd-card .sd-card__title.entry-title{font-size:1.75rem}
}
@media (min-width:1024px){
  .sd-card .sd-card__title.entry-title{font-size:1.875rem}
}
@supports (height:100svh){
  @media (min-width:768px){
    .sd-card--fixed{height:min(calc(100svh - 14rem),calc(100svh - var(--sdc-header) - 3rem))}
  }
}
/* Short desktop windows: smaller margins, keep a usable card */
@media (min-width:768px) and (max-height:620px){
  .sd-card-stage{padding-top:.75rem;padding-bottom:.75rem}
}

/* Reading mode keeps the card; slightly warmer page behind it */
html.sd-reading .sd-has-card .sd-card-stage{background:transparent}

@media (prefers-reduced-motion:reduce){
  .sd-card.entry{animation:none;opacity:1}
  .sd-card__home{transition:none}
}
@media print{
  .sd-card--fixed{height:auto}
  .sd-card__body{overflow:visible}
  .sd-card__foot{display:none}
}


/* sd-home-pin-2026-11-17: keep ← Home on screen on mobile, above the header, through the footer. */
@media (max-width:767px){
  /* Keep the Home bar above the site footer social icons (.sf-sq) as the footer scrolls past. */
  body.sd-has-card .site-main{position:relative;z-index:3}
  body.sd-has-card .sf, body.sd-has-card .site-footer{position:relative;z-index:1}
  .sd-has-card .sd-card__foot{
    position:fixed;
    left:0;right:0;bottom:0;
    z-index:40;
    padding:.25rem 1rem calc(.25rem + env(safe-area-inset-bottom,0px));
    background:var(--sdc-sheet,#FFFDF8);
    box-shadow:0 -1px 0 var(--sdc-line,#BBB6AA);
  }
  .sd-has-card .sd-card-stage{padding-bottom:4.25rem}
}


/* sd-ts-content-2026-11-18: body paragraphs with inline font-size follow the
 * card prose size (and therefore the text-size buttons) instead of staying at 14px. */
.sd-card .sd-prose.entry-content p[style*="font-size"]{
  font-size:1em !important;
  line-height:1.65 !important;
}


/* sd-home-pin-desktop-2026-11-18: keep ← Home tappable at the bottom on desktop,
 * including long/flow cards and once the window is scrolled to the site footer. */
@media (min-width:768px){
  body.sd-has-card .site-main{position:relative;z-index:3}
  body.sd-has-card .sf, body.sd-has-card .site-footer{position:relative;z-index:1}
  .sd-has-card .sd-card__foot{
    position:fixed;
    left:0;right:0;bottom:0;
    z-index:40;
    padding:.375rem 1.25rem calc(.375rem + env(safe-area-inset-bottom,0px));
    background:var(--sdc-sheet,#FFFDF8);
    box-shadow:0 -1px 0 var(--sdc-line,#BBB6AA);
  }
  .sd-has-card .sd-card-stage{padding-bottom:4.5rem}
}


/* Official author portrait in bylines and on the About page. */
.entry-meta{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.35rem .55rem}
.entry-meta__avatar{
  width:32px;height:32px;border-radius:50%;object-fit:cover;display:block;
  border:1px solid #1B2C3E;box-shadow:1px 2px 0 #142433;
}
.sd-prose figure.sd-author-portrait,
.entry-content figure.sd-author-portrait{
  max-width:168px;margin:0 0 1.1rem;
  border-radius:50%;overflow:hidden;
  border:3px solid #1B2C3E;
  box-shadow:3px 5px 0 #142433, 6px 10px 16px rgba(8,24,40,.2);
  background:#F7F0DE;
}
.sd-prose figure.sd-author-portrait img,
.entry-content figure.sd-author-portrait img{
  width:100%;height:auto;border-radius:50%;display:block;
}
@media (max-width:360px){
  .sd-prose figure.sd-author-portrait,
  .entry-content figure.sd-author-portrait{max-width:128px}
}


/* 100 Days itinerary table on the Europe Travel hub (day order). */
.sd-itinerary-wrap{overflow-x:auto;max-width:100%;margin:0 0 1.2rem;-webkit-overflow-scrolling:touch}
.journal-itinerary{width:100%;max-width:100%;border-collapse:collapse;font-size:.95em;margin:0;table-layout:auto}
.journal-itinerary th,.journal-itinerary td{text-align:left;vertical-align:top;padding:.45rem .55rem;border-bottom:1px solid #c9c2b0}
.journal-itinerary thead th{border-bottom:2px solid #1B2C3E;font-weight:600}
.journal-itinerary td:nth-child(1),.journal-itinerary th:nth-child(1){white-space:nowrap}
.sd-series-nav{margin:1.25rem 0 .6rem}
@media (max-width:640px){
  .journal-itinerary,.journal-itinerary thead,.journal-itinerary tbody,.journal-itinerary tr,.journal-itinerary th,.journal-itinerary td{display:block;width:auto}
  .journal-itinerary thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .journal-itinerary tr{border-bottom:1px solid #c9c2b0;padding:.65rem 0 .5rem;margin:0}
  .journal-itinerary td{border:0;padding:.15rem 0}
  .journal-itinerary td:nth-child(1){font-weight:600}
}

/* sd-ott-aura-2026-11-21: lift #ott-aura-toggle above the pinned Home bar
 * so it is clickable and does not cover the Home link. Module pages set
 * bottom:12px;z-index:10 in a later content stylesheet, so these need !important. */
body.sd-has-card #ott-aura-toggle{
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 50 !important;
}
