/* System theme defaults */
@media (prefers-color-scheme: dark) {
    :root.system {
        --bg: #333333;
        --text: #eaeaea;
        --light-text: #bbbbbb;
        --border: #333;
        --header-bg: #1a1a1a;
    	--link: #2157c3;
   	--visited: #BB86FC;
    }
}

@media (prefers-color-scheme: light) {
    :root.system {
        --bg: #ffffff;
        --text: #222;
        --light-text: #555;
        --border: #e5e5e5;
        --header-bg: #ffffff;
   	--link: #7DD3FC;
    	--visited: #BB86FC;
    }
}

/* Light mode */
:root {
    --accent: #df5526;
    --bg: #ffffff;
    --text: #222;
    --light-text: #555;
    --border: #e5e5e5;
    --header-bg: #ffffff;
    --link: #7DD3FC;
    --visited: #BB86FC;
}

/* Dark mode */
:root.dark {
    --bg: #333333;
    --text: #eaeaea;
    --light-text: #bbbbbb;
    --border: #333;
    --header-bg: #1a1a1a;
    --link: #2157c3;
    --visited: #BB86FC;
}

/* Page border */
body {
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    border: 12px solid var(--border);
    min-height: 100vh;
    box-sizing: border-box;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Header */
.site-header {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 60px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    z-index: 1000;
}

.logo {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text);
}
.header-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Container for the toggle + dropdown */
.theme-dropdown {
    position: relative;
   /* display: inline-block;*/
    display: inline-flex;
    align-items: center;
	padding-bottom: 6px; /* invisible buffer */
	padding-left: 6px; /* invisible buffer */
}


/* Hidden menu */
.theme-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--header-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    min-width: 140px; /* ensures the menu doesn’t collapse */
	
	transition: opacity 0.15s ease;
    opacity: 0;
    pointer-events: none;

}

/* Show menu on hover */
.theme-dropdown:hover .theme-menu {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
/*.theme-dropdown.open .theme-menu {
    display: block !important;
    opacity: 1;
    pointer-events: auto;
}
*/


/* Menu buttons */
.theme-menu button {
    display: block !important;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
}

.theme-menu button:hover {
    background: var(--border);
}


/* Main content */
main {
    max-width: 800px;
    margin: 120px auto 0 auto;
    padding: 20px;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px 0;
}

.hero-img {
    width: 100%;
    border-radius: 8px;
}

.section {
    margin: 60px 0;
}

.section h2 {
    color: var(--accent);
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
    border-top: 1px solid var(--border);
    color: var(--light-text);
}

.footer-nav {
    margin-bottom: 15px;
}

.footer-nav a {
    margin: 0 10px;
    color: var(--text);
    text-decoration: none;
}

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

a:link {
    color: var(--link);
}

a:visited {
    color: var(--visited);
}

:root, body, .site-header, .footer {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* Fullscreen zoom overlay */
.image-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(51,51,51,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* When active */
.image-zoom-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Enlarged image */
.image-zoom-overlay img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    transition: transform 0.25s ease;
    transform: scale(0.9);
}

.image-zoom-overlay.active img {
    transform: scale(1);
}

/* Cursor hint on desktop */
.zoomable {
    cursor: zoom-in;
}
