/* STYLES FOR THE WHOLE WEBSITE */

/* General */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
    /* https://coolors.co/palette/c33149-a8c256-f3d9b1-c29979-a22522 */
    --coolors-1: #C33149; /* Raspberry */
    --coolors-2: #A8C256; /* Salad */
    --coolors-3: #F3D9B1; /* Cream */
    --coolors-4: #C29979; /* Browned meat */
    --coolors-5: #A22522; /* Red meat */
    --coolors-2-lighter: #e7edd4;
    --coolors-2-darker: #6f891f;
    --primary-color: var(--coolors-1);
    --secondary-color: #2ecc71;
    --accent-color: var(--coolors-2);
    --light-green-grey: #d8dbce;
    --background-color: #f8f4ed; /* lighter version of coolors-3 */
    --text-color:  #3d1b00; /* Near-black version of coolors-4 */
    --primary-color-lighter:  #dc3752;
    --link-color: var(--primary-color);
    --link-hover-color: var(--primary-color-lighter);
    --root-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
    --root-border: 1px solid #ddd;
    --root-border-radius: 0.5rem;
}
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Optima, Tahoma, Geneva, sans-serif;
}
h1, h2, h3, h4, h5, p, hr, ul, img {
    margin-bottom: 1rem;
}
ul {
    margin-left: 1rem;
}
a {
    color: var(--link-color);
}
a:hover {
    color: var(--link-hover-color);
}
small a {
    color: var(--coolors-2-darker);
}
img {
    max-width: 100%;
    height: auto;
    border: var(--root-border);
    border-radius: var(--root-border-radius);
}

/* Header */

header {
    background-color: var(--coolors-3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
}

.header-link {
    display: flex; /* Use flexbox to align items */
    align-items: center; /* Center items vertically */
    text-decoration: none; /* Remove underline from link */
}

.logo {
    height: 5rem;
    width: auto;
    margin: 0 3rem 0 0;
    border: 0;
    border-radius: 0;
}

.title {
    font-size: 3rem;
    color: var(--text-color);
    margin: 0;
}


nav {
    position: relative;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 3rem;
    cursor: pointer;
}
.menu {
    display: none;
    position: absolute;
    right: 0;
    top: 3rem;
    background-color: var(--coolors-4);
    border: var(--root-border);
    border-radius: var(--root-border-radius);
    box-shadow: var(--root-box-shadow);
    z-index: 1000;
}
.menu a {
    display: block;
    padding: 1rem 2rem;
    color: white;
    text-decoration: none;
}
.menu a:hover {
    background-color: var(--text-color);
}
.menu.show {
    display: block;
}

/* Main */
main {
    margin: 2rem;
}

/* Footer */

footer {
    background-color: var(--coolors-3);
    margin-top: 6rem;
    padding: 2rem;
}

.clickable-linkedin-box {
    display: block;
    margin: 0 auto;
    width: 61.8%;
    text-decoration: none;
    color: inherit;
}
.clickable-linkedin-box h2 {
    margin-bottom: 0.5rem;
}
.clickable-linkedin-box p {
    margin-bottom: 0;
}

.footer-linkedin-container {
    display: grid; /* Use grid layout */
    grid-template-columns: 120px 1fr; /* Set widths for the columns */
    width: 100%;
    align-items: center;
    margin: 0 auto;
    gap: 0rem;
    background-color: white;
    box-shadow: var(--root-box-shadow);
    border: var(--root-border);
    border-radius: 100px;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}
.footer-linkedin-container:hover {
    transform: translateY(-5px);
}
.footer-linkedin-image-container {
   margin: 0;
   padding: 0;
}
.footer-linkedin-image-container img {
   margin: 0;
   padding: 0;
   border: 0;
}
.footer-linkedin-text {
    padding: 1rem;
}


/* HOMEPAGE WITH OVERVIEW OF POSTS */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.posts-grid a {
    text-decoration: none;
    color: inherit;
}

.post-tile {
    background-color: white;
    border: var(--root-border);
    border-radius: var(--root-border-radius);
    padding: 1.5rem;
    box-shadow: var(--root-box-shadow);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.post-tile:hover {
    transform: translateY(-5px);
}
.post-tile small {
    margin-bottom: 1rem;
    color: var(--coolors-4);
}
.post-tile div:last-child {
    margin-top: auto; /* pushes the image section to the bottom */
}


/* POST PAGES */

.post-info {
    color: var(--coolors-4);
    margin-bottom: 2rem;
}

/* Chart elements */

.chart-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.chart-iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 300px;
    border: var(--root-border);
    border-radius: var(--root-border-radius);
    background-color: #fff;
    box-shadow: var(--root-box-shadow);
}

/* Help button and open plot button */
.help-button, .open-plot-new-tab-button {
    background-color: var(--accent-color);
    color: white;
    border: var(--root-border);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--root-box-shadow);
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
    left: 0.5rem;
    z-index: 40;
}

.help-button {
    top: 0.5rem;
}

.open-plot-new-tab-button {
    top: 4rem;
}

.open-new-plot-icon-in-js {
    background-color: var(--accent-color);
    border: var(--root-border);
    border-radius: 50%;
    padding: 0.8rem 0.6rem 0.3rem 0.6rem;
}

/* Tooltip base */
.tooltip {
    position: fixed;
    background-color: var(--coolors-2-lighter);
    border: var(--root-border);
    border-radius: var(--root-border-radius);
    padding: 1rem;
    box-shadow: var(--root-box-shadow);
    width: 62%;
    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none; /* Prevent interaction when hidden */
    transition: opacity 0.3s ease;
}
/* Visible state */
.tooltip.visible {
    opacity: 1;
    pointer-events: auto; /* Allow interaction when visible */
}

/* Close button in top-right */
.close-tooltip {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
}

/* LINK TO LINKEDIN */

.link-linkedin-post {
    display: block;
    width: 38.2%;
    text-align: center;
    margin: 2rem auto;
    padding: 1rem 2rem;
    color: white;
    background-color: #0077b5;
    text-decoration: none;
    box-shadow: var(--root-box-shadow);
    border: var(--root-border);
    border-radius: 100px;
    transition: transform 0.2s ease;
}
.link-linkedin-post:hover {
    transform: translateY(-5px);
}
.link-linkedin-post p {
    margin-bottom: 0;
}

/* CONTACT PAGE */

.contact-container {
    display: grid; /* Use grid layout */
    grid-template-columns: minmax(150px, 20%) 1fr; /* Set widths for the columns */
    gap: 2rem; /* Space between the columns */
}

/* Responsive styles */
@media (max-width: 768px) { /* Adjust the breakpoint as needed */
    .contact-container {
        grid-template-columns: 1fr; /* Stack items in a single column */
    }
}

.contact-intro {
    margin: 0rem;
    padding: 0rem;
}

.contact-section {
    padding: 2rem;
    border: var(--root-border);
    border-radius: var(--root-border-radius);
    box-shadow: var(--root-box-shadow);
}

.contact-form {
      padding: 2rem;
      border: var(--root-border);
      border-radius: var(--root-border-radius);
      background-color: var(--coolors-2-lighter);
      box-shadow: var(--root-box-shadow);
    }

.form-group, .g-recaptcha {
  margin-bottom: 1.5rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: var(--root-border);
  border-radius: var(--root-border-radius);
  font-size: 1rem;
}
.submit-btn {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--accent-color);
  color: white;
  border: var(--root-border);
  border-radius: 2rem;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.submit-btn:hover {
  background-color: var(--light-green-grey);
}


/* Responsive tweaks */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        padding: 20px;
    }

    .chart-container,
    .chart-iframe {
        padding: 0px;
        margin: 0px;
    }

    .help-button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        top: 8px;
        left: 8px;
    }

    .open-plot-new-tab-button {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        top: 51px;
        left: 8px;
    }

    .tooltip {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .chart-container,
    .chart-iframe {
        min-height: 200px;
    }

    .help-button,
    .open-plot-new-tab-button {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .tooltip {
        font-size: 0.85rem;
    }
}
