:root {
    --accent-color: #ff483b;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Accessibility: Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    text-decoration: none;
    font-family: 'IBM Plex Serif', serif;
}

.skip-link:focus {
    top: 0;
}

/* Accessibility: Focus styles */
a:focus,
button:focus,
input:focus,
[tabindex]:focus {
    outline: 2px solid var(--accent-color, #ff483b);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-color, #ff483b);
    outline-offset: 2px;
}

/* Accessibility: Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Main element should not affect flex layout */
main {
    display: contents;
}

@font-face {
    font-family: 'Impact';
    src: url('/font/impact/impact.ttf') format('truetype');
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    animation: slowZoom 60s ease-in-out forwards;
    transition: opacity 0.6s ease;
}

.background.active {
    opacity: 0;
}

body.active {
    background-color: white;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

body.scrollable {
    overflow: auto;
}

body:has(.page-content) {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: auto;
}

body.no-transition,
body.no-transition .background,
body.no-transition .title,
body.no-transition .nav,
body.no-transition .content {
    transition: none !important;
    animation: none !important;
}

@keyframes slowZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.5);
    }
}

.title {
    position: absolute;
    top: 55%;
    left: 2rem;
    margin: 0;
    font-size: 7rem;
    line-height: 7rem;
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    transition: top 0.6s ease, color 0.6s ease;
}

.title.active {
    top: 2rem;
    color: black !important;
}

.title.scrollable {
    position: relative;
    inset: auto;
    margin-top: 2rem;
    padding-left: 2rem;
}

.left-column {
    display: contents;
}

.left-column.scrollable {
    display: block;
}

.content {
    position: absolute;
    top: 55%;
    left: 2rem;
    right: 2rem;
    max-width: 600px;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    color: black;
    pointer-events: auto;
    font-family: 'IBM Plex Serif', serif;
}

/* .content.active {
    top: 18rem;
    opacity: 1;
    pointer-events: auto;
} */

.content.scrollable {
    position: relative;
    inset: auto;
    padding-left: 2rem;
    padding-bottom: 4rem;
    opacity: 1;
}

.nav {
    position: absolute;
    top: 55%;
    left: 2rem;
    display: flex;
    gap: 2rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    pointer-events: none;
}

.nav a {
    color: black;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.2s ease;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

.nav a:hover {
    color: var(--accent-color, #ff483b);
}

/* .nav.active {
    top: 16rem;
    opacity: 1;
    pointer-events: auto;
} */

.nav.scrollable {
    position: relative;
    inset: auto;
    padding-left: 2rem;
    margin-bottom: 1rem;
    margin-top: 1rem;
    opacity: 1;
    pointer-events: auto;
}

p {
    font-size: 16px;
    line-height: 22px;
}

/* Inner page styles */
.page-title {
    position: relative;
    top: auto;
    left: auto;
    margin-top: 1rem;
    padding-left: 2rem;
    color: black;
}

body:has(.page-content) .left-column .nav {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
    padding-left: 2rem;
    margin-top: 1rem;
    pointer-events: auto;
}

body:has(.page-content) .left-column .nav a {
    margin-top: 0;
    margin-bottom: 0;
}

.page-content {
    position: relative;
    top: auto;
    opacity: 1;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 4rem;
    pointer-events: auto;
}

.page-content h2 {
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    margin-top: 2rem;
}

.page-content ul {
    list-style: none;
    padding: 0;
}

.page-content li {
    margin-bottom: 0.75rem;
}

.page-content a,
.content a {
    color: black;
    text-decoration: none;
    border-bottom: 1px solid black;
}

.page-content a:hover,
.content a:hover {
    color: var(--accent-color, #ff483b);
    border-bottom-color: var(--accent-color, #ff483b);
}

/* Blog post figures and captions */
figure {
    margin: 1.5rem 0;
    margin-left: 0;
    margin-right: 0;
}

figure img {
    display: block;
    max-width: 100%;
}

figcaption {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

figcaption a {
    color: #999;
    border-bottom: none;
}

figcaption a:hover {
    color: var(--accent-color, #ff483b);
}

/* Blog post image grids */
.image-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.image-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.image-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.image-grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 600px) {
    .image-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .image-grid-2,
    .image-grid-4 {
        grid-template-columns: 1fr;
    }
}

.post-date {
    display: block;
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
}

.post-date-title {
    font-family: 'IBM Plex Serif', serif;
    font-size: 1rem;
    color: #666;
    margin: 0.5rem 0 0 0;
    padding-left: 2rem;
}

.post-tags {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-tags .tag {
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    background-color: #666;
    border: none;
    border-bottom: none;
    text-decoration: none;
    color: white;
}

.post-tags .tag:hover {
    background-color: var(--accent-color, #ff483b);
    color: white;
}

.newsletter-signup {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid black;
}

.newsletter-signup h3 {
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.newsletter-description {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: #333;
}

.newsletter-form {
    display: flex;
    gap: 0;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.75rem;
    font-family: 'IBM Plex Serif', serif;
    font-size: 1rem;
    border: 1px solid black;
    border-right: none;
    outline: none;
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--accent-color, #ff483b);
}

.newsletter-form input[type="submit"] {
    padding: 0.75rem 1.5rem;
    font-family: 'Impact', sans-serif;
    text-transform: uppercase;
    font-size: 1rem;
    background-color: black;
    color: white;
    border: 1px solid black;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.newsletter-form input[type="submit"]:hover {
    background-color: var(--accent-color, #ff483b);
    border-color: var(--accent-color, #ff483b);
}

.newsletter-feedback {
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.newsletter-feedback.success {
    color: #333;
}

.newsletter-feedback.error {
    color: #c00;
}

.head-container {
    width:80%
}

.head-container img {
    width:100%
}

.footer {
    padding-bottom: 2rem;
    font-family: 'IBM Plex Serif', serif;
    font-size: 0.875rem;
    color: #666;
    width: 100%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

body:has(.content.scrollable) .footer,
body:has(.page-content) .footer {
    opacity: 1;
    pointer-events: auto;
}

.footer img {
    max-height: 290px;
    max-width: 100%;
}

.footer p {
    margin: 0;
}

/* Wide screen - two column layout */
@media (min-width: 1024px) {
    body.active,
    body.scrollable,
    body:has(.page-content) {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .left-column.scrollable {
        position: fixed;
        top: 2rem;
        left: 2rem;
        width: 40%;
        display: flex;
        flex-direction: column;
        z-index: 100;
    }

    .left-column .title.scrollable,
    .left-column .page-title {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        padding-left: 0;
        margin-top: 0;
    }

    .left-column .nav.scrollable,
    .left-column .nav,
    body:has(.page-content) .left-column .nav {
        position: relative;
        top: auto;
        bottom: auto;
        left: auto;
        padding-left: 0;
        margin-top: 1rem;
    }

    .left-column .post-date-title {
        padding-left: 0;
    }

    .content.scrollable,
    .page-content {
        margin-left: 50%;
        width: 45%;
        padding-left: 0;
        padding-right: 2rem;
        padding-top: 2rem;
    }

    .footer {
        width: 100%;
        margin-left: 0;
        text-align: center;
    }
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {

    /* Inner pages (blog posts, list pages) */
    body:has(.page-content) .left-column {
        display: block;
        padding: 0;
    }

    body:has(.page-content) .left-column .title,
    body:has(.page-content) .left-column .page-title,
    body:has(.page-content) .left-column .title.scrollable {
        font-size: 4rem;
        line-height: 4rem;
        position: relative;
        top: auto;
        left: auto;
        margin: 1rem 0 0 0;
        padding-left: 1rem;
    }

    body:has(.page-content) .left-column .post-date-title {
        padding-left: 1rem;
        margin: 0.5rem 0 0 0;
    }

    body:has(.page-content) .left-column .nav {
        position: relative;
        top: auto;
        left: auto;
        padding-left: 1rem;
        margin: 0.75rem 0 0 0;
        opacity: 1;
        pointer-events: auto;
    }

    body:has(.page-content) .left-column .nav a {
        margin: 0;
    }

    body:has(.page-content) .content.page-content {
        position: relative;
        left: auto;
        right: auto;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Homepage mobile styles */
    .title {
        font-size: 4rem;
        line-height: 4rem;
        left: 1rem;
        top: 1rem;
    }

    .title.active {
        top: 1rem;
    }

    .left-column.scrollable {
        display: block;
        padding: 0;
    }

    .left-column.scrollable .title,
    .left-column.scrollable .title.scrollable {
        position: relative;
        top: auto;
        left: auto;
        margin: 1rem 0 0 0;
        padding-left: 1rem;
    }

    .left-column.scrollable .nav {
        position: relative;
        top: auto;
        left: auto;
        padding-left: 1rem;
        margin: 0.75rem 0 0 0;
        opacity: 1;
        pointer-events: auto;
    }

    .left-column.scrollable .nav a {
        margin: 0;
    }

    .nav {
        left: 1rem;
        top: 1rem;
    }

    .nav.active {
        top: 9rem;
    }

    .content {
        left: 1rem;
        right: 1rem;
    }

    .content.active {
        top: 11rem;
    }

    .content.scrollable {
        position: relative;
        top: auto;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 3rem;
        line-height: 3rem;
    }

    .title {
        font-size: 3rem;
        line-height: 3rem;
    }

    .nav {
        gap: 1rem;
    }

    .nav a {
        font-size: 1rem;
    }

    .nav.active {
        top: 7rem;
    }

    .nav.scrollable {
        top: auto;
        margin-top: 1rem;
    }

    .content.active {
        top: 9rem;
    }

    .content.scrollable {
        top: auto;
    }

    .footer img {
        max-height: 100px;
    }
}
