/* MELONESQUE -- Emacs Wiki Theme
 * 
 * Copyright (C) 2025 Nawan <saya@nawan.my.id>
 * Copyright (C) 2023-2024 Muto <https://www.emacswiki.org/emacs/muto>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see
 * <https://www.gnu.org/licenses/>.
 *
 */

/* TABLE OF CONTENTS
 *
 * COLORS
 * HEADER / NAVBAR
 * MAIN BODY STUFF
 * TABLE OF CONTENTS
 * TABLES
 * SOURCE CODE
 * SYNTAX HIGHLIGHTING
 * FOOTER STUFF
*/


/********************************************************************/
/* COLORS
 *
 * You only need to change these.
 * If you just want to theme the color pallette,
 * then there is no need to look further than this.
 *
 */
:root {
    --main-bg:      #FFFFFF;
    --toplinks:     #E6E6E6;
    --intense-bg:   #E6E6E6;
    --textcolor:    #111111;
    --boldcolor:    #000000;
    --subtle-grey:  #999999;
    --subtle-grey2: #777777;
    --h1:           #111111;
    --h2:           #444444;
    --link:         #770000;
    --link-hover:   #114444;
    --link-edit:    #f21818;
    --link-edit-hover: #f27e7e;
    --diff-old:     #ffffaf;
    --diff-new:     #cfffcf;


    /* For syntax highlighting: */
    --blue0:  #483d8b;
    --red0:   #3c3511;
    --blue1:  #0000ff;
    --red1:   #ff0000;
    --cyan:   #008b8b;
    --ourple: #7f007f;
    --violet: maroon;
    --green:  #228b22;
}

/* This is the dark theme */
@media (prefers-color-scheme: dark) {
    :root {
	--main-bg:      #191919;
	--intense-bg:   #111111;
	--textcolor:    #DDDDDD;
	--boldcolor:    #FFFFFF;
	--toplinks:     #222222;
	--subtle-grey:  #444444;
	--subtle-grey2: #333333;
	--h1:           #AAAAAA;
	--h2:           #888888;
	--link:         #66DD77;
	--link-hover:   #55AAAA;
	--link-edit:    #d11b1b;
	--link-edit-hover: #ba5656;
	--diff-old:     #666603;
	--diff-new:     #306230;

	/*In the dark theme, these names make less sense lol*/
	--blue0:  #9fbfdf;
	--red0:   #e98888;
	--blue1:  #ab85a3;
	--red1:   #a9df90;
	--cyan:   #91a0b3;
	--ourple: #ddbc91;
	--violet: #BB99FF;
	--green:  #FF0055;
    }
}

/* Remove the nav bar / footer when the page is printed to a PDF. */
@media print {
    nav {display: none}
    footer {display: none}
}

/********************************************************************/
/* HEADER / NAVBAR */

.gotobar a, .edit.bar a {
    margin: 3px;
    line-height: 1.5em;
    padding: 3px 5px;
    background: var(--toplinks);
    border-radius: 5px;
    display: inline-block;
}

label[for="searchlang"],
input#searchlang {
  display: none;
}

form.search {
  display: inline-block;
  margin-left: .5em;
  margin-top: -5px;
  float: right;
}

@media only screen and (max-width: 1200px) {
    span.gotobar {
        display: inline-block;
    }
    form.search {
        float: left;
        margin: auto;
    }
}

input, textarea  {
    color: var(--textcolor);
    background: var(--toplinks);
    border: 1px solid var(--toplinks);
    font-size: inherit;
}

textarea#text, #summary {
    width: 100%;
    font-family: sans-serif;
}

textarea#text {
    font-family: monospace, monospace;
}

img {max-width: 90%; max-height: 40em;}

/********************************************************************/

/* MAIN BODY STUFF
 * Body
 * Links
 * Headers
 * Text */

body {
    background: var(--main-bg);
    color: var(--textcolor);
    margin:auto;
    padding: 2% 5%;
    font-size: 1.1em;
}

@media only screen and (max-width: 1200px) {
    body {
        font-size: 1em;
        padding: 0 5%;
    }
    h1 {
        font-size: 1.7em;
    }
    h2 {
        font-size: 1.5em;
    }
    h3 {
        font-size: 1.2em;
    }
}

a {
    text-decoration: none;
    color: var(--link);
}

a.edit {
    text-decoration: none;
    color: var(--link-edit);
}

a:hover         {text-decoration: underline}
a:visited       {color: var(--link-hover)}
a.outside:after {content: "˺"}
a.edit:visited  {color: var(--link-edit-hover)}
a.footnote      {font-size: 0.8em;vertical-align: super}
div.footnote    {padding-left: 2rem;font-size: 80%}

/* Some internal links are marked as "outside" */
a.inter:after, a.EmacsWiki:after {content: ""}

/* language links are flagged as "outside", */
/* so we remove the arrow from those, too   */
.WikiLanguageMenu p a {color: var(--textcolor);}
.WikiLanguageMenu p a:after  {content: ""}

h1, h1 a, h1 a:link, h1 a:hover, h1 a:visited, h1 a span {
    color: var(--h1);
    border-bottom: none;
    text-decoration: none;
}

h1 {
    border-bottom: 4px solid var(--h1);
    padding-top: 1.5em;
    padding-bottom: 3px;
    font-weight: normal;
}

h2 {
    border-bottom: 2px solid var(--h2);
    padding-bottom: 3px;
    margin-top: 0.7em;
    font-weight: normal;
}

h3 {
  color: var(--h2);
  border-bottom: 1px solid var(--subtle-grey);
  border-left:   1px solid var(--subtle-grey);
  padding: 5px;
  margin-top: 0.8em;
}

* b, * strong {color: var(--boldcolor);}

hr {border: 1px solid var(--subtle-grey);}

/********************************************************************/
/* SOURCE CODE */
code {
    background: var(--toplinks);
    border-radius: 3px;
    padding: 1px 3px;
    font-family: monospace, monospace;
    overflow: auto;
}

pre {
    font-family: monospace, monospace;
    border-radius: 5px;
    padding: 0.5em;
    margin:  1em;
    background-color: var(--intense-bg);
    color: var(--h1);
    overflow: auto;
}

/********************************************************************/
/* DIFF */
/*div.diff { padding-left: 2%; padding-right: 2%; }*/
div.old {background-color: var(--diff-old); font-family: monospace, monospace; overflow-wrap: break-word;}
div.new {background-color: var(--diff-new); font-family: monospace, monospace; overflow-wrap: break-word;}
div.old p, div.new p {
    padding: 0.5em 0;
}

/********************************************************************/
/* TABLE OF CONTENTS */
.toc {
    background-color: var(--toplinks);
    display: inline-block;
    padding: 5px;
    border: 2px solid var(--subtle-grey);
}

/********************************************************************/
/* QUOTE BLOCKS */

.quote, .WikiLanguageMenu {
    background: var(--toplinks);
    padding: 5px;
    border-radius: 5px;
    margin: 1em;
}
.quote dd, .WikiLanguageMenu {
    margin: 0 5px;
    padding: 5px 10px;
    border-left: 5px solid var(--subtle-grey);
}

/* Easily differentiate quote depths */
.quote dd dd {color: var(--violet);}
.quote dd dd dd {color: var(--textcolor);}
.quote dd dd dd dd {color: var(--violet);}


/********************************************************************/
/* TABLES */

table.user tbody tr.odd.first td{
    background: var(--toplinks);
    font-weight: bold;
}
table.user tbody td {
    background: var(--subtle-grey);
    padding: 2px 5px;
}
table.user tbody tr.odd td  {
    background: var(--subtle-grey2);
    color: var(--boldcolor);
}
table.user tbody tr td:first-child {
    border-right: 5px solid var(--main-bg);
}

/********************************************************************/
/* SYNTAX HIGHLIGHTING */

span.builtin      { color: var(--blue0); } /* DarkSlateBlue */
span.comment      { color: var(--red0); } /* Firebrick */
span.constant     { color: var(--cyan); } /* DarkCyan */
span.function     { color: var(--blue1); } /* Blue1 */
span.keyword      { color: var(--ourple); } /* Purple */
span.string       { color: var(--violet); } /* VioletRed4 */
span.type         { color: var(--green); } /* ForestGreen */
span.warning      { color: var(--red1); font-weight: bold; } /* Red1 */
span.comment span,
span.string  span { color: inherit; }
span.comment span.important.constant,
span.string  span.important.constant { color: var(--cyan); }


/********************************************************************/

/* FOOTER STUFF:
 *
 * Let's dim out the footer a bit
 * Who reads all that copyright boilerplate anyway?
 */

footer a,   footer a:visited {
    color: var(--subtle-grey);
    text-decoration: underline;
}



footer,   footer a {
    color: var(--subtle-grey)
}

header img,   footer img {display: none;}

footer .time,
footer .time a
{color: var(--h2);}
div.time {text-align: center}
.edit.bar {text-align: center}
.edit.bar a {color: var(--boldcolor);
	    text-decoration:none}
.edit.bar a:hover {text-decoration: underline;}

/* idk if im gonna get in legal trouble for
   hiding this but i am a big fan of NOT visual-clutter ;-;
   sorryyyyyyyyyyyyyyyyyy*/
p.legal {display: none}
footer .time {padding-bottom: .5em;}
footer:after {content: "GPLv2"}

/********************************************************************/
/* Pygments staroffice CSS */

pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.hll { background-color: #ffffcc }
.c { color: #696969 } /* Comment */
.err { color: #800000 } /* Error */
.esc { color: #000080 } /* Escape */
.g { color: #000080 } /* Generic */
.k { color: #000080 } /* Keyword */
.l { color: #EE0000 } /* Literal */
.n { color: #008000 } /* Name */
.o { color: #000080 } /* Operator */
.x { color: #000080 } /* Other */
.p { color: #000080 } /* Punctuation */
.ch { color: #696969 } /* Comment.Hashbang */
.cm { color: #696969 } /* Comment.Multiline */
.cp { color: #696969 } /* Comment.Preproc */
.cpf { color: #696969 } /* Comment.PreprocFile */
.c1 { color: #696969 } /* Comment.Single */
.cs { color: #696969 } /* Comment.Special */
.gd { color: #000080 } /* Generic.Deleted */
.ge { color: #000080 } /* Generic.Emph */
.ges { color: #000080 } /* Generic.EmphStrong */
.gr { color: #000080 } /* Generic.Error */
.gh { color: #000080 } /* Generic.Heading */
.gi { color: #000080 } /* Generic.Inserted */
.go { color: #000080 } /* Generic.Output */
.gp { color: #000080 } /* Generic.Prompt */
.gs { color: #000080 } /* Generic.Strong */
.gu { color: #000080 } /* Generic.Subheading */
.gt { color: #000080 } /* Generic.Traceback */
.kc { color: #000080 } /* Keyword.Constant */
.kd { color: #000080 } /* Keyword.Declaration */
.kn { color: #000080 } /* Keyword.Namespace */
.kp { color: #000080 } /* Keyword.Pseudo */
.kr { color: #000080 } /* Keyword.Reserved */
.kt { color: #000080 } /* Keyword.Type */
.ld { color: #EE0000 } /* Literal.Date */
.m { color: #EE0000 } /* Literal.Number */
.s { color: #EE0000 } /* Literal.String */
.na { color: #008000 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #008000 } /* Name.Class */
.no { color: #008000 } /* Name.Constant */
.nd { color: #008000 } /* Name.Decorator */
.ni { color: #008000 } /* Name.Entity */
.ne { color: #008000 } /* Name.Exception */
.nf { color: #008000 } /* Name.Function */
.nl { color: #008000 } /* Name.Label */
.nn { color: #008000 } /* Name.Namespace */
.nx { color: #008000 } /* Name.Other */
.py { color: #008000 } /* Name.Property */
.nt { color: #008000 } /* Name.Tag */
.nv { color: #008000 } /* Name.Variable */
.ow { color: #000080 } /* Operator.Word */
.pm { color: #000080 } /* Punctuation.Marker */
.w { color: #000080 } /* Text.Whitespace */
.mb { color: #EE0000 } /* Literal.Number.Bin */
.mf { color: #EE0000 } /* Literal.Number.Float */
.mh { color: #EE0000 } /* Literal.Number.Hex */
.mi { color: #EE0000 } /* Literal.Number.Integer */
.mo { color: #EE0000 } /* Literal.Number.Oct */
.sa { color: #EE0000 } /* Literal.String.Affix */
.sb { color: #EE0000 } /* Literal.String.Backtick */
.sc { color: #EE0000 } /* Literal.String.Char */
.dl { color: #EE0000 } /* Literal.String.Delimiter */
.sd { color: #EE0000 } /* Literal.String.Doc */
.s2 { color: #EE0000 } /* Literal.String.Double */
.se { color: #EE0000 } /* Literal.String.Escape */
.sh { color: #EE0000 } /* Literal.String.Heredoc */
.si { color: #EE0000 } /* Literal.String.Interpol */
.sx { color: #EE0000 } /* Literal.String.Other */
.sr { color: #EE0000 } /* Literal.String.Regex */
.s1 { color: #EE0000 } /* Literal.String.Single */
.ss { color: #EE0000 } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.fm { color: #008000 } /* Name.Function.Magic */
.vc { color: #008000 } /* Name.Variable.Class */
.vg { color: #008000 } /* Name.Variable.Global */
.vi { color: #008000 } /* Name.Variable.Instance */
.vm { color: #008000 } /* Name.Variable.Magic */
.il { color: #EE0000 } /* Literal.Number.Integer.Long */
