/* ==========================
   Old School Green Theme
========================== */

:root {
    /* Core palette */
    --text: #111;
    --white: #fff;
    --border: #000;

    /* Greens (page chrome) */
    --bg-page: #8fa88d;
    --bg-container: #bfd0bc;
    --bg-header: #5d7d61;
    --bg-nav: #7d997b;
    --bg-nav-hover: #a9c1a5;
    --bg-main: #d9e5d5;
    --bg-subfooter: #8aa486;

    /* Links */
    --light-link: #5b3efd;
    --light-link-hover: #462ece;
    --dark-link: #3d28b9;
    --dark-link-hover: #291a7d;
    --medium-link: #5f4ccb;
    --medium-link-hover: #4b3ba3;
    --visited-link: #130d37;


    /* Greens (interactive / surfaces) */
    --bg-input: #dbe6d8;
    --bg-accent: #90ad8e;
    --bg-accent-hover: #799a78;
    --bg-surface: #cddac9;
    --bg-surface-hover: #b9cdb6;
    --bg-surface-alt: #c3d3bf;
    --text-muted: #5f5f5f;
    --border-soft: rgba(0, 0, 0, .2);
    --shadow-card: rgba(0, 0, 0, .18);

    /* Status colors */
    --bg-danger: #c98a8a;
    --bg-danger-hover: #b56f6f;
    --bg-success: #cfe8cf;
    --bg-error: #eccaca;
    --form-required: #9c0000;

    /* Overlays */
    --overlay: rgba(0, 0, 0, .55);
    --shadow: rgba(0, 0, 0, .25);

    /* Scrollbars */
    --scrollbar-thumb: #56745d;
    --scrollbar-track: #93ad95;
    --scrollbar-track-main: #a6bba5;
    --scrollbar-thumb-main: #5f7f63;
    --scrollbar-thumb-main-hover: #4b684f;
    --scrollbar-track-body: #9db29c;
    --scrollbar-thumb-body-hover: #4d674f;

    /* Code blocks */
    --bg-code: #1e1e1e;
    --text-code: #dcdcdc;
}

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

html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body {

    background: var(--bg-page);

    font-family: Verdana, Geneva, sans-serif;
    color: var(--text);

    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 25px;

    overflow: hidden;
}

/* ==========================
   Floating Site Box
========================== */

.site-container {
    width: min(1100px, 100%);
    height: min(90%);
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    border: 1px solid var(--border);
    background: var(--bg-container);
    box-shadow: 6px 6px 0 var(--shadow);
}

/* ==========================
   Shared Section Styling
========================== */

header,
nav,
main,
.subfooter,
footer {

    border: 1px solid var(--border);

}

/* ==========================
   Header
========================== */

header {

    background: var(--bg-header);

    color: var(--white);

    padding: 18px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    flex-wrap: wrap;

}

header h1 {

    font-size: 2rem;

    margin-bottom: 6px;

}

.tagline {

    font-size: .95rem;

    opacity: .9;

}

/* ==========================
   Search
========================== */

.search-form {

    display: flex;

    gap: 8px;

}

.search-form input {

    padding: 7px 10px;

    border: 1px solid var(--border);

    background: var(--bg-input);

    min-width: 180px;

}

.search-form button {

    padding: 7px 14px;

    border: 1px solid var(--border);

    background: var(--bg-accent);

    cursor: pointer;

    font-weight: bold;

}

.search-form button:hover {

    background: var(--bg-accent-hover);

}

/* ==========================
   Navigation
========================== */

nav {

    background: var(--bg-nav);

}

nav ul {

    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    list-style: none;

}

nav a {

    display: block;

    padding: 12px 22px;

    color: var(--text);

    text-decoration: none;

    font-weight: bold;

}

nav a:hover,
nav a.active {

    background: var(--bg-nav-hover);

}

/* ==========================
   Main Content
========================== */

main {

    background: var(--bg-container);

    padding: 22px;

    overflow-y: auto;

    overflow-x: hidden;

    line-height: 1.6;

    word-wrap: break-word;

}

main h2 {

    margin-bottom: 15px;

}

main p {

    margin-bottom: 18px;

}

/* ==========================
   Sub Footer
========================== */

.subfooter {

    background: var(--bg-subfooter);

    text-align: center;

    padding: 10px;

    font-size: .9rem;

}

/* ==========================
   Footer
========================== */

footer {

    background: var(--bg-header);

    color: var(--white);

    position: relative;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 14px 54px 14px 14px;

    font-size: .9rem;

}

.footer-copy {

    text-align: center;

}

/* ==========================
   Body Scrollbar
========================== */

main::-webkit-scrollbar {

    width: 14px;

}

main::-webkit-scrollbar-track {

    background: var(--scrollbar-track-main);

    border-left: 1px solid var(--border);

}

main::-webkit-scrollbar-thumb {

    background: var(--scrollbar-thumb-main);

    border: 1px solid var(--border);

}

main::-webkit-scrollbar-thumb:hover {

    background: var(--scrollbar-thumb-main-hover);

}

/* ==========================
   Page Scrollbar
========================== */

body::-webkit-scrollbar {

    width: 14px;

}

body::-webkit-scrollbar-track {

    background: var(--scrollbar-track-body);

}

body::-webkit-scrollbar-thumb {

    background: var(--scrollbar-thumb-main);

    border: 1px solid var(--border);

}

body::-webkit-scrollbar-thumb:hover {

    background: var(--scrollbar-thumb-body-hover);

}

/* ==========================
   Mobile
========================== */

@media (max-width:700px) {

    header {

        flex-direction: column;

        align-items: flex-start;

    }

    .search-form {

        width: 100%;

    }

    .search-form input {

        flex: 1;

        min-width: 0;

    }

    nav ul {

        justify-content: flex-start;

    }

    nav a {

        padding: 10px 14px;

    }

}

/* ==========================
   Title Group / Logo
========================== */

.title-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.title-group .logo {
    width: 34px;
    height: 34px;
}

.title-group h1 {
    margin-bottom: 0;
}

.title-group h1 a {
    color: inherit;
    text-decoration: none;
}

.tagline {
    flex-basis: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

/* ==========================
   Nav Icons
========================== */

nav a.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    width: 16px;
    height: 16px;
}

.nav-icon-open {
    display: none;
}

nav a.nav-link:hover .nav-icon-closed,
nav a.nav-link.active .nav-icon-closed {
    display: none;
}

nav a.nav-link:hover .nav-icon-open,
nav a.nav-link.active .nav-icon-open {
    display: inline-block;
}

/* ==========================
   Hit Counter
========================== */
.hit-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.hit-counter-icon {
    width: 14px;
    height: 14px;
}

/* ==========================
   Buttons (shared)
========================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-accent);
    color: var(--text);
    font-weight: bold;
    font-family: inherit;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: var(--bg-accent-hover);
}

.btn-secondary {
    background: var(--bg-input);
}

.btn-secondary:hover {
    background: var(--bg-surface-alt);
}

.btn-danger {
    background: var(--bg-danger);
}

.btn-danger:hover {
    background: var(--bg-danger-hover);
}

.btn-icon {
    width: 14px;
    height: 14px;
}

/* ==========================
   Dictionary Entry (Home)
========================== */

.dictionary-entry {
    background: var(--bg-container);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    box-shadow: 0 3px 10px var(--shadow-card);
    max-width: 90%;
    padding: 20px 24px;
    margin: 0 auto 26px;
}

.dictionary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.dictionary-locale {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    font-size: .75rem;
    font-weight: bold;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.dictionary-locale-icon {
    width: 16px;
    height: 16px;
}

.dictionary-pronounce {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
}

.pronounce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-accent);
    color: var(--text);
    cursor: pointer;
}

.pronounce-btn:hover {
    background: var(--bg-accent-hover);
}

.pronounce-btn .btn-icon {
    width: 16px;
    height: 16px;
}

.dictionary-word {
    font-size: 1.5rem;
    font-weight: bold;
}

.dictionary-phonetic {
    color: var(--text);
    font-weight: 600;
}

.dictionary-ipa {
    color: var(--text-muted);
    font-style: italic;
    margin-left: 10px;
}

.dictionary-alt {
    margin-bottom: 8px;
}

.dictionary-pos {
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.dictionary-definitions {
    list-style: none;
    margin: 4px 0 18px;
    padding: 0;
}

.dictionary-definitions li {
    margin-bottom: 6px;
}

/* ==========================
   Forms (shared)
========================== */

.form-standard {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 560px;
    border: 1px solid var(--border);
    padding: 15px;
    margin: 0 auto;
}

.form-standard .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-standard label {
    font-weight: bold;
    font-size: .9rem;
}

.form-standard input[type="text"],
.form-standard input[type="email"],
.form-standard input[type="url"],
.form-standard input[type="search"],
.form-standard input[type="password"],
.form-standard select,
.form-standard textarea {
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: inherit;
    font-size: .95rem;
    width: 100%;
}

.form-standard textarea {
    resize: vertical;
    min-height: 100px;
}

.form-standard .form-hint {
    font-size: .8rem;
    opacity: .75;
}

.char-counter {
    display: block;
    margin-top: 4px;
    font-size: .8rem;
    text-align: right;
    color: var(--text-muted);
}

.char-counter--low {
    color: var(--form-required);
    font-weight: bold;
}

.form-standard .form-actions {
    display: flex;
    gap: 10px;
}

.form-header h4 {
    margin: 0;
}

.form-header .form-hint {
    margin: 4px 0 0 0;
}

.form-standard h4 {
    margin: 0;
}

.form-standard p.form-hint {
    margin: -4px 0 0 0;
}

/* Honeypot field */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================
   Messages (success / error)
========================== */

.message {
    padding: 12px 14px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
    font-size: .9rem;
}

.message-success {
    background: var(--bg-success);
}

.message-error {
    background: var(--bg-error);
}

.message-info {
    background: var(--bg-container);
}

/* ==========================
   Tables (shared)
========================== */

.table-standard {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.table-standard th,
.table-standard td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.table-standard th {
    background: var(--bg-accent);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.table-standard th.sorted-asc::after {
    content: " \25B2";
}

.table-standard th.sorted-desc::after {
    content: " \25BC";
}

.table-standard tbody tr:nth-child(even) {
    background: var(--bg-surface);
}

.table-standard tbody tr:hover {
    background: var(--bg-surface-hover);
}

.external-link-icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
}

/* ==========================
   Aggregate Stats
========================== */

.stat-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-row--center {
    justify-content: center;
}

.stat-card {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 12px 18px;
    min-width: 140px;
    text-align: center;
}

.stat-card .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-card .stat-label {
    font-size: .8rem;
    opacity: .8;
}

/* ==========================
   Modal (shared)
========================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-box {
    background: var(--bg-main);
    border: 1px solid var(--border);
    box-shadow: 6px 6px 0 var(--shadow);
    width: min(480px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px;
}

.modal-box h3 {
    margin-bottom: 14px;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

/* ==========================
   Cards / list items (blog, links, projects, guestbook)
========================== */

.item-card {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 16px;
    margin-bottom: 14px;
}

.item-card .item-meta {
    font-size: .8rem;
    opacity: .8;
    margin-bottom: 8px;
}

.item-card h3 {
    margin-bottom: 8px;
}

.item-card h3 a {
    color: inherit;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

/* ==========================
   Blog
========================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.page-header .headings-highlight {
    margin-bottom: 0;
}

.search-summary {
    margin-bottom: 16px;
    font-size: .9rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin-bottom: 16px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-accent);
    border: 1px solid var(--border);
    padding: 3px 10px;
    font-size: .75rem;
    font-weight: bold;
    color: var(--text);
    text-decoration: none;
}

.tag-pill:hover {
    background: var(--bg-accent-hover);
}

.tag-pill .btn-icon {
    width: 12px;
    height: 12px;
}

.post-body {
    line-height: 1.7;
    margin-bottom: 24px;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
}

.post-video {
    max-width: 100%;
    border: 1px solid var(--border);
    display: block;
    margin: 10px 0;
}

.post-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 10px 0;
}

.post-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-body pre {
    background: var(--bg-code);
    color: var(--text-code);
    padding: 12px;
    overflow-x: auto;
    margin-bottom: 16px;
    font-size: .85rem;
}

.post-body code {
    background: var(--bg-surface-alt);
    padding: 1px 5px;
    font-size: .9em;
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-body blockquote {
    border-left: 4px solid var(--bg-header);
    padding-left: 14px;
    margin: 0 0 16px;
    opacity: .85;
}

.permalink-note {
    font-size: .8rem;
    opacity: .75;
    margin-bottom: 24px;
}

.similar-posts {
    margin-bottom: 24px;
}

.similar-posts h3 {
    margin-bottom: 10px;
}

.comments-section h3,
.comments-section h4 {
    margin-bottom: 12px;
}

.comment-card p {
    margin-bottom: 0;
}

/* ==========================
   Links Page
========================== */

.links-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.links-toolbar select,
.links-toolbar input[type="search"] {
    padding: 7px 10px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: inherit;
}

.table-wrap {
    margin-bottom: 10px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* ==========================
   Fake News Prank Article
========================== */

.prank-disclaimer {
    font-style: italic;
}

.share-section {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    padding: 16px;
    margin-top: 20px;
}

.share-section h3 {
    margin-bottom: 10px;
}

.share-section input[readonly] {
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: var(--white);
    width: 100%;
    max-width: 420px;
    margin-bottom: 10px;
    font-family: inherit;
}

/* ==========================
   Misc
========================== */

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    opacity: .3;
    margin: 24px 0;
}

.headings-highlight {
    color: var(--text);
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--bg-header);
}

/* ==========================
   Issue Report Widget
========================== */

.subfooter {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.issue-report-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-accent);
    cursor: pointer;
}

.issue-report-btn:hover {
    background: var(--bg-accent-hover);
}

.issue-report-btn .btn-icon {
    width: 16px;
    height: 16px;
}

.github-btn {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-accent);
    cursor: pointer;
}

.github-btn:hover {
    background: var(--bg-accent-hover);
}

.github-btn .btn-icon {
    width: 16px;
    height: 16px;
}