.mygithub-meta-box {
    background: #f6f8fa;
    border: 1px solid #d1d5da;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.mygithub-badge {
    display: inline-block;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 2em;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.mygithub-btn {
    text-decoration: none;
    background-color: #2ea44f;
    color: #fff !important;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.mygithub-btn:hover {
    background-color: #2c974b;
}

.mygithub-releases-sidebar {
    background: #f6f8fa;
    border: 1px solid #d1d5da;
    padding: 15px;
    margin-top: 30px;
    border-radius: 6px;
}

.mygithub-releases-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mygithub-releases-sidebar li {
    border-bottom: 1px solid #e1e4e8;
    padding: 10px 0;
}

.mygithub-releases-sidebar li:last-child {
    border-bottom: none;
}

.mygithub-releases-sidebar .date {
    font-size: 0.85em;
    color: #586069;
}

.mygithub-download-shortcode-button {
    --mygithub-download-button-bg: #0073aa;
    --mygithub-download-button-hover-bg: #005177;
    --mygithub-download-button-text: #ffffff;
    --mygithub-download-button-icon: #ffffff;
    --mygithub-download-button-text-size: 15px;
    --mygithub-download-button-icon-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--mygithub-download-button-bg);
    border-radius: 8px;
    background: var(--mygithub-download-button-bg);
    color: var(--mygithub-download-button-text) !important;
    text-decoration: none !important;
    line-height: 1.2;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}

.mygithub-download-shortcode-button:hover,
.mygithub-download-shortcode-button:focus {
    background: var(--mygithub-download-button-hover-bg);
    border-color: var(--mygithub-download-button-hover-bg);
    color: var(--mygithub-download-button-text) !important;
    transform: translateY(-1px);
}

.mygithub-download-shortcode-button.is-full-width {
    display: flex;
    width: 100%;
}

.mygithub-download-shortcode-button i {
    color: var(--mygithub-download-button-icon);
    font-size: var(--mygithub-download-button-icon-size);
    line-height: 1;
}

.mygithub-download-shortcode-button-text {
    color: var(--mygithub-download-button-text);
    font-size: var(--mygithub-download-button-text-size);
    font-weight: 600;
}

.mygithub-download-shortcode-button--small {
    padding: 0.55rem 0.95rem;
}

.mygithub-download-shortcode-button--medium {
    padding: 0.75rem 1.25rem;
}

.mygithub-download-shortcode-button--large {
    padding: 0.95rem 1.5rem;
}

/* New Layout Styles */

.mygithub-grid {
    display: grid;
    /* Grid columns are set inline via PHP based on customizer */
    gap: 20px;
}

.mygithub-card {
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.mygithub-archive-container {
    align-items: stretch;
}

.mygithub-archive-container .mygithub-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
}

.mygithub-archive-container .mygithub-card-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mygithub-archive-container .mygithub-card-excerpt {
    flex: 1 1 auto;
}

.mygithub-archive-container .mygithub-card-excerpt p:last-child {
    margin-bottom: 0;
}

.mygithub-archive-container .mygithub-card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    margin-top: auto !important;
    padding-top: 16px;
    min-height: 42px;
}

.mygithub-archive-container .mygithub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mygithub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.mygithub-card-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Single Modern Hero */
.mygithub-hero {
    position: relative;
    background-color: #24292e;
    color: #fff;
}

.mygithub-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mygithub-hero-content {
    position: relative;
    z-index: 2;
}

/* Responsive */
@media (max-width: 768px) {
    .mygithub-grid {
        grid-template-columns: 1fr !important;
    }
    
    .mygithub-single-wrapper {
        flex-direction: column !important;
    }
    
    .mygithub-sidebar {
        width: 100% !important;
        margin-top: 30px;
    }
}

/* Fix for README content overflow on mobile */
.single-github_repo .entry-content img,
.single-github_repo .entry-content video,
.mygithub-readme-content img,
.mygithub-readme-content video {
    max-width: 100% !important;
    height: auto !important;
    display: block; /* Helps with some layout issues */
    margin: 0 auto; /* Optional: center images */
}

/* iframe needs special handling to respect responsive container */
.single-github_repo .entry-content iframe,
.mygithub-readme-content iframe {
    max-width: 100% !important;
    /* height: auto !important;  <- REMOVED: This breaks responsive aspect ratio */
    display: block;
    margin: 0 auto;
}

.single-github_repo .entry-content pre,
.mygithub-readme-content pre {
    white-space: pre-wrap;       /* CSS3 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
    overflow-x: auto;            /* Scroll horizontal si es necesario */
    max-width: 100%;
    background: #f6f8fa;         /* GitHub style background */
    padding: 16px;
    border-radius: 6px;
}

.single-github_repo .entry-content code,
.mygithub-readme-content code {
    white-space: pre-wrap; /* Ensure inline code wraps */
    word-break: break-all; /* Break long strings like hashes */
}

/* Specific fix for tables */
.single-github_repo .entry-content table,
.mygithub-readme-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
}

/* Ensure table cells don't force width */
.single-github_repo .entry-content table td,
.single-github_repo .entry-content table th,
.mygithub-readme-content table td,
.mygithub-readme-content table th {
    min-width: 100px; /* Prevent squishing too much */
    max-width: 300px; /* Prevent expanding too much */
    word-wrap: break-word;
}

.single-github_repo .entry-content .mygithub-alert,
.mygithub-readme-content .mygithub-alert {
    margin: 1.5em 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid #0969da;
    border-radius: 8px;
    background: #f6f8fa;
}

.single-github_repo .entry-content .mygithub-alert-title,
.mygithub-readme-content .mygithub-alert-title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.single-github_repo .entry-content .mygithub-alert-note,
.mygithub-readme-content .mygithub-alert-note {
    border-left-color: #0969da;
    background: #ddf4ff;
}

.single-github_repo .entry-content .mygithub-alert-tip,
.mygithub-readme-content .mygithub-alert-tip {
    border-left-color: #1a7f37;
    background: #dafbe1;
}

.single-github_repo .entry-content .mygithub-alert-important,
.mygithub-readme-content .mygithub-alert-important {
    border-left-color: #8250df;
    background: #fbefff;
}

.single-github_repo .entry-content .mygithub-alert-warning,
.mygithub-readme-content .mygithub-alert-warning {
    border-left-color: #9a6700;
    background: #fff8c5;
}

.single-github_repo .entry-content .mygithub-alert-caution,
.mygithub-readme-content .mygithub-alert-caution {
    border-left-color: #cf222e;
    background: #ffebe9;
}

.single-github_repo .entry-content kbd,
.mygithub-readme-content kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #f6f8fa;
    box-shadow: inset 0 -1px 0 #d0d7de;
    font-family: monospace;
    font-size: 0.9em;
}

.single-github_repo .entry-content details,
.mygithub-readme-content details {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #f6f8fa;
}

.single-github_repo .entry-content summary,
.mygithub-readme-content summary {
    cursor: pointer;
    font-weight: 600;
}

.single-github_repo .entry-content,
.mygithub-readme-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%; /* Ensure container respects parent width */
    max-width: 100vw; /* Hard limit */
}

/* Force container constraints on mobile */
@media (max-width: 768px) {
    .single-github_repo .entry-content,
    .mygithub-readme-content {
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden; /* Prevent horizontal scroll on body */
    }
}
