/* Polaroid Desk - A Free Design by Bryant Smith (bryantsmith.com)

   A casual photo collection: rotated polaroid cards scattered on a pale
   desk. Everything you can see is controlled from this one file.
   Use the section headings below to jump to what you want to change.

   The palette, in short:
     pale desk   #e7e2d8      paper       #fbf9f4
     card white  #ffffff      ink         #2c2a27
     grey text   #6f6a61      accent      #2f7d7b  (soft teal)
*/


/* ---- BODY / DESK: the pale surface everything rests on ---- */

body {
    background-color: #e7e2d8;
    /* A faint wood-grain of light and shade, made only from gradients. */
    background-image:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 2px, rgba(0, 0, 0, 0.015) 2px 5px),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 65%);
    color: #2c2a27;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 17px;
    line-height: 1.7;
    margin: 0;
    padding: 48px 20px 40px 20px;
    text-align: center;
}

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


/* ---- HANDWRITING STACK ----
   System fonts only, but these three read like a marker on the back of a
   photo. Reused for the title, captions and small labels. */

h1, .tagline, figcaption, .howto h2, .about h2 {
    font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
}


/* ---- PAGE: the whole page behaves as one wide desk board ---- */

#page {
    margin: 0 auto;
    max-width: 940px;
    text-align: left;
}


/* ---- MASTHEAD: title, tagline and links ---- */

#masthead {
    border-bottom: 2px dashed rgba(44, 42, 39, 0.22);
    margin-bottom: 34px;
    padding-bottom: 26px;
    text-align: center;
}

#masthead h1 {
    color: #2c2a27;
    font-size: 52px;
    font-weight: normal;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

#masthead .tagline {
    color: #2f7d7b;
    font-size: 17px;
    letter-spacing: 1px;
    margin-top: 6px;
}


/* ---- MENU: the row of text links ---- */

#menu {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    margin-top: 22px;
    text-transform: uppercase;
}

#page #menu a,
#page #menu a:visited {
    border-bottom: 2px solid transparent;
    color: #6f6a61;
    margin: 0 10px;
    padding-bottom: 3px;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#page #menu a:hover,
#page #menu a:focus {
    border-bottom: 2px solid #2f7d7b;
    color: #2f7d7b;
    text-decoration: none;
}


/* ---- INTRO: the short note above the photos ---- */

.lead {
    color: #4a4741;
    font-size: 20px;
    line-height: 1.65;
    margin: 0 auto 46px auto;
    max-width: 640px;
    text-align: center;
}


/* ---- DESK / OFFSET GRID ----
   Six equal columns. Narrow cards take two of them, wide cards take three,
   so the rows are never quite even. align-items:start lets a "pushed"
   card hang lower than its neighbours. */

.desk {
    align-items: start;
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 30px;
}

/* ---- POLAROID CARD: white frame, thick bottom lip, drop shadow ---- */

.polaroid {
    background: #ffffff;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(44, 42, 39, 0.10), 0 12px 22px rgba(44, 42, 39, 0.13);
    grid-column: span 2;
    padding: 12px 12px 46px 12px;
    position: relative;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.polaroid:hover,
.polaroid:focus-within {
    box-shadow: 0 3px 6px rgba(44, 42, 39, 0.12), 0 22px 38px rgba(44, 42, 39, 0.20);
    transform: rotate(0deg) translateY(-6px);
    z-index: 5;
}


/* ---- TAPE: a translucent strip stuck across the top of each card ---- */

.polaroid::before {
    background: rgba(214, 203, 175, 0.62);
    box-shadow: 0 1px 2px rgba(44, 42, 39, 0.12);
    content: "";
    height: 24px;
    left: 50%;
    position: absolute;
    top: -11px;
    transform: translateX(-50%) rotate(-3deg);
    width: 86px;
    z-index: 2;
}

.polaroid.wide::before {
    width: 120px;
}


/* ---- ROTATION: each card gets its own playful tilt ---- */

.tilt-a { transform: rotate(-2.4deg); }
.tilt-b { transform: rotate(1.8deg); }
.tilt-c { transform: rotate(-1.1deg); }
.tilt-d { transform: rotate(2.2deg); }
.tilt-e { transform: rotate(-1.6deg); }
.tilt-f { transform: rotate(1.3deg); }

/* A card that hangs a little lower than its row-mates. */
.push {
    margin-top: 34px;
}

.polaroid.wide {
    grid-column: span 3;
}

/* Wide cards get a landscape photo, which breaks up the square rhythm. */
.polaroid.wide .photo {
    aspect-ratio: 4 / 3;
}


/* ---- PHOTO: gradient placeholders instead of image files ----
   To use a real photo, replace the .photo div with <img>. The rule
   below makes any swapped-in image square and neatly cropped. */

.photo {
    aspect-ratio: 1 / 1;
    background-position: center;
    background-size: cover;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(44, 42, 39, 0.12);
    width: 100%;
}

.photo img {
    border-radius: 3px;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.photo-1 {
    background-image:
        radial-gradient(circle at 68% 28%, rgba(255, 244, 214, 0.95) 0 12%, rgba(255, 244, 214, 0) 45%),
        linear-gradient(180deg, #f4c98d 0%, #e79a6b 50%, #b7624f 100%);
}

.photo-2 {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0) 58%, rgba(255, 255, 255, 0.32) 60%, rgba(255, 255, 255, 0) 64%),
        linear-gradient(180deg, #c6e3e0 0%, #7fb6b3 55%, #3f7c80 100%);
}

.photo-3 {
    background-image:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.55) 0 10%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(158deg, #dbe6c4 0%, #9dbb82 52%, #5f7f4a 100%);
}

.photo-4 {
    background-image:
        radial-gradient(circle at 76% 74%, rgba(255, 226, 178, 0.7) 0 8%, rgba(255, 226, 178, 0) 32%),
        linear-gradient(180deg, #e3d3e8 0%, #a98fc0 55%, #6b5588 100%);
}

.photo-5 {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0) 52%, rgba(255, 255, 255, 0.28) 53%, rgba(255, 255, 255, 0) 57%),
        linear-gradient(180deg, #cddcef 0%, #8aa6c8 46%, #4d688c 100%);
}

.photo-6 {
    background-image:
        repeating-linear-gradient(96deg, rgba(44, 42, 39, 0.05) 0 9px, rgba(255, 255, 255, 0.05) 9px 18px),
        linear-gradient(180deg, #f3e2ad 0%, #d9b45c 55%, #9c7a2e 100%);
}


/* ---- CAPTION: the handwritten note under each photo ---- */

figcaption {
    color: #3a3833;
    font-size: 15px;
    line-height: 1.5;
    margin-top: 12px;
    text-align: center;
}


/* ---- HOW-TO NOTE: a sheet of paper sitting inside the grid ---- */

.howto {
    background: #fbf9f4;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(44, 42, 39, 0.08), 0 10px 20px rgba(44, 42, 39, 0.10);
    grid-column: span 4;
    padding: 30px 34px;
    transform: rotate(-0.7deg);
}

.howto h2,
.about h2 {
    color: #2c2a27;
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 14px;
}

.howto p,
.about p {
    color: #4a4741;
    font-size: 16px;
    margin-bottom: 14px;
}

.howto p:last-child,
.about p:last-child {
    margin-bottom: 0;
}

.howto strong,
.about strong {
    color: #2f7d7b;
}


/* ---- ABOUT: a closing paragraph on the desk ---- */

.about {
    margin: 46px auto 0 auto;
    max-width: 620px;
    text-align: left;
}


/* ---- LINKS: the accent colour in running text ---- */

#page a,
#page a:visited {
    color: #2f7d7b;
    text-decoration: none;
}

#page a:hover,
#page a:focus {
    color: #1d5654;
    text-decoration: underline;
}


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

#footer {
    border-top: 2px dashed rgba(44, 42, 39, 0.22);
    color: #8a857b;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    margin-top: 60px;
    padding-top: 20px;
    text-align: center;
    text-transform: uppercase;
}

#footer a,
#footer a:visited {
    color: #6f6a61;
}

#footer a:hover {
    color: #2f7d7b;
}


/* ---- SMALL / MEDIUM SCREENS ----
   Two columns on tablets, one column on phones, and the tilts calm down
   so nothing pokes off the edge of a narrow screen. */

@media (max-width: 900px) {
    .desk {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .polaroid {
        grid-column: span 1;
    }

    .polaroid.wide,
    .howto {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
        padding: 32px 14px 28px 14px;
    }

    #masthead h1 {
        font-size: 38px;
    }

    .lead {
        font-size: 18px;
        margin-bottom: 34px;
    }

    .desk {
        gap: 24px;
        grid-template-columns: minmax(0, 1fr);
    }

    .polaroid,
    .polaroid.wide,
    .howto {
        grid-column: auto;
    }

    .push {
        margin-top: 0;
    }

    .tilt-a, .tilt-b, .tilt-c,
    .tilt-d, .tilt-e, .tilt-f,
    .howto {
        transform: rotate(0deg);
    }

    .howto {
        padding: 24px 22px;
    }
}


/* ---- PRINT: unstick everything for a tidy sheet of paper ---- */

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

    .polaroid,
    .howto {
        box-shadow: none;
        transform: none;
    }

    .polaroid::before {
        display: none;
    }
}
