/*Carbon themed CSS*/
:root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #252525;
    --tertiary-bg: #2d2d2d;
    --accent-gold: #c9aa71;
    --accent-blue: #5b8fc7;
    --text-primary: #e2e2e2;
    --text-secondary: #b8b8b8;
    --text-dim: #888888;
    --border-color: #3a3a3a;
    --link-color: #7db8e8;
    --link-hover: #a5d0f0;
    --header-gradient-start: #2a2a2a;
    --header-gradient-end: #1a1a1a;
    --nav-bg: #1f1f1f;
    --nav-hover: #333333;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Meiryo", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.01) 10px,
        rgba(255, 255, 255, 0.01) 20px
    );
}

/* Navigation sidebar */
.nav-sidebar {
    width: 250px;
    background-color: var(--nav-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.nav-logo {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.nav-logo h3 {
    color: var(--accent-gold);
    font-size: 1.2em;
    margin: 0;
}

.nav-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background-color: var(--nav-hover);
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
    text-shadow: none;
}

.nav-menu a::after {
    display: none;
}

.nav-menu h4 {
    padding: 15px 20px 5px;
    color: var(--accent-gold);
    font-size: 1em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-submenu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Indentation for nested submenu items */
.nav-submenu li.level-2 a {
    padding-left: 30px;
}

.nav-submenu li.level-3 a {
    padding-left: 40px;
}

.nav-submenu li.level-4 a {
    padding-left: 50px;
}

.nav-submenu li.level-5 a {
    padding-left: 60px;
}

.nav-submenu li.level-6 a {
    padding-left: 70px;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 250px;
    width: calc(100% - 250px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: rgba(26, 26, 26, 0.95);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Jupiter Pro", "Cinzel", "Georgia", serif;
    color: var(--accent-gold);
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2.2em;
    padding-bottom: 0.5em;
    border-bottom: 3px solid var(--accent-gold);
    background: var(--accent-gold);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    margin-top: 0.5em;
}

h1::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), transparent 70%);
}

h2 {
    font-size: 1.8em;
    color: var(--accent-blue);
    padding-left: 15px;
    border-left: 4px solid var(--accent-blue);
    margin-left: -15px;
}

h3 {
    font-size: 1.4em;
    color: var(--text-primary);
}

h4 {
    font-size: 1.2em;
    color: var(--text-secondary);
}

h5,
h6 {
    font-size: 1.1em;
    color: var(--text-secondary);
}

/* Paragraphs and text */
p {
    margin-bottom: 1.2em;
    color: var(--text-secondary);
    text-align: left;
}

/* Links with FFXIV styling */
a {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: var(--link-hover);
    text-shadow: 0 0 10px rgba(125, 184, 232, 0.5);
}

a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--link-hover);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* Bold and Italic */
strong,
b {
    color: var(--accent-gold);
    font-weight: 600;
}

em,
i {
    color: var(--text-primary);
    font-style: italic;
}

/* Lists with FFXIV styling */
ul,
ol {
    margin-left: 30px;
    margin-bottom: 1.2em;
}

li {
    margin-bottom: 0.5em;
    color: var(--text-secondary);
}

ul li::marker {
    color: var(--accent-gold);
}

ol li::marker {
    color: var(--accent-blue);
    font-weight: bold;
}


blockquote {
    border-left: 4px solid var(--accent-gold);
    background: linear-gradient(90deg, rgba(201, 170, 113, 0.1), transparent);
    padding: 15px 20px;
    margin: 1.5em 0;
    color: var(--text-secondary);
    position: relative;
}

blockquote::before {
    font-size: 3em;
    color: var(--accent-gold);
    opacity: 0.3;
    position: absolute;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.5em 0;
    background-color: var(--secondary-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

thead {
    background: linear-gradient(
        180deg,
        var(--tertiary-bg),
        var(--secondary-bg)
    );
}

th {
    padding: 12px 15px;
    text-align: left;
    color: var(--accent-gold);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-gold);
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

td {
    padding: 10px 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

tr:hover td {
    background-color: rgba(201, 170, 113, 0.05);
}

hr {
    border: none;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-gold) 20%,
        var(--accent-gold) 50%,
        var(--accent-gold) 80%,
        transparent
    );
    margin: 2em 0;
    position: relative;
}

hr::before {
    content: "◆";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--primary-bg);
    color: var(--accent-gold);
    padding: 0 10px;
    font-size: 1.2em;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Wiki-style additional elements */
.wiki-infobox {
    float: right;
    width: 300px;
    margin: 0 0 20px 20px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.wiki-infobox-header {
    background-color: var(--tertiary-bg);
    color: var(--accent-gold);
    padding: 10px 15px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

.wiki-infobox-content {
    padding: 15px;
}

.wiki-infobox-row {
    display: flex;
    margin-bottom: 10px;
}

.wiki-infobox-label {
    flex: 1;
    font-weight: bold;
    color: var(--accent-blue);
}

.wiki-infobox-value {
    flex: 2;
    color: var(--text-secondary);
}

/* Article meta information */
.article-meta {
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9em;
    color: var(--text-dim);
}

.article-categories {
    margin-top: 10px;
}

.article-category {
    display: inline-block;
    background-color: var(--tertiary-bg);
    color: var(--accent-gold);
    padding: 3px 10px;
    margin-right: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Selection styling */
::selection {
    background-color: rgba(201, 170, 113, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: rgba(201, 170, 113, 0.3);
    color: var(--text-primary);
}

/* Custom Figure styling */
.custom-figure {
    margin: 2.5rem auto;
    padding: 1.5rem;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    max-width: 95%;
}

/* Image gallery layout for multiple images */
.custom-figure .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Single image in figure */
.custom-figure img {
    margin: 0 auto 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    max-height: 500px;
    width: auto;
}

/* Hover effect for images */
.custom-figure img:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-gold);
}

/* Image titles (from title attribute) */
.custom-figure .image-title {
    display: block;
    text-align: center;
    font-style: italic;
    color: var(--accent-gold);
    font-size: 0.9em;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

/* Caption styling */
.custom-figure figcaption {
    font-family: "Jupiter Pro", "Cinzel", "Georgia", serif;
    text-align: center;
    color: var(--text-primary);
    font-size: 1.1em;
    padding: 0.8rem 0;
    border-top: 1px solid rgba(201, 170, 113, 0.3);
    margin-top: 0.5rem;
    position: relative;
}

/* Special styling for captions to match FFXIV aesthetic */
.custom-figure figcaption::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
}

/* Responsive design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .nav-sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .nav-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .container {
        padding: 20px 15px;
    }

    .wiki-infobox {
        float: none;
        width: 100%;
        margin: 1.5em 0;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.6em;
    }

    h3 {
        font-size: 1.3em;
    }
}
/* Animation for page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }

    .custom-figure {
        padding: 1rem;
        margin: 2rem auto;
    }

    .custom-figure .image-gallery {
        grid-template-columns: 1fr;
    }

    .custom-figure img {
        max-height: 350px;
    }
}

.main-content > * {
    animation: fadeIn 0.6s ease-out;
}

/* ============================================================
   Lock screen — encrypted posts
   ============================================================ */

/* The data holder is invisible; only the lock UI is shown */
#encrypted-content {
    display: none;
}

/* Full-viewport overlay */
#lock-screen {
    position: fixed;
    inset: 0;
    background-color: var(--primary-bg);
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.01) 10px,
        rgba(255, 255, 255, 0.01) 20px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.4s ease-out;
}

/* Card */
#lock-box {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.75rem 3rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    box-shadow:
        0 12px 50px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(201, 170, 113, 0.07);
    position: relative;
    overflow: hidden;
}

/* Gradient top-accent bar */
#lock-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
}

/* Lock emoji */
.lock-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 0.15rem;
}

/* Override the global h2 blue/border-left styles inside the lock box */
#lock-box h2 {
    font-family: "Jupiter Pro", "Cinzel", "Georgia", serif;
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--accent-gold);
    -webkit-text-fill-color: var(--accent-gold);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-shadow: none;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    margin-top: 0;
    margin-bottom: 0;
    position: static;
}

#lock-box p {
    color: var(--text-dim);
    font-size: 0.87rem;
    margin: 0;
    text-align: center;
}

/* Password input */
#enc-input {
    background-color: var(--tertiary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    border-radius: 6px;
    width: 100%;
    font-size: 0.95rem;
    font-family: inherit;
    text-align: center;
    letter-spacing: 0.05em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#enc-input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0;
}

#enc-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow:
        0 0 0 3px rgba(91, 143, 199, 0.12),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (max-width: 480px) {
    #lock-box {
        padding: 2rem 1.5rem;
    }
}
