/* ----------------------------
   Devonshire Archive Base
----------------------------- */

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    color: #3d342b;
    font-family: Georgia, serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;

    background-image: url("assets/misc/BG.png");
    border-radius: 16px; 
    margin: 5px;

    filter: opacity(0.4);

    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    box-shadow: inset 0 0 100px rgba(61, 52, 43, 0.25);
}

/* ----------------------------
   Header and navigation
----------------------------- */

header {
    margin-top: -10px;
    margin-bottom: -30px;
    position: relative;
    padding: 20px;
    text-align: center;
}

header h1 {
    font-family: "IM Fell English", serif;
    margin: -10px;
    font-size: 3rem;
    font-weight: normal;
    letter-spacing: 3px;

    display: inline-block;
}

.typewriter {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #3d342b;

    animation:
        typing 3s steps(18, end),
        blink 0.8s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 24ch;
    }
}

@keyframes blink {
    0%,
    100% {
        border-color: #3d342b;
    }

    50% {
        border-color: transparent;
    }
}

header h2 {
    margin-top: -15px;
    margin-bottom: 5px;
    font-family: "Cormorant Garamond", serif;
    font-weight: normal;
    letter-spacing: 2px;
}

.statistics-button {
    position: absolute;
    top: 15px;
    right: 20px;
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #f6f3ea;
    background-color: #6d6458;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.statistics-button:hover {
    background-color: #514a41;
    transform: translateY(-2px);
}

.statistics-button > i {
    width: auto;
    height: auto;
    margin-right: 6px;
    font-size: 15px;
    line-height: 1;
}

.statistics-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.25rem;
    text-transform: lowercase;
}

.statistics-nav a {
    color: #6d6458;
    text-decoration: none;
    transition: color 0.2s ease;
}

.statistics-nav a:hover {
    color: #3d342b;
    text-decoration: underline;
}

.statistics-nav .current-page {
    color: #3d342b;
    font-weight: 600;
    cursor: default;
}

.statistics-nav .separator {
    color: #a49a8c;
}

/* ----------------------------
   Statistics layout and cards
----------------------------- */

.statistics-page {
    display: flex;
    width: 90%;
    max-width: 900px;
    margin: 30px auto;
    flex-direction: column;
    gap: 20px;
}

.stat-card {
    position: relative;
    padding: 28px;
    border: 1px solid rgba(109, 100, 88, 0.2);
    border-radius: 16px;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.62),
        rgba(246, 243, 234, 0.42)
    );
    box-shadow:
        0 8px 28px rgba(61, 52, 43, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.stat-card h2 {
    margin: 0;
    border: 0;
    padding: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 2px;
}

.stat-card p,
.stat-card li {
    font-size: 1.1rem;
    line-height: 1.8;
}

.stat-card span {
    font-weight: bold;
}

/* Card headings: this is the only decorative divider rule. */

.section-heading {
    display: flex;
    width: auto;
    height: auto;
    margin-bottom: 22px;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Card-heading icons */
.section-heading > i:not(.stat-icon) {
    width: auto;
    height: auto;
    margin-bottom: 7px;
    color: #6d6458;
    font-size: 20px;
    line-height: 1;
}

/* ----------------------------
   Overview statistics
----------------------------- */

.stat-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    text-align: center;
}

.overview-stat {
    display: flex;
    min-width: 0;
    padding: 18px 10px;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(109, 100, 88, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.22);
    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

.overview-stat:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 7px 16px rgba(61, 52, 43, 0.09);
    transform: translateY(-3px);
}

.overview-stat > .stat-icon,
#season-chart .chart-icon,
#time-chart .chart-icon {
    display: inline-flex;
    margin-bottom: 10px;
    align-items: center;
    justify-content: center;
    color: #6d6458;
    font-size: 15px;
    line-height: 1;
}

.stat-label {
    margin-top: -10px;
    display: flex;
    min-height: 2.4em;
    align-items: center;
    color: #6d6458;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
}

.overview-stat strong {
    margin-top: -10px;
    color: #3d342b;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    opacity: 0.6;
}

/* ----------------------------
   Season and time results
----------------------------- */

#season-chart,
#time-chart {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    text-align: center;
}

#season-chart p,
#time-chart p {
    display: flex;
    min-width: 0;
    min-height: 92px;
    margin: 0;
    padding: 18px 10px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    border: 1px solid rgba(109, 100, 88, 0.12);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.22);
    text-align: center;

    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        box-shadow 0.25s ease;
}

#season-chart p:hover,
#time-chart p:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 7px 16px rgba(61, 52, 43, 0.09);
    transform: translateY(-3px);
}

#season-chart .chart-label,
#time-chart .chart-label {
    font-family: "Cormorant Garamond", serif;
    min-height: auto;
    color: #6d6458;
    font-size: 1.05rem;
    font-weight: 600 !important;
    line-height: 1.15;
}

#season-chart strong,
#time-chart strong {
    margin-top: -10px;
    color: #3d342b;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
    opacity: 0.6;
}

/* ----------------------------
   PNG visitor graph
----------------------------- */

.stats-gallery {
    display: flex;
    justify-content: center;
}

#commonBirds {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 520px;
    margin: 0 auto;
    padding-bottom: 50px;
    overflow: visible;
}

.birdStat {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.birdImage {
    position: relative;
    display: inline-block;
}

.birdStat img {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.birdStat:hover img {
    filter: drop-shadow(0 13px 10px rgba(61, 52, 43, 0.28));
    transform: translateY(-8px) scale(1.08);
}

.birdStat:hover,
.birdStat:focus-within {
    z-index: 9999 !important;
}

.tooltip {
    position: absolute;
    top: calc(100% + 20px);
    left: 50%;
    z-index: 10;
    display: flex;
    width: 170px;
    padding: 12px;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(109, 100, 88, 0.18);
    border-radius: 12px;
    background: rgba(248, 244, 235, 0.97);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    font-size: 0.8rem;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.birdStat:hover .tooltip,
.birdStat:focus-within .tooltip {
    opacity: 1;
    visibility: visible;
}

#top-birds {
    padding: 0;
    list-style-position: inside;
}

#top-birds li {
    margin: 8px;
}