/* Hog Island Gallery Manager */
.higm-public-wrap,
.higm-public-wrap *,
.higm-manager-shell,
.higm-manager-shell * { box-sizing: border-box; }

.higm-public-wrap,
.higm-manager-shell {
    --higm-blue: #4778f6;
    --higm-blue-dark: #3565df;
    --higm-ink: #20262b;
    --higm-muted: #697177;
    --higm-border: #e3e7ea;
    --higm-panel: #ffffff;
    --higm-soft: #f5f7f9;
    font-family: Georgia, "Times New Roman", Times, serif;
    color: var(--higm-ink);
}

/* Public gallery */
.higm-public-hero {
    min-height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    background: linear-gradient(135deg,#303b44 0%,#344552 55%,#2c3943 100%);
}
.higm-public-hero-inner { width: min(100%, 820px); }
.higm-public-hero h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(40px,6vw,66px);
    line-height: 1;
}
.higm-public-hero p {
    margin: 0 auto;
    max-width: 680px;
    color: rgba(255,255,255,.88);
    font-size: 17px;
    line-height: 1.65;
}
.higm-public-content {
    width: min(calc(100% - 36px), 1180px);
    margin: 0 auto;
    padding: 60px 0 75px;
}
.higm-public-gallery {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 28px;
}
.higm-public-item { margin: 0; min-width: 0; }
.higm-lightbox-link {
    position: relative;
    display: block;
    height: 310px;
    overflow: hidden;
    background: linear-gradient(135deg,#fff 0%,#f6f7f8 58%,#e9edf0 100%);
    clip-path: polygon(0 0,100% 0,100% 88%,94% 100%,6% 100%,0 88%);
    box-shadow: 0 15px 30px rgba(0,0,0,.10);
    text-decoration: none !important;
}
.higm-public-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, filter .35s ease;
}
.higm-lightbox-link:hover .higm-public-image {
    transform: scale(1.045);
    filter: brightness(.88);
}
.higm-view-label {
    position: absolute;
    right: 18px;
    bottom: 22px;
    padding: 8px 12px;
    background: rgba(32,44,53,.88);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(8px);
    transition: .25s ease;
}
.higm-lightbox-link:hover .higm-view-label { opacity: 1; transform: translateY(0); }
.higm-public-item figcaption {
    padding: 12px 4px 0;
    color: var(--higm-muted);
    font-size: 14px;
    line-height: 1.5;
}
.higm-empty {
    padding: 34px 22px;
    border: 1px dashed #ccd3d8;
    background: #fafbfc;
    color: var(--higm-muted);
    text-align: center;
}

/* Lightbox */
.higm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(10,15,18,.94);
}
.higm-lightbox.is-open { display: flex; }
.higm-lightbox-stage {
    position: relative;
    width: min(94vw, 1350px);
    height: min(88vh, 900px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.higm-lightbox-image { max-width: 100%; max-height: calc(100% - 55px); object-fit: contain; }
.higm-lightbox-caption { min-height: 35px; padding-top: 14px; color: #fff; text-align: center; font-size: 15px; }
.higm-lightbox-close,
.higm-lightbox-prev,
.higm-lightbox-next {
    position: absolute;
    z-index: 2;
    border: 0;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
}
.higm-lightbox-close { top: 0; right: 0; width: 46px; height: 46px; font-size: 27px; }
.higm-lightbox-prev,
.higm-lightbox-next { top: 50%; width: 48px; height: 58px; margin-top: -29px; font-size: 30px; }
.higm-lightbox-prev { left: 0; }
.higm-lightbox-next { right: 0; }

/* Manager */
.higm-manager-shell {
    width: min(calc(100% - 30px), 1180px);
    margin: 42px auto 70px;
}
.higm-login-card,
.higm-manager-panel,
.higm-manager-topbar {
    background: var(--higm-panel);
    border: 1px solid var(--higm-border);
    box-shadow: 0 14px 38px rgba(0,0,0,.08);
}
.higm-login-card {
    width: min(100%, 540px);
    margin: 80px auto;
    padding: 42px;
}
.higm-manager-kicker {
    margin-bottom: 9px;
    color: var(--higm-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.higm-login-card h1,
.higm-manager-topbar h1 { margin: 0 0 10px; font-size: clamp(31px,4vw,46px); }
.higm-login-card p,
.higm-manager-topbar p { margin: 0; color: var(--higm-muted); line-height: 1.65; }
.higm-login-form { margin-top: 28px; }
.higm-login-form label,
.higm-caption-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.higm-login-form input,
.higm-caption-input {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #ccd3d8;
    border-radius: 0;
    background: #fff;
    color: #222;
    font: inherit;
}
.higm-login-form input:focus,
.higm-caption-input:focus { outline: 2px solid rgba(71,120,246,.25); border-color: var(--higm-blue); }
.higm-manager-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 24px;
    padding: 30px;
}
.higm-manager-panel { margin-bottom: 24px; padding: 30px; }
.higm-manager-panel h2 { margin: 0 0 8px; font-size: 27px; }
.higm-help { margin: 0 0 20px; color: var(--higm-muted); font-size: 14px; line-height: 1.55; }
.higm-manager-section-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.higm-count { white-space: nowrap; padding: 7px 10px; background: #eef3ff; color: var(--higm-blue); font-size: 12px; font-weight: 700; }

.higm-drop-zone {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 30px;
    border: 2px dashed #c9d1d6;
    background: var(--higm-soft);
    color: #4f585e;
    text-align: center;
    cursor: pointer;
    transition: .2s ease;
}
.higm-drop-zone:hover,
.higm-drop-zone.is-dragover { border-color: var(--higm-blue); background: #f2f6ff; }
.higm-drop-icon { color: var(--higm-blue); font-size: 42px; line-height: 1; }
.higm-file-summary { min-height: 24px; margin: 12px 0 8px; color: var(--higm-muted); font-size: 13px; }

.higm-primary-button,
.higm-secondary-button,
.higm-small-button {
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: .2s ease;
}
.higm-primary-button {
    min-height: 50px;
    padding: 14px 24px;
    background: var(--higm-blue);
    color: #fff;
}
.higm-primary-button:hover { background: var(--higm-blue-dark); transform: translateY(-1px); }
.higm-secondary-button { min-height: 44px; padding: 12px 18px; background: #303e49; color: #fff; }
.higm-small-button { min-height: 38px; padding: 9px 12px; background: #eef1f3; color: #30383e; font-size: 11px; }
.higm-small-button:hover { background: #dfe5e9; }
.higm-danger-button { background: #fff0f0; color: #a22; }
.higm-danger-button:hover { background: #ffe0e0; }
button[disabled] { opacity: .55; cursor: wait; }

.higm-manager-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 22px;
}
.higm-manager-card {
    position: relative;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--higm-border);
    background: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,.05);
}
.higm-manager-card.is-hidden { opacity: .68; background: #fafafa; }
.higm-drag-handle {
    position: absolute;
    top: 19px;
    left: 19px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(29,37,43,.85);
    color: #fff;
    cursor: move;
    font-size: 18px;
    letter-spacing: -3px;
}
.higm-manager-thumb { position: relative; height: 210px; margin-bottom: 14px; overflow: hidden; background: #f3f5f6; }
.higm-manager-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.higm-hidden-badge { position: absolute; right: 10px; bottom: 10px; padding: 6px 9px; background: #202c35; color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.higm-caption-label { margin: 0 0 12px; }
.higm-caption-input { margin-top: 7px; min-height: 42px; font-size: 14px; }
.higm-card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.higm-status { min-height: 22px; margin-top: 12px; color: var(--higm-muted); font-size: 13px; line-height: 1.5; }
.higm-status.is-error { color: #a22; }
.higm-status.is-success { color: #287a3f; }
.higm-sort-placeholder { min-height: 330px; border: 2px dashed #aeb8bf; background: #f7f9fa; }

@media (max-width: 960px) {
    .higm-public-gallery,
    .higm-manager-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 640px) {
    .higm-public-hero { min-height: 195px; padding: 38px 16px; }
    .higm-public-content { width: calc(100% - 24px); padding: 38px 0 50px; }
    .higm-public-gallery,
    .higm-manager-grid { grid-template-columns: 1fr; gap: 18px; }
    .higm-lightbox-link { height: 285px; }
    .higm-manager-shell { width: calc(100% - 20px); margin-top: 20px; }
    .higm-login-card,
    .higm-manager-panel,
    .higm-manager-topbar { padding: 22px; }
    .higm-login-card { margin: 35px auto; }
    .higm-manager-topbar,
    .higm-manager-section-head { flex-direction: column; align-items: stretch; }
    .higm-secondary-button { width: 100%; }
    .higm-manager-thumb { height: 245px; }
    .higm-lightbox { padding: 10px; }
    .higm-lightbox-stage { width: 100%; height: 92vh; }
}
