/* Phone layout of the Cat & Dan wedding website, written by hand.
   Below 700 pixels wide each section becomes one centred column. Elements
   appear in Canva's reading order (top to bottom, then left to right, stored
   as --o by the converter) unless a rule below sets a different order.
   A .cluster keeps its desktop arrangement, scaled to the phone's width. */

@media (max-width: 700px) {
  .nav { gap: 22px; font-size: 18px; padding: 12px 8px; }

  .sec {
    aspect-ratio: auto;
    container-type: normal;
    display: flex; flex-flow: row wrap; justify-content: center; align-content: flex-start;
    gap: 16px 12px;
    padding: 56px 24px;
    --u: 0.62px;
  }

  /* Elements leave their desktop positions and join the column. */
  .grp { display: contents; }
  .el {
    position: relative; left: auto; top: auto;
    width: calc(var(--w) * var(--u)); height: auto;
    max-width: 100%;
    order: var(--o, 0);
    z-index: 1;
  }
  .pic, .shape { aspect-ratio: var(--w) / var(--h); }
  .txt { width: 100%; }
  .r-h { font-size: calc(var(--fs) * 0.52px); }
  .r-script { font-size: calc(var(--fs) * 0.68px); }
  .r-body { font-size: calc(var(--fs) * 0.66px); }
  .txt span { font-size: inherit; }
  .txt .r-h { font-size: calc(var(--fs) * 0.52px); }
  .txt .r-script { font-size: calc(var(--fs) * 0.68px); }
  .txt .r-body { font-size: calc(var(--fs) * 0.66px); }
  .txt { line-height: 1.45 !important; }
  .txt .nl { display: none; }
  .txt .sp { display: inline; }
  .t-h { line-height: 1.15 !important; }

  /* Buttons */
  .btn { width: auto; aspect-ratio: auto; padding: 6px 30px; border-radius: 22px; border-width: 3px; transform: none; }
  .btn .t-btn span { font-size: 24px; }

  /* Maps */
  .map { width: 100%; height: 260px; }

  /* Straight decorative lines are desktop-only. */
  .line { display: none; }

  /* Background textures fill the whole section. */
  .bg, .bgpic {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
    transform: none; aspect-ratio: auto; z-index: 0;
  }
  .bg img, .bgpic img {
    left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    object-fit: cover; transform: none !important;
  }

  /* Clusters keep their desktop arrangement at phone scale. */
  .cluster {
    position: relative; inset: auto;
    width: min(100%, calc(var(--cw, 9999) * 1px));
    aspect-ratio: var(--gw) / var(--gh);
    container-type: inline-size;
    --u: calc(100cqw / var(--gw));
    order: var(--o);
    pointer-events: auto;
    z-index: 1;
  }
  .grp.cluster { display: block; }
  .cluster .el {
    position: absolute;
    left: calc((var(--x) - var(--gx)) * var(--u));
    top: calc((var(--y) - var(--gy)) * var(--u));
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
    max-width: none;
    aspect-ratio: auto;
  }
  .cluster .txt span, .cluster .txt .r-h, .cluster .txt .r-script, .cluster .txt .r-body {
    font-size: calc(var(--fs) * var(--u));
  }
  .cluster .txt { line-height: inherit !important; }

  /* Panels: the rounded boxes behind a section's content. */
  #LBQTKWLG2CWxv7b8, #LBmFKHbHm3PskrJ3, #LBvFwxTpTGgDBjH8, #LB5hQm8MRZtSbC0R {
    position: absolute; inset: 20px 12px; width: auto; height: auto; max-width: none;
    aspect-ratio: auto; border-radius: 18px; z-index: 0;
  }

  /* ---------- Wedding page ---------- */

  /* Welcome: the bow frame keeps its top and bottom and stretches only
     along its plain sides. */
  #welcome { padding: calc((100vw - 24px) * 0.2) 40px calc((100vw - 24px) * 0.2); gap: 10px; }
  #welcome::before {
    content: ''; position: absolute; inset: 12px; z-index: 1;
    border-style: solid; border-width: 0;
    border-image-source: url(../assets/img/MAHVGzwZ8FI.webp);
    border-image-slice: 38% 0 38% 0 fill;
    border-image-width: calc((100vw - 24px) * 0.225) 0;
    border-image-repeat: stretch;
  }
  #LBkDm5MdXvfDdKtY { display: none; }
  #welcome .el:not(.bg) { z-index: 2; }
  #LBTd03VvHRggKQWF { order: 1; }
  #LB0FgK0ggmGn7vkk { order: 2; }
  #LB0FgK0ggmGn7vkk .r-script { font-size: 21px; }
  #LBYGJg8FgW4NcqnP { order: 3; margin-top: 14px; }
  #LBbqcftd1WJtWJxd { order: 4; width: 130px; }
  #LBpqcsJRjjsTLV1k { order: 5; }

  /* Venue: the photo runs edge to edge with its RSVP note on top. */
  #venue { padding-top: 0; }
  #LBXGXY718BWFvFvK { order: 0; }
  #LBXGXY718BWFvFvK {
    width: calc(100% + 48px); max-width: none; margin: 0 -24px 24px;
    aspect-ratio: 390 / 420; border-radius: 0;
  }
  #LBXGXY718BWFvFvK img { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; object-fit: cover; object-position: 62% 50%; }
  /* The group covers the photo exactly (same width and aspect ratio). The
     text sits in the sky at the top; the button is pushed to the bottom, over
     the rock wall by their feet, so it never covers their faces (Daniel,
     3 December 2026). The bracketed note sits under the button, and the pair
     stays clear of the photo's bottom edge (Daniel, 3 December 2026). */
  #LBphrQvtFMGvz0nF {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    position: absolute; left: 0; right: 0; top: 0; z-index: 2;
    aspect-ratio: 390 / 420; padding: 22px 0 30px; box-sizing: border-box;
  }
  #LBJFF7JVdrxk1W5h { order: 1; }
  #rsvp-note { order: 3; width: 240px; }
  #rsvp-note .r-body { font-size: 13px; }
  #LBK8Xdw4QTqwtBzs { order: 2; margin-top: auto; }
  #LBJFF7JVdrxk1W5h { width: 220px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45); }
  #LBj4Kv3xnn54Ps7c { order: 1; width: 200px; }
  #LBggK3bcnsYqRlPG { order: 2; }
  #LBGdTykg1prQw093 { order: 3; }
  #venue .cluster { order: 4; margin-top: 12px; }

  /* Directions */
  #directions { padding: 52px 32px; }
  #LBJk6qQld0XYGZXz { order: 1; }
  #LBLZqq5fnB6hVRS6 { order: 2; }
  #LBHQ10gff756LhYq { order: 3; border-radius: 12px; }

  /* Our Story teaser: photo with the note and button at its foot. */
  #story-teaser { padding: 0; min-height: 520px; align-content: flex-end; padding-bottom: 36px; }
  #LBBzpDM9Wmmdrp4k {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; z-index: 0;
  }
  #LBBzpDM9Wmmdrp4k img { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; object-fit: cover; object-position: 30% 50%; }
  #story-teaser::after {
    content: ''; position: absolute; inset: 40% 0 0 0; z-index: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
  }
  #LBKmHhj4zWWt7K4B { order: 1; width: 260px; z-index: 2; }
  #LBtPbYVGygyF9Lw3 { order: 2; z-index: 2; }

  /* Programme. The heading, flourishes and date run across the full width.
     Below them each item is one row of three columns, alternating:
       drinks drawing | Welcome Drinks + time | arrow
       arrow          | Ceremony + time       | ring drawing
       croquet drawing| Cocktail Hour + time  | arrow
       (empty)        | Reception + time      | disco drawing
     Grid rows 7, 10 and 13 are empty spacers that keep the items apart.
     The three arrows are the same size: the first is a copy of the third
     (#phone-arrow-1), because Canva's first arrow is a shorter shape. Each
     is turned to point down and mirrored so it bows outwards, and sits
     beside its own item's text, next to the middle column. */
  #programme {
    display: grid;
    grid-template-columns: minmax(66px, 1fr) minmax(0, 200px) minmax(66px, 1fr);
    grid-template-rows: repeat(6, auto) 40px auto auto 40px auto auto 40px auto auto;
    gap: 4px 6px; padding-left: 14px; padding-right: 14px;
  }
  #programme > .el, #programme .grp > .el, #programme .cluster { justify-self: center; }
  #LBhlcHp71LvRmfrP { grid-area: 1 / 1 / 2 / -1; width: 230px; margin-bottom: 4px; }
  #LB5cV1FLgWlBZ2Nc { grid-area: 2 / 1 / 3 / -1; }
  #LBbQm2q7mYZdScPQ { grid-area: 3 / 1 / 4 / -1; width: 230px; margin-top: 4px; }
  #programme .cluster { grid-area: 4 / 1 / 5 / -1; --cw: 260; margin: 8px 0 28px; }

  /* names and times in the middle column */
  #LBBy6zTJ7FBMmyf2 { grid-area: 5 / 2; }
  #LBMWDcYLcWbJ4KBv { grid-area: 6 / 2; }
  #LBzPxCCbVK31XL7s { grid-area: 8 / 2; }
  #LB4232ChzFhkRr2v { grid-area: 9 / 2; }
  #LB85jBMbql4Qg83t { grid-area: 11 / 2; }
  #LBqKsJ7dht06kq6P { grid-area: 12 / 2; width: 100%; }
  #LBDxl8BV0TsyGFph { grid-area: 14 / 2; }
  #LBcNwxHRK35NLwcQ { grid-area: 15 / 2; }
  #programme .txt { align-self: center; }

  /* drawings, each beside its own name and time */
  #LBKpmxcrxY81kjPP { grid-area: 5 / 1 / 7 / 2; width: 74px; }
  #LBJWBBz9JnCFFfZp { grid-area: 8 / 3 / 10 / 4; width: 56px; }
  #LBH0ppx6T2DtPDrD { grid-area: 11 / 1 / 13 / 2; width: 74px; }
  #LBXs2Q0qLnRV0Nmf { grid-area: 14 / 3 / 16 / 4; width: 74px; }
  #LBKpmxcrxY81kjPP, #LBJWBBz9JnCFFfZp, #LBH0ppx6T2DtPDrD, #LBXs2Q0qLnRV0Nmf { align-self: center; }

  /* arrows, on the side opposite the drawing */
  #programme #LBVztxFnZKXPFMRQ { display: none; }
  #phone-arrow-1 { grid-area: 5 / 3 / 7 / 4; justify-self: start; margin-left: -30px; }
  #LBzrn22QjYGZ9GWS { grid-area: 8 / 1 / 10 / 2; justify-self: end; margin-right: -30px; }
  #LBHGqcwVL2JhCS8Z { grid-area: 11 / 3 / 13 / 4; justify-self: start; margin-left: -30px; }
  #programme .curve {
    display: block; width: 76px; aspect-ratio: var(--w) / var(--h);
    align-self: center;
    /* the box is 76 pixels wide before turning, but the turned arrow is
       only about 34 pixels wide, so a negative margin on the text side
       brings the arrow itself up to the middle column */
    transform: scaleX(-1) rotate(90deg);
  }

  /* Dress code */
  #dress-code { padding: 64px 36px; }
  #LB9wqkyclKKMy69q { order: 1; }
  #LBj8fDHzYDPhxrC5 { order: 2; }
  #LBCCqjn38nsdL3GX { order: 3; margin-top: 10px; }
  #dress-code .cluster { order: 4; --cw: 300; margin-top: 4px; }
  #LBzLfwtgqjVmmGnk, #LBqxGkpnkXjYZv5P { order: 5; width: 74px; margin: 14px 18px 0; }

  /* Staying over */
  #LBK4tLH0wbQ3lYvG { order: 1; width: 170px; }
  #LBljW96dNnsjGPV3 { order: 2; }
  #LBvRn8v7HmprLl08 { order: 3; }
  #LBNr8kR2LgD3WLdt { order: 4; margin-top: 12px; }

  /* RSVP */
  #rsvp { padding: 60px 36px; }
  #LBKccPzwXmNLN6ys { order: 1; width: 100%; }
  #LBd6Ndcr3JQfV9z5 { order: 2; }
  #LBVSLLCzrVGD4jgg { order: 3; width: 70px; }
  #LBnRqhP1BqgRfxth { order: 4; }
  #LBtwpS7TVxcK2RMt { order: 5; margin: 8px 0; }
  #LBPWrBx0qHy8bP3N { order: 6; width: 100%; }

  /* FAQ */
  #LBKNZzDqH3RvjkPW { order: 1; }
  #LBKGnJ2QntrZxqx0 { order: 2; width: 110px; }
  #LBtPMDvfQFLvPk9k { order: 3; margin-top: 14px; }
  #LBW8yvnz54wqSDT2 { order: 4; }
  #LB11xPgkQQPSK1fg { order: 5; margin-top: 14px; }
  #LBdnY04Sq98DThQh { order: 6; }
  #LBVG8MJ6QYvKJNVh { order: 7; margin-top: 14px; }
  #LBxj56MsZHSQdZsZ { order: 8; }
  #LB9sV3wTr5jzHFFB { order: 9; width: 90px; margin-top: 18px; }
  #LB0tZz3CZkgqL0V2 { order: 10; }
  #LBcd2BFNtwS24mh0 { order: 11; }
  /* Registry and Honeymoon fund buttons side by side. */
  #faq .gift-btns { display: flex; order: 12; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; position: relative; z-index: 1; }
  #faq .gift-btns .btn { padding: 6px 18px; }
  #faq .gift-btns .btn .t-btn span { font-size: 20px; }
  #faq .txt { --gap: 0; }

  /* See you there */
  #see-you-there { padding: 48px 20px 56px; gap: 22px; }
  #LB9RmTX39S3N1zZJ { order: 50; }
  #see-you-there .cluster:last-of-type { --cw: 342; }

  /* ---------- Our Story page ---------- */
  #LBDRRDmWK94gxJtq { order: 1; }
  #LBJdNlPtKySnxwSn { order: 2; width: 80px; }
  #LBSHymk7dcRkspzN { order: 3; }
  #LB58pG1ZJtHRk7DC { order: 4; --cw: 280; margin-top: 12px; }

  #LBxgZhJJFzYP9tk2 { order: 1; }
  #LBSqdkd2PppYG1jy { order: 2; width: 150px; }
  #LB5hXb3YXphNV7c5 { order: 3; }
  #adventures-frame-2 { order: 4; --cw: 260; }
  #LBcb8Np0TvQmRTCt { order: 5; }
  #adventures-frame-1 { order: 6; --cw: 220; }
  #LB86qkqJzyMf6KgT { display: flex; order: 7; width: 100%; margin-top: 16px; }
  #LBQ4wSjKqLV4t3fg { width: 100%; aspect-ratio: 4 / 3; height: auto; }
  #adventures-gallery { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; padding: 12px; z-index: 2; }
  #adventures-gallery .gallery-track, #adventures-gallery img { border-radius: 10px; }
  #adventures-gallery .gallery-track { gap: 10px; }
  #adventures-gallery .prev { left: 4px; }
  #adventures-gallery .next { right: 4px; }
  #LB86qkqJzyMf6KgT { position: relative; inset: auto; }

  #LByfFV8YcDDCPgRg { order: 1; }
  #LBrqGG4JnXT0X3M6 { order: 2; width: 100px; }
  #LB3dWlBwmlG550ry { order: 3; }
  #the-next-chapter .cluster { order: 4; --cw: 280; margin-top: 12px; }

  /* ---------- Accommodation page ---------- */
  #LBrbQD69Y4jydDPH { order: 1; }
  #LB1zZtlyDCyty7F2 { order: 2; width: 110px; }
  #LB9rPhf7Gg5V16jB { order: 3; }
  #LBBN0gkBY7Mw5b3T, #LBVgH8fkcXL6mY4k, #LBYVsFZSNQ44lpmc {
    display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; margin-top: 22px;
    position: relative; inset: auto;
  }
  #LBBN0gkBY7Mw5b3T { order: 4; }
  #LBVgH8fkcXL6mY4k { order: 5; }
  #LBYVsFZSNQ44lpmc { order: 6; }
  #accommodation .map { height: 240px; }
}
