/* Global variables. */
:root,
::backdrop {
  /* Set sans-serif & mono fonts */
  --sans-font: -apple-system, BlinkMacSystemFont, "Avenir Next", Avenir,
    "Nimbus Sans L", Roboto, "Noto Sans", "Segoe UI", Arial, Helvetica,
    "Helvetica Neue", sans-serif;
  --mono-font: Consolas, Menlo, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  --standard-border-radius: 0.25rem;

  /* Default (light) theme */
  --bg: #fff;
  --accent-bg: #f5f7ff;
  --text: #212121;
  --text-light: #585858;
  --border: #d8dae1; /*#898EA4;*/
  --accent: #0d47a1;
  --code: #d81b60;
  --preformatted: #444;
  --marked: #ffdd33;
  --disabled: #efefef;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root,
  ::backdrop {
    color-scheme: dark;
    --bg: #212121;
    --accent-bg: #2b2b2b;
    --text: #dcdcdc;
    --text-light: #ababab;
    --accent: #ffb300;
    --code: #f06292;
    --preformatted: #ccc;
    --disabled: #111;
  }
  /* Add a bit of transparency so light media isn't so glaring in dark mode */
  img,
  video {
    opacity: 1;
  }
}

body > header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0;
}

body > header p {
  margin: 1rem;
}

header > nav form {
    margin-top: -0.5rem;
}

header > nav select {
    padding: 0.4rem;
}

/* Hide text, so only icons on mobile */
@media only screen and (max-width: 720px) {
    header > nav a { padding: 2rem }
    header > nav a span { display: none; }
}

.notice {
  border-radius: 0.25rem;
  margin: 2rem 0.5rem;
}

/* === Timeline Style === */

.right {
    float: right;
    margin-right: 0.25rem;
}

header p a img.logo {
    border: none;
    height: 1.5rem;
    width:  1.5rem;
    vertical-align: sub;
}

header img.avatar {
    height: 1.5rem;
    width:  1.5rem;
    vertical-align: sub;
}

header a span {
    padding-left: 0.5rem;
}

header p a,
header p a:visited {
/*    font-weight: bold;*/
/*    color: var(--text);*/
    color: var(--accent);
    text-decoration: none;
}

nav ul.secondary {
/*    padding: 0 0.75rem;*/
    font-size: small;
}

/*nav ul li {
    display: inline-block;
    list-style: none;
}*/

header a {
/*    text-decoration: none;*/
/*    font-weight: bold;*/
/*    line-height: 1.5;*/
}

nav .link-btn { 
    background: none;
    border: none;
    cursor: pointer;
    margin: 0;
    padding: 0;
    width: 100%;
    color: var(--text);
    font-weight: bold;
    border-radius: 0;
}

img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    border: thin solid var(--border);
}

img.avatar {
    height: 2.5rem;
    width: 2.5rem;
    object-fit: cover;
    border: none;
}

a.author {
    text-decoration: none;
    color: var(--text);
}

/* === PROFILE === */

.profile {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 4rem 1fr;
    grid-gap: 1rem;
}

.profile img.avatar {
    width: 4rem;
    height: 4rem;
}

.profile .author {
    font-size: larger;
    line-height: 1;
}

.profile p {
    margin: 0.2rem 0;
    color: var(--text-light);
}

.profile a,
.profile a:visited {
    color: var(--text);
    text-decoration: none;
}

.profile a:hover {
    color: var(--accent);
}

.profile-nav {
    margin-top: 1rem;
    font-size: smaller;    
}

.profile-filters {
    padding: 0.25rem;
}

.profile-filters a {    
    padding-right: 0.5rem;
    font-weight: bold;    
}

.profile a.active {
    color: var(--accent);
}

.profile a.button {
    font-size: small;
    background-color: var(--accent-bg);
    padding: 0.25em 0.5rem;
    margin-left: 0.5rem;
}


a.txt-link i {
    display: none;
    color: var(--accent);
}

a.txt-link span {
    text-decoration: underline;
}

a.txt-link:hover span {
    text-decoration: none;
}

/* Only show icon for link to txt*/

@media only screen and (max-width: 720px) {
    a.txt-link i { display: initial; }
    a.txt-link span { display: none; }
}

/* == Tag Cloud ===================== */

.tagcloud {
    margin-top: 0.75rem;
    border-top: thin solid var(--border);
    padding: 0.5rem 0.25rem;
    text-align: justify;
}

.tagcloud a,
.tagcloud a:visited {
    text-decoration: none;
    padding-right: 0.2rem;
    line-height: 1;
    color: var(--text-light);
}


.tagcloud a.active {
    color: var(--accent);
}

/* === TIMELINE === */

article {
    color: var(--text-light);
    margin: 0.5rem;
    padding: 0.5rem;
}

article.post-entry {
    display: grid;
    grid-gap: 1rem;
    grid-template-columns: 2.5rem auto;
}

article .twt-msg {
    padding: 0.5rem 0.5rem 0.5rem 0 ;
    overflow-wrap: anywhere; 
}

article .twt-msg p {
    margin: 0.25rem 0;
}

article .twt-msg > blockquote {
    margin: 0.5rem 0;
    border-left: thick solid grey;
    padding: 0.25rem 0.5rem;
    display: inline-block;
    font-style: italic;
}

article .twt-msg ul,
article .twt-msg ol {
    padding-left: 2rem;
}

article .twt-msg li {
    padding-left: 0.5rem;
}


article .twt-msg pre {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

article .twt-msg img {
    margin: 0.25rem -0.25rem;
    display: block;
}

article .twt-msg > img:first-child {
    margin-top: 0;
}

article .twt-msg > img:last-child {
    margin-bottom: 0;
}

article .embed-video {
    margin-top: 0.5rem;
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 0.25rem;    
}

article small {
    font-size: small;
}

article small a,
article small a:visited {
    color: var(--text);
    text-decoration: none;
    font-weight: bold;
}

article small a.right,
article small a.right:visited {
    font-weight: normal;
}

article small a:hover {
    color: var(--accent);
/*    text-decoration: underline;*/
}


/* === New Post Form === */

#new_twt {
    border: none;
/* text-align: center*/
}

#new_twt input[type="submit"] {
    min-width: 33%;
}

nav.pagnation {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

/* === REFRESH === */

#refreshInfo {
    display: block;
}

#refreshInfo {
    display: block;
    text-align: center:
}

#refreshURL {
}

#refreshCounter {
    float: right;
}

/* == Gallery ===================== */

.gallery {
    max-width: 1200px;
    margin: 0 auto ;
    display: grid;
    grid-gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    /*grid-auto-rows: 225px;*/
    /*grid-auto-flow: dense;*/
}  

.gallery a img {
    /* https://web.dev/aspect-ratio/ */
    aspect-ratio: 1 / 1; 
    width: 100%;
    /*height: 100%;*/
    object-fit: cover;
    /*background-color: var(--border-color);*/
    border-radius: 0.25rem;
}

/* === FOOTER === */

footer {
    border-top: thin solid grey;
    margin-top: 1rem;
    text-align: center;
}
