/* =========================================
   BASE STYLES
   ========================================= */
   body {
    font-family: 'Courier Prime', Courier, monospace;
    color: #454545;
    font-size: 16px;
    margin: 2em auto;
    max-width: 800px;
    padding: 1em;
    line-height: 1.4;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

a {
    color: #07a;
}

a:visited {
    color: #941352;
}

p.st {
    margin-top: -1em;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
span.wr {
    color: #c0392b;
    font-weight: 600;
    text-decoration: underline;
}

p.jailbreak {
    font-size: 0.4em;
    color: #fefefe;
}

/* =========================================
   PROFILE HEADER & SOCIAL ICONS
   ========================================= */

.button-row {
	display: flex; /* Makes buttons horizontal */
	flex-direction: row; /* Explicit direction */
	gap: 10px; /* Space between buttons */
	margin-bottom: 15px; /* Space below buttons */
	width: 100%; /* Full width */  
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-text {
    display: flex;
    flex-direction: column;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #0077aa;
    margin-left: auto;
}

.social-icons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.social-icons a {
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.social-icons a:hover {
    opacity: 1;
}

.social-icons img {
    width: 24px;
    height: 24px;
}

/* =========================================
   LIST STYLING
   ========================================= */
ul {
    list-style: none;
    padding-left: 0;
    line-height: 1.6;
}

ul > li {
    padding: 8px;
    margin-bottom: 10px;
    border-left: 3px solid #0077aa;
    background-color: #222222;
    border-radius: 4px;
    color: #f0f0f0;
}

ul ul {
    margin-top: 5px;
    margin-left: 15px;
}

ul ul > li {
    background-color: #444444;
    border-left: 3px solid #66b3dd;
    margin-bottom: 5px;
    padding: 6px;
}

ul > li:hover {
    background-color: #333333;
    transition: background-color 0.2s ease-in-out;
}

ul ul > li:hover {
    background-color: #555555;
    transition: background-color 0.2s ease-in-out;
}

ul li a {
    text-decoration: none;
    color: #66b3dd;
    font-weight: 500;
}

ul li a:hover {
    text-decoration: underline;
}

/* =========================================
   BUTTONS & CONTROLS
   ========================================= */
button.cont-inv {
    cursor: pointer;
    border-radius: 2px;
    font-size: 0.8em;
    border: 0;
    text-decoration: underline;
}

#contrast {
    color: #000;
    top: 10px;
}

#contrast,
#invmode {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#invmode {
    color: #fff;
    background-color: #000;
    top: 34px;
    text-decoration: underline;
}

/* =========================================
   NEWS SECTION ANIMATIONS
   ========================================= */
.news-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-out, opacity 0.5s ease-out;
    opacity: 0;
}

.news-content.show {
    max-height: 2000px;
    opacity: 1;
}

.clickable-heading {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.clickable-heading:hover {
    color: #0066cc;
}

.clickable-heading::after {
    content: "▼";
    font-size: 0.8em;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.clickable-heading.active::after {
    transform: rotate(180deg);
}

.news-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.news-content.show .news-item {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation using CSS counters */
@supports (transition-delay: calc(0.05s * var(--i))) {
    .news-content.show .news-item:nth-child(n) {
        transition-delay: calc(0.05s * var(--i, 0));
    }

    .news-content {
        counter-reset: item;
    }

    .news-item {
        counter-increment: item;
        --i: counter(item);
    }
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    border-top: 1px solid #ddd;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

footer h4 {
    margin: 0;
    font-weight: normal;
    font-size: 14px;
}

footer a {
    text-decoration: none;
    color: #555;
    display: inline-flex;
    align-items: center;
}

footer a:hover {
    text-decoration: underline;
}

footer img {
    margin-right: 5px;
    vertical-align: middle;
}

/* =========================================
   THEME: DARK MODE (DEFAULT)
   ========================================= */
/* Default dark mode styles are included in the element styling above */

/* =========================================
   THEME: CONTRAST MODE
   ========================================= */
html.contrast body {
    color: #050505;
}

html.contrast a {
    color: #03f;
}

html.contrast a:visited {
    color: #7d013e;
}

html.contrast span.wr {
    color: #800;
}

html.contrast p.jailbreak {
    color: #fefefe;
}

/* =========================================
   THEME: LIGHT MODE
   ========================================= */
@media screen and (prefers-color-scheme: light) {
    html.inverted {
        background-color: #000;
    }

    html.inverted body {
        color: #d9d9d9;
    }

    html.inverted #contrast,
    html.inverted #invmode {
        color: #fff;
        background-color: #000;
    }

    html.inverted a {
        color: #00a2e7;
    }

    html.inverted a:visited {
        color: #114411;
    }

    html.inverted span.wr {
        color: #d24637;
    }

    html.inverted p.jailbreak {
        color: #000;
    }

    html.inverted.contrast {
        background-color: #000;
    }

    html.inverted.contrast body {
        color: #fff;
    }

    html.inverted.contrast #contrast,
    html.inverted.contrast #invmode {
        color: #fff;
        background-color: #000;
    }

    html.inverted.contrast a {
        color: #44c7ff;
    }

    html.inverted.contrast a:visited {
        color: #006600;
    }

    html.inverted.contrast span.wr {
        color: #db695d;
    }

    html.inverted.contrast p.jailbreak {
        color: #000;
    }
}

/* Dark mode preference */
@media (prefers-color-scheme: dark) {
    html:not(.inverted) {
        background-color: #000;
    }

    html:not(.inverted) body {
        color: #d9d9d9;
    }

    html:not(.inverted) #contrast,
    html:not(.inverted) #invmode {
        color: #fff;
        background-color: #000;
    }

    html:not(.inverted) a {
        color: #00a2e7;
    }

    html:not(.inverted) a:visited {
        color: #11bb11;
    }

    html:not(.inverted) span.wr {
        color: #d24637;
    }

    html:not(.inverted) p.jailbreak {
        color: #000;
    }

    html:not(.inverted).contrast {
        background-color: #000;
    }

    html:not(.inverted).contrast body {
        color: #fff;
    }

    html:not(.inverted).contrast #contrast,
    html:not(.inverted).contrast #invmode {
        color: #fff;
        background-color: #000;
    }

    html:not(.inverted).contrast a {
        color: #44c7ff;
    }

    html:not(.inverted).contrast a:visited {
        color: #00cc00;
    }

    html:not(.inverted).contrast span.wr {
        color: #db695d;
    }

    html:not(.inverted).contrast p.jailbreak {
        color: #000;
    }

    html.inverted html {
        background-color: #fefefe;
    }
}

/* =========================================
   INVERTED MODE LIST STYLING
   ========================================= */
html.inverted ul > li {
    background-color: #e8f4fa;
    border-left-color: #0077aa;
    color: #222222;
}

html.inverted ul ul > li {
    background-color: #ffffff;
    border-left-color: #66b3dd;
}

html.inverted ul > li:hover {
    background-color: #cfeaf7;
}

html.inverted ul ul > li:hover {
    background-color: #eef8fd;
}

html.inverted ul li a {
    color: #0077aa;
}

html.inverted ul li a:hover {
    color: #005580;
}

/* =========================================
   RESPONSIVE LAYOUTS
   ========================================= */
@media screen and (max-width: 1080px) {
    #contrast,
    #invmode {
        position: absolute;
    }
}

/* High-DPI screen adjustments */
@media only screen and (-webkit-min-device-pixel-ratio: 2.5),
only screen and (min--moz-device-pixel-ratio: 2.5),
only screen and (-o-min-device-pixel-ratio: 2.5/1),
only screen and (min-device-pixel-ratio: 2.5),
only screen and (min-resolution: 402dpi),
only screen and (min-resolution: 2.5dppx) {
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .button-row {
        align-self: center;
    }

    .profile-image {
        margin-bottom: 1em;
        margin-left: 0;
    }

    .social-icons {
        justify-content: center;
    }
    
    footer {
        flex-direction: column;
        gap: 10px;
    }
}