/* =============================================================================
   PPC Contest Manager — Public / Voting Ballot Styles
   ============================================================================= */

/* ---- Notices ---- */
.ppc-notice {
    padding: .75rem 1rem;
    border-radius: 4px;
    margin: .75rem 0;
    font-size: .95rem;
}
.ppc-notice--success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.ppc-notice--error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }
.ppc-notice--warning { background: #fff3cd; border: 1px solid #ffeeba; color: #856404; }

/* ---- Ballot wrapper ---- */
.ppc-ballot { max-width: 1100px; margin: 0 auto; font-family: inherit; }

.ppc-ballot__header { margin-bottom: 1.5rem; }
.ppc-ballot__title  { font-size: 1.5rem; margin-bottom: .4rem; }
.ppc-ballot__intro  { color: #555; }
.ppc-ballot__loading { color: #888; font-style: italic; }

/* ---- Status message ---- */
.ppc-ballot__status {
    padding: .75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.ppc-ballot__status--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.ppc-ballot__status--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.ppc-ballot__status--warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.ppc-ballot__status--info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ---- Category section ---- */
.ppc-category { margin-bottom: 2.5rem; }
.ppc-category__header {
    display: flex; align-items: baseline; gap: 1rem; margin-bottom: .75rem;
    border-bottom: 2px solid #ddd; padding-bottom: .4rem;
}
.ppc-category__name  { font-size: 1.2rem; font-weight: 700; margin: 0; }
.ppc-category__limit-label { font-size: .85rem; color: #777; }

/* ---- Image grid ---- */
.ppc-category__grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 160px, 1fr ) );
    gap: 12px;
}

/* ---- Image card ---- */
.ppc-image-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 6px;
    padding: 6px;
    transition: border-color .15s, background .15s, opacity .15s;
    background: #f9f9f9;
    user-select: none;
}
.ppc-image-card:hover {
    border-color: #aaa;
    background: #f0f0f0;
}
.ppc-image-card--selected {
    border-color: #007cba;
    background: #e8f4fb;
}
.ppc-image-card--disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Hide native checkbox */
.ppc-image-card__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ppc-image-card__img-wrap {
    width: 100%; padding-top: 100%; /* square aspect ratio */
    position: relative; overflow: hidden; border-radius: 4px;
    background: #e0e0e0;
}
.ppc-image-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.ppc-image-card__seq {
    margin-top: 6px;
    font-size: .8rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}
.ppc-image-card__caption {
    margin-top: 2px;
    font-size: .75rem;
    color: #555;
    text-align: center;
    font-style: italic;
}
.ppc-image-card__check-indicator {
    display: none;
    position: absolute;
    top: 6px; right: 6px;
    background: #007cba;
    color: #fff;
    border-radius: 50%;
    width: 22px; height: 22px;
    line-height: 22px;
    text-align: center;
    font-size: .85rem;
    font-weight: 700;
}
.ppc-image-card--selected .ppc-image-card__check-indicator {
    display: block;
}

/* ---- Submit button ---- */
.ppc-ballot__actions { margin-top: 2rem; text-align: center; }
.ppc-btn--primary {
    display: inline-block;
    padding: .65rem 2.5rem;
    background: #007cba;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
}
.ppc-btn--primary:hover { background: #005f8e; }
.ppc-btn--primary:disabled {
    background: #b0c4d8;
    cursor: not-allowed;
}

/* =============================================================================
   Review Gallery
   ============================================================================= */

.ppc-review-gallery { max-width: 1100px; margin: 0 auto; font-family: inherit; }

.ppc-review-gallery__header { margin-bottom: 1.5rem; }
.ppc-review-gallery__title  { font-size: 1.5rem; margin-bottom: .4rem; }
.ppc-review-gallery__notice { color: #555; font-style: italic; }

/* ---- Category tabs ---- */
.ppc-review-gallery__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
}
.ppc-tab-btn {
    padding: .4rem 1rem;
    border: 1px solid #ccc;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    font-size: .9rem;
}
.ppc-tab-btn--active {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}
.ppc-tab-count { font-size: .8em; opacity: .8; }

/* ---- Image grid ---- */
.ppc-review-gallery__grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
    gap: 1rem;
}
.ppc-review-gallery__item {
    margin: 0;
    text-align: center;
}
.ppc-review-gallery__item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    background: #f0f0f0;
    border-radius: 4px;
    display: block;
    cursor: pointer;
    transition: opacity .15s;
}
.ppc-review-gallery__item img:hover { opacity: .85; }

/* ---- Figcaption: seq + caption ---- */
.ppc-review-gallery__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 6px;
}
.ppc-review-gallery__seq {
    font-size: .8rem;
    font-weight: 600;
    color: #333;
}
.ppc-review-gallery__caption {
    font-size: .75rem;
    color: #555;
    font-style: italic;
}

.ppc-hidden { display: none !important; }

/* =============================================================================
   Member Gallery
   ============================================================================= */

.ppc-member-gallery { max-width: 1100px; margin: 0 auto; font-family: inherit; }

.ppc-member-index {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.ppc-member-index__card {
    display: block;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ppc-member-index__card:hover,
.ppc-member-index__card:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, .16);
}

.ppc-member-index__image-wrap {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e9ecef;
}

.ppc-member-index__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ppc-member-index__placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #4b5563;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.ppc-member-index__name {
    display: block;
    padding: .85rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
}

.ppc-member-gallery__header { margin-bottom: 1.5rem; }
.ppc-member-gallery__name   { font-size: 1.6rem; margin: 0 0 .25rem; }

.ppc-member-gallery__contest { margin-bottom: 3rem; }
.ppc-member-gallery__contest-title {
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 2px solid #ddd;
    padding-bottom: .4rem;
    margin-bottom: 1rem;
}

.ppc-member-gallery__grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
    gap: 1rem;
}

.ppc-member-gallery__item { text-align: center; }

.ppc-member-gallery__img-wrap {
    position: relative;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.ppc-member-gallery__img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: opacity .15s;
}
.ppc-member-gallery__img:hover { opacity: .85; }

.ppc-member-gallery__badge {
    position: absolute;
    top: 6px; left: 6px;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    pointer-events: none;
}
.ppc-member-gallery__badge--hm  { background: #7a6000; }
.ppc-member-gallery__badge--1st { background: #b8860b; }
.ppc-member-gallery__badge--2nd { background: #666;    }
.ppc-member-gallery__badge--3rd { background: #8b5e3c; }

.ppc-member-gallery__caption {
    margin: 5px 0 2px;
    font-size: .8rem;
    font-style: italic;
    color: #444;
}
.ppc-member-gallery__cat {
    margin: 0;
    font-size: .75rem;
    color: #888;
    font-weight: 600;
}

/* ---- Responsive ---- */
@media ( max-width: 600px ) {
    .ppc-category__grid,
    .ppc-member-gallery__grid {
        grid-template-columns: repeat( auto-fill, minmax( 130px, 1fr ) );
    }
    .ppc-ballot__title { font-size: 1.2rem; }
}

/* =============================================================================
   Contest Text Results
   ============================================================================= */

.ppc-text-results {
    display: grid;
    gap: 2.5rem 4rem;
    width: 100%;
}
.ppc-text-results--columns-1 { grid-template-columns: 1fr; }
.ppc-text-results--columns-2 { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
.ppc-text-results__category { break-inside: avoid; }
.ppc-text-results__heading {
    margin: 0 0 .65rem;
    color: #0785d1;
    font-size: 1.35rem;
    line-height: 1.2;
    text-transform: uppercase;
}
.ppc-text-results__list { margin: 0; padding-left: 1.25rem; }
.ppc-text-results__list li { margin: 0 0 .35rem; }
.ppc-text-results__place { font-weight: 700; }
.ppc-text-results__empty { margin: 0; text-transform: uppercase; }

@media ( max-width: 700px ) {
    .ppc-text-results--columns-2 { grid-template-columns: 1fr; }
}
