body {
    font-family: 'Arial', sans-serif;
    background-image: url('images/other/bookshelf.jpg');
    background-size: cover;
    background-position: center;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: -1;
}

.frame {
    background: #efdcf9;
    border-radius: 15px;
    padding: 30px 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    box-sizing: border-box;
    flex-shrink: 0;
    text-align: center;
    margin: 20px;
}

img {
    width: 100%;
    height: auto;
    margin: auto;
}

h1 {
    margin-bottom: 10px;
    font-size: 2.5em;
    color: #7954a1;
}

.intro {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 20px;
}

/* Tooltip container */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%; /* Position above the link */
    left: 50%;
    transform: translateX(-50%);
    background-color: #35323d;
    color: white;
    padding: 5px;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    visibility: hidden; /* Hide by default */
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 10;
    line-height: 24px;
}

[data-tooltip]:hover::after {
    visibility: visible;
    opacity: 1;
}

.nav-button {
    text-decoration: none;
    font-size: 25px;
    color: #fff;
    background-color: #3700b3;
    padding: 10px 20px;
    margin: 5px 0;
    border-radius: 5px;
    display: inline-block;
    transition: background-color 0.3s, color 0.3s;
}

.links-and-stories a img {
    max-height: 32px;
    max-width: 32px;
    margin-right: 8px;
    position: absolute;
    left: 16px;
    border-radius: 4px;
}

.nav-button:hover {
    background-color: #12034c;
    color: #fff;
}

hr.divider {
    border: none;
    border-top: 1px solid #888;
    margin: 10px 10;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

a {
    display: block;
    margin: 15px auto;
    padding: 15px;
    width: 80%;
    max-width: 400px;
    background-color: #7954a1;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    line-height: 32px;
}

a:hover {
    background-color: #3b2c3f;
    transform: translateY(-2px);
}

/* Ensure this only targets links with the "unstyled-link" class */
a.unstyled-link {
    all: revert; /* Reverts to the browser's default styles */
    text-decoration: underline; /* Adds underline */
    color: inherit; /* Makes it blend with surrounding text */
    background: none; /* Removes button background */
    border: none; /* Removes button borders */
    padding: 0; /* Removes any padding */
    margin: 0; /* Removes any margin */
    box-shadow: none; /* Removes any shadow */
    display: inline; /* Ensures it behaves like inline text */
}

.stories-section {
    margin-left: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    max-width: 600px;
}

.stories-frame {
    background: rgba(220, 240, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
    max-width: 560px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stories-frame h2 {
    font-size: 2em;
    color: #3700b3;
    margin-bottom: 20px;
    line-height: 1;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
    margin-top: 20px;
}

.story-cover-container {
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 5px solid #ededed;
    overflow: hidden;
}

.story-cover-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.story-cover-container.highlight {
    border: 3px solid #3700b3;
}

.story-cover {
    width: 100%;
    height: auto;
    border-radius: 0;
    display: block;
    margin: 0;
}

.story-details {
    display: none;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 15px;
    width: 500px;
    margin: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: left;
    opacity: 0;
    transition: opacity 2.6s ease-in-out;
}

.story-title {
    font-weight: bold;
    font-size: 1.2em;
    color: #6200ea;
    text-align: center;
}

.story-synopsis {
    font-style: italic;
    margin-top: 10px;
    color: #555;
}

.story-specs {
    padding-top: 10px;                                   
    color: #6200ea;
    font-weight: bold;
}

.story-link {
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    background-color: #6200ea;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s;
}

.story-link:hover {
    background-color: #3700b3;
}

.footer {
    margin: auto;
    text-align: center;
    font-size: 14px;
    color: #555;
}

@keyframes show-overflow {
  from { overflow: hidden; }
}

.story-grid {
    display: grid;
    max-height: 0px;
    transition: 250ms max-height ease-out;
    overflow: hidden;
}

.story-grid.open {
    display: grid;
    max-height: 520px;
    overflow: visible;
    animation: show-overflow 250ms;  /* now this works! */
}

@media (max-width: 768px) {
    body {
        background-image: none;
        background-color: #3b2c3f;
    }

    .pfp {
        width: 50px;
        height: 50px;
        margin: 0 auto 20px;
        margin-top: 20px;
    }

    h1 {
        font-size: 2em;
    }
    
    .frame{
        margin-top: 20px;
    }

    .intro {
        font-size: 1em;
    }
    
    .pfp {
        max-width: 100px;
        max-height: 100px;
        margin: auto;
        margin-top: 20px;
    }

    .frame {
        padding: 0 10px;
        width: 90%;
        overflow: hidden;
    }

    [data-tooltip]::after {
        display:none;
    }

    .stories-section {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        overflow: hidden;
    }

    a {
        font-size: 0.9em;
        padding: 12px;
    }

    a:hover {
      background-color: #6200ea;
      transform: none;
    }
    
    a.unstyled-link {
      text-decoration: underline; /* Adds underline */
      background: none; /* Removes button background */
      border: none; /* Removes button borders */
      padding: 0; /* Removes any padding */
      box-shadow: none; /* Removes any shadow */
      display: inline; /* Ensures it behaves like inline text */
    }

    .nav-button:hover {
      background-color: #3b2c3f;
    }
    
    .story-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0px;
        width: 100%;
        margin: auto;
        margin-top: 20px;
        padding: 0;
    }
    
    .story-grid.open {
    max-height: 750px;
    }

    .stories-frame h2 {
        font-size: 1.8em;
    }

    .story-cover-container {
        width: 100%;
        max-width: 130px;
        margin: auto;
        margin-bottom: 20px;
        padding: 5px;
    }

    .story-cover {
        width: 100%;
        margin: auto;
    }

    .story-details {
        padding: 0 10px;
        width: 85%;
        overflow: hidden;
        margin: auto;
    }

    .story-title {
        font-size: 1.1em;
        margin-top: 20px;
    }

    .stories-section .stories-frame {
        padding: 0 10px;
        width: 85%;
        overflow: hidden;
    }
  
    
    hr.divider {
        display: none;
    }
}