/*
Theme Name: GitHub Like Theme
Theme URI: https://dataa.dev
Author: Nithin Mohan TK
Author URI: https://dataa.dev
Description: A developer blog theme modelled on GitHub's interface. Four colour schemes plus "follow system", self-hosted syntax highlighting, a table of contents with scroll tracking, heading anchors, a code block toolbar, and layouts tuned for long technical articles with diagrams and tables.
Version: 2.0.1
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
Update URI: https://dataa.dev/
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: github-like-theme
Tags: blog, custom-logo, custom-menu, editor-style, featured-images, sticky-post, threaded-comments, translation-ready, two-columns, left-sidebar

This file holds the design tokens and base element styles.
Layout and components are in css/theme.css, article content in css/content.css,
syntax colours in css/syntax.css and print rules in css/print.css.
*/

/* ==========================================================================
   Design tokens. Values follow GitHub Primer's functional colours.
   ========================================================================== */

:root {
    --gh-color-canvas-default: #ffffff;
    --gh-color-canvas-subtle: #f6f8fa;
    --gh-color-canvas-inset: #f6f8fa;
    --gh-color-canvas-overlay: #ffffff;
    --gh-color-border-default: #d1d9e0;
    --gh-color-border-muted: #d1d9e0b3;
    --gh-color-border-subtle: #d1d9e0;
    --gh-color-fg-default: #1f2328;
    --gh-color-fg-muted: #59636e;
    --gh-color-fg-subtle: #6e7781;
    --gh-color-fg-on-emphasis: #ffffff;
    --gh-color-accent-emphasis: #0969da;
    --gh-color-accent-fg: #0969da;
    --gh-color-accent-muted: #54aeff66;
    --gh-color-accent-subtle: #ddf4ff;
    --gh-color-success-emphasis: #1f883d;
    --gh-color-success-fg: #1a7f37;
    --gh-color-success-subtle: #dafbe1;
    --gh-color-danger-emphasis: #cf222e;
    --gh-color-danger-fg: #d1242f;
    --gh-color-danger-subtle: #ffebe9;
    --gh-color-attention-emphasis: #9a6700;
    --gh-color-attention-fg: #9a6700;
    --gh-color-attention-muted: #d4a72c66;
    --gh-color-attention-subtle: #fff8c5;
    --gh-color-done-fg: #8250df;
    --gh-color-done-subtle: #fbefff;
    --gh-color-neutral-muted: #818b981f;
    --gh-color-btn-bg: #f6f8fa;
    --gh-color-btn-hover-bg: #eff2f5;
    --gh-color-btn-text: #25292e;
    --gh-color-header-bg: #f6f8fa;
    --gh-color-backdrop: rgba(31, 35, 40, 0.5);

    /* Posting-activity squares (contribution graph greens) */
    --gh-activity-0: #eff2f5;
    --gh-activity-1: #aceebb;
    --gh-activity-2: #4ac26b;
    --gh-activity-3: #2da44e;
    --gh-activity-4: #116329;

    /* Code */
    --gh-code-bg: #f6f8fa;
    --gh-code-border: #d1d9e0;
    --gh-code-fg: #1f2328;
    --gh-code-comment: #59636e;
    --gh-code-keyword: #cf222e;
    --gh-code-string: #0a3069;
    --gh-code-function: #6639ba;
    --gh-code-variable: #953800;
    --gh-code-number: #0550ae;
    --gh-code-tag: #116329;
    --gh-code-inserted-bg: #dafbe1;
    --gh-code-inserted-fg: #116329;
    --gh-code-deleted-bg: #ffebe9;
    --gh-code-deleted-fg: #82071e;

    /* Typography */
    --gh-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --gh-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    /* Spacing */
    --gh-spacing-1: 4px;
    --gh-spacing-2: 8px;
    --gh-spacing-3: 16px;
    --gh-spacing-4: 24px;
    --gh-spacing-5: 32px;
    --gh-spacing-6: 40px;

    /* Shape and motion */
    --gh-radius-sm: 3px;
    --gh-radius-md: 6px;
    --gh-radius-lg: 12px;
    --gh-shadow-sm: 0 1px 0 rgba(31, 35, 40, 0.04);
    --gh-shadow-md: 0 3px 6px rgba(140, 149, 159, 0.15);
    --gh-shadow-lg: 0 8px 24px rgba(140, 149, 159, 0.2);
    --gh-transition-fast: 80ms cubic-bezier(0.33, 1, 0.68, 1);

    /* Layout */
    --gh-header-height: 64px;
    --gh-sidebar-width: 256px;
    --gh-rail-width: 248px;
    --gh-content-max: 880px;   /* article column */
    --gh-list-max: 1128px;     /* post lists */

    color-scheme: light;
}

/* Large screens: widen the article column, the right rail and the post
   lists in steps. These four variables are the only place widths are set. */

@media (min-width: 1600px) {
    :root {
        --gh-content-max: 1040px;
        --gh-rail-width: 264px;
        --gh-list-max: 1440px;
    }
}

@media (min-width: 1920px) {
    :root {
        --gh-content-max: 1200px;
        --gh-rail-width: 280px;
        --gh-list-max: 1760px;
    }
}

@media (min-width: 2400px) {
    :root {
        --gh-content-max: 1440px;
        --gh-rail-width: 300px;
        --gh-list-max: 2200px;
    }
}

@media (min-width: 3200px) {
    :root {
        --gh-content-max: 1680px;
        --gh-rail-width: 320px;
        --gh-list-max: 2800px;
    }
}

[data-github-theme="dark"] {
    --gh-color-canvas-default: #0d1117;
    --gh-color-canvas-subtle: #151b23;
    --gh-color-canvas-inset: #010409;
    --gh-color-canvas-overlay: #151b23;
    --gh-color-border-default: #3d444d;
    --gh-color-border-muted: #3d444db3;
    --gh-color-border-subtle: #3d444d;
    --gh-color-fg-default: #f0f6fc;
    --gh-color-fg-muted: #9198a1;
    --gh-color-fg-subtle: #7d8590;
    --gh-color-fg-on-emphasis: #ffffff;
    --gh-color-accent-emphasis: #1f6feb;
    --gh-color-accent-fg: #4493f8;
    --gh-color-accent-muted: #388bfd66;
    --gh-color-accent-subtle: #388bfd1a;
    --gh-color-success-emphasis: #238636;
    --gh-color-success-fg: #3fb950;
    --gh-color-success-subtle: #2ea04326;
    --gh-color-danger-emphasis: #da3633;
    --gh-color-danger-fg: #f85149;
    --gh-color-danger-subtle: #f851491a;
    --gh-color-attention-emphasis: #9e6a03;
    --gh-color-attention-fg: #d29922;
    --gh-color-attention-muted: #bb800966;
    --gh-color-attention-subtle: #bb800926;
    --gh-color-done-fg: #ab7df8;
    --gh-color-done-subtle: #ab7df826;
    --gh-color-neutral-muted: #656c7633;
    --gh-color-btn-bg: #212830;
    --gh-color-btn-hover-bg: #262c36;
    --gh-color-btn-text: #f0f6fc;
    --gh-color-header-bg: #010409;
    --gh-color-backdrop: rgba(1, 4, 9, 0.6);

    --gh-activity-0: #151b23;
    --gh-activity-1: #033a16;
    --gh-activity-2: #196c2e;
    --gh-activity-3: #2ea043;
    --gh-activity-4: #56d364;

    --gh-code-bg: #151b23;
    --gh-code-border: #3d444d;
    --gh-code-fg: #f0f6fc;
    --gh-code-comment: #9198a1;
    --gh-code-keyword: #ff7b72;
    --gh-code-string: #a5d6ff;
    --gh-code-function: #d2a8ff;
    --gh-code-variable: #ffa657;
    --gh-code-number: #79c0ff;
    --gh-code-tag: #7ee787;
    --gh-code-inserted-bg: #033a16;
    --gh-code-inserted-fg: #aff5b4;
    --gh-code-deleted-bg: #67060c;
    --gh-code-deleted-fg: #ffdcd7;

    --gh-shadow-sm: 0 0 transparent;
    --gh-shadow-md: 0 3px 6px #010409;
    --gh-shadow-lg: 0 8px 24px #010409;

    color-scheme: dark;
}

[data-github-theme="dark_dimmed"] {
    --gh-color-canvas-default: #212830;
    --gh-color-canvas-subtle: #262c36;
    --gh-color-canvas-inset: #151b23;
    --gh-color-canvas-overlay: #2a313c;
    --gh-color-border-default: #3d444d;
    --gh-color-border-muted: #3d444db3;
    --gh-color-border-subtle: #3d444d;
    --gh-color-fg-default: #d1d7e0;
    --gh-color-fg-muted: #9198a1;
    --gh-color-fg-subtle: #7d8590;
    --gh-color-fg-on-emphasis: #ffffff;
    --gh-color-accent-emphasis: #316dca;
    --gh-color-accent-fg: #478be6;
    --gh-color-accent-muted: #4184e466;
    --gh-color-accent-subtle: #4184e41a;
    --gh-color-success-emphasis: #347d39;
    --gh-color-success-fg: #57ab5a;
    --gh-color-success-subtle: #46954a26;
    --gh-color-danger-emphasis: #c93c37;
    --gh-color-danger-fg: #e5534b;
    --gh-color-danger-subtle: #e5534b1a;
    --gh-color-attention-emphasis: #966600;
    --gh-color-attention-fg: #c69026;
    --gh-color-attention-muted: #ae7c1466;
    --gh-color-attention-subtle: #ae7c1426;
    --gh-color-done-fg: #986ee2;
    --gh-color-done-subtle: #986ee226;
    --gh-color-neutral-muted: #656c7633;
    --gh-color-btn-bg: #2a313c;
    --gh-color-btn-hover-bg: #2f3742;
    --gh-color-btn-text: #d1d7e0;
    --gh-color-header-bg: #151b23;
    --gh-color-backdrop: rgba(21, 27, 35, 0.6);

    --gh-activity-0: #2a313c;
    --gh-activity-1: #1b4721;
    --gh-activity-2: #2b6a30;
    --gh-activity-3: #46954a;
    --gh-activity-4: #6bc46d;

    --gh-code-bg: #262c36;
    --gh-code-border: #3d444d;
    --gh-code-fg: #d1d7e0;
    --gh-code-comment: #9198a1;
    --gh-code-keyword: #f47067;
    --gh-code-string: #96d0ff;
    --gh-code-function: #dcbdfb;
    --gh-code-variable: #f69d50;
    --gh-code-number: #6cb6ff;
    --gh-code-tag: #8ddb8c;
    --gh-code-inserted-bg: #1b4721;
    --gh-code-inserted-fg: #b4f1b4;
    --gh-code-deleted-bg: #78191b;
    --gh-code-deleted-fg: #ffd8d3;

    --gh-shadow-sm: 0 0 transparent;
    --gh-shadow-md: 0 3px 6px #151b23;
    --gh-shadow-lg: 0 8px 24px #151b23;

    color-scheme: dark;
}

[data-github-theme="high_contrast"] {
    --gh-color-canvas-default: #010409;
    --gh-color-canvas-subtle: #151b23;
    --gh-color-canvas-inset: #010409;
    --gh-color-canvas-overlay: #151b23;
    --gh-color-border-default: #b7bdc8;
    --gh-color-border-muted: #b7bdc8;
    --gh-color-border-subtle: #b7bdc8;
    --gh-color-fg-default: #ffffff;
    --gh-color-fg-muted: #d9dee3;
    --gh-color-fg-subtle: #b7bdc8;
    --gh-color-fg-on-emphasis: #ffffff;
    --gh-color-accent-emphasis: #194fb1;
    --gh-color-accent-fg: #74b9ff;
    --gh-color-accent-muted: #409eff;
    --gh-color-accent-subtle: #5cacff1a;
    --gh-color-success-emphasis: #006222;
    --gh-color-success-fg: #2bd853;
    --gh-color-success-subtle: #0ac7401a;
    --gh-color-danger-emphasis: #ad0116;
    --gh-color-danger-fg: #ff9492;
    --gh-color-danger-subtle: #ff80801a;
    --gh-color-attention-emphasis: #7b4900;
    --gh-color-attention-fg: #f0b72f;
    --gh-color-attention-muted: #e09b13;
    --gh-color-attention-subtle: #edaa2726;
    --gh-color-done-fg: #d3abff;
    --gh-color-done-subtle: #bf8fff1a;
    --gh-color-neutral-muted: #212830;
    --gh-color-btn-bg: #212830;
    --gh-color-btn-hover-bg: #262c36;
    --gh-color-btn-text: #ffffff;
    --gh-color-header-bg: #010409;
    --gh-color-backdrop: rgba(1, 4, 9, 0.7);

    --gh-activity-0: #151b23;
    --gh-activity-1: #007728;
    --gh-activity-2: #02a232;
    --gh-activity-3: #0ac740;
    --gh-activity-4: #4ae168;

    --gh-code-bg: #151b23;
    --gh-code-border: #b7bdc8;
    --gh-code-fg: #ffffff;
    --gh-code-comment: #d9dee3;
    --gh-code-keyword: #ff9492;
    --gh-code-string: #addcff;
    --gh-code-function: #dbb7ff;
    --gh-code-variable: #ffb757;
    --gh-code-number: #91cbff;
    --gh-code-tag: #72f088;
    --gh-code-inserted-bg: #033a16;
    --gh-code-inserted-fg: #acf7b6;
    --gh-code-deleted-bg: #67060c;
    --gh-code-deleted-fg: #ffdedb;

    --gh-shadow-sm: 0 0 transparent;
    --gh-shadow-md: 0 3px 6px #010409;
    --gh-shadow-lg: 0 8px 24px #010409;

    color-scheme: dark;
}

/* ==========================================================================
   Base elements
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--gh-header-height) + 16px);
}

body {
    margin: 0;
    font-family: var(--gh-font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gh-color-fg-default);
    background-color: var(--gh-color-canvas-default);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gh-color-fg-default);
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
h5 { font-size: 14px; }
h6 { font-size: 13px; }

p {
    margin: 0 0 16px;
}

a {
    color: var(--gh-color-accent-fg);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

ul,
ol {
    margin: 0 0 16px;
    padding-left: 2em;
}

hr {
    height: 1px;
    margin: 24px 0;
    border: 0;
    background-color: var(--gh-color-border-default);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

code,
kbd,
samp,
pre {
    font-family: var(--gh-font-mono);
}

kbd {
    display: inline-block;
    padding: 2px 5px;
    font-size: 11px;
    line-height: 10px;
    color: var(--gh-color-fg-muted);
    vertical-align: middle;
    background-color: var(--gh-color-canvas-subtle);
    border: 1px solid var(--gh-color-border-default);
    border-radius: var(--gh-radius-md);
    box-shadow: inset 0 -1px 0 var(--gh-color-border-default);
}

:focus-visible {
    outline: 2px solid var(--gh-color-accent-fg);
    outline-offset: 2px;
}

::selection {
    background-color: var(--gh-color-accent-muted);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    clip: auto;
    color: var(--gh-color-fg-on-emphasis);
    background-color: var(--gh-color-accent-emphasis);
    border-radius: var(--gh-radius-md);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
