/*
 * Memphis Pop: cream page sprinkled with confetti, solid ink navbar, chunky
 * ink borders with big friendly rounding, hard candy-colored offset shadows
 * (coral/teal/sun/sky), rounded display type.
 * Mockup reference: design_mockups/07-memphis.html.
 */
[data-theme="memphis"] {
    /* Typography — rounded stacks that exist on Mac and Windows */
    --font-body: 'Arial Rounded MT Bold', 'Baloo 2', 'Trebuchet MS', 'Comic Sans MS', sans-serif;
    --font-heading: var(--font-body);
    --font-weight-heading: 800;

    /* Surfaces — cream page, white cards */
    --color-bg: #f7f3eb;
    --color-surface: #ffffff;
    --color-surface-hover: #fdf1d8;
    --color-surface-sunken: #efe7d8;

    /* Text — deep ink with cool muted steps */
    --color-text: #22223b;
    --color-text-secondary: #22223b;
    --color-text-muted: #5f5d75;
    --color-text-faint: #9b98ad;

    /* Inverse — the ink navbar flips to cream */
    --color-surface-inverse: #22223b;
    --color-text-inverse: #f7f3eb;

    /* Borders — every edge is ink */
    --color-border-subtle: #efe7d8;
    --color-border: #22223b;
    --color-border-strong: #22223b;
    --color-border-hover: #22223b;
    --border-width: 2px;

    /* Accent — coral, ink text on color fills */
    --color-accent: #ff6b6b;
    --color-accent-hover: #ff5252;
    --color-accent-soft: #ffe0e0;
    --color-accent-soft-text: #22223b;
    --color-accent-soft-border: #22223b;
    --color-on-accent: #22223b;

    /* Status — the candy palette (the skin also cycles these as card shadows) */
    --color-success: #2ec4b6;
    --color-success-hover: #29b0a3;
    --color-success-soft: #d7f5f1;
    --color-success-soft-text: #0f5950;
    --color-success-soft-border: #22223b;
    --color-danger: #e63946;
    --color-danger-hover: #d62839;
    --color-danger-soft: #fcd5d5;
    --color-danger-soft-text: #8a1c24;
    --color-danger-soft-border: #22223b;
    --color-warning: #ffd166;
    --color-warning-soft: #fff0c7;
    --color-warning-soft-text: #6b5200;
    --color-warning-soft-border: #22223b;
    --color-info: #4cc9f0;

    /* Neutral action — white pills that warm up on hover */
    --color-neutral: #ffffff;
    --color-neutral-hover: #fff0c7;

    --color-disabled-bg: #efe7d8;
    --color-disabled-text: #9b98ad;

    /* Shape — big, friendly rounding */
    --radius-sm: 12px;
    --radius-md: 20px;

    /* Elevation — hard offsets; panels pop teal, overlays pop violet */
    --color-backdrop: rgba(34, 34, 59, 0.55);
    --shadow-navbar: none;
    --shadow-sm: 2px 2px 0 #22223b;
    --shadow-md: 4px 4px 0 #22223b;
    --shadow-lg: 6px 6px 0 #2ec4b6;
    --shadow-xl: 8px 8px 0 #9b5de5;
    --shadow-accent: 6px 6px 0 #22223b;
    --shadow-inset: inset 0 -2px 0 #22223b;
    --focus-ring: 0 0 0 3px #ffd166;

    /* Violet pop + its pastel — consumed only by the memphis skin */
    --pop-violet: #9b5de5;
    --pop-violet-soft: #e6d7fa;

    /* Component hooks */
    --btn-border: 2px solid #22223b;
    --shadow-btn: 3px 3px 0 #22223b;
    --color-navbar-bg: #22223b;
}


/*
 * Memphis Pop theme skin: structural rules that tokens alone can't express —
 * the confetti page background, the solid ink navbar with candy pill links,
 * sun-shadowed page titles, button press mechanics, and the cycling
 * coral/teal/sun/sky card shadows and pastel person chips. Every rule is
 * scoped to [data-theme="memphis"], so this file is inert for other themes;
 * palette values come from tokens.css.
 * Mockup reference: design_mockups/07-memphis.html.
 *
 * Icons reuse the classic theme's line set via mask + currentColor, so this
 * theme ships no icon files of its own — only a favicon and placeholder.
 * Mask longhands only — the `mask:` shorthand resets mask-image, which the
 * lower-specificity per-icon rules below would then lose.
 */

/* ---- confetti page: dots and dashes in the candy colors; the last layer
   punches small holes in a bg-colored wash so only confetti shows through ---- */
[data-theme="memphis"] body {
    background-image:
        radial-gradient(var(--color-success) 2.5px, transparent 3px),
        radial-gradient(var(--color-accent) 2.5px, transparent 3px),
        linear-gradient(45deg, transparent 48%, var(--color-warning) 48% 52%, transparent 52%),
        radial-gradient(transparent 12px, var(--color-bg) 13px);
    background-size: 170px 170px, 230px 230px, 120px 120px, 60px 60px;
    background-position: 0 0, 85px 115px, 40px 20px, 0 0;
}

/* ---- navbar: solid ink bar; everything on it flips to the inverse text ---- */
[data-theme="memphis"] .navbar {
    border-bottom: none;
}

/* Brand carries the favicon mark so tab icon and logo match (app convention). */
[data-theme="memphis"] .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-inverse);
    font-size: var(--font-size-xl);
    font-weight: 800;
    letter-spacing: 0.02em;
}

[data-theme="memphis"] .navbar-brand::before {
    content: "";
    width: 26px;
    height: 26px;
    flex: none;
    background: url("/static/themes/memphis/favicon.svg") center / contain no-repeat;
}

[data-theme="memphis"] .navbar-nav {
    gap: 8px;
    align-items: center;
}

[data-theme="memphis"] .nav-link {
    border-bottom: none;
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    margin: 10px 0;
    font-weight: 700;
    color: var(--color-text-inverse);
}

[data-theme="memphis"] .nav-link:hover {
    background: color-mix(in srgb, var(--color-text-inverse) 14%, transparent);
    color: var(--color-text-inverse);
}

[data-theme="memphis"] .nav-link.active {
    background: var(--color-accent);
    color: var(--color-text);
}

[data-theme="memphis"] .navbar-pages-bar {
    border-top-color: color-mix(in srgb, var(--color-text-inverse) 18%, transparent);
}

[data-theme="memphis"] .nav-new-page {
    color: var(--color-text-inverse);
    border-bottom: none;
}

/* ---- page-tab edit pencil: hide the ✎ glyph, draw the line icon in a pill ---- */
[data-theme="memphis"] .nav-page-edit .nav-page-edit-glyph {
    display: none;
}

[data-theme="memphis"] .nav-page-edit {
    align-self: center;
    border-bottom: none;
    border-radius: var(--radius-pill);
    padding: 8px 10px;
    color: color-mix(in srgb, var(--color-text-inverse) 75%, transparent);
}

[data-theme="memphis"] .nav-page-edit::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask-image: url("/static/themes/classic/icon-edit.svg");
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-image: url("/static/themes/classic/icon-edit.svg");
    mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
}

[data-theme="memphis"] .nav-page-edit:hover {
    background: color-mix(in srgb, var(--color-text-inverse) 14%, transparent);
    color: var(--color-text-inverse);
}

/* ---- page header: bare title with a hard sun shadow, violet subtitle pill ---- */
[data-theme="memphis"] .page-header {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

[data-theme="memphis"] .page-header h1 {
    text-shadow: 3px 3px 0 var(--color-warning);
}

[data-theme="memphis"] .page-header .subtitle {
    display: inline-block;
    font-weight: 700;
    color: var(--color-text-inverse);
    background: var(--pop-violet);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 5px 16px;
    margin-top: 10px;
}

/* ---- buttons: chunky pills with press-down mechanics ---- */
[data-theme="memphis"] .btn,
[data-theme="memphis"] .btn-primary,
[data-theme="memphis"] .btn-secondary,
[data-theme="memphis"] .btn-danger,
[data-theme="memphis"] .btn-success,
[data-theme="memphis"] .action-button {
    border-radius: var(--radius-pill);
    font-weight: 800;
    transition: transform 0.1s, box-shadow 0.1s;
}

[data-theme="memphis"] .btn:hover:not(:disabled),
[data-theme="memphis"] .btn-primary:hover:not(:disabled),
[data-theme="memphis"] .btn-secondary:hover:not(:disabled),
[data-theme="memphis"] .btn-danger:hover:not(:disabled),
[data-theme="memphis"] .btn-success:hover:not(:disabled),
[data-theme="memphis"] .action-button:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 var(--color-border);
}

[data-theme="memphis"] .btn:active:not(:disabled),
[data-theme="memphis"] .btn-primary:active:not(:disabled),
[data-theme="memphis"] .btn-secondary:active:not(:disabled),
[data-theme="memphis"] .btn-danger:active:not(:disabled),
[data-theme="memphis"] .btn-success:active:not(:disabled),
[data-theme="memphis"] .action-button:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--color-border);
}

/* ---- forms: shouty little labels ---- */
[data-theme="memphis"] .form-group label,
[data-theme="memphis"] .filter-group label {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- panels: thick ink frames with the teal pop shadow ---- */
[data-theme="memphis"] .sidebar,
[data-theme="memphis"] .photo-sidebar,
[data-theme="memphis"] .settings-section,
[data-theme="memphis"] .editor-card {
    border: 3px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}

/* Widget cards sit close together in the grid, so they take the smaller ink
   offset instead of the teal panel pop. */
[data-theme="memphis"] .widget-card {
    border: 3px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* The mockup's ◖ glyph reads as accidentally clipped content next to the
   heading, so the bullet is a drawn coral disc instead. */
[data-theme="memphis"] .sidebar h2::before,
[data-theme="memphis"] .settings-section h2::before {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: var(--color-accent);
    margin-right: 8px;
}

/* ---- tables: ink frame to match the cards ---- */
[data-theme="memphis"] table {
    border: 3px solid var(--color-border);
}

/* ---- photo cards: ink frames, candy shadows cycling per grid position,
   a playful lift-and-tilt on hover ---- */
[data-theme="memphis"] .photo-card {
    border: 3px solid var(--color-border);
    transition: transform 0.12s, box-shadow 0.12s;
}

[data-theme="memphis"] .photo-card img {
    border-bottom: 3px solid var(--color-border);
}

[data-theme="memphis"] .photo-grid .photo-card:nth-child(4n+1) { box-shadow: 6px 6px 0 var(--color-accent); }
[data-theme="memphis"] .photo-grid .photo-card:nth-child(4n+2) { box-shadow: 6px 6px 0 var(--color-success); }
[data-theme="memphis"] .photo-grid .photo-card:nth-child(4n+3) { box-shadow: 6px 6px 0 var(--color-warning); }
[data-theme="memphis"] .photo-grid .photo-card:nth-child(4n+4) { box-shadow: 6px 6px 0 var(--color-info); }

[data-theme="memphis"] .photo-card:hover {
    transform: translate(-3px, -3px) rotate(-0.5deg);
}

/* ---- person chips: ink-rimmed pastel pills cycling through the palette ---- */
[data-theme="memphis"] .person-tag {
    border: 2px solid var(--color-border);
    color: var(--color-text);
    font-weight: 700;
}

[data-theme="memphis"] .photo-people .person-tag:nth-child(4n+1) { background: var(--color-accent-soft); }
[data-theme="memphis"] .photo-people .person-tag:nth-child(4n+2) { background: var(--color-success-soft); }
[data-theme="memphis"] .photo-people .person-tag:nth-child(4n+3) { background: var(--color-warning-soft); }
[data-theme="memphis"] .photo-people .person-tag:nth-child(4n+4) { background: var(--pop-violet-soft); }

/* ---- icons: the default set (components/icons.css), a notch smaller ---- */
[data-theme="memphis"] .nav-link[data-icon]::before,
[data-theme="memphis"] .btn[data-icon]::before,
[data-theme="memphis"] button[data-icon]::before {
    width: 16px;
    height: 16px;
}
