/* =====================================================================
   COMBINED SITE STYLESHEET
   =====================================================================
   Loaded by every page (index.html, works-lander.html,
   works-digital.html). Previously split across styles.css and
   styles-gallery.css with a duplicated reset + font-face between the
   two (plus a third file, "styles - Copy.css", that was a byte-for-
   byte duplicate of styles.css and has been dropped entirely rather
   than merged). Combined here into one file so there's a single
   source of truth for shared rules like the reset, the custom font,
   and the header/nav.

   Sections in this file:
     1. CSS variables (:root)
     2. Global reset
     3. Custom font (@font-face)
     4. Base page styles (body, html)
     5. Shared header & nav (.site-header / .site-nav)
     6. Category grid    — index.html / works-lander.html
     7. Photo gallery grid — works-digital.html (and any future
        works-<category>.html pages)
     8. Lightbox — the full-screen photo viewer
     9. About / Contact page layout — about.html, contact.html
    10. Contact form — contact.html
    11. Responsive media queries
   ===================================================================== */


/* =====================================================================
   1. CSS VARIABLES
   ===================================================================== */
:root {
    /* THE site font. Every font-family rule in this file points at
       this one variable, so changing the font anywhere on the site
       — including the gallery page — means editing this single
       line, nowhere else.

       To use a DIFFERENT font on just one page instead, give that
       page's <body> an id (index.html, works-lander.html, and
       works-digital.html already have one) and override the
       variable scoped to that id, e.g.:

         #works-digital-page { --font-family: 'someOtherFont', sans-serif; }

       Custom properties inherit down from wherever they're set, so
       that one override automatically cascades into every rule on
       that page that reads var(--font-family) — body, .caption,
       .grid-item::after, etc. — without touching any other page. */
    --font-family: 'aeroregular', sans-serif;

    /* Main site palette — index.html & works-lander.html */
    --color-bg: #111111;
    --color-text: #ffffff;

    /* Gallery-viewer palette — works-digital.html (and any future
       gallery page). Kept deliberately separate from the palette
       above: the gallery page currently ships its own charcoal
       background, warm off-white text, and amber accent color
       instead of the main site's pure black/white. This merge
       preserves that as-is rather than silently unifying the two
       looks — say the word if you'd rather the gallery matched the
       main site's palette/font exactly. */
    --gallery-color-bg: #14141a;
    --gallery-color-surface: #1e1e26;
    --gallery-color-text: #f2efe9;
    --gallery-color-text-muted: #a9a6b0;
    --gallery-color-accent: #f2a154;

    /* Size of the images in the About page's two image cells (left
       cell, and the top half of the right column). A single pair of
       parameters instead of the images always being force-stretched
       to fill 100% of their cell — change these two values to
       resize them. Any unit works (px, %, rem, vh...). The cell
       itself keeps centering whatever size image you set (see
       .about-image below), so shrinking these won't leave the image
       stuck in a corner. */
    --about-image-width: 100%;
    --about-image-height: 100%;

    /* Size of the image in the Contact page's right-hand cell (see
       .contact-image below). Same idea as --about-image-width/height
       above, but kept as its own pair of variables since the
       Contact page's image is deliberately smaller than the About
       page's — change these two values to resize just this image.
       Any unit works (px, %, rem, vh...); the cell itself keeps
       centering whatever size you set. */
    --contact-image-width: 400px;
    /* --contact-image-height: 50%; */

    /* Height of the About page's whole two-cell row (.about-grid).
       It's used as min-height, not height, so the row can still
       grow if content ever needs more room — but this is what
       you'll see day to day. Try a fixed unit like 600px instead of
       a vh value if you'd rather it stay locked regardless of
       viewport size. */
    --about-container-height: 70vh;

    /* Same idea, for the Contact page's row (.contact-grid). Kept
       as its own variable (rather than reusing
       --about-container-height) so the two pages' row heights can
       be tuned independently. */
    --contact-container-height: 70vh;

    /* Split between the right column's top (image) and bottom
       (text) cells (.about-column). Equal by default. Any
       grid-template-rows value works for either one — e.g. set
       --about-top-row to "2fr" for a taller image, or to a fixed
       size like "300px" to lock the image's height and let the
       text fill whatever's left. */
    --about-top-row: 1fr;
    --about-bottom-row: 1fr;

    /* Shared */
    --radius: 0px;
}


/* =====================================================================
   2. GLOBAL RESET
   Removes default browser spacing and makes sizing calculations
   predictable (padding/border counted INSIDE an element's width, not
   added on top of it) before any custom styles are applied.
   ===================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* Safety net: any image without its own explicit sizing rule (the
   hero/logo/nav images) scales down instead of overflowing on
   narrow viewports. Images with their own width/height + object-fit
   rules (.thumb-btn img, .about-image img, .contact-image img,
   .lightbox-image) override this via specificity, so this only
   affects the ones that previously had none. */
img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* =====================================================================
   3. CUSTOM FONT
   ===================================================================== */
@font-face {
    font-family: 'aeroregular';
    src: url('fonts/aero-webfont.woff2') format('woff2'),
         url('fonts/aero-webfont.woff') format('woff'),
         url('fonts/Aero.ttf') format('truetype');
    /* FIXED: this used to point at "fonts/aero.tff" — a typo
       (.tff instead of .ttf) that also didn't match the actual
       file's capitalization (Aero.ttf). Any browser that had to
       fall back to the truetype source (i.e. couldn't use woff or
       woff2) would have failed to load the font at all. */
}


/* =====================================================================
   4. BASE PAGE STYLES
   ===================================================================== */
body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
}

/* Opt-in override for gallery-style pages — add class="page-gallery"
   to <body> (see works-digital.html) to switch to the gallery color
   palette instead of the main site's. Font is intentionally NOT
   overridden here anymore — every page now shares the one
   var(--font-family) set at :root above, so this class only
   controls color/layout, not typeface. */
body.page-gallery {
    background: var(--gallery-color-bg);
    color: var(--gallery-color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* stacks header / grid vertically */
}

/* Small centering helper — replaces the deprecated align="center"
   HTML attribute that index.html used to use. */
.center {
    text-align: center;
}

/* Images are now display:block (see the global img rule above) so
   text-align:center no longer centers them on its own — block
   elements center via margin, not text-align. */
.center img {
    margin: 0 auto;
}


/* =====================================================================
   5. SHARED HEADER & NAV
   Used by works-lander.html and works-digital.html: logo on the
   left, primary nav links pushed to the right. (index.html doesn't
   use this — its header is just a centered logo, see .center above.)
   Previously this exact layout was written out as inline styles on
   every single link, on every page — pulled out here so it only
   needs to be defined, and changed, in one place.
   ===================================================================== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.site-nav {
    display: flex;
    align-items: center;
}

.site-nav a {
    text-decoration: none;
    color: inherit; /* follows whichever palette the page is using */
    margin-right: 20px;
    font-size: 20px;
}

.site-nav a:last-child {
    margin-right: 0; /* no trailing gap after the last nav link */
}

/* Small screens: stack logo above nav links instead of side-by-side,
   so the header reads top-to-bottom above the rest of the page content. */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}


/* =====================================================================
   6. CATEGORY GRID — index.html / works-lander.html
   A responsive grid of clickable category tiles, each with a
   background-image thumbnail and a caption that appears on hover.
   ===================================================================== */
.container {
    width: min(1400px, 95%);
    margin: 40px auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-item {
    position: relative;
    border: none;
    padding: 0;
    cursor: pointer;
    aspect-ratio: 16/9;

    background-size: cover;
    background-position: center;

    overflow: hidden;
    border-radius: var(--radius);

    transition: transform .3s ease;
}

/* Slightly enlarges the tile on hover — gated to real mouse/hover
   input only (see the touch-device query below for why). */
@media (hover: hover) and (pointer: fine) {
    .grid-item:hover {
        transform: scale(1.02);
    }
}

/* Invisible layer over each tile, used to display the caption on
   hover (desktop). On tablet/mobile the overlay is shown
   permanently instead — see the touch-device media query below. */
.overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0);

    transition: background .35s ease;
}

@media (hover: hover) and (pointer: fine) {
    .grid-item:hover .overlay {
        background: rgba(0, 0, 0, .75);
    }
}

/* Caption text shown in the center of the overlay. On desktop this
   text is inserted into the .caption element by js/script.js on
   hover (a typewriter effect). That JS-driven text never appears on
   tablet/mobile (no hover event there), so the touch-device media
   query below renders the caption straight from each tile's
   data-text attribute instead, independent of the JS. */
.caption {
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 2rem;
    letter-spacing: 2px;
    text-align: center;
    white-space: nowrap;

    min-height: 2.5rem;
}


/* =====================================================================
   7. PHOTO GALLERY GRID — works-digital.html
   The thumbnail grid built dynamically by js/script-gallery.js.
   Reusable as-is by any future works-<category>.html gallery page.
   ===================================================================== */
.grid-gallery {
    display: grid;

    /* Fixed 3-column layout on most screens; the two narrow-viewport
       media queries below switch to an auto-fill layout for
       small/short screens instead. A fully fluid
       repeat(auto-fill, minmax(clamp(...), 1fr)) approach (auto-
       sizing columns at every width, not just the narrow ones) was
       tried during development — worth revisiting if you want the
       column count to reflow smoothly at every screen size instead
       of the current fixed-3-then-narrow-override behavior. */
    grid-template-columns: repeat(3, 1fr);

    gap: 0.75rem;
    width: 100%;
    margin: 0 auto; /* centers the grid horizontally on wide screens */
    padding: 1.25rem;

    /* Vertically centers a short grid within the available space;
       items still fill from the top-left as normal. */
    align-content: center;
}

/* Each thumbnail is a real <button> (see works-digital.html) so
   it's keyboard-focusable and screen-reader friendly without extra
   ARIA plumbing. */
.thumb-btn {
    position: relative; /* positioning context, kept for consistency/future use */
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: var(--gallery-color-surface); /* shows briefly while an image loads */
    border-radius: var(--radius);
    overflow: hidden; /* clips the photo to the tile's corners */

    /* Locking every tile to a 1:1 square keeps the grid neat and
       evenly aligned regardless of each source photo's original
       proportions — the "scale to fit" part happens on the <img>
       inside (object-fit: cover, below). */
    aspect-ratio: 1 / 1;

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thumb-btn:hover,
.thumb-btn:focus-visible {
    transform: translateY(-2px); /* subtle lift on hover/focus */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Accessible keyboard-focus ring — important for anyone tabbing
   through the grid instead of clicking with a mouse. */
.thumb-btn:focus-visible {
    outline: 3px solid var(--gallery-color-accent);
    outline-offset: 2px;
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    /* Scales each photo to completely fill its square tile (cropping
       any excess) rather than stretching it out of shape or leaving
       empty letterboxed gaps. */
    object-fit: cover;
    display: block;

    transition: transform 0.25s ease; /* slight zoom on hover */

    /* Right-click/drag protection groundwork for thumbnails,
       layered with the JS-side preventDefault() calls. */
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.thumb-btn:hover img {
    transform: scale(1.06);
}

/* Currently unused — the matching <footer> markup in
   works-digital.html is commented out. Kept here so the footer's
   styling is ready to go if it's re-enabled later. */
.site-footer {
    background: var(--gallery-color-surface);
    text-align: center;
    padding: 0.9rem 1rem;
}

.site-footer p {
    color: var(--gallery-color-text-muted);
    font-size: 0.8rem;
    max-width: 700px;
    margin: 0 auto; /* centers the hint text within the footer */
}


/* =====================================================================
   8. LIGHTBOX — full-screen single-photo viewer
   ===================================================================== */
.lightbox {
    position: fixed;
    inset: 0; /* stretch to cover the entire viewport, all four sides */
    background: rgba(10, 10, 12, 0.94); /* dark, near-opaque backdrop */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10; /* sits above the thumbnail grid/header */
}

/* Toggled by script-gallery.js to show/hide the lightbox.
   display:none removes it from layout entirely (rather than just
   making it transparent), so it can't accidentally block clicks
   while "closed." */
.lightbox.is-hidden {
    display: none;
}

/* The sized box that hugs the photo — also the positioning anchor
   for the buttons and protection overlay stacked on top of it. */
.lightbox-image-wrapper {
    position: relative;
    max-width: 99vw;
    max-height: 99vh;
    line-height: 0; /* prevents a few stray pixels of inline-image whitespace below the image */
}

.lightbox-image {
    /* No fixed width/height and no object-fit here on purpose:
       letting the browser size the image naturally, then
       constraining it with max-width/max-height, scales EVERY photo
       down (preserving its own aspect ratio) just enough to fit the
       viewport — tall or wide — without ever cropping it. */
    max-width: 99vw;
    max-height: 99vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);

    /* Fades between photos; toggled from script-gallery.js via the
       "opacity" inline style, timed to match the setTimeout() there. */
    transition: opacity 0.2s ease;

    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Invisible div stacked exactly on top of .lightbox-image (see the
   HTML comments for the full right-click-protection explanation). */
.protection-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 2; /* above the image, below the nav/close buttons */
    cursor: default;
}

/* On-image navigation buttons, positioned absolutely INSIDE
   .lightbox-image-wrapper so they sit directly on top of the
   photo's left/right edges, vertically centered. */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3; /* above the protection overlay so it stays clickable */

    width: clamp(2.25rem, 5vw, 3rem);
    height: clamp(2.25rem, 5vw, 3rem);
    border-radius: 50%;
    border: none;
    cursor: pointer;

    /* Semi-transparent dark circle so the arrow stays visible and
       legible regardless of how light or busy the photo is. */
    background: rgba(20, 20, 26, 0.55);
    color: var(--gallery-color-text);
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.15s ease, transform 0.1s ease;
}

.lightbox-nav-btn:hover {
    background: var(--gallery-color-accent);
    color: #1a1a1a;
}

.lightbox-nav-btn:active {
    transform: translateY(-50%) scale(0.92); /* keep the translateY centering while adding a "press" effect */
}

.lightbox-nav-btn:focus-visible {
    outline: 3px solid var(--gallery-color-accent);
    outline-offset: 2px;
}

.lightbox-nav-btn--prev {
    left: 0.75rem;
}

.lightbox-nav-btn--next {
    right: 0.75rem;
}

/* Close ("×") button, pinned to the photo's top-right corner. */
.lightbox-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 3;

    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;

    background: rgba(20, 20, 26, 0.55);
    color: var(--gallery-color-text);
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.15s ease, transform 0.1s ease;
}

.lightbox-close:hover {
    background: var(--gallery-color-accent);
    color: #1a1a1a;
}

.lightbox-close:focus-visible {
    outline: 3px solid var(--gallery-color-accent);
    outline-offset: 2px;
}


/* =====================================================================
   9. ABOUT / CONTACT PAGE LAYOUT — about.html, contact.html
   =====================================================================
   A single horizontal row, two cells side by side. about.html and
   contact.html share this exact same layout system, just with the
   two cells swapped (contact.html mirrors it horizontally):
     - about.html:   LEFT = image,           RIGHT = image-over-text
     - contact.html: LEFT = image-over-form, RIGHT = text
   ===================================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;

    /* Gives the row a deliberate height so the left image and the
       right column read as one tall row, instead of collapsing to
       whatever height their content happens to need. Set via
       --about-container-height above. */
    min-height: var(--about-container-height);
}

/* Reused for BOTH image cells (left cell, and the top half of the
   right column) — one rule instead of duplicating it twice. Centers
   its image regardless of what size that image ends up being. */
.about-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius);
}

.about-image img {
    /* Sized off the --about-image-width/height variables above —
       change those two values to resize every image in this layout
       at once. */
    width: var(--about-image-width);
    height: var(--about-image-height);
    /* Fills its own box, cropping any excess, rather than
       stretching out of shape or leaving letterboxed gaps. Only
       matters once width/height above are no longer both 100%. */
    object-fit: cover;
    display: block;
}

/* A split cell: a nested 2-row grid so its own top (image) and
   bottom (text, or on contact.html, the form) split evenly,
   independent of the other cell's height. Split set via
   --about-top-row / --about-bottom-row above. */
.about-column {
    display: grid;
    grid-template-rows: var(--about-top-row) var(--about-bottom-row);
    gap: 24px;
}

.about-text {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertical centering */
    align-items: center;     /* horizontal centering of the h1/p boxes */
    text-align: center;      /* centers the text itself within those boxes */
    padding: 24px;
}

.about-text h1 {
    font-family: var(--font-family);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

/* Smaller heading used above the contact form (see contact.html) —
   a lighter-weight label rather than a second page-title. */
.about-text h2 {
    font-family: var(--font-family);
    font-size: 1.4rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.6;
}


/* =====================================================================
   9b. CONTACT PAGE LAYOUT — contact.html
   =====================================================================
   A flat 2-column, 1-row grid — one piece per column, no nested
   split like the About page has:
     LEFT cell  (.contact-text):  the contact form (see section 10
                                   below for the form itself)
     RIGHT cell (.contact-image): a single image
   Independent from .about-grid/.about-image/.about-text (section 9
   above) now that contact.html has its own classes — this means the
   two pages' layouts can be resized/tuned separately without one
   change affecting the other.
   ===================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;

    /* Row height — set via --contact-container-height above. */
    min-height: var(--contact-container-height);
}

/* Centers the image regardless of what size it ends up being (see
   --contact-image-width/height above). */
.contact-image {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius);
}

.contact-image img {
    /* Sized off --contact-image-width/height above — change those
       two values to resize the image. Defaults to 50%/50%, i.e.
       half the width and height of its cell, centered within it
       (unlike the About page's images, which default to 100% and
       fill their cell edge-to-edge) — bump both toward 100% for a
       larger image, or down for a smaller one. */
    width: var(--contact-image-width);
    height: var(--contact-image-height);
    object-fit: cover;
    display: block;
}

.contact-text {
    display: flex;
    flex-direction: column;
    justify-content: center; /* vertical centering */
    align-items: center;     /* horizontal centering of the h2/form */
    text-align: center;
    padding: 24px;
}

.contact-text h2 {
    font-family: var(--font-family);
    font-size: 1.4rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}


/* =====================================================================
   10. CONTACT FORM — contact.html
   =====================================================================
   Sits inside the .contact-text cell (see section 9b above). Name /
   email / message fields, plus a submit button that's an image
   (<input type="image">) rather than a normal <button>, per request.
   ===================================================================== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px; /* keeps fields a comfortable width rather than
                          stretching edge-to-edge inside the cell */
}

.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left; /* overrides .about-text's centered alignment —
                          labels/inputs read better left-aligned */
    font-size: 0.9rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    font-family: var(--font-family);
    font-size: 1rem;
    padding: 8px 10px;
    border: 1px solid var(--color-text);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 2px;
}

/* The image submit button. max-width keeps it from rendering at
   whatever size the source image file happens to be — swap the src
   for your own button graphic and adjust this if it needs to be
   bigger/smaller. */
.contact-submit {
    align-self: center;
    display: block;
    max-width: 160px;
    height: auto;
    cursor: pointer;
}


/* =====================================================================
   11. RESPONSIVE MEDIA QUERIES
   ===================================================================== */

/* ---- Category grid (index.html / works-lander.html) ---- */

/* Tablet + touch devices: 3 columns -> 2 columns, hover caption ->
   permanent CSS caption. */
@media (max-width: 900px), (hover: none), (pointer: coarse) {

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

    /* Hide the JS-driven (and normally empty) caption element so it
       can't clash with the CSS-generated one below. */
    .grid-item .caption {
        display: none;
    }

    .grid-item .overlay {
        background: rgba(0, 0, 0, .50);
        transition: none;
        pointer-events: none;
    }

    /* Touch devices (no real hover) get the caption shown
       permanently instead of on hover, generated straight from the
       data-text attribute — independent of the JS, and independent
       of screen width. That width-independence matters: a wide
       touchscreen laptop/tablet would otherwise be treated as
       "desktop" by a width-only breakpoint and could get a stuck
       hover state on tap. Keying off (hover:none)/(pointer:coarse)
       instead means this is driven by actual input capability. */
    .grid-item::after {
        content: attr(data-text);

        position: absolute;
        inset: 0;
        z-index: 2;

        display: flex;
        justify-content: center;
        align-items: center;

        color: var(--color-text);
        font-family: var(--font-family);
        font-size: 1.5rem;
        letter-spacing: 2px;
        text-align: center;
        white-space: nowrap;
        pointer-events: none;
    }
}

/* Mobile: single column, smaller captions */
@media (max-width: 600px) {

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

    .caption {
        font-size: 1.5rem;
    }

    .grid-item::after {
        font-size: 1.5rem;
    }
}

/* Narrow phones: category labels ("PAINTINGS", etc.) can clip against
   nowrap + letter-spacing at 600px's 1.5rem size — step down further. */
@media (max-width: 400px) {
    .caption {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .grid-item::after {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }
}


/* ---- Photo gallery grid + lightbox (works-digital.html) ---- */

@media (max-width: 420px) {
    .grid-gallery {
        /* A smaller minimum column width so at least 2 tiles
           comfortably fit side-by-side even on the narrowest phones. */
        grid-template-columns: repeat(auto-fill, minmax(clamp(90px, 40vw, 160px), 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .lightbox-nav-btn,
    .lightbox-close {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}

/* Short/landscape viewports (e.g. a phone turned sideways) have
   limited VERTICAL space, so trim padding and widen columns
   slightly, since horizontal space is comparatively plentiful. */
@media (orientation: landscape) and (max-height: 500px) {
    .site-header {
        padding: 0.4rem 0.9rem;
    }

    .grid-gallery {
        grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 22vw, 200px), 1fr));
        padding: 0.6rem;
    }

    .lightbox-image-wrapper {
        max-height: 94vh;
    }

    .lightbox-image {
        max-height: 94vh;
    }
}


/* ---- About / Contact page (about.html, contact.html) ---- */

@media (max-width: 900px) {
    .about-grid,
    .contact-grid {
        /* Stack cells into a single column instead of a squeezed
           2-column layout at tablet/phone widths. Deliberately
           overrides --about-container-height/--contact-container-
           height with "auto" here — a fixed/vh height stops making
           sense once everything is stacked in one column instead of
           sitting side by side. */
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .about-column {
        /* Same idea: --about-top-row/--about-bottom-row are
           overridden with "auto" so each stacked cell is only as
           tall as its own content. */
        grid-template-rows: auto auto;
    }

    .about-image img,
    .contact-image img {
        /* Once cells are no longer filling a tall shared row,
           give each image its own sensible fixed proportions
           instead of collapsing to min-content. On the Contact
           page this temporarily overrides --contact-image-width/
           height (50%/50%) so the image doesn't shrink to near-
           nothing once its cell is only as tall as the form beside
           it — full width, fixed aspect ratio, reads better stacked. */
        aspect-ratio: 4 / 3;
        width: 100%;
        height: auto;
    }
}

@media (max-width: 600px) {
    .about-text h1 {
        font-size: 1.5rem;
    }

    .contact-text h2 {
        font-size: 1.2rem;
    }
}
