/* Boarding Pass - A Free Design by Bryant Smith (bryantsmith.com)
   Everything about the look of the pass lives here. The file is split
   into the same sections you can see on the page, so use the comment
   headings below to jump to whatever you want to change.

   Palette
     paper   #fbfaf6   the pass itself
     tint    #f3f0e7   the tear-off stub
     ink     #14213d   nearly-black navy for text and bars
     accent  #c1501c   the single warm orange
     muted   #6b6757   small labels
     desk    #e7e4db   the background the pass rests on
*/

/* ---- RESET & BODY: the check-in desk ---- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #e7e4db;
    color: #14213d;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    padding: 48px 16px;
}


/* ---- PAGE: holds the pass and the fine print, nicely centred ---- */

#page {
    margin: 0 auto;
    max-width: 900px;
}


/* ---- THE PASS: a grid of coupon + stub, with punched notches ----
   The whole pass is one rounded card. The coupon is the flexible
   column; the stub is a fixed 232px column on the right. */

.pass {
    background: #fbfaf6;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 33, 61, 0.08),
                0 18px 40px rgba(20, 33, 61, 0.16);
    display: grid;
    grid-template-columns: 1fr 232px;
    overflow: hidden;      /* clips the notches into half-circles */
    position: relative;
}

/* let the two grid columns shrink on narrow screens */
.coupon,
.stub {
    min-width: 0;
}


/* ---- COUPON TOP: the coloured airline band across the top ---- */

.coupon-top {
    align-items: center;
    background: #14213d;
    color: #fbfaf6;
    display: flex;
    justify-content: space-between;
    padding: 18px 28px;
}

.airline {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
}

.doc {
    background: #c1501c;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 2px;
    padding: 5px 12px;
    text-transform: uppercase;
}

.coupon-body {
    padding: 26px 28px 30px 28px;
}


/* ---- CLASS TAG: the small "Class: Portfolio" line ---- */

.class-tag {
    color: #6b6757;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.class-tag strong {
    color: #c1501c;
    margin-left: 6px;
}


/* ---- ROUTE: the big from / to codes with a dashed line ---- */

.route {
    align-items: center;
    display: flex;
    gap: 16px;
    margin: 14px 0 4px 0;
}

.endpoint {
    display: flex;
    flex-direction: column;
}

.endpoint--to {
    text-align: right;
}

.endpoint .code {
    font-family: "Courier New", Courier, monospace;
    font-size: 42px;
    font-weight: bold;
    letter-spacing: 2px;
    line-height: 1;
}

.endpoint--to .code {
    color: #c1501c;
}

.endpoint .place {
    color: #6b6757;
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-top: 6px;
    text-transform: uppercase;
}

/* the horizontal dashed line joining the two codes */
.route-line {
    border-top: 2px dashed #c7c2b2;
    flex: 1;
    height: 0;
    position: relative;
}

/* a small dot at the start of the route */
.route-line::before {
    background: #c7c2b2;
    border-radius: 50%;
    content: "";
    height: 8px;
    left: 0;
    position: absolute;
    top: -5px;
    width: 8px;
}

/* an arrowhead at the end of the route, drawn from borders */
.route-line::after {
    border-bottom: 6px solid transparent;
    border-left: 10px solid #c1501c;
    border-top: 6px solid transparent;
    content: "";
    position: absolute;
    right: -1px;
    top: -6px;
}


/* ---- FIELDS: the grid of labelled ticket details (a list) ---- */

.fields {
    border-top: 1px solid #e6e2d6;
    display: grid;
    gap: 16px 18px;
    grid-template-columns: repeat(3, 1fr);
    list-style: none;
    margin: 26px 0 6px 0;
    padding-top: 20px;
}

.fields li {
    border-left: 2px solid #eae6da;
    padding-left: 12px;
}

.fields .label {
    color: #6b6757;
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.fields .value {
    color: #14213d;
    display: block;
    font-family: "Courier New", Courier, monospace;
    font-size: 17px;
    font-weight: bold;
}


/* ---- MENU: the row of navigation links on the coupon ---- */

#menu {
    border-top: 1px solid #e6e2d6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 22px;
    padding-top: 16px;
}

#menu a,
#menu a:visited {
    border-bottom: 2px solid transparent;
    color: #55516a;
    font-size: 11px;
    letter-spacing: 1.5px;
    padding-bottom: 2px;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#menu a:hover,
#menu a:focus {
    border-bottom-color: #c1501c;
    color: #c1501c;
}


/* ---- STUB: the tear-off half, separated by a dashed edge ---- */

.stub {
    background: #f3f0e7;
    border-left: 2px dashed #cfc9b8;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    position: relative;
}

/* the two punched notches, made from circles in the desk colour.
   They straddle the perforation line and are clipped by the pass,
   leaving two clean half-circle bites. */
.stub::before,
.stub::after {
    background: #e7e4db;
    border-radius: 50%;
    content: "";
    height: 22px;
    left: -11px;
    position: absolute;
    width: 22px;
}

.stub::before {
    top: -11px;
}

.stub::after {
    bottom: -11px;
}

.stub-title {
    color: #6b6757;
    font-size: 10px;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}


/* ---- STUB LIST: the repeated details on the stub ---- */

.stub-list {
    list-style: none;
    margin: 18px 0 22px 0;
}

.stub-list li {
    border-bottom: 1px dotted #d4cebc;
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
}

.stub-list .k {
    color: #6b6757;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stub-list .v {
    color: #14213d;
    font-family: "Courier New", Courier, monospace;
    font-size: 13px;
    font-weight: bold;
}


/* ---- BARCODE: pure CSS, from a repeating gradient ----
   Each pair of numbers is a bar width then a gap width, in
   pixels. Because the gradient repeats, the stripes begin
   again every 47px. No image file is used. */

.barcode {
    background: #fbfaf6;
    background-image: repeating-linear-gradient(
        90deg,
        #14213d 0 2px,
        transparent 2px 4px,
        #14213d 4px 5px,
        transparent 5px 6px,
        #14213d 6px 9px,
        transparent 9px 11px,
        #14213d 11px 12px,
        transparent 12px 15px,
        #14213d 15px 17px,
        transparent 17px 18px,
        #14213d 18px 22px,
        transparent 22px 24px,
        #14213d 24px 25px,
        transparent 25px 27px,
        #14213d 27px 29px,
        transparent 29px 32px,
        #14213d 32px 33px,
        transparent 33px 34px,
        #14213d 34px 37px,
        transparent 37px 39px,
        #14213d 39px 41px,
        transparent 41px 44px,
        #14213d 44px 45px,
        transparent 45px 47px
    );
    height: 66px;
    margin-top: auto;
}

.code-number {
    color: #55516a;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    letter-spacing: 4px;
    margin-top: 8px;
    text-align: center;
}


/* ---- NOTES: the "how to use this template" fine print ---- */

.notes {
    background: #fbfaf6;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 33, 61, 0.06),
                0 10px 24px rgba(20, 33, 61, 0.08);
    margin-top: 22px;
    padding: 26px 28px;
}

.notes h2 {
    color: #c1501c;
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.notes p {
    color: #4b5268;
    font-size: 14px;
    margin-bottom: 12px;
    max-width: 66ch;
}

.notes p:last-child {
    margin-bottom: 0;
}

.notes a,
.notes a:visited {
    border-bottom: 1px solid #e0b39c;
    color: #c1501c;
    text-decoration: none;
}

.notes a:hover {
    border-bottom-color: #8f3813;
    color: #8f3813;
}


/* ---- FOOTER: the required credit link ---- */

#footer {
    color: #55516a;
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 34px;
    text-align: center;
    text-transform: uppercase;
}

#footer a,
#footer a:visited {
    color: #14213d;
    text-decoration: none;
}

#footer a:hover {
    color: #c1501c;
}


/* ---- MEDIUM SCREENS: give the coupon a little more room ---- */

@media (max-width: 760px) {
    .pass {
        grid-template-columns: 1fr 190px;
    }

    .coupon-body {
        padding: 22px 20px 24px 20px;
    }

    .coupon-top {
        padding: 16px 20px;
    }

    .endpoint .code {
        font-size: 34px;
    }
}


/* ---- SMALL SCREENS: stack the stub under the coupon ---- */

@media (max-width: 640px) {
    body {
        padding: 28px 12px;
    }

    .pass {
        grid-template-columns: 1fr;
    }

    .fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .stub {
        border-left: none;
        border-top: 2px dashed #cfc9b8;
    }

    /* move the notches to the left and right of the new top seam */
    .stub::before {
        left: -11px;
        top: -11px;
    }

    .stub::after {
        bottom: auto;
        left: auto;
        right: -11px;
        top: -11px;
    }
}


/* ---- TINY SCREENS: shrink the big route codes to fit ---- */

@media (max-width: 420px) {
    .coupon-top {
        padding: 14px 16px;
    }

    .airline {
        font-size: 17px;
    }

    .doc {
        letter-spacing: 1px;
        padding: 4px 8px;
    }

    .coupon-body {
        padding: 20px 16px 22px 16px;
    }

    .endpoint .code {
        font-size: 28px;
    }

    #menu {
        gap: 8px 12px;
    }
}


/* ---- PRINT: drop the desk, shadows and links for a clean pass ---- */

@media print {
    body {
        background: #ffffff;
        padding: 0;
    }

    .pass,
    .notes {
        box-shadow: none;
    }

    #menu {
        display: none;
    }

    .stub::before,
    .stub::after {
        display: none;
    }

    .stub {
        border-top: none;
        border-left: 2px dashed #cfc9b8;
    }
}
