/* ny-mobile.css — Askur & Embla on a phone. One sheet, every page. (María 30.11: "fallegt í farsíma, frá A til Ö".)
   The design export is a 1240px magazine; under 720px this turns it into a single calm column:
   a sticky masthead (name + bell + menu), no bottom bar, every multi-column block stacked, spacing and type for a 400px page.
   Loaded on all pages by build_ny.py (?v= VER). Desktop and tablet are untouched: everything sits inside max-width: 720px. */

@media (max-width: 720px) {
  /* ---- 0. nothing may be wider than the phone ---- */
  html, body { overflow-x: hidden !important; max-width: 100vw !important; }
  html, body, #dc-root, .jr-main { scrollbar-width: none !important; }                 /* whichever layer scrolls in a preview tool: no grey rail on the right (María 30.11/1.12) */
  html::-webkit-scrollbar, body::-webkit-scrollbar, #dc-root::-webkit-scrollbar, .jr-main::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
  html { scrollbar-gutter: auto !important; }
  img, video, iframe, canvas, svg, figure { max-width: 100% !important; }
  img:not([style*="object-fit"]):not([style*="height: 100%"]) { height: auto !important; }
  main, section:not(.jr-bleed), article, aside, header, footer { min-width: 0 !important; max-width: 100% !important; }
  .jr-bleed { max-width: none !important; width: auto !important; }                      /* full-bleed blocks reach both edges (the 40px gap on the right, María 1.12) */
  [style*="grid-template-columns"] > *, [style*="display: flex"] > * { min-width: 0; }

  /* ---- 1. the page frame: 20px gutters, no bottom bar ---- */
  .jr-main { padding: 0 20px calc(48px + env(safe-area-inset-bottom, 0px)) !important; }
  .jr-bleed { margin-left: -20px !important; margin-right: -20px !important; padding-left: 20px !important; padding-right: 20px !important; }
  .jr-tabbar { display: none !important; }
  body.ny-student .jr-tabbar { display: flex !important; padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important; gap: 0 !important; }
  body.ny-student .jr-tabbar button { flex: 1 1 0 !important; min-width: 0; height: 48px; border: 0; border-bottom: 2px solid transparent; background: none; color: #5D6E61; font: 400 11px Jost, sans-serif; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
  body.ny-student .jr-tabbar button[aria-current] { color: #1E2D24; border-bottom-color: #1E2D24; }
  body.ny-student .jr-main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
  .jr-cover { min-height: min(70vh, 560px) !important; }
  .jr-coverpad { padding: 24px 20px !important; }

  /* ---- 2. the masthead: "Askur & Embla" · bell · ☰ — sticky, so the menu is always one tap away ---- */
  header { position: sticky; top: 0; z-index: 40; background: #FBFAF3; }
  .jr-head { padding: 10px 20px 10px !important; grid-template-columns: minmax(0, 1fr) auto !important; column-gap: 8px !important; align-items: center !important; border-bottom: 1px solid #D8DEC9; }
  .jr-head > :first-child { display: none !important; }                                  /* "6. hefti · Desember" lives in the drawer's head */
  .jr-head > :nth-child(2) { justify-self: start !important; text-align: left !important; font-size: 30px !important; margin: 0 !important; padding-left: 0 !important; white-space: nowrap; }
  .jr-head > :last-child { min-width: 0; justify-self: end; gap: 4px !important; }
  .jr-head [data-ny-langbtn], .jr-head .ny-lang-menu, #ny-signin-link, #ny-signout, header [data-ny-help],
  header a[title]:not([data-ny-help]) { display: none !important; }                     /* language, sign-in, help, avatar → all in the drawer */
  #ny-burger { display: inline-flex !important; margin-left: 2px; }

  /* the live line under the masthead: keep the pulse + count, drop the running sentence (it was cut mid-word) */
  .jr-bleed[style*="overflow: hidden"] { gap: 10px !important; padding-top: 9px !important; padding-bottom: 9px !important; margin-top: -28px !important; }
  .jr-bleed[style*="overflow: hidden"] > span[style*="flex: 1 1 0%"] { display: none !important; }
  .jr-bleed[style*="overflow: hidden"] > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto !important; }

  /* ---- 2b. air between blocks (María: "klístrað upp í hvert annað"), the dark block's two buttons, the advert card ---- */
  .jr-main > section.jr-bleed, .jr-main section.jr-bleed + section, .jr-main .jr-bleed + .jr-bleed { margin-top: 28px !important; }
  section.jr-bleed[style*="background: rgb(30, 45, 36)"] p a { display: flex !important; justify-content: center; width: 100%; margin: 12px 0 0 !important; box-sizing: border-box; }
  section.jr-bleed[style*="background: rgb(30, 45, 36)"] p a[href="https://phytoartisan.com/"] { border: 1px solid #FBFAF3; }
  a[style*="display: flex"][style*="background: rgb(248, 230, 219)"] { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; padding: 16px 16px 18px !important; }
  a[style*="display: flex"][style*="background: rgb(248, 230, 219)"] > div:first-child { width: 100% !important; height: auto !important; aspect-ratio: 16 / 10; }
  a[style*="display: flex"][style*="background: rgb(248, 230, 219)"] [style*="white-space: nowrap"] { white-space: normal !important; }
  a[style*="display: flex"][style*="background: rgb(248, 230, 219)"] > span:last-child { display: block; text-align: center; line-height: 46px; margin-top: 4px; background: #1E2D24; color: #FBFAF3 !important; font-size: 11px !important; letter-spacing: .22em; }

  /* ---- 3. every grid becomes one column; small card grids (photos, products, prompts) keep two ---- */
  [style*="grid-template-columns"]:not(.jr-head) { grid-template-columns: minmax(0, 1fr) !important; }
  /* card galleries (auto-fill: photos, products, issues, prompts) keep two columns; text lists (auto-fit) read better in one */
  [style*="grid"][style*="auto-fill, minmax(180px"], [style*="grid"][style*="auto-fill, minmax(200px"], [style*="grid"][style*="auto-fill, minmax(220px"], [style*="grid"][style*="auto-fill,minmax(230px"], [style*="grid"][style*="auto-fill, minmax(240px"],
  [style*="grid"][style*="auto-fit, minmax(180px"],
  [style*="grid"][style*="repeat(4,1fr)"], [style*="grid"][style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 14px !important; }
  body[data-ny-page="markadur"] [style*="grid"][style*="auto-fill, minmax(200px"], body[data-ny-page="markadur"] [style*="grid"][style*="auto-fill, minmax(240px"] { grid-template-columns: minmax(0, 1fr) !important; gap: 14px !important; }
  body[data-ny-page="markadur"] a.scp3, body[data-ny-page="markadur"] a[style*="display: block"][href*="product.html"] { display: grid !important; grid-template-columns: 112px minmax(0, 1fr); column-gap: 14px; align-items: center; border-bottom: 1px solid #E2E6D3; padding-bottom: 14px; }
  body[data-ny-page="markadur"] a[href*="product.html"] > div:first-child { grid-row: 1 / span 4; }
  body[data-ny-page="markadur"] a[href*="product.html"] > div[style*="margin-top: 10px"] { margin-top: 0 !important; font-size: 19px !important; }
  body[data-ny-page="uppskriftir"] [style*="grid"][style*="auto-fill, minmax(240px"] { grid-template-columns: minmax(0, 1fr) !important; }   /* recipes carry text: one column */
  [style*="repeat(12,1fr)"] > * { grid-column: auto !important; grid-row: auto !important; }
  [style*="gap: 48px"], [style*="gap: 56px"], [style*="gap: 40px"], [style*="gap: 24px 40px"], [style*="gap: 40px 28px"], [style*="gap: 30px 26px"] { gap: 24px !important; }

  /* ---- 4. side-by-side panes (riddle, recipe box, class page, meeting card) stack ---- */
  [style*="display: flex"]:has(> [style*="flex: 1 1 2"]), [style*="display: flex"]:has(> [style*="flex: 1 1 3"]), [style*="display: flex"]:has(> [style*="flex: 1 1 4"]),
  [style*="display: flex"]:has(> [style*="flex: 3 1 "]), [style*="display: flex"]:has(> [style*="flex: 2 1 "]), [style*="display: flex"]:has(> [style*="flex: 0 0 3"]),
  [style*="display: flex"]:has(> [style*="flex: 1 1 1"]) { flex-wrap: wrap !important; }
  [style*="flex: 1 1 1"], [style*="flex: 1 1 2"], [style*="flex: 1 1 3"], [style*="flex: 1 1 4"], [style*="flex: 3 1 "], [style*="flex: 2 1 "], [style*="flex: 0 0 3"],
  [style*="flex: 0 0 2"] { flex: 1 1 100% !important; min-width: 0 !important; max-width: 100% !important; }

  /* hard-coded widths from the 1240px design fill the column */
  [style*="width: 860px"], [style*="width: 800px"], [style*="width: 760px"], [style*="width: 720px"], [style*="width: 680px"], [style*="width: 620px"],
  [style*="width: 600px"], [style*="width: 560px"], [style*="width: 520px"], [style*="width: 480px"], [style*="width: 460px"], [style*="width: 440px"],
  [style*="width: 420px"], [style*="width: 400px"], [style*="width: 380px"], [style*="width: 360px"], [style*="width: 340px"], [style*="width: 320px"],
  [style*="width: 300px"], [style*="min-width: 300px"], [style*="min-width: 320px"], [style*="min-width: 360px"] { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }

  /* ---- 5. spacing sized for a wide page comes down ---- */
  [style*="padding: 28px 28px 90px"] { padding: 20px 20px 48px !important; }
  [style*="padding: 72px 28px"], [style*="padding: 64px 28px"], [style*="padding: 56px 28px"], [style*="padding: 54px 28px"], [style*="padding: 48px 28px"], [style*="padding: 40px 28px"],
  [style*="padding: 48px 40px"] { padding: 36px 20px !important; }
  [style*="padding: 72px 0px"], [style*="padding: 64px 0px"], [style*="padding: 56px 0px"] { padding-top: 36px !important; padding-bottom: 36px !important; }
  [style*="padding: 56px 0px 0px"] { padding-bottom: 0 !important; }
  [style*="padding: 24px 0px 64px"], [style*="padding: 8px 28px 48px"] { padding-bottom: 32px !important; }
  [style*="padding: 26px 28px"], [style*="padding: 28px 26px"], [style*="padding: 28px 30px"], [style*="padding: 28px 32px"], [style*="padding: 32px"], [style*="padding: 36px"],
  [style*="padding: 40px"] { padding: 22px 20px !important; }
  [style*="padding-left: 28px"], [style*="padding-right: 28px"] { padding-left: 20px !important; padding-right: 20px !important; }
  [style*="margin-bottom: 56px"], [style*="margin-bottom: 48px"] { margin-bottom: 32px !important; }
  [style*="margin-top: 48px"], [style*="margin-top: 56px"] { margin-top: 32px !important; }

  /* ---- 6. type for a 400px measure ---- */
  h1, [style*="font-size: clamp(34px"], [style*="font-size: clamp(38px"], [style*="font-size: clamp(40px"] { font-size: clamp(30px, 8vw, 38px) !important; line-height: 1.08 !important; overflow-wrap: anywhere; }
  h2, [style*="font-size: clamp(30px"] { font-size: clamp(26px, 7vw, 32px) !important; line-height: 1.12 !important; overflow-wrap: anywhere; }
  h1[style*="uppercase"], h2[style*="uppercase"] { font-size: 24px !important; letter-spacing: .12em !important; line-height: 1.25 !important; }   /* "VIKAN · 30. NÓV.–6. DES." */
  h3 { overflow-wrap: anywhere; }
  p, li, blockquote { overflow-wrap: anywhere; }
  [style*="font-size: clamp(90px, 14vw, 160px)"] { font-size: clamp(64px, 20vw, 96px) !important; }   /* the big week counter */
  [style*="column-count"], [style*="columns:"] { column-count: 1 !important; columns: auto !important; }

  /* ---- 6b. the editors' page: its 240px side rail becomes a scrollable tab row ---- */
  .jr-topnav { display: none !important; }
  .ad-side { width: 100% !important; position: static !important; height: auto !important; border-right: 0 !important; border-bottom: 1px solid #D8DEC9; }
  .ad-nav { flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 4px !important; padding: 6px 12px !important; -webkit-overflow-scrolling: touch; }
  .ad-nav button { width: auto !important; flex: none; white-space: nowrap; border-left: 0 !important; }

  /* ---- 7. fingers, not cursors ---- */
  button[data-href], button[data-act], a[data-href] { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; }                                /* iOS zooms into anything smaller */
  table { display: block; overflow-x: auto; max-width: 100%; }
}

/* ---- the ☰ button and the drawer exist on every width; they only SHOW under 720px ---- */
#ny-burger { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-left: 6px; border: 1px solid #1E2D24; background: transparent; color: #1E2D24; font: 400 22px/1 Jost, sans-serif; cursor: pointer; flex: none; }
#ny-drawer { position: fixed; inset: 0; z-index: 9500; background: #FBFAF3; color: #1E2D24; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 22px calc(28px + env(safe-area-inset-bottom, 0px)); display: none; }
#ny-drawer.open { display: block; }
#ny-drawer .ny-dr-top { position: sticky; top: 0; z-index: 1; background: #FBFAF3; display: flex; align-items: center; justify-content: space-between; padding: 12px 0 10px; border-bottom: 1px solid #1E2D24; margin-bottom: 8px; }
#ny-drawer .ny-dr-title { font: italic 400 28px 'Cormorant Garamond', serif; letter-spacing: .02em; }
#ny-drawer .ny-dr-close { width: 44px; height: 44px; border: 1px solid #1E2D24; background: transparent; color: #1E2D24; font: 300 26px/1 'Cormorant Garamond', serif; cursor: pointer; }
#ny-drawer .ny-dr-vol { font: 400 11px Jost, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #5D6E61; margin: 6px 0 2px; }
#ny-drawer .ny-dr-eye { font: 400 11px Jost, sans-serif; letter-spacing: .22em; text-transform: uppercase; color: #C45F3A; margin: 22px 0 6px; }
#ny-drawer a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #E2E6D3; font: 400 22px 'Cormorant Garamond', serif; color: #1E2D24; text-decoration: none; }
#ny-drawer a.is-here { color: #C45F3A; }
#ny-drawer a small { font: 400 11px Jost, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: #5D6E61; text-align: right; }
#ny-drawer a.ny-dr-cta { justify-content: center; background: #1E2D24; color: #FBFAF3; border: 0; margin: 14px 0 4px; padding: 15px; font: 400 12px Jost, sans-serif; letter-spacing: .22em; text-transform: uppercase; }
#ny-drawer .ny-dr-me { display: flex; align-items: center; gap: 12px; padding: 14px 0 6px; }
#ny-drawer .ny-dr-me img, #ny-drawer .ny-dr-me .ny-dr-ini { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; flex: none; background: #E7D7CC; display: flex; align-items: center; justify-content: center; font: 400 18px 'Cormorant Garamond', serif; color: #1E2D24; }
#ny-drawer .ny-dr-me b { display: block; font: 400 20px 'Cormorant Garamond', serif; }
#ny-drawer .ny-dr-me small { font: 400 11px Jost, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #5D6E61; }
#ny-drawer .ny-dr-langs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 12px; }
#ny-drawer .ny-dr-langs button { border: 1px solid #D8DEC9; background: transparent; color: #1E2D24; padding: 9px 13px; font: 400 13px Jost, sans-serif; cursor: pointer; min-height: 40px; }
#ny-drawer .ny-dr-langs button.is-here { border-color: #1E2D24; color: #C45F3A; }
body.ny-drawer-open { overflow: hidden !important; }

/* ---- language popup ---- */
#ny-lang-modal { position: fixed; inset: 0; z-index: 9600; background: rgba(30, 45, 36, .55); display: flex; align-items: flex-end; justify-content: center; }
#ny-lang-modal .ny-lm-card { width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; background: #FBFAF3; color: #1E2D24; padding: 18px 22px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 50px -30px rgba(30, 45, 36, .6); }
#ny-lang-modal .ny-lm-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #1E2D24; padding-bottom: 10px; }
#ny-lang-modal .ny-lm-title { font: italic 400 30px 'Cormorant Garamond', serif; }
#ny-lang-modal .ny-lm-close { width: 44px; height: 44px; border: 1px solid #1E2D24; background: transparent; color: #1E2D24; font: 300 26px/1 'Cormorant Garamond', serif; cursor: pointer; }
#ny-lang-modal .ny-lm-sub { font: 400 15px 'Cormorant Garamond', serif; color: #5D6E61; margin: 10px 0 14px; }
#ny-lang-modal .ny-lm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
#ny-lang-modal .ny-lm-grid button { min-height: 48px; border: 1px solid #D8DEC9; background: transparent; color: #1E2D24; font: 400 20px 'Cormorant Garamond', serif; cursor: pointer; text-align: left; padding: 0 14px; }
#ny-lang-modal .ny-lm-grid button.is-here { border-color: #1E2D24; color: #C45F3A; background: #F8E6DB; }

/* ---- photo tiles (tileify in askur-ny.js): phone always, any width with ?tiles=1 ---- */
.ny-tiled { display: block !important; padding: 0 !important; border: 0 !important; }
.ny-tile { position: relative; overflow: hidden; background: #1E2D24; aspect-ratio: 4 / 3; }
.ny-tile > :first-child { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; aspect-ratio: auto !important; margin: 0 !important; }
.ny-tile .ny-img, .ny-tile img { width: 100% !important; height: 100% !important; object-fit: cover; }
.ny-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(30, 45, 36, .82) 0%, rgba(30, 45, 36, .45) 45%, rgba(30, 45, 36, 0) 75%); pointer-events: none; }
.ny-tile-txt { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 14px 16px 14px; color: #FBFAF3; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.ny-tile-h { font: 500 clamp(19px, 5.2vw, 24px)/1.12 'Cormorant Garamond', serif; letter-spacing: .01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ny-tile-m { font: 400 10px Jost, sans-serif; letter-spacing: .18em; text-transform: uppercase; margin-top: 6px; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ny-tile-hide { display: none !important; }
/* two-column tiles: taller (4/5), smaller title, four lines at most */
[style*="grid"][style*="auto-fill, minmax(240px"] > .ny-tiled .ny-tile, [style*="grid"][style*="repeat(4,1fr)"] > .ny-tiled .ny-tile, [style*="grid"][style*="auto-fill, minmax(200px"] > .ny-tiled .ny-tile, [style*="grid"][style*="auto-fill, minmax(220px"] > .ny-tiled .ny-tile { aspect-ratio: 4 / 5; }
[style*="grid"][style*="auto-fill, minmax(240px"] > .ny-tiled .ny-tile-h, [style*="grid"][style*="repeat(4,1fr)"] > .ny-tiled .ny-tile-h, [style*="grid"][style*="auto-fill, minmax(200px"] > .ny-tiled .ny-tile-h, [style*="grid"][style*="auto-fill, minmax(220px"] > .ny-tiled .ny-tile-h { font-size: 18px; line-height: 1.15; }
[style*="grid"] > .ny-tiled .ny-tile-txt { padding: 10px 12px 12px; }

@media (min-width: 721px) { .ny-tile-h { font-size: 24px !important; } [style*="grid"] > .ny-tiled .ny-tile { aspect-ratio: 4 / 3 !important; } .ny-tile-txt { padding: 16px 18px 16px !important; } }
