.ghtportal {
    max-width: 1150px;
    margin: 35px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e7edf5;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(20, 40, 70, .07);
    font-family: Arial, sans-serif;
    color: #263248
}

.ghtportal * {
    box-sizing: border-box
}

.ghtportal h2 {
    margin: 0 0 18px;
    font-size: 29px
}

.ghtportal a {
    text-decoration: none
}

.ghtportal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0 24px
}

.ghtportal-btn {
    display: inline-block;
    background: #1876d2;
    color: #fff !important;
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600
}

.ghtportal-btn.secondary {
    background: #edf3fb;
    color: #1b4e85 !important
}

.ghtportal-table {
    width: 100%;
    border-collapse: collapse
}

.ghtportal-table th, .ghtportal-table td {
    padding: 13px;
    border-bottom: 1px solid #e8edf3;
    text-align: left
}

.ghtportal-table th {
    background: #f5f8fc
}

.ghtportal label {
    display: block;
    font-weight: 600;
    margin: 18px 0 8px
}

.ghtportal input[type=text], .ghtportal input[type=file], .ghtportal select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cdd6e0;
    border-radius: 8px
}

.ghtportal-alert {
    background: #e8f6ed;
    color: #185d32;
    padding: 13px;
    border-radius: 8px;
    margin-bottom: 18px
}

.ghtportal-note {
    color: #697386;
    font-size: 14px
}

.ghtportal .wp-editor-wrap {
    margin-top: 8px
}

.ghtportal .ghtportal-thumb {
    max-width: 200px;
    max-height: 140px;
    display: block;
    margin: 8px 0;
    border-radius: 9px
}

@media (max-width: 650px) {
    .ghtportal {
        padding: 18px
    }

    .ghtportal-table {
        font-size: 13px
    }

    .ghtportal-table th, .ghtportal-table td {
        padding: 8px
    }
}

.ghtportal-auth {
    max-width: 1050px;
    margin: 16px auto 0;
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    align-items: center;
    font-size: 14px
}

.ghtportal-auth a {
    color: #1266b0;
    font-weight: 700
}

.ghtportal-row-actions {
    white-space: nowrap
}

.ghtportal-row-actions a {
    margin-right: 14px
}

.ghtportal-browser {
    max-width: 1200px;
    margin: 12px auto
}

.ghtportal-browser-toolbar {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap
}

.ghtportal-browser-toolbar h2 {
    margin-right: auto
}

.ghtportal-browser-toolbar input, .ghtportal-browser-toolbar select {
    width: auto !important;
    max-width: 200px
}

.ghtportal-upload-label {
    margin: 0 !important
}

.ghtportal-browser-layout {
    display: grid;
    grid-template-columns:190px minmax(0, 1fr);
    gap: 20px;
    margin-top: 20px
}

.ghtportal-folders {
    border-right: 1px solid #dfe7f0;
    padding-right: 12px
}

.ghtportal-folder {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer
}

.ghtportal-folder.active {
    background: #e6f1ff;
    color: #115fba;
    font-weight: 700
}

.ghtportal-media-grid {
    display: grid;
    grid-template-columns:repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px
}

.ghtportal-media-item {
    padding: 10px;
    border: 1px solid #e0e7ef;
    border-radius: 12px;
    box-shadow: 0 2px 8px #142d4510;
    min-width: 0
}

.ghtportal-media-thumb, .ghtportal-pdf {
    width: 100%;
    height: 125px;
    object-fit: cover;
    border-radius: 8px
}

.ghtportal-pdf {
    display: grid;
    place-items: center;
    background: #fff0ed;
    color: #b13b2c;
    font-size: 24px
}

.ghtportal-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    margin: 8px 0
}

.ghtportal-file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.ghtportal-file-actions button {
    border: 0;
    background: #edf3fc;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: #175b9d
}

.ghtportal-file-actions form {
    display: inline
}

.ghtportal-preview-overlay {
    position: fixed;
    inset: 0;
    background: #0009;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 25px
}

.ghtportal-preview-overlay[hidden] {
    display: none
}

.ghtportal-preview-box {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    max-width: 1000px;
    width: 100%;
    max-height: 92vh;
    overflow: auto
}

.ghtportal-preview-box img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    margin: auto
}

.ghtportal-preview-box iframe {
    width: 100%;
    height: 75vh;
    border: 0
}

.ghtportal-preview-box > button {
    float: right;
    margin-bottom: 10px
}

.ghtportal-list-view {
    display: block
}

.ghtportal-list-view .ghtportal-media-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px
}

.ghtportal-list-view .ghtportal-media-thumb, .ghtportal-list-view .ghtportal-pdf {
    width: 65px;
    height: 55px
}

.ghtportal-list-view .ghtportal-filename {
    flex: 1
}

@media (max-width: 650px) {
    .ghtportal-browser-layout {
        grid-template-columns:1fr
    }

    .ghtportal-folders {
        display: flex;
        overflow: auto;
        gap: 5px;
        border: 0
    }

    .ghtportal-folder {
        white-space: nowrap;
        width: auto
    }
}

.ghtportal-picker-page {
    margin: 0 !important;
    background: #fff !important
}

.ghtportal-picker-page .ghtportal-browser {
    margin: 0 auto !important;
    box-shadow: none !important;
    border: 0 !important;
    max-width: none !important
}

.ghtportal-media-item {
    cursor: pointer
}

.ghtportal-media-item.selected {
    outline: 3px solid #1976d2;
    outline-offset: 1px;
    background: #eef6ff
}

.ghtportal-context {
    position: fixed;
    z-index: 1000001;
    min-width: 195px;
    background: #fff;
    border: 1px solid #dbe4ef;
    box-shadow: 0 12px 35px #142d4530;
    border-radius: 12px;
    padding: 6px
}

.ghtportal-context button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 7px
}

.ghtportal-context button:hover {
    background: #edf4ff
}

.ghtportal-context button.danger {
    color: #b42318
}

#ghtportal-media-modal {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: #0009;
    display: none;
    place-items: center;
    padding: 25px
}

#ghtportal-media-modal .ghtportal-media-dialog {
    width: min(1250px, 96vw);
    height: min(850px, 92vh);
    background: white;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column
}

#ghtportal-media-modal iframe {
    width: 100%;
    flex: 1;
    border: 0
}

#ghtportal-media-modal .ghtportal-close-modal {
    align-self: flex-end;
    border: 0;
    background: #eef3fa;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer
}

/* Browser-like media explorer */
.ghtportal-picker-page .ghtportal-browser {
    padding: 14px !important;
    min-height: 100vh;
    border-radius: 0 !important
}

.ghtportal-browser-toolbar {
    border-bottom: 1px solid #dce3eb;
    padding-bottom: 14px;
    margin-bottom: 4px
}

.ghtportal-browser-toolbar h2 {
    width: 100%;
    font-size: 22px;
    margin-bottom: 4px
}

.ghtportal-browser-files {
    background: #f6f7f9;
    border-radius: 10px;
    padding: 15px;
    min-height: 350px
}

.ghtportal-media-item {
    background: #fff;
    overflow: hidden
}

.ghtportal-media-thumb {
    height: 135px
}

.ghtportal-media-grid {
    grid-template-columns:repeat(auto-fill, minmax(170px, 1fr))
}

.ghtportal-file-actions {
    margin-top: 6px
}

.ghtportal-file-actions button {
    font-size: 12px
}

.ghtportal-context button {
    font-size: 14px
}

/* v1.6: original Photo Browser-inspired layout */
.ghtportal-picker-page .ghtportal-browser {
    padding: 0 !important;
    background: #f5f5f5 !important;
    min-height: 100vh
}

.ghtportal-browser-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    margin: 0;
    border-bottom: 1px solid #ddd
}

.ghtportal-browser-toolbar input {
    margin-left: auto;
    max-width: 250px !important
}

.ghtportal-browser-toolbar select {
    max-width: 190px !important
}

.ghtportal-browser-toolbar .ghtportal-btn {
    padding: 9px 12px;
    white-space: nowrap
}

.ghtportal-browser-layout {
    display: grid;
    grid-template-columns:200px minmax(0, 1fr);
    gap: 0;
    margin: 0;
    min-height: calc(100vh - 66px)
}

.ghtportal-folders {
    padding: 12px;
    background: #fff;
    border-right: 1px solid #ddd
}

.ghtportal-folder {
    margin-bottom: 3px
}

.ghtportal-folder.active {
    background: #0d6efd;
    color: #fff
}

.ghtportal-browser-files {
    border-radius: 0;
    padding: 15px;
    background: #f5f5f5;
    min-height: calc(100vh - 66px)
}

.ghtportal-media-grid {
    grid-template-columns:repeat(auto-fill, minmax(145px, 1fr));
    gap: 14px
}

.ghtportal-media-item {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 7px #0001;
    transition: transform .15s
}

.ghtportal-media-item:hover {
    transform: translateY(-2px)
}

.ghtportal-media-thumb, .ghtportal-pdf {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 0
}

.ghtportal-filename {
    margin: 8px 10px 3px;
    font-size: 13px
}

.ghtportal-file-size {
    font-size: 11px;
    color: #777;
    margin: 0 10px 10px
}

.ghtportal-media-item.selected {
    outline: 2px solid #0d6efd
}

.ghtportal-list-view .ghtportal-media-item {
    padding: 8px
}

.ghtportal-list-view .ghtportal-filename {
    margin: 0;
    flex: 1
}

.ghtportal-list-view .ghtportal-file-size {
    margin: 0 10px
}

.ghtportal-list-view .ghtportal-media-thumb, .ghtportal-list-view .ghtportal-pdf {
    height: 48px;
    width: 48px
}

@media (max-width: 700px) {
    .ghtportal-browser-toolbar {
        flex-wrap: wrap
    }

    .ghtportal-browser-toolbar input {
        margin-left: 0
    }

    .ghtportal-browser-layout {
        grid-template-columns:1fr
    }

    .ghtportal-folders {
        display: flex;
        overflow-x: auto;
        gap: 5px
    }

    .ghtportal-folder {
        white-space: nowrap;
        width: auto
    }
}


/* ============================================================
   HIDE HERO ON MY BLOG POSTS PAGE
   ============================================================ */
body.page-slug-my-blog-posts .page-hero {
    display: none !important;
}

/* ============================================================
   GHT CONTRIBUTOR DASHBOARD 1.7
   ============================================================ */
.ghtportal-posts {
    max-width: 1150px;
    padding: 38px 42px;
    border: 1px solid #e6edf4;
    box-shadow: 0 15px 50px rgba(19, 62, 98, .08)
}

.ghtportal-posts-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px
}

.ghtportal-posts-heading h2 {
    color: #153e62;
    font-size: 36px;
    letter-spacing: -.8px;
    margin: 5px 0
}

.ghtportal-posts-heading p {
    color: #697c90;
    margin: 0;
    font-size: 15px
}

.ghtportal-eyebrow {
    font-size: 11px;
    letter-spacing: 1.8px;
    color: #168fce;
    font-weight: 800
}

.ghtportal-post-count {
    background: #edf8fe;
    color: #167db6;
    border-radius: 30px;
    padding: 9px 16px;
    font-weight: 700;
    white-space: nowrap
}

.ghtportal-posts .ghtportal-actions {
    margin: 24px 0
}

.ghtportal-posts .ghtportal-btn {
    background: #168fce;
    border-radius: 10px;
    padding: 12px 20px
}

.ghtportal-posts .ghtportal-btn.secondary {
    background: #edf4fa;
    color: #153e62 !important
}

.ghtportal-posts .ghtportal-table {
    border: 1px solid #eaf0f5;
    border-radius: 12px;
    overflow: hidden
}

.ghtportal-posts .ghtportal-table th {
    background: #f3f8fc;
    color: #153e62;
    font-size: 13px
}

.ghtportal-posts .ghtportal-table td {
    vertical-align: middle
}

.ghtportal-post-title {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 240px
}

.ghtportal-post-title strong {
    font-weight: 650;
    line-height: 1.4
}

.ghtportal-post-thumb {
    display: block;
    width: 64px;
    height: 52px;
    object-fit: cover;
    flex: none;
    border-radius: 9px;
    background: #e7f3fa
}

.ghtportal-post-placeholder {
    display: grid;
    place-items: center;
    color: #168fce;
    font-size: 25px
}

.ghtportal-status {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap
}

.ghtportal-status-published {
    background: #e5f6ec;
    color: #187444
}

.ghtportal-status-pending {
    background: #fff3dc;
    color: #9b6500
}

.ghtportal-status-draft {
    background: #edf1f7;
    color: #50647d
}

.ghtportal-posts .ghtportal-row-actions a {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 7px;
    background: #eff7fc;
    color: #1379b5;
    font-weight: 700;
    margin: 2px
}

.ghtportal-auth {
    max-width: 1150px;
    margin: 18px auto 0;
    gap: 14px;
    flex-wrap: wrap
}

.ghtportal-auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto
}

.ghtportal-auth-user strong, .ghtportal-auth-user small {
    display: block
}

.ghtportal-auth-user strong {
    color: #153e62;
    font-size: 14px
}

.ghtportal-auth-user small {
    color: #7d8e9d;
    font-size: 11px;
    margin-top: 3px
}

.ghtportal-avatar {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #d6ebf8
}

.ghtportal-profile-link, .ghtportal-logout {
    border-radius: 9px;
    padding: 9px 14px;
    text-decoration: none !important
}

.ghtportal-profile-link {
    background: #e9f6fd;
    color: #157bb5 !important
}

.ghtportal-logout {
    background: #fff1e5;
    color: #a64b10 !important
}

.ghtportal-profile {
    margin-top: 36px;
    padding: 26px;
    border: 1px solid #e3edf4;
    border-radius: 16px;
    background: linear-gradient(120deg, #f4fbff, #fff)
}

.ghtportal-profile-heading {
    display: flex;
    align-items: center;
    gap: 17px
}

.ghtportal-profile-heading .ghtportal-avatar {
    width: 76px;
    height: 76px
}

.ghtportal-profile h3 {
    margin: 0 0 6px;
    color: #153e62;
    font-size: 23px
}

.ghtportal-profile p {
    margin: 0;
    color: #657b8e
}

.ghtportal-profile-fields {
    display: grid;
    grid-template-columns:1fr 1fr;
    gap: 20px
}

.ghtportal-profile textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cdd6e0;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 16px
}

@media (max-width: 700px) {
    .ghtportal-posts {
        padding: 22px 14px
    }

    .ghtportal-posts-heading {
        align-items: flex-start
    }

    .ghtportal-posts-heading h2 {
        font-size: 27px
    }

    .ghtportal-post-count {
        font-size: 11px
    }

    .ghtportal-profile-fields {
        grid-template-columns:1fr;
        gap: 0
    }

    .ghtportal-posts .ghtportal-table {
        display: block;
        overflow-x: auto
    }

    .ghtportal-post-thumb {
        width: 50px;
        height: 44px
    }
}

/* Contributor profile: collapsed until Edit */
.ghtportal-profile {
    padding: 20px 24px;
    margin-top: 25px
}

.ghtportal-profile-heading {
    gap: 15px
}

.ghtportal-profile-heading > div {
    flex: 1
}

.ghtportal-profile-heading .ghtportal-avatar {
    width: 58px;
    height: 58px
}

.ghtportal-profile-heading h3 {
    font-size: 20px
}

.ghtportal-profile-heading .ghtportal-btn {
    margin-left: auto;
    white-space: nowrap
}

.ghtportal-profile-form[hidden] {
    display: none !important
}

.ghtportal-profile-form {
    padding-top: 18px
}

.ghtportal-profile-form input[type=text] {
    width: 100%;
    padding: 12px;
    border: 1px solid #cdd6e0;
    border-radius: 8px
}

.ghtportal-profile-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

@media (max-width: 650px) {
    .ghtportal-profile-heading {
        flex-wrap: wrap
    }

    .ghtportal-profile-heading .ghtportal-btn {
        margin-left: 0
    }
}


/* ============================================================
   GHT AUTH PROFILE CARD
   ============================================================ */
.ghtportal-auth {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    background: #f4f9fd;
    border: 1px solid #dceaf5;
    border-radius: 14px;
}

.ghtportal-auth-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ghtportal-auth-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.ghtportal-auth-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ghtportal-auth-info strong {
    color: #153e62;
    font-size: 15px;
}

.ghtportal-auth-info small {
    color: #74889a;
    font-size: 12px;
}

.ghtportal-auth-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ghtportal-auth-actions a,
.ghtportal-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
}

.ghtportal-profile-link {
    background: #168fce;
    color: white !important;
}

.ghtportal-profile-link:hover {
    background: #0878b3;
}

.ghtportal-logout {
    background: white;
    color: #c44b4b !important;
    border: 1px solid #f0dada;
}

.ghtportal-logout:hover {
    background: #fff0f0;
}

.ghtportal-login-btn {
    background: #168fce;
    color: white !important;
}

@media (max-width: 600px) {
    .ghtportal-auth {
        flex-direction: column;
        align-items: stretch;
    }

    .ghtportal-auth-actions {
        width: 100%;
    }

    .ghtportal-auth-actions a {
        flex: 1;
    }
}
