﻿/* ==============================
 Embedding site fonts
 - Margarine, Pangolin, Playpen Sans, Fuzzy Bubbles: comic balloon fonts
 - Baloo 2: main site font
 ============================== */
@import url('https://fonts.googleapis.com/css2?family=Margarine&display=swap'); /* Preferred balloon font */
@import url('https://fonts.googleapis.com/css2?family=Pangolin&display=swap'); /* Secondary balloon font */
@import url('https://fonts.googleapis.com/css2?family=Playpen+Sans&display=swap'); /* Tertiary balloon font */
@import url('https://fonts.googleapis.com/css2?family=Fuzzy+Bubbles&display=swap'); /* Balloon font (nice but not bold) */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500&display=swap'); /* Main site font */


/* ==============================
 Global styles and variables
 - Colors, radii, spacing, transitions
 - comic-font: used inside balloons
 ============================== */
:root {
    --bg: #f2f2f2;
    --field-bg: #e5e5e5;
    --text: #000000;
    --accent: #222;
    --muted: #aaa;
    --danger: #c23934;
    --radius: 6px;
    --pad: 12px;
    --transition: 200ms ease;
    --table-border: #e6e6e6;
    --comic-font: 'Margarine', cursive, sans-serif;
}

/* Prevent mobile browsers from auto-adjusting text size */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
/* Ensure footer fonts are consistent on all pages/devices */
footer.comicity-footer .copyright {
    font-size: 14px;
    font-weight: bold;
}

footer.comicity-footer .disclaimer {
    font-size: 11px;
    font-style: italic;
    color: #ccc;
}

/* ==============================
 Layout: body defaults
 - Full width, min-height viewport
 - Baloo 2 as main font
 ============================== */
body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    flex-direction: column;
    align-items: left;
    font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
}


/* ==============================
 Box-sizing reset
 ============================== */
*, *::before, *::after {
    box-sizing: border-box;
}


/* ==============================
 Small helper: narrow form control
 ============================== */
.form-control.small {
    max-width: 220px;
    width: 100%;
}


/* ==============================
 Floating/custom field
 - Replacement for .custom-field-one
 - Supports input, textarea, select with floating labels
 ============================== */
.form-field {
    position: relative;
    width: 250px;
    font-size: 16px;
    font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

    /* Inner control uses full width */
    .form-field > input,
    .form-field > textarea,
    .form-field > select {
        width: 100%;
        background: var(--field-bg);
        border-radius: calc(var(--radius) - 1px);
        border: 2px solid transparent;
        padding: var(--pad);
    }

    /* Floating label element (use <label class="placeholder"> or .placeholder span) */
    .form-field .placeholder {
        position: absolute;
        left: 5px;
        top: calc(50% + 3px);
        transform: translateY(-75%);
        color: var(--muted);
        pointer-events: none;
        transition: top 0.24s var(--transition), font-size 0.24s var(--transition), color 0.24s var(--transition);
        font-size: 16px;
        background: transparent;
        padding: 0 4px;
    }

    /* Move label up when input is focused or field has content (class 'filled') */
    .form-field.filled .placeholder,
    .form-field input:focus + .placeholder,
    .form-field textarea:focus + .placeholder,
    .form-field select:focus + .placeholder {
        top: -5px;
        font-size: 12px;
        color: var(--accent);
    }

    /* Outlined variant (borders visible) */
    .form-field.outlined > input,
    .form-field.outlined > textarea,
    .form-field.outlined > select {
        background: none;
        border: 2px solid #ddd;
        transition: border-color 0.24s ease;
        font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
        font-size: 16px;
    }

        /* Border highlight when filled or focused */
        .form-field.outlined.filled > textarea,
        .form-field.outlined > textarea:focus,
        .form-field.outlined.filled > input,
        .form-field.outlined > input:focus,
        .form-field.outlined.filled > select,
        .form-field.outlined > select:focus {
            border-color: var(--accent);
        }

            /* Disabled input styling (outlined variant) */
            .form-field.outlined > input:disabled,
            .form-field.outlined.filled > input:disabled {
                background-color: #eee !important;
                border-color: #eee !important;
                color: #aaa !important;
                cursor: not-allowed;
            }


    /* ==============================
 Select specific: custom caret
 - Ensures a down-arrow appears even with custom styling
 ============================== */
    .form-field select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding-right: 40px; /* room for caret */
        background-repeat: no-repeat;
        background-position: calc(100% - 12px) center;
        background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    }

    .form-field.outlined select {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding-right: 40px; /* room for caret */
        background-repeat: no-repeat;
        background-position: calc(100% - 12px) center;
        background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23888' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    }


/* ==============================
 Custom Checkbox
 - Styled replacement for native checkbox
 ============================== */
.custom-checkbox {
    font-family: system-ui, sans-serif;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center; /* center horizontally */
    gap: 0.5em;
    font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

input[type="checkbox"] {
    /* Add if not using autoprefixer */
    -webkit-appearance: none;
    /* Remove most all native input styles */
    appearance: none;
    /* For iOS < 15 */
    background-color: var(--form-background);
    /* Not removed via appearance */
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid currentColor;
    border-radius: 0.15em;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
}

    /* Checkmark pseudo-element */
    input[type="checkbox"]::before {
        content: "";
        width: 0.65em;
        height: 0.65em;
        clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
        transform: scale(0);
        transform-origin: bottom left;
        transition: 120ms transform ease-in-out;
        box-shadow: inset 1em 1em var(--form-control-color);
        /* Windows High Contrast Mode */
        background-color: CanvasText;
    }

    /* Checked state */
    input[type="checkbox"]:checked::before {
        transform: scale(1);
    }

    /* Optional focus style (commented) */
    /*
input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}
*/

    /* Disabled state */
    input[type="checkbox"]:disabled {
        --form-control-color: var(--form-control-disabled);
        color: var(--form-control-disabled);
        cursor: not-allowed;
    }


/* ==============================
 Buttons
 - Base style + variants (primary, ghost, danger)
 - Block and disabled states
 ============================== */
.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: calc(var(--radius) - 2px);
    border: 2px solid #aaa;
    background: var(--field-bg);
    color: var(--accent);
    cursor: pointer;
    font-size: 16px;
    transition: transform 80ms ease, box-shadow var(--transition), background var(--transition);
    text-decoration: none;
    line-height: 1;
    font-family: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

    /* Hover / active / focus states */
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }

    .btn:active {
        transform: translateY(0);
    }

    .btn:focus {
        outline: 3px solid rgba(34,34,34,0.12);
        outline-offset: 2px;
    }

    /* Variants */
    .btn.primary {
        background: var(--accent);
        color: #fff;
        border-color: var(--accent);
    }

    .btn.ghost {
        background: transparent;
        border: 2px solid #eee;
        color: var(--accent);
    }

    .btn.danger {
        background: #fff0f0;
        color: var(--danger);
        border-color: rgba(194,57,52,0.12);
    }

    .btn.green {
        background: transparent;
        color: #40b700;
        border-color: #40b700;
    }

    /* Block button */
    .btn.block {
        display: block;
        width: 100%;
        max-width: 360px;
    }

    /* Disabled */
    .btn[disabled], .btn.disabled {
        opacity: .6;
        pointer-events: none;
    }


/* ==============================
 Tables: wrapper + styled table
 - Compact variant reduces padding and font-size
 ============================== */
.table-wrapper {
    /*width: 100%;*/
    /*    max-width: 900px;*/
    overflow-x: auto;
    margin: 8px 0;
}

/* Styled table base styles */
.styled-table {
    border-collapse: collapse;
    width: 80%;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.06);
}

    /* Header */
    .styled-table thead th {
        background: #444242;
        color: #fff;
        padding: 12px 14px;
        text-align: center;
        font-weight: 600;
        font-size: 16px;
    }

    /* Body cells (default) */
    .styled-table tbody td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--table-border);
        text-align: center;
        vertical-align: middle;
        font-size: 18px;
        color: #222;
    }

    /* Alternating row color */
    .styled-table tbody tr:nth-child(odd) {
        background: #fbfbfb;
    }

    /* Hover effect */
    .styled-table tbody tr:hover {
        background: #f3f6fb;
    }

    /* Centered rows: icon + text alignment without flex */
    .styled-table tbody tr.centered-row td {
        /* keep consistent spacing with the page */
        padding: 10px 8px;
        /* no forced line-height: alignment is handled via vertical-align on inline elements */
    }

    /* Icon sizing (consistent between CSS and page) */
    .styled-table tbody tr.centered-row img,
    .styled-table tbody tr.centered-row img.icon {
        width: 25px;
        height: 25px;
        display: inline-block;
        vertical-align: middle;
        object-fit: contain;
    }

    /* Underlined collection name: vertically centered */
    .styled-table tbody tr.centered-row td u {
        display: inline-block;
        vertical-align: middle;
        text-decoration: underline;
    }

    /* Icon-cell pattern: force inline-block for middle alignment and uniform spacing */
    .styled-table td.icon-cell > * {
        display: inline-block;
        vertical-align: middle;
    }

    /* Label spacing next to the icon */
    .styled-table td.icon-cell .label {
        margin-left: 6px;
    }

/* Icon button: remove default button chrome and center the icon (consistent with the page) */
.icon-btn {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Compact variant */
.styled-table.compact tbody td {
    padding: 6px 8px;
    font-size: 14px;
}


/* ==============================
 Comics Strip table
 - Enhanced comic-table for vignette grid look
 ============================== */

/* Enhanced comic-table styles */
.comic-table {
    width: 100%; /* keep fixed size for desktop */
    max-width: 100%; /* be responsive on small screens */
    margin: 0 auto;
    border-radius: var(--radius);
    border: 2px solid #000;
    box-shadow: 0 12px 30px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.03);
    background: linear-gradient(180deg, #fff 0%, #fbfbfb 100%);
    transition: transform var(--transition), box-shadow var(--transition);
    overflow: hidden; /* ensures rounded corners clip content */
    border-collapse: separate; /* preserve radius on cells */
    background-clip: padding-box;
}

    /* Only cells with explicit class get the separator */
    .comic-table > tbody > tr > td.vignette-cell:not(:last-child) {
        border-right: 2px solid #000;
    }

    /* bottom separator on top-level vignette cells (not the last row which is the footer) */
    .comic-table > tbody > tr:not(:last-child) > td.vignette-cell {
        border-bottom: 2px solid #000;
    }


/* ==============================
 Balloon styling (speech bubbles)
 - Thick border, rounded corners, white background
 ============================== */
.balloon {
    border: 3px solid #000; /* thicker border */
    border-radius: 8px; /* rounded corners */
    overflow: hidden; /* clip to radius */
    border-collapse: separate; /* necessary for border-radius on table */
    border-spacing: 0;
    background: #ffffff; /* balloon background */
    background-clip: padding-box; /* prevents bg under border */
}

    .balloon td {
        background: #ffffff; /* ensure cells are white and don't show page bg */
        padding: 6px;
        vertical-align: middle;
    }


/* ==============================
 Comic font for balloons
 - Uses Margarine via --comic-font
 ============================== */
.comic-text {
    font-family: var(--comic-font);
    font-size: 16px;
}


/* ==============================
 White card container
 - Grid and card visuals for sections
 ============================== */
.grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.card {
    border: 1px solid #eee;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    background: #fff;
    padding: var(--card-padding);
}


/* ==============================
 Small helpers: muted text, rows, centering
 ============================== */
.muted {
    color: var(--muted);
    font-size: 13px;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.center {
    text-align: center;
}

/* ==============================
 Mobile normalization for cards (keeps Home and Characters consistent)
 - Make avatars responsive and force consistent text sizing inside .card .desc
 ============================== */
@media (max-width: 768px) {
    /* Stack top row like Home.asp */
    .top,
    .card.reverse .top {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Responsive avatar (matches Home.asp behavior) */
    .avatar {
        width: 100%;
        height: auto;
        max-width: 320px;
    }

        .avatar img {
            width: 100%;
            height: auto;
            object-fit: contain;
        }

    /* Normalize any headings/blocks that may come from XML inside card descriptions */
    .card .desc,
    .card .desc p,
    .card .desc ul,
    .card .desc li,
    .card .desc h1,
    .card .desc h2,
    .card .desc h3,
    .card .desc h4,
    .card .desc h5,
    .card .desc h6 {
        font-size: 16px;
        line-height: 1.5;
        margin: 0 0 6px 0;
    }

        /* Slightly reduce heading weight inside descriptions for balance */
        .card .desc h1,
        .card .desc h2,
        .card .desc h3 {
            font-weight: 600;
        }
}


/* ==============================
 Accessibility and motion preferences
 - Disable transitions for users preferring reduced motion
 ============================== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
