.dropdown, .button, button {
    display: inline-block;
}

/* Dropdown button styling */
.dropdown button, .button a, button {
    background-color: #241e03;
    color: #e5be8a;
    padding: 10px 20px;
    font-size: x-large;
    font-weight: bold;
    font-family: monospace;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
}

/* Dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(36, 30, 3, 0.9);
    min-width:max-content;
    cursor: pointer;
    box-shadow: 0px 20px 100px rgba(212, 175, 55, 0.2);
    border-radius: 5px;
    z-index: 1;
    max-height: 50vh;        /* adjust as needed */
    overflow-y: auto;         /* vertical scrolling */
    overflow-x: hidden;       /* prevent horizontal scroll */
}

/* Links inside the dropdown */
.dropdown-content a {
    color: #e5be8a;
    padding: 0.3ch;
    text-decoration: none;
    display: block;
}

/* Hover effect on links */
.dropdown-content a:hover {
    background-color: #0c0a00;
}

/* Show the dropdown on hover */
.dropdown:hover > .dropdown-content {
    display: block;
}

/* Optional: change button color on hover */
.dropdown:hover button, .button:hover a, a:hover button {
    background-color: #e5be8a;
    color: #0c0a00;
}

/* Make sure nested dropdowns position relative to parent item */
.dropdown-content .dropdown {
    position: relative;
}

/* Position the nested dropdown to the right */
.dropdown-content .dropdown > .dropdown-content {
    top: 100%;
    right: 25%;
    box-shadow: 0px 20px 100px rgba(224, 191, 184, 0.9);
}

table, td, th {
    border: 3px solid #241e03;
    border-collapse: collapse;
    vertical-align: top;
    padding: 1ch;
}

th {
    background-color: #241e03;
}

body {
    background-color: #0c0a00;
    color: #d4af37;
    font-size: x-large;
    font-family: monospace;
    text-align: justify;
    max-width: 85ch;
    min-height: 200vh; /* Just to show scrolling */
    margin: 0 auto;     /* center horizontally */
    padding: 1rem;      /* spacing on small screens */
    line-height: 1.6;
}

hr {
    border: 0px dashed rgba(212, 175, 55, 0.5);
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to right,
        rgba(212, 175, 55, 0),
        rgba(212, 175, 55, 0.1),
        rgba(212, 175, 55, 1),
        rgba(212, 175, 55, 0.1),
        rgba(212, 175, 55, 0)
        );
}

/* Top fade bar */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 130px;
    background: linear-gradient(
        to bottom,
        rgba(12, 10, 0, 1),
        rgba(12, 10, 0, 0)
    );
    z-index: 999;
    display: flex;
    align-items: center;
    padding-left: 20px;
    pointer-events: none; /* allows clicks through except button */
}

/* Bottom fade bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(
    to top,
        rgba(12, 10, 0, 1),
        rgba(12, 10, 0, 0)
    );
    z-index: 1000;
    pointer-events: none;
}

/* Button on top bar */
.top-bar a {
    pointer-events: auto; /* re-enable clicking */
    text-decoration: none;
    color: #d4af37;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.2s;
}

.top-bar a:hover {
    background: rgba(255, 255, 255, 0.35);
}
a {
    color: #e5be8a;
}
       
h1, h2 {
    margin-top: 2em;
    margin-bottom: 1em;
    font-family: monospace;
}
h3, h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-family: monospace;
}
.scroll-image {
    position: absolute;
    bottom: 10px;
    right: -1250px;          /* start off-screen */
    height: 60px;           /* adjust as needed */
    opacity: 0.3;
    transition: transform 0.05s linear;
    pointer-events: none;   /* decorative only */
}
h1::after, h2::after, h3::after, h4::after {
    content: "";
    display: block;

    height:1em;              /* total height for 3 lines */
    margin-top: 0.25em;       /* close to heading */
    width: 100%;
}

h1::after {
    background:
        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,1),
            rgba(212,175,55,0)
        ) 0 0 / 100% 2px no-repeat,

        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,0.5),
            rgba(212,175,55,0)
        ) 0 0.25em / 100% 2px no-repeat;
}

h2::after {
    background:
        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,0.5),
            rgba(212,175,55,0)
        ) 0 0 / 100% 2px no-repeat,

        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,0.2),
            rgba(212,175,55,0)
        ) 0 0.25em / 100% 2px no-repeat;
}

h3::after {
    background:
        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,0.2),
            rgba(212,175,55,0)
        ) 0 0.25em / 100% 2px no-repeat;
}

h4::after {
    background:
        linear-gradient(
            to right,
            rgba(212,175,55,0),
            rgba(212,175,55,0.1),
            rgba(212,175,55,0)
        ) 0 0.25em / 100% 2px no-repeat;
}

.sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
}

code {
    font-style: italic;
    color: #E0BFB8
}
.näide {
    border: 3px dashed rgba(212, 175, 55, 0.5);
    padding: 1ch;
    margin-top: 2ch;
    margin-bottom: 2ch;
    max-width: max-content;
    margin: 0 auto;
}
.näide span {
    display: block;
    padding-left: 4ch;
}

.thumb {
  width: 100%;
  cursor: pointer;
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#overlayImg {
  max-width: 90%;
  max-height: 90%;
}