/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,100..900;1,100..900&display=swap');

/* CSS Custom Properties */
:root {
    --header-height: 100px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: scroll;
}

body {
    max-width: 1728px;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    background-color: #333;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height);
}

a {
    color: #ffffff;
    text-decoration: none;
    transition: none;
}

a:hover {
    color: #999;
    border-bottom-color: #999;
}

/* Fixed Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: #000000;
    z-index: 1000;
}

.fixed-header::before {
    content: '';
    position: absolute;
    top: -100vh;
    left: 0;
    right: 0;
    height: 100vh;
    background-color: #000000;
    z-index: -1;
}

.header-content {
    max-width: 1728px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
    white-space: nowrap;
}

/* Left side - grouped elements */
.header-left-group {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-shrink: 1;
    min-width: 0;
}

/* 1. Logo */
.logo-container {
    flex-shrink: 0;
    margin-right: -10px;
    margin-top: 1px;
}

.logo {
    width: auto;
    height: 25px;
    border: none;
    display: block;
    color: #fff;
}

.logo svg {
    width: auto;
    height: 25px;
    display: block;
}

.logo:hover img {
    filter: brightness(0.6);
}

/* 2. Header Info / Description */
.header-info {
    flex: 0 0 auto;
}

.header-description {
    font-size: 12px;
    line-height: 14px;
    margin: 0;
    letter-spacing: -0.2px;
    margin-right: 20px;
}

.header-description strong {
    font-weight: 700;
}

/* 3. Header Links */
.header-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 6px 20px;
}

.header-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 14px;
    letter-spacing: -0.5px;
}

.link-label {
    font-weight: 400;
}

/* Hover effect for icons */
.header-link:hover img {
    filter: brightness(0.6);
}

/* Right side - Navigation */
.header-nav {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.header-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: -0.5px;
    border: none;
}

.header-nav a.active {
    pointer-events: none;
    border-bottom: 1px solid #fff;
}

.header-nav a.active:hover {
    color: inherit;
    border-bottom-color: transparent;
}

/* Mobile burger menu */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 25px;
    height: 25px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    flex-shrink: 0;
    position: relative;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #fff;
}

.burger-menu.active span {
    display: none;
}

.burger-menu::before,
.burger-menu::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 2px;
    background-color: #fff;
    display: none;
    top: 50%;
    left: 50%;
}

.burger-menu.active::before {
    display: block;
    transform: translate(-50%, -50%) rotate(45deg);
}

.burger-menu.active::after {
    display: block;
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: #000;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0s, visibility 0s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-description {
    display: none;
    padding: 0 20px;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    gap: 10px;
}

.mobile-nav a {
    font-family: 'Inter', sans-serif;
    font-size: 25px;
    font-weight: 400;
    color: #fff;
    text-decoration: none;
    border: none;
    letter-spacing: -1px;
    border-bottom: 1px solid transparent;
    width: fit-content;
    transition: all 0s ease;
}

.mobile-nav a:hover {
    color: #999;
    border: none;
    
}

.mobile-nav a.active {
    pointer-events: none;
}

.mobile-nav a.active:hover {
    color: #fff;
    border-bottom-color: transparent;
}

.mobile-social-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    padding: 20px 20px 0;
    color: #fff;
}

.mobile-bottom-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000;
    z-index: 1000;
}

/* Inverted strip at the bottom of the menu: black on white */
.mobile-header-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    padding: 14px 20px;
    background: #fff;
    color: #000;
}

.mobile-header-links .header-link-with-logo {
    color: #000;
}

.mobile-header-links .header-link-with-logo svg path {
    fill: #000;
}

.mobile-social-links .header-link,
.mobile-header-links .header-link-with-logo {
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* retry.studio on the left, logo on the right */
.mobile-header-links .header-link-with-logo {
    justify-content: space-between;
}

.mobile-social-links .header-link svg,
.mobile-header-links .header-link-with-logo svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.header-stats {
    font-size: 9px;
    line-height: 10px;
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
}

/* Subscription Spacer */
.subscription-spacer {
    background-color: #000;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    height: var(--header-height);
}

/* Subscription Panel */
.subscription-panel {
    width: 100%;
    height: 50px;
    background-color: #000;
    border-radius: 0 0 25px 25px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0px 0px 20px 0px;
    margin-bottom: 0px;
    align-items: center;
}

.subscription-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.5px;
}

.subscription-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 20px 0 5px;
    letter-spacing: -0.5px;
}

.subscription-email {
    background-color: #333;
    color: #999;
    border: 1px solid transparent;
    outline: none;
    border-radius: 15px;
    padding: 0 15px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    min-width: 0;
    width: 100%;
    height: 30px;
    letter-spacing: -0.5px;
    text-align: left;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.subscription-email::placeholder {
    color: #999;
    text-align: left;
    border: 1px solid transparent;
}

.subscription-button {
    background-color: #fff;
    color: #000;
    border: none;
    outline: none;
    border-radius: 15px;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-width: 0;
    width: 100%;
    height: 30px;
    letter-spacing: -0.5px;
}

.subscription-button:hover {
    background-color: #999;
}

.subscription-button:disabled {
    cursor: not-allowed;
    background-color: #999;
}

.subscription-message {
    display: none;
}

/* Responsive header - progressive hiding */
@media (max-width: 1280px) {
    .header-links {
        display: none;
    }
     .header-nav {
        display: none;
    }
    
    .burger-menu {
        display: flex;
    }
    
    .header-stats {
        display: none;
    }
}


@media (max-width: 480px) {
    /* Compact header: logo + burger only. The description moves into the menu overlay.
       The main page keeps the tall header with the description (see index.css). */
    :root {
        --header-height: 65px;
    }

    .header-info {
        display: none;
    }

    .mobile-menu-description {
        display: block;
    }
    
    .subscription-panel {
        height: auto;
        grid-template-columns: 1fr;
        padding: 20px;
        padding-top: 10px;
        gap: 15px;
        border-radius: 0 0 35px 35px;
    }
    
    .subscription-text {
        justify-content: flex-start;
        text-align: left;
        font-size: 14px;
        letter-spacing: -0.2px;
    }
    
    .subscription-form {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0;
    }
    
    .subscription-email,
    .subscription-button {
        width: 100%;
        height: 40px;
        border-radius: 20px;
    }
    
    .header-left-group {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .mobile-social-links {
        letter-spacing: -0.2px !important;
    }
    
    .logo-container {
        margin-right: 0;
    }
    
    .logo {
        width: 53px;
        height: 25px;
    }
    
    .header-description {
        font-size: 14px;
        line-height: 16px;
    }
    
    .burger-menu {
        width: 25px;
        height: 25px;
    }
    
    .burger-menu::before,
    .burger-menu::after {
        width: 32px;
    }
}

/* Follow / donate banners — in the mobile feed (index.ejs) and at the end of the tape page (tape.ejs) */
.feed-banner {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    /* Half the height of a square tape block (grid width = viewport minus .main-content padding).
       min-height rather than aspect-ratio, so longer text grows the banner instead of widening the column. */
    min-height: calc((100vw - 10px) / 2);
    min-width: 0;
    padding: 30px 15px 40px;
    font-size: 14px;
    letter-spacing: -0.2px;
    color: #fff;
}

/* Matches the metadata value text on the tape page (.tape-recorded etc. in tape.css) */
.feed-banner-title {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 350;
    letter-spacing: -0.5px;
    color: #ffffff;
}

/* Keeps a phrase together so a caption never ends on a single orphaned word */
.feed-banner-nowrap {
    white-space: nowrap;
}

/* Line breaks that only apply where a banner is a grid cell (see index.css) */
.feed-banner-cell-break {
    display: none;
}

/* Decorative link shown only where a banner is a grid cell (see index.css) */
.feed-banner-plus {
    display: none;
}

.feed-banner-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Same text style as .grid-item-title */
.feed-banner-caption {
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: #ffffff;
}

/* Same horizontal divider as .grid-item */
.feed-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background-color: #ffffff70;
    pointer-events: none;
}

.feed-banner:last-child::after {
    display: none;
}

.feed-banner-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Icons are white in the markup; buttons are white, so paint them black */
.feed-banner-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.feed-banner-button svg path {
    fill: #000;
}

/* Banner links reuse .subscription-button; these make an <a> behave like the <button> */
.feed-banner-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.feed-banner-button:hover {
    color: #000;
}

/* Donation block, stacked layouts (mobile feed strip and tape page up to tablet width):
   the button's link is stretched over the whole block, so tapping anywhere on it works */
@media (max-width: 1024px) {
    .feed-banner-donate .feed-banner-button::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 1;
    }
}
