/* Notes & tutorials (notes/index.php) - the list of cards and a single post. Colours come from the theme and skin
   (links and headings), with neutral borders so it works on the light and dark versions. */

.notes-page {
    padding-bottom: 40px;
}

.notes-intro {
    max-width: 760px;
    margin: 0 auto 30px;
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
}

/* Category filter */
.notes-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 35px;
}
.notes-filter a {
    padding: 6px 16px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 30px;
    font-size: 14px;
    text-decoration: none;
    transition: border-color 0.2s;
}
.notes-filter a small {
    opacity: 0.6;
    margin-left: 4px;
}
.notes-filter a:hover,
.notes-filter a.active {
    border-color: currentColor;
}
.notes-filter a.active {
    font-weight: 600;
}

/* Cards */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}
.note-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.note-card-image {
    display: block;
    aspect-ratio: 1200 / 630;
    background: rgba(127, 127, 127, 0.12);
    overflow: hidden;
}
.note-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.note-card-image.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    opacity: 0.5;
}
.note-card-body {
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.note-card-category {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 6px;
}
.note-card-title {
    font-size: 19px;
    line-height: 1.4;
    margin: 0 0 10px;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    text-transform: none;
}
.note-card-title a {
    color: inherit;
    text-decoration: none;
}
.note-card-summary {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 14px;
    flex: 1;
}
.note-card-meta {
    font-size: 13px;
    opacity: 0.7;
    margin: 0;
}

.notes-pages {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.notes-pages a {
    min-width: 38px;
    padding: 6px 10px;
    text-align: center;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 6px;
    text-decoration: none;
}
.notes-pages a.active {
    border-color: currentColor;
    font-weight: 600;
}

.notes-empty {
    text-align: center;
    padding: 40px 0;
}

/* One post */
.note {
    max-width: 820px;
    margin: 0 auto;
}
.note-back {
    margin-bottom: 20px;
    font-size: 14px;
}
.note-back a {
    text-decoration: none;
}
.note-title {
    font-family: "Poppins", sans-serif;
    font-size: 34px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: none;
    margin-bottom: 12px;
}
.note-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 25px;
}
.note-meta i {
    margin-right: 4px;
}
.note-image {
    margin: 0 0 30px;
}
.note-image img {
    width: 100%;
    border-radius: 10px;
    display: block;
}

.note-content {
    font-size: 16px;
    line-height: 1.85;
    overflow-wrap: break-word;
}
.note-content h2,
.note-content h3,
.note-content h4 {
    font-family: "Poppins", sans-serif;
    text-transform: none;
    font-weight: 600;
    margin: 1.8em 0 0.6em;
}
.note-content h2 { font-size: 26px; }
.note-content h3 { font-size: 21px; }
.note-content h4 { font-size: 18px; }
.note-content p,
.note-content ul,
.note-content ol,
.note-content table,
.note-content pre,
.note-content blockquote,
.note-content figure {
    margin-bottom: 1.2em;
}
.note-content ul,
.note-content ol {
    padding-left: 1.4em;
}
.note-content li {
    margin-bottom: 0.35em;
}
.note-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.note-content figcaption {
    font-size: 13px;
    opacity: 0.75;
    text-align: center;
    margin-top: 6px;
}
.note-content blockquote {
    border-left: 4px solid currentColor;
    padding: 4px 0 4px 18px;
    font-style: italic;
    opacity: 0.9;
}
.note-content code,
.note-content kbd,
.note-content samp {
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    background: rgba(127, 127, 127, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}
.note-content pre {
    background: #1e1e1e;
    color: #e6e6e6;
    padding: 18px 20px;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.6;
    font-size: 14px;
}
.note-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}
.note-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}
.note-content th,
.note-content td {
    border: 1px solid rgba(127, 127, 127, 0.3);
    padding: 8px 12px;
    text-align: left;
}
.note-content hr {
    border: 0;
    border-top: 1px solid rgba(127, 127, 127, 0.3);
    margin: 2em 0;
}

.note-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(127, 127, 127, 0.3);
    margin-top: 40px;
    padding-top: 25px;
}
.note-nav a {
    display: flex;
    flex-direction: column;
    max-width: 48%;
    text-decoration: none;
    font-weight: 600;
}
.note-nav a small {
    font-weight: 400;
    opacity: 0.7;
    margin-bottom: 4px;
}
.note-nav-newer {
    text-align: right;
    margin-left: auto;
}

.notes-related {
    max-width: 1100px;
    margin: 50px auto 0;
}
.notes-related h3 {
    font-family: "Poppins", sans-serif;
    font-size: 22px;
    text-transform: none;
    margin-bottom: 20px;
}

@media (max-width: 575px) {
    .note-title {
        font-size: 26px;
    }
    .note-content pre {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }
    .note-nav {
        flex-direction: column;
    }
    .note-nav a {
        max-width: 100%;
    }
    .note-nav-newer {
        text-align: left;
        margin-left: 0;
    }
}

/* Accent colour: each skin (assets/css/skins/*.css) sets --spk-accent, so skin and holiday changes carry through */
.notes-page a {
    color: var(--spk-accent, #fa5b0f);
    text-decoration: none;
}
.notes-page a:hover {
    text-decoration: underline;
}
.notes-filter a,
.notes-pages a,
.note-card-title a {
    color: inherit;
}
.notes-filter a:hover,
.notes-filter a.active,
.notes-pages a:hover,
.notes-pages a.active {
    color: var(--spk-accent, #fa5b0f);
    border-color: var(--spk-accent, #fa5b0f);
    text-decoration: none;
}
.note-card-title a:hover {
    color: var(--spk-accent, #fa5b0f);
    text-decoration: none;
}
.note-card-image.is-empty {
    color: var(--spk-accent, #fa5b0f);
}
.note-content blockquote {
    border-left-color: var(--spk-accent, #fa5b0f);
}
