/* =====================================================================
   Portfolio — public site styles
   1) Design tokens (light default, dark via [data-theme="dark"])
   2) Shell layout (top nav, offcanvas, main)
   3) Theme toggle component
   ===================================================================== */

/* ---------- 1) Design tokens ---------- */

:root {
    /* Layout tokens (theme-independent) */
    --radius-lg: 0px;
    --radius-md: 0px;
    --transition-fast: 0.25s ease;
}

:root,
[data-theme="light"] {
    color-scheme: light;

    /* Surfaces */
    --bg-main: #f5f3f0;
    --bg-panel: #ffffff;
    --bg-panel-soft: rgba(20, 20, 20, 0.04);

    /* Text */
    --text-main: #1c1c1c;
    --text-muted: rgba(28, 28, 28, 0.62);

    /* Lines & accents */
    --border-soft: rgba(20, 20, 20, 0.1);
    --accent: #111111;

    /* Effects */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);

    /* Themed extras */
    --nav-bg: rgba(245, 243, 240, 0.92);
    --offcanvas-close-filter: none;
    --btn-invert-bg: #161616;
    --btn-invert-fg: #f5f3f0;
    --btn-invert-bg-hover: #000000;
    --btn-invert-fg-hover: #ffffff;
}

[data-theme="dark"] {
    color-scheme: dark;

    /* Surfaces */
    --bg-main: #0f0f0f;
    --bg-panel: #171717;
    --bg-panel-soft: rgba(255, 255, 255, 0.04);

    /* Text */
    --text-main: #f2f2f2;
    --text-muted: rgba(242, 242, 242, 0.6);

    /* Lines & accents */
    --border-soft: rgba(255, 255, 255, 0.1);
    --accent: #ffffff;

    /* Effects */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.45);

    /* Themed extras */
    --nav-bg: rgba(15, 15, 15, 0.96);
    --offcanvas-close-filter: invert(1) grayscale(100%) brightness(200%);
    --btn-invert-bg: #f2f2f2;
    --btn-invert-fg: #111111;
    --btn-invert-bg-hover: #ffffff;
    --btn-invert-fg-hover: #111111;
}
/* ---------- 2) Shell layout ---------- */

html, body {
    min-height: 100%;
    background: var(--bg-main);
    color: var(--text-main);
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.public-page-shell {
    min-height: 100vh;
    display: block;
    background: var(--bg-main);
}

.sidebar-section-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    margin-bottom: 0.9rem;
}

.sidebar-links li {
    margin-bottom: 0.4rem;
}

.sidebar-link {
    display: inline-block;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.45rem 0.2rem;
    transition: var(--transition-fast);
    opacity: 0.82;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--accent);
    opacity: 1;
    transform: translateX(4px);
}

.public-main {
    flex: 1;
    min-width: 0;
    padding: 28px;
    background: var(--bg-main);
}

.public-topnav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(10px);
}

.mobile-nav-inner {
    min-height: 68px;
    padding: 0 4px;
    gap: 0.5rem;
}

.mobile-brand {
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.mobile-brand:hover {
    color: var(--text-main);
}

.topnav-links {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    column-gap: 1.5rem;
}

/* Categories are injected inside #desktopTopNavCategories as <li> items;
   make the placeholder transparent so they become direct flex siblings
   instead of nesting into a single column. */
#desktopTopNavCategories {
    display: contents;
}

.topnav-links .topnav-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.4rem 0;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.topnav-links .topnav-link:hover,
.topnav-links .topnav-link.active {
    color: var(--accent);
}

.mobile-menu-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    width: 46px;
    height: 46px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--bg-panel-soft);
}

.menu-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.offcanvas-title{
    color: var(--text-main);

}

.public-offcanvas {
    background: var(--bg-panel);
    color: var(--text-main);
}

.public-offcanvas .btn-close {
    filter: var(--offcanvas-close-filter);
}

.mobile-sidebar-links .sidebar-link {
    display: block;
    padding: 0.7rem 0;
}

@media (max-width: 991.98px) {
    .public-main {
        padding: 18px 14px 24px;
    }
}
/* ---------- 3) Theme toggle ---------- */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: var(--transition-fast);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: var(--bg-panel-soft);
    border-color: var(--accent);
    color: var(--text-main);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle .theme-toggle-icon {
    font-size: 1.15rem;
    line-height: 1;
}

/* Default (and [data-theme="light"]) shows the moon icon; dark shows the sun. */
.theme-toggle .theme-toggle-icon--sun {
    display: none;
}

.theme-toggle .theme-toggle-icon--moon {
    display: inline-flex;
}

[data-theme="dark"] .theme-toggle .theme-toggle-icon--sun {
    display: inline-flex;
}

[data-theme="dark"] .theme-toggle .theme-toggle-icon--moon {
    display: none;
}

.theme-toggle-label {
    line-height: 1;
}

/* Compact icon-only variant (mobile top bar) */
.theme-toggle--icon-only {
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    flex-shrink: 0;
}

.theme-toggle--icon-only .theme-toggle-icon {
    font-size: 1.25rem;
}

.theme-toggle--icon-only .theme-toggle-label {
    display: none;
}

/* Sidebar footer variant (desktop) */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}

.sidebar-footer .theme-toggle {
    width: 100%;
}

/* Floating variant (homepage hero) */
.theme-toggle--floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1050;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.55);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
}

.theme-toggle--floating:hover,
.theme-toggle--floating:focus-visible {
    background: rgba(15, 15, 15, 0.75);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.55);
}

/* Light-theme page loader (site.css default is dark) */
/* Light-theme page loader (light is now the default theme) */
.page-loader {
    background: rgba(245, 243, 240, 0.96);
    color: #1c1c1c;
}

.page-loader__mark {
    border-color: rgba(28, 28, 28, 0.12);
    border-top-color: #1c1c1c;
}

[data-theme="dark"] .page-loader {
    background: rgba(15, 15, 15, 0.96);
    color: #f2f2f2;
}

[data-theme="dark"] .page-loader__mark {
    border-color: rgba(242, 242, 242, 0.12);
    border-top-color: #f2f2f2;
}
/* ---------- 4) Public footer ---------- */

.public-footer {
    margin-top: 2.75rem;
    padding: 1.5rem 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-soft);
}

.public-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.public-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.public-footer-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-main);
}

.public-footer-tag {
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.public-footer-contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem 1.4rem;
}

.public-footer-contact li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.public-footer-contact li i {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.public-footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.public-footer-contact a:hover {
    color: var(--accent);
}

@media (max-width: 575.98px) {
    .public-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .public-footer-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.65rem;
    }
}