* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fonts */
@font-face {
    font-family: "Main";
    src: url(/assets/fonts/VictorMono-Regular.ttf);
}

@font-face {
    font-family: "Main";
    src: url(/assets/fonts/VictorMono-Bold.ttf);
    font-weight: bold;
}

@font-face {
    font-family: "Code";
    src: url(/assets/fonts/VictorMono-Regular.ttf);
}

html {
    background-color: #fff;
}

body {
    color: #000;
    font-family: "Main";
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* High-level */
.wrapper {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 40px 0 40px;
    text-align: center;
}

.page {
    font-size: 1.05em;
    text-align: left;
}

.float-container > * {
    float: left;
}

.float-container::after {
    display: block;
    content: "";
    clear: both;
}

.mobile {
    display: none;
}

.inline-block {
    display: inline-block;
}

/* Header */
header {
    position: relative;
    /*background: linear-gradient(to bottom right, #ff644e, #cb3018);*/
    background: linear-gradient(to bottom right, #2c5689, #3b719c);
    color: #eee;
    line-height: 1.5em;
    padding: 0 20px;
}

header .wrapper {
    padding: 25px 0 20px 0;
}

header a {
    display: inline-block;
}

header p a {
    text-decoration: underline;
}

header .logo {
    width: 500px;
    max-width: 80%;
    margin-bottom: 6px;
}

header nav {
    display: inline-block;
    background-color: #fff;
    border-radius: 10px;
    margin-top: 18px;
    overflow: hidden;
}

header nav li {
    display: inline-block;
}

header nav a {
    display: block;
    color: #3b719c;
    padding: 0 10px;
    line-height: 30px;
}

header nav a:hover, header nav li.selected a {
    color: #fff;
    background-color: #3b719c;
}

header nav .search a {
    background-image: url(/assets/theme/search.svg);
    background-repeat: no-repeat;
    background-size: 65% 65%;
    background-position: center center;
    width: 34px;
    color: transparent !important;
    user-select: none;
}

header nav .search a:hover, header nav .search.selected a, .search .search-box input[type="submit"] {
    background-image: url('data:image/svg+xml,%3Csvg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Crect fill="%23FFF" transform="rotate(-45 9 29.5)" x="-1" y="27" width="20" height="5" rx="2.5"/%3E%3Ccircle stroke="%23FFF" stroke-width="5" cx="23" cy="15" r="12"/%3E%3C/g%3E%3C/svg%3E');
}

/* Lists */
ul {
    list-style-type: none;
    margin-block-start: 0;
    margin-block-end: 0;
}

.item-list.grid {
    margin-top: 20px;
    margin-bottom: 20px;
}

h2.tag, .item-list > li {
    margin-top: 20px;
    background-color: #f3f3f3;
    padding: 12px 14px;
    border-radius: 15px;
    overflow: hidden;
}

.item-list > li > a {
    display: block;
    width: 100%;
    padding: 12px 14px;
    border-radius: 15px;
}

.item-list > li > a:hover {
    background-color: #ddd;
}

.item-list.grid > li {
    margin-top: 0;
}

.item-list.grid.latest > li {
    padding: 0;
}

.item-list article {
    width: 100%;
}

.item-list article h1 {
    font-size: 1.5em;
    margin-bottom: 12px;
    max-width: inherit;
}

.item-list article h1 a:hover, .item-list article p a:hover {
    /*color: #3b719c;*/
    color: #3b7e87;
}

.item-list.grid article h1 {
    font-size: 1.3em;
    line-height: 1.2em;
    margin-bottom: 0;
}

.item-list.grid article p {
    font-size: 0.9em;
}

.item-list.grid article .tags {
    margin-top: 10px;
    font-size: 0.9em;
}

.item-list.grid article.podcast .tags {
    margin-top: 12px;
}

.item-list article .metadata {
    margin: 0;
}

.item-list article .metadata.date-only {
    margin-bottom: 10px;
}

.item-list article p {
    margin-top: 5px;
}

.item-list article .type {
    display: block;
    padding-left: 18px;
    background-repeat: no-repeat;
    background-size: auto 80%;
    background-position-y: center;
    font-size: 0.8em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 10px;
    padding-top: 1px;
}

.item-list .article .type {
    background-image: url(/assets/theme/article-gray.svg);
}

.item-list .podcast .type {
    background-image: url(/assets/theme/podcast-gray.svg);
}

.item-list .tips .type, .item-list .special .type {
    background-image: url(/assets/theme/tips-gray.svg);
    padding-left: 19px;
}

.item-list .basics .type {
    background-image: url(/assets/theme/basics-gray.svg);
    padding-left: 20px;
}

.item-list .video .type {
    background-image: url(/assets/theme/video-gray.svg);
}

/* Gallery */
.gallery.grid,
.gallery.video {
    margin-top: 20px;
    margin-bottom: 20px;
}

.gallery.video > li {
      margin-bottom: 20px;
  }

.gallery.video > li:last-child {
    margin-bottom: 0;
}

/* Headings */
h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Links */
a {
    text-decoration: none;
    color: inherit;
}

a.browse-all {
    color: #e6241e;
    font-weight: bold;
    float: right;
    line-height: 1em;
}

a.browse-all:hover {
    text-decoration: underline;
}


 .item-list.grid article .date, .item-list article .date {
    display: block;
    float: right;
    font-size: 0.9em;
    margin-bottom: 5px;
    text-align: right;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 15px;
}

.grid.compact {
    grid-template-columns: repeat(3, 1fr);
}

.grid > * {
    /* display: flex; */
}

/* Articles */
article h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    line-height: 1.2em;
    max-width: 95%;
}

article h2 {
    font-size: 1.5em;
    margin: 25px 0 20px 0;
}

article h3 {
    font-size: 1.2em;
    margin-top: 20px;
}

article .metadata {
    margin-bottom: 23px;
}

article .date {
    color: #555;
}

article p {
    margin-top: 20px;
    font-size: 1.05em;
    line-height: 1.5;
}

article .recommendation {
    display: inline-block;
    border-radius: 7px;
    color: #fff;
    padding: 7px 7px 7px 33px;
    font-size: 0.9em;
}

article p.info, blockquote p, .sponsorship .content > ul {
    position: relative;
    background-color: #efefef;
    padding: 10px 10px 10px 15px;
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
    border-left: 4px solid #ff644e;
}

/* Content */
.content a, .content a code {
    text-decoration: underline;
}

.content h2 a, .content h2 a code {
    text-decoration: none;
}

.content ul {
    list-style-type: disc;
    margin-top: 20px;
    padding-left: 20px;
    line-height: 1.5em;
}

.content ul li {
    margin-top: 10px;
}

.content ul ul {
    margin-top: 0;
}

.content ul.compact li {
    margin-top: 5px;
}

.content img {
    display: block;
    max-width: 100%;
    margin: 20px auto 0 auto;
}

.content img.compact {
    display: inline-block;
}

/* Code */
code {
    font-family: "Code", monospace;
}

/* This hack is required since Firefox isn't able to render Source Code Pro */
@supports (-moz-appearance:none) {
    code {
        font-family: monospace;
    }
}

article p code, article li code {
    background-color: #e2e2e2;
    display: inline-block;
    padding: 0 5px;
    border-radius: 8px;
    font-size: 0.9em;
    margin: 1px;
}

article p code.inline, article li code.inline {
    display: inline;
    background-color: inherit;
    padding: 0;
}

pre {
    margin-top: 20px;
}

pre code {
    display: block;
    /*background-color: #1a1a1a;*/
    padding: 15px 20px;
    border-radius: 12px;
    color: #a9bcbc;
    line-height: 1.4em;
    font-size: 0.95em;
    overflow-x: auto;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
}

pre code .s-keyword {
    color: #e83b8e;
}

pre code .s-type {
    color: #8281ca;
}

pre code .s-call {
    color: #348fe5;
}

pre code .s-property {
    color: #21ab9d;
}

pre code .s-number {
    color: #db6f57;
}

pre code .s-string {
    color: #fa641e;
}

pre code .s-comment {
    color: #6b8a94;
}

pre code .s-dotAccess {
    color: #92b300;
}

pre code .s-preprocessing {
    color: #b68a00;
}

/* Tags */
.tags {
    display: inline-block;
    margin-right: 5px;
}

.tags li {
    display: inline-block;
    margin-right: 5px;
    padding: 3px 6px;
    font-size: 0.85em;
    border-radius: 8px;
    color: #fff;
    margin-bottom: 7px;
}

.tags .variant-a, .tag.variant-a {
    background-color: #ca4a44;
}

.tags .variant-b, .tag.variant-b {
    background-color: #497d97;
}

.tags .variant-c, .tag.variant-c {
    background-color: #3b7e87;
}

.tags .variant-d, .tag.variant-d {
    background-color: #388466;
}

.tags .variant-e, .tag.variant-e {
    background-color: #54549c;
}

.tags .swift-version {
    background-color: #b8402e
}

/* Basics */
.tags .basics, .recommendation.basics {
    background-color: hsl(121, 40%, 30%);
    background-image: url(/assets/basics-white.svg);
    background-repeat: no-repeat;
    background-position: 7px center;
    background-size: 20px;
}

.tags .basics {
    padding-left: 24px;
    background-size: 14px;
    background-position: 6px center;
}

/* Audio */
.audio-box {
    background-color: #e0e0e0;
    border-radius: 15px;
    padding: 12px 10px 5px 10px;
    margin-bottom: 25px;
}

.audio-box .podcast-players {
    margin-top: 7px;
    line-height: 1.5em;
    text-align: center;
}

.audio-box .podcast-players a {
    background-color: #eff1f2;
    margin-right: 8px;
    margin-bottom: 7px;
}

audio {
    width: 100%;
    height: 42px;
}

/* Actions */
.actions {
    margin-top: 25px;
    line-height: 22px;
}

.actions li {
    margin-top: 10px;
}

.actions a {
    display: inline-block;
    font-weight: bold;
    background-size: 22px 22px;
    background-repeat: no-repeat;
    padding-left: 30px;
}

.actions a:hover {
    text-decoration: underline;
}

.actions .download a {
    background-image: url(/assets/theme/download-black.svg);
}

.actions .share a {
    background-image: url(/assets/theme/twitter-black.svg);
}


/* Search */
.search form input:focus {
    outline-offset: -2px;
}

.search .search-box {
    display: inline-block;
    position: relative;
    border: none;
    margin-bottom: 15px;
}

.search .search-box input {
    font-family: Main;
    font-size: 1.3em;
    padding-top: 0.3em;
    padding-bottom: 0.3em;
    max-width: 300px;
}

.search .search-box input[type="text"] {
    border: none;
    border-collapse: collapse;
    border-radius: 12px;
    background-color: #f3f3f3;
    padding-left: 0.5em;
    padding-right: 2.4em;
}

.search .search-box input[type="submit"] {
    position: absolute;
    top: 0;
    right: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 50% 50%;
    background-color: #222;
    border: none;
    border-radius: 0;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    color: transparent;
    width: 1.9em;
}

/* Hack to customize the border radius in Chrome to match the native highlighting */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    .search .search-box input[type="text"] {
        border-radius: 4px;
        outline-offset: 0px;
    }

    .search .search-box input[type="submit"] {
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }
}

.search .content p {
    margin-top: 7px;
}

.search .content p:first-child {
    margin-top: 20px;
}

.search .item-list li {
    padding: 0;
}

/* Videos */
article .video-player {
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 25px;
}

article .video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pagination */
.pagination {
    position: fixed;
    display: inline-block;
    top: 50%;
    line-height: 40px;
    margin-top: -20px;
    background-size: 25px 25px;
    background-repeat: no-repeat;
    background-position: left center;
    padding: 0 10px 0 30px;
    width: 10px;
    height: 40px;
    overflow: hidden;
    color: #00000000;
    border-radius: 15px;
}

.pagination:hover {
    color: #222;
    background-color: #f7f7f7;
    width: auto;
}

.pagination.next {
    background-image: url(/assets/theme/chevron-left.svg);
    left: 7px;
}

.pagination.previous {
    background-image: url(/assets/theme/chevron-right.svg);
    right: 7px;
    padding-left: 10px;
    padding-right: 30px;
    background-position-x: right;
}

/* Footer */
footer {
    margin-top: 20px;
    padding: 20px;
    text-align: center;
    color: #757575;
    line-height: 1.5em;
}

footer a {
    text-decoration: underline;
}

/* Theming */
@media (prefers-color-scheme: dark) {
    html, .sponsor::before {
        background-color: #222;
    }

    article .date, footer {
        color: #8a8a8a;
    }

    body, .search input[type="text"], .pagination:hover {
        color: #ddd;
    }

    h2.tag, .item-list > li, .related-content .item-list > li, .search .search-box input[type="text"], .pagination:hover {
        background-color: #2c5689;
    }

    .search .search-box input[type="submit"], .item-list > li > a:hover {
        background-color: #050505;
    }

    .index h2.latest {
        background-image: url(/assets/theme/latest-white.svg);
    }

    .index h2.article {
        background-image: url(/assets/theme/article-white.svg);
    }

    .index h2.podcast {
        background-image: url(/assets/theme/podcast-white.svg);
    }

    .index h2.tips {
        background-image: url(/assets/theme/tips-white.svg);
    }

    .index h2.basics {
        background-image: url(/assets/theme/basics-white-muted.svg);
    }

    .item-list .article .type {
        background-image: url(/assets/theme/article-lightgray.svg);
    }

    .item-list .podcast .type {
        background-image: url(/assets/theme/podcast-lightgray.svg);
    }

    .item-list .tips .type, .item-list .special .type {
        background-image: url(/assets/theme/tips-lightgray.svg);
        padding-left: 19px;
    }

    .item-list .basics .type {
        background-image: url(/assets/theme/basics-lightgray.svg);
        padding-left: 20px;
    }

    .item-list .video .type {
        background-image: url(/assets/theme/video-lightgray.svg);
    }

    article p code, article li code, .related-content, .podcast .audio-box, .newsletter .signup {
        background-color: #171717;
    }

    article p.info, blockquote p, .sponsorship .content > ul, .sponsorship .packages .grid > li {
        background-color: #101010;
    }

    article audio {
        opacity: 0.8;
    }

    .item-list article .date, .item-list article .type, .sponsorship .sponsor-list .name {
        color: #7d7d7d;
    }

    .actions .download a {
        background-image: url(/assets/theme/download-white.svg);
    }

    .actions .share a {
        background-image: url(/assets/theme/twitter-white.svg);
    }

    .sponsorship .packages .price {
        color: #ff644e;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .pagination {
        display: none;
    }
}

@media (max-width: 700px) {
    .sponsor .note, .sponsor.compact .note {
        display: block;
        float: none;
        clear: left;
        top: 0;
        padding-top: 12px;
    }

    .newsletter .signup {
        text-align: center;
    }

    .newsletter .signup label {
        display: block;
        margin-bottom: 10px;
    }

    .sponsorship .sponsor-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .mobile {
        display: inherit;
    }

    .wrapper {
        padding-left: 20px;
        padding-right: 20px;
    }

    header nav {
        margin-left: 15px;
        margin-right: 15px;
        padding-top: 2px;
    }

    header nav li a {
        padding: 0;
        margin: 0 10px;
        border-bottom: 2px solid transparent;
    }

    header nav li a:hover, header nav li.selected a {
        background-color: inherit;
        border-bottom: 2px solid #cb3018;
        color: #cb3018;
        /*
        border-bottom: 2px solid #3b719c;
        color: #3b719c;
        */
    }

    header nav li.search.selected a, header nav li.search a:hover {
        background-image: url(/assets/theme/search.svg);
    }

    .page {
        padding-top: 20px;
    }

    .item-list.grid, .gallery.grid {
        display: block;
    }

    .item-list.grid > li, .gallery.grid > li {
        margin-bottom: 20px;
    }

    .item-list.grid > li:last-child, .gallery.grid > li:last-child {
        margin-bottom: 0;
    }

    .index .latest p {
        display: none;
    }

    .index .browse-all {
        display: none;
    }

    .index .browse-all.mobile {
        display: block;
        margin: 10px 0 25px 0;
        float: none;
        text-align: center;
        font-size: 1.1em;
    }

    .theme-select > span {
        display: block;
        margin-bottom: 7px;
    }

    article .tags {
        display: block;
        margin-bottom: 5px;
    }

    .section-overview .item-list article .date {
        display: block;
        margin-bottom: 7px;
        font-size: 0.85em;
    }

    .section-overview .item-list.grid article .date {
        margin-bottom: 0;
    }

    .theme-select {
        display: block;
        border-radius: 15px;
        padding-bottom: 15px;
    }

    .newsletter .signup {
        padding-bottom: 0;
    }

    .newsletter .signup input[type="email"] {
        margin-bottom: 15px;
    }

    .newsletter .signup input[type="submit"] {
        font-size: inherit;
        margin-bottom: 15px;
    }

    .search .search-box, .search .search-box input[type="text"] {
        display: block;
        max-width: 100%;
        width: 100%;
    }
}


/**
 * Code formatting
 */
pre,
code {
    border: 1px solid #3b719c;
    border-radius: 3px; }

a > code {

    border: 1px solid #3b719c;
    border-radius: 3px; }

code {
    padding: 1px 5px; }

pre {
    padding: 8px 12px;
    overflow-x: auto; }
pre.playground {
    padding: 0px 0px;
    overflow-x: auto; }
pre > code {
    border: 0;
    padding-right: 0;
    padding-left: 0; }

/**
 * Syntax highlighting styles
 */
.highlight {
    /*background: #fff;*/ }
.highlighter-rouge .highlight {
    background: #eef; }
.highlight .c {
    color: #998;
    font-style: italic; }
.highlight .err {
    color: #a61717;
    background-color: #e3d2d2; }
.highlight .k {
    font-weight: bold; }
.highlight .o {
    font-weight: bold; }
.highlight .cm {
    color: #998;
    font-style: italic; }
.highlight .cp {
    color: #999;
    font-weight: bold; }
.highlight .c1 {
    color: #998;
    font-style: italic; }
.highlight .cs {
    color: #999;
    font-weight: bold;
    font-style: italic; }
.highlight .gd {
    color: #000;
    background-color: #fdd; }
.highlight .gd .x {
    color: #000;
    background-color: #faa; }
.highlight .ge {
    font-style: italic; }
.highlight .gr {
    color: #a00; }
.highlight .gh {
    color: #999; }
.highlight .gi {
    color: #000;
    background-color: #dfd; }
.highlight .gi .x {
    color: #000;
    background-color: #afa; }
.highlight .go {
    color: #888; }
.highlight .gp {
    color: #555; }
.highlight .gs {
    font-weight: bold; }
.highlight .gu {
    color: #aaa; }
.highlight .gt {
    color: #a00; }
.highlight .kc {
    font-weight: bold; }
.highlight .kd {
    font-weight: bold; }
.highlight .kp {
    font-weight: bold; }
.highlight .kr {
    font-weight: bold; }
.highlight .kt {
    color: #458;
    font-weight: bold; }
.highlight .m {
    color: #099; }
.highlight .s {
    color: #d14; }
.highlight .na {
    color: #008080; }
.highlight .nb {
    color: #0086B3; }
.highlight .nc {
    color: #458;
    font-weight: bold; }
.highlight .no {
    color: #008080; }
.highlight .ni {
    color: #800080; }
.highlight .ne {
    color: #900;
    font-weight: bold; }
.highlight .nf {
    color: #900;
    font-weight: bold; }
.highlight .nn {
    color: #555; }
.highlight .nt {
    color: #000080; }
.highlight .nv {
    color: #008080; }
.highlight .ow {
    font-weight: bold; }
.highlight .w {
    color: #bbb; }
.highlight .mf {
    color: #099; }
.highlight .mh {
    color: #099; }
.highlight .mi {
    color: #099; }
.highlight .mo {
    color: #099; }
.highlight .sb {
    color: #d14; }
.highlight .sc {
    color: #d14; }
.highlight .sd {
    color: #d14; }
.highlight .s2 {
    color: #d14; }
.highlight .se {
    color: #d14; }
.highlight .sh {
    color: #d14; }
.highlight .si {
    color: #d14; }
.highlight .sx {
    color: #d14; }
.highlight .sr {
    color: #009926; }
.highlight .s1 {
    color: #d14; }
.highlight .ss {
    color: #990073; }
.highlight .bp {
    color: #999; }
.highlight .vc {
    color: #008080; }
.highlight .vg {
    color: #008080; }
.highlight .vi {
    color: #008080; }
.highlight .il {
    color: #099; }
