/* Copyright 2018 Oliver Smith
   SPDX-License-Identifier: GPL-3.0-or-later

   This file is used for single blog posts and for pages (e.g. FAQ). */

/* HEADLINES WITH TOC-LINKS */
.toclink {
    text-decoration: none;
}

.toclink:hover {
    text-decoration: underline;
}

/* TITLE RELATED */
.title {
    display: grid;
    grid-template-areas: "title title"
                         "date reading_time";
    margin: 20px 30px 0px;
}

.title h1 {
    grid-area: title;
    margin: 60px 0px;

    font-size: 30pt;
    text-align: center;
    line-height: 50pt;
    display: block;

    /* treat \n like <br> (we replace ":" with ":\n" in post titles) */
    white-space: pre-line;
}

.date {
    grid-area: date;
}

.reading_time {
    grid-area: reading_time;
    text-align: right;
}

/* IMAGES */
img.w150 {
    width: 150px;
}
img.w200 {
    width: 200px;
}
img.w300 {
    width: 300px;
}
img.wfull {
    width: 100%;
}
img.center {
    display: block;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

div.border,
img.border,
video.border {
    border: 1px solid lightgrey;
}

/* TEXT BELOW IMAGES */
span.w200,
span.w300,
span.img-center-subtext {
    display: inline-block;
    width: 200px;
    margin-left: auto;
    line-height: 1.2;
    font-size: small;
}
span.w300 {
    width: 300px;
}
span.img-center-subtext {
    text-align: center;
    width: 100%;
}

/* GRID */
.grid {
    display: grid;
    grid-template-areas: "text   . side"
                         "bottom . side";
    grid-template-columns: auto 20px auto;
    align-items: center;
}

.grid-text {
    grid-area: text;
}

.grid-side {
    display: flex;
    flex-direction: column;
    grid-area: side;
    text-align: right;
}
.grid-side img,
.grid-side video {
    max-width: 100%;
}
.grid-side label {
    text-align: center;
}

.grid-bottom {
    grid-area: bottom;
}
.grid-bottom img,
.grid-bottom video {
    border: 1px solid lightgrey;
}


/* RESPONSIVENESS */
@media screen and (max-width: 800px) {
    .grid {
        grid-template-areas: "side"
                             "text"
                             "bottom";
        grid-template-columns: 100%;
    }
    .grid-side {
        align-items: center;
    }
    .grid-bottom {
        text-align: center;
    }
}
@media screen and (max-width: 500px) {
    .title h1 {
        font-size: 22pt;
    }
}
@media screen and (max-width: 400px) {
    .date,
    .reading_time {
        font-size: 12pt;
    }
}

/* TABLE: SPECS */
.table-specs {
    font-size: 8pt;
    border-spacing: 0;
    border-collapse: collapse;
    margin: 5px auto 10px auto;
}

.table-specs tr td { /* first column */
    text-align: left;
    padding-left: 2px;
}
.table-specs tr td:nth-child(2n) { /* second column */
    text-align: right;
    max-width: 250px;
    padding-right: 2px;
}

.table-specs tr:nth-child(2n-1) {
    background-color: white;
}

.new {
    display: inline-block;
    color: white;
    padding: 0px 6px;
    font-size: 11pt;
    border-radius: 7px;
    background-color: #090;
    position: relative;
    top: -3px;
    margin-left: 5px;
    line-height: 17pt;
}
