/* ---------- Apps page (app-specific) ----------
   Shared structure (container, grid, card shell, detail layout, details table,
   fade) lives in collection.css. This file holds only app-card internals and
   the icon-bearing detail header. */

.app-card-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

/* App icon tile. Percent rounding so every size (64/80/128px) has the same
   shape. Two shapes, picked by support:
   - circular corner at 22% for Safari until it supports corner-shape. An
     exported icon mask measured as a 23.3% circular arc, but on device that
     read slightly over-rounded; 22% (14px on the 64px tile) matches by eye;
   - where corner-shape exists, a squircle at 32%: iOS's own continuous corner
     spreads ~1.5x its nominal 22.4% radius along each edge, and a CSS
     squircle curves over exactly its radius, so ~32% matches the device.
   The img fill inside comes from the shared rule (collection.css). */
.app-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 22%;
    corner-shape: round;
    overflow: hidden;
    position: relative;
}

@supports (corner-shape: squircle) {
    .app-icon {
        border-radius: 32%;
        corner-shape: squircle;
    }
}

/* Hairline edge drawn over the artwork, so white icons (Mercari, Luma) don't
   dissolve into the light page and black ones (Threads) into the dark page.
   It follows the tile's own corner, whichever shape is active. */
.app-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    corner-shape: inherit;
    box-shadow: inset 0 0 0 1px var(--image-stroke);
    pointer-events: none;
}

.app-card-meta {
    min-width: 0;
}

.app-card-name {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--heading);
    margin: 0 0 0.15em;
}

.app-card-tagline {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin: 0 0 0.6em;
}

/* Year / platform chips. */
.app-badges {
    display: flex;
    gap: 8px;
}

.app-badge {
    font-size: 0.72em;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 6px;
    corner-shape: squircle;
    padding: 3px 8px;
}

/* An app's hero image (`image:`): a full-bleed picture in the card's 16:10
   media slot, cropped to fill. On the detail page it sits in the shared
   natural-ratio frame instead (collection.css). Heroes are rectangular
   pictures, so they're rounded. */
.app-hero {
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    corner-shape: squircle;
    overflow: hidden;
    background: var(--bg-secondary);
}

.collection-detail-shot .app-hero {
    border-radius: 0;
}

/* Detail header: icon tile + headings, left-aligned. */
.app-detail-head {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 1.5em;
}

.app-detail-head .app-icon {
    width: 128px;
    height: 128px;
}

.app-detail-headings {
    min-width: 0;
}

/* Name + tagline are the shared .collection-detail-name/-tagline (collection.css).
   Beside the icon the tagline hugs the name - the header block below provides
   the vertical gap, so drop the shared rule's bottom margin. */
.app-detail-headings .collection-detail-tagline {
    margin: 0.1em 0 0;
}

/* Mobile tweaks for app-specific detail bits. */
@media (max-width: 720px) {
    /* Compact detail header - the desktop icon (128px) and headings dwarf a
       phone screen, so step them down to App-Store-detail proportions. */
    .app-detail-head {
        gap: 16px;
        margin-bottom: 1.25em;
    }
    .app-detail-head .app-icon {
        width: 80px;
        height: 80px;
    }
    /* Slightly smaller than the shared 2.1em detail-name shrink - the name
       shares its row with the 80px icon. */
    .app-detail-headings .collection-detail-name {
        font-size: 1.9em;
    }
    .app-detail-headings .collection-detail-tagline {
        font-size: 1.05em;
    }

}
