/* prompted copilot for a style guide that would make this page look like The New Yorker */
/* map 1 */
#map {
    height: 500px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid #ccc; /* Optional */
}


/* Typography */
body {
    font-family: 'Georgia', serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    font-weight: normal;
    color: #000;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 2em;
    margin-bottom: 0.75em;
}

h3 {
    font-size: 1.75em;
    margin-bottom: 1em;
}

p {
    font-size: 1.125em;
    margin-bottom: 1.5em;
}

/* Links */
a {
    color: #1a0dab;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    width: 80%;
    margin: 0 auto;
    max-width: 1200px;
}

header, footer {
    background-color: #f8f8f8;
    padding: 20px 0;
    text-align: center;
}

header h1 {
    font-size: 3em;
    margin: 0;
}

nav {
    display: none;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
}
/* Hero Container */
#hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #000;
    color: #fff;
    padding: 60px 20px 20px; /* Add more space at the top */
    position: relative;
    z-index: 1;
    width: 100%; /* Make hero section full width */
    box-sizing: border-box; /* Include padding in width calculation */
}

.hero-title {
    flex: 1;
    padding-right: 20px;
}

.hero-title h1 {
    font-size: 2.5em;
    font-weight: bold;
    line-height: 1.2;
    margin: 0;
    color: white;
}

.hero-image {
    flex: 1;
    text-align: right;
    position: relative;
}

.hero-image img {
    max-width: 100%;
    height: auto;
}

.photo-credit {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9em;
    border-radius: 3px;
}
#byline {
    margin-top: 30px;
    font-size: 1em;
    color: #ccc;
    text-align: center;
}

#byline h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: normal;
    color: #ccc;
}

#byline p {
    margin: 0;
    font-size: 1em;
}

/* main story styling */
#story-contents{
    width: 80%;
    margin: 0 auto; /*centers content*/
}
/* author section */
#author-info {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.author-photo img {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 20px;
}

.author-details h2 {
    margin: 0;
    font-size: 1.5em;
}

.author-details p {
    margin: 5px 0;
}

.author-details a {
    color: #0073b1; /* LinkedIn blue */
    text-decoration: none;
    margin-right: 10px;
}

.author-details a i {
    margin-right: 5px;
}

.author-details a:hover {
    text-decoration: underline;
}
/* Buttons */
button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
}

button:hover {
    background-color: #333;
}

/* Footer */
footer p {
    font-size: 0.875em;
    color: #666;
}

/* Header Styles */
#main-header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s, padding 0.3s;
    background-color: transparent;
}

.header-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column; /* Stack logo and nav vertically */
    padding: 10px 20px;
    position: relative; /* Ensure search bar stays within header */
}

.logo {
    font-family: "Bodoni Moda", serif;
    font-optical-sizing: auto;
    font-weight: medium;
    font-size: 24px;
    font-weight: bold;
    font-style: italic;
    color: white;
    text-align: center;
    margin-bottom: 10px; /* Add space between logo and nav */
}

.search-bar {
    position: absolute; /* Position search bar absolutely */
    top: 10px; /* Align search bar to the top */
    right: 20px; /* Align search bar to the right */
}

.search-bar i {
    color: white;
    font-size: 20px;
}

/* Styles for when the header is scrolled */
#main-header.scrolled {
    background-color: black;
    padding: 10px 20px;
}

#main-header.scrolled nav {
    display: flex;
}


/* heatmap styling */
.day {
    stroke: #ccc;
}

#heatmap {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    min-height: 200px;
    margin: 20px 0;
    position: relative;
}

.heatmap-year {
    margin: 10px;
}

.heatmap-svg {
    border: 1px solid #ccc;
}

.month {
    fill: none;
    stroke: #000;
    stroke-width: 2px;
}

/* Enhanced tooltip styles */
.tooltip {
    position: absolute;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    pointer-events: none;
    font-size: 12px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

/* Cell hover effect */
rect:hover {
    stroke: #555;
    stroke-width: 2px;
    cursor: pointer;
}

.year-label {
    font-size: 14px;
}
.cell {
    stroke: #fff;
}

.day-label, .month-label {
    font-size: 12px;
    fill: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

rect {
    stroke: #fff;
    stroke-width: 1px;
}

select {
    margin: 10px;
    padding: 5px;
    font-size: 14px;
}


/* General chart container styling */
.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    margin: 40px 0;
}

/* Specific chart styling */
#heatmap, #map-container {
    max-width: 100%;
    width: auto;
    /* max-width: 800px; */
    max-height: 70%;
    height: auto;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Radial chart styling */
#radial-time-chart {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
}

#radial-chart {
    width: 100%;
    height: auto;
    margin: 0 auto;
    position: relative;
}

#radial-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

/* table styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    padding: 0 10px; /* Optional */
}

/* media query for resposiveness */
/* Add to styles.css */
@media screen and (max-width: 768px) {
    #story-contents {
        /* giving the story contents more space on mobile */
        width: 95%;
        margin: 0 auto;
        padding: 10px;
    }
    #hero-container {
        flex-direction: column;
    }

    .hero-title {
        width: 100%;
        padding: 1rem;
        order: 1;
    }

    .hero-image {
        width: 100%;
        order: 2;
    }

    .hero-title h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-image img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }
    /* media query for heatmap */
    #heatmap {
        width: 90vw;
        height: auto;
        min-height: 600px; /* Ensure enough vertical space */
        margin: 0 auto;
        overflow-x: auto; /* Add horizontal scroll if needed */
        overflow-y: visible; /* Show full height */
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    /* making sure users know they can scroll */
    #heatmap::-webkit-scrollbar {
        height: 8px;
        background-color: #f5f5f5;
    }

    #heatmap::-webkit-scrollbar-thumb {
        background-color: #4B9CD3;
        border-radius: 4px;
    }

    #heatmap::-webkit-scrollbar-track {
        background-color: #f5f5f5;
        border-radius: 4px;
    }

    #heatmap svg {
        max-width: none; /* Allow SVG to maintain its dimensions */
        height: 100%; /* Fill container height */
        min-height: 600px; /* Match container */
    }

    /* Make year selector more prominent on mobile */
    #year-select {
        width: 90%;
        margin: 1rem auto;
        display: block;
    }
    /* #radial-chart {
        width: 95vw;
        max-width: 95vw;
        height: auto;
        margin: 0 auto;
    } */

    #radial-chart svg {
        width: 100%;
        height: auto;
    }

    /* Ensure container fits */
    #radial-time-chart {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 2rem auto;
    }
    /* Navigation styles to make a hamburger menu on mobile */
    .header-container nav {
        position: relative;
    }

    .header-container nav a {
        display: none; /* Hide nav links by default */
    }

    /* Hamburger icon */
    .header-container nav::before {
        content: '☰';
        display: block;
        position: absolute;
        right: 20px;
        top: -40px;
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
    }

    /* Show menu when nav has active class */
    .header-container nav.active a {
        display: block;
        width: 100%;
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid #eee;
        background: white;
    }

    .header-container nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: pink;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .header-container nav.active {
        background-color: white;
        border-radius: 4px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }

    .header-container nav.active a {
        display: block;
        padding: 1rem;
        color: #13294B;
        text-decoration: none;
        border-bottom: 1px solid #eee;
        transition: background-color 0.2s;
    }

    .header-container nav.active a:hover {
        background-color: #f8f9fa;
        color: #4B9CD3;
    }

    .header-container nav::before {
        color: white; /* Hamburger icon color */
        text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Add contrast */
    }

    .header-container nav.active::before {
        color: #13294B;
    }

    .header-container {
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-container nav::before {
        content: '☰';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
        z-index: 1001;
    }

    .search-bar {
        margin-right: 40px; /* Space for hamburger icon */
    }

    .header-container nav.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding-top: 60px; /* Space for hamburger icon */
        background-color: white;
        border-radius: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 1000;
    }

    #radial-time-chart {
        margin: 1rem 0; /* Reduce margin to eliminate big gaps */
    }

    #radial-chart {
        width: 100%; /* Ensure full width on mobile */
        margin: 1rem auto; /* Reduce margin */
    }

    #radial-chart svg {
        width: 100%;
        height: auto;
    }

    #myTable th, #myTable td {
        padding: 8px;
        font-size: 14px;
    }

    #radialChartContainer {
        height: 300px; /* Reduce height on mobile */
    }
}

/* Base responsive design rules, suggested by copilot */
* {
    box-sizing: border-box;
    /* not sure what this does but worth a shot */
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;

}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    overflow-x: hidden;
}

/* Ensure the SVG scales with its container */
.responsive-svg {
    width: 100%;
    height: 100%;
}

/* Container styling */
#radialChartContainer {
    width: 100%;
    height: 500px; /* Adjust as needed */
    max-width: 800px; /* Optional: set a max-width */
    margin: 0 auto; /* Center the container */
    position: relative; /* If needed for positioning */
}
