/* =============================================================================
   GoodStock Stories — Stylesheet
   ============================================================================= */

/* ---- Shared ---- */
.gs-story-form-wrap,
.gs-homepage-stories,
.gs-login-notice {
    font-family: inherit;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* ---- Login notice ---- */
.gs-login-notice {
    background: #1c1c1c;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: #aaa;
    font-size: 15px;
}
.gs-login-notice a {
    color: #e05c2a;
    text-decoration: none;
    font-weight: 600;
}
.gs-login-notice a:hover {
    text-decoration: underline;
}

/* =============================================================================
   Story Form  [goodstock_story_form]
   ============================================================================= */
.gs-story-form-wrap {
    background: #1c1c1c;
    border-radius: 14px;
    padding: 24px;
    max-width: 680px;
    margin: 0 auto 32px;
}

/* User row */
.gs-form-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.gs-form-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e05c2a;
    display: block;
}
.gs-form-username {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
}

/* Textarea */
#gs-story-form textarea {
    width: 100%;
    background: #2a2a2a;
    border: 1.5px solid #3a3a3a;
    border-radius: 10px;
    color: #eee;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
    font-family: inherit;
}
#gs-story-form textarea:focus {
    outline: none;
    border-color: #e05c2a;
}
#gs-story-form textarea::placeholder {
    color: #666;
}

/* Character count */
.gs-char-count {
    font-size: 12px;
    color: #666;
    text-align: right;
    margin-top: 4px;
    margin-bottom: 12px;
}
#gs-chars-left.gs-warn { color: #e05c2a; }

/* Form footer */
.gs-form-footer {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Photo label */
.gs-photo-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    user-select: none;
}
.gs-photo-label:hover { color: #e05c2a; }
.gs-photo-label svg { flex-shrink: 0; }

/* Photo preview */
#gs-photo-preview-wrap {
    position: relative;
    display: inline-block;
}
#gs-photo-preview {
    height: 52px;
    width: 52px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e05c2a;
    display: block;
}
#gs-remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e05c2a;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}
#gs-remove-photo:hover { background: #c44d20; }

/* Submit button */
#gs-submit-btn {
    margin-left: auto;
    background: #e05c2a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 0.2s, transform 0.1s;
}
#gs-submit-btn:hover:not(:disabled) {
    background: #c44d20;
    transform: translateY(-1px);
}
#gs-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Form message */
#gs-form-message {
    margin-top: 14px;
    font-size: 14px;
    border-radius: 8px;
    padding: 10px 14px;
    display: none;
}
#gs-form-message.gs-success {
    background: #1a3a1a;
    color: #66bb6a;
    display: block;
}
#gs-form-message.gs-error {
    background: #3a1a1a;
    color: #ef5350;
    display: block;
}

/* =============================================================================
   Homepage Stories Grid  [goodstock_stories]
   ============================================================================= */
.gs-homepage-stories {
    width: 100%;
}

.gs-stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Story card */
.gs-story-card {
    background: #1c1c1c;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.gs-story-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

/* Card header: avatar + name + time */
.gs-story-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.gs-story-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #e05c2a;
    display: block;
    flex-shrink: 0;
}
.gs-story-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.gs-story-name {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gs-story-time {
    font-size: 12px;
    color: #888;
}

/* Story text */
.gs-story-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

/* Story image */
.gs-story-img-wrap {
    border-radius: 10px;
    overflow: hidden;
    margin-top: 2px;
}
.gs-activity-photo,
.gs-story-img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Empty state */
.gs-no-stories {
    color: #888;
    font-size: 15px;
    text-align: center;
    padding: 32px 0;
}

/* =============================================================================
   Responsive
   ============================================================================= */
@media ( max-width: 640px ) {
    .gs-story-form-wrap {
        padding: 16px;
    }
    .gs-form-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    #gs-submit-btn {
        margin-left: 0;
        width: 100%;
    }
    .gs-stories-grid {
        grid-template-columns: 1fr;
    }
}
