/* ======================
   FONTS
   ====================== */
@font-face {
    font-family: fira;
    src: url(../fonts/fira.ttf);
}

@font-face {
    font-family: VictorMono;
    src: url(../fonts/VictorMono-VariableFont_wght.ttf);
}

/* ======================
   ANIMATIONS
   ====================== */
@keyframes slideInFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ======================
   BASE ELEMENTS
   ====================== */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #777;
    line-height: 1.6;
}

body {
    font-family: VictorMono, monospace;
    font-size: 0.9em; /* Reduced from 1em */
    color: #333;
    background: #ddd;
    margin: 1em auto;
    padding: 1em;
    max-width: 50em;
    text-align: justify;
    border-radius: 20px;
    /* Entrance animation */
    opacity: 0;
    transform: translateY(20px);
    animation: slideInFade 4s ease-out forwards;
}

/* ======================
   TYPOGRAPHY
   ====================== */
h1, h2 {
    text-align: left;
}

p {
    padding: 6px;
    border-radius: 20px;
    max-width: 100%;
    margin: 6px auto;
}

a {
    color: #ddd;
    display: inline;
    background: #5a6d6d;
    border-radius: 5px;
    padding: 0px 6px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
    text-decoration-style: solid;
    text-decoration-thickness: 0.10em;
}

nav {
    font-family: VictorMono;
    font-size: 1em;
    color: #666;
    font-weight: bold;
}

hr {
    border-top: 0.3em dashed #777;
    border-bottom: 0;
    border-left: 0;
    border-right: 0;
    background-color: transparent;
}

/* ======================
   LISTS
   ====================== */
ul {
    list-style-type: none;
    border-radius: 4px;
    padding: 12px 16px 12px 36px;
}

ul.ami {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

li.ami {
    padding-left: 1em;
    text-indent: -1em;
}

li.ami:before {
    content: "*";
}

/* ======================
   CODE BLOCKS
   ====================== */
pre {
    border-radius: 15px;
    display: block;
    background: #5a6d6d;
    color: #ddd;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
    font-family: fira;
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 1.6em;
    max-width: 93%;
    padding: 1.5em;
    word-wrap: break-word;
    page-break-inside: avoid;
    /* Entrance animation */
    opacity: 0;
    transform: translateY(20px);
    animation: slideInFade 4s ease-out forwards;
}

div.code::before {
    content: "#";
}

div.code, dt {
    padding: 4px;
    border-radius: 8px;
    color: #ddd;
    background: #040;
    width: 94%;
    margin: auto;
    margin-top: 10px;
}

/* ======================
   IMAGES & MEDIA
   ====================== */
img {
    border: 6px;
    border-radius: 20px;
    margin: 6px;
    max-width: 99%;
    cursor: pointer;
}

/* Image link styling */
a img {
    text-decoration: none;
    border: none;
    outline: none;
}

a:has(img) {
    text-decoration: none;
    color: inherit;
    border: none;
    outline: none;
}

.image-link img {
    text-decoration: none;
    border: 6px;
    border-radius: 20px;
    margin: 6px;
    max-width: 99%;
    cursor: pointer;
    display: block;
}

.image-link:hover img {
    opacity: 0.8;
}

/* Image overlay effect */
.f {
    z-index: 1;
    position: fixed;
    top: 999%;
    left: 50%;
    max-height: 99%;
    max-width: 99%;
    transform: translate(-50%, -50%);
}

*:focus + .f {
    top: 50%;
}

/* ======================
   LAYOUT COMPONENTS
   ====================== */
.header {
    padding: 20px;
    text-align: center;
    background: #444;
    color: #ccc;
}

footer {
    clear: both;
    margin-top: 2em;
}

.footer {
    clear: both;
    margin-top: 2em;
    position: fixed;
    bottom: 0;
    left: 50%;
    padding: 0.5rem;
}

.box {
    width: 94%;
    height: auto;
    background: #aaa;
    margin: 40px auto;
    border-radius: 8px;
}

.box h3 {
    text-align: center;
    position: relative;
    top: 80px;
}

/* ======================
   INTERACTIVE ELEMENTS
   ====================== */
details summary {
    cursor: pointer;
    list-style: none;
    padding: 2px;
    line-height: 1.8;
}

details summary > * {
    display: inline;
    color: #ddd;
    background: #5a6d6d;
    border-radius: 5px;
    padding: 2px 6px;
    margin: 0;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
}

/* ======================
   TABLES
   ====================== */
#list th, tr:nth-child(even) {
    background: #999;
}

/* ======================
   UTILITY CLASSES
   ====================== */
.inln {
    display: inline-block;
    margin-bottom: auto;
}

.smol {
    font-size: 75%;
    color: #555555;
}

/* ======================
   SHADOW EFFECTS
   ====================== */
.effect2 {
    position: relative;
}

.effect2:before, .effect2:after {
    z-index: -2;
    position: absolute;
    content: "";
    bottom: 15px;
    left: 10px;
    width: 50%;
    top: 80%;
    max-width: 300px;
    background: #000;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.8);
    transform: rotate(-3deg);
}

.effect2:after {
    transform: rotate(3deg);
    right: 10px;
    left: auto;
}
