/*
 * Tela Network v2 — layout shell, site chrome, reading-list rows.
 */

html.v2 {
    /* Keep header/shell width stable when page height toggles the scrollbar. */
    scrollbar-gutter: stable;
}

html.v2 body {
    margin: 0;
    padding: 0;
}

.v2-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.v2-main {
    flex: 1;
}

.v2-shell {
    margin-inline: auto;
    max-width: var(--v2-shell-max);
    padding-inline: 1rem;
    width: 100%;
}

.v2-main.v2-shell {
    padding-top: var(--v2-page-start);
}

@media (min-width: 768px) {
    .v2-shell {
        padding-inline: 2rem;
    }
}

.v2-section {
    padding-block: 3rem;
}

@media (min-width: 768px) {
    .v2-section {
        padding-block: 3.5rem;
    }
}

.v2-rule-t {
    border-top: 1px solid var(--v2-rule);
}

.v2-grid-forum-row {
    display: grid;
    gap: 0.5rem 2rem;
}

@media (min-width: 768px) {
    .v2-grid-forum-row {
        grid-template-columns: 1fr 9rem;
    }
}


/* Forum list rows (home teaser, future forum index) */

.v2-forum-row {
    border-bottom: 1px solid var(--v2-border);
    padding-block: 1.25rem;
}

.v2-forum-row-title {
    font-family: var(--v2-font-serif);
    font-size: var(--v2-text-lg);
    font-weight: 500;
    line-height: 1.375;
    margin: 0;
}

.v2-forum-row-title a {
    color: inherit;
    text-decoration: none;
}

.v2-forum-row-title a:hover {
    color: var(--v2-accent);
    text-decoration: underline;
    text-decoration-color: var(--v2-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.v2-forum-row-excerpt {
    font-family: var(--v2-font-serif);
    font-size: 0.9375rem;
    line-height: 1.625;
    margin: 0.5rem 0 0;
    max-width: 42rem;
}

.v2-forum-row-meta {
    font-size: var(--v2-text-base);
}

.v2-forum-row-meta > a {
    color: inherit;
    text-decoration: none;
}

.v2-forum-row-meta > a:hover {
    color: var(--v2-accent);
    text-decoration: underline;
    text-decoration-color: var(--v2-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.v2-forum-row-date {
    margin-top: 0.25rem;
}

.v2-forum-row-replies {
    font-size: var(--v2-text-sm);
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .v2-forum-row-meta {
        text-align: end;
    }
}

.v2-forum-empty {
    font-size: var(--v2-text-base);
    line-height: 1.5;
    margin: 1.5rem 0 0;
}


/* Header */

.v2-header {
    background: color-mix(in oklch, var(--v2-background) 95%, transparent);
    backdrop-filter: blur(2px);
    border-bottom: 1px solid var(--v2-rule);
    position: sticky;
    top: 0;
    z-index: 40;
}

.v2-header-inner {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-inline: auto;
    max-width: var(--v2-shell-max);
    padding: 0.875rem 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .v2-header-inner {
        padding-inline: 2rem;
    }
}

.v2-logo {
    align-items: center;
    color: inherit;
    display: flex;
    flex-shrink: 0;
    gap: 0.375rem;
    min-width: 0;
    text-decoration: none;
}

.v2-logo-mark {
    font-size: var(--v2-text-logo);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
}

.v2-nav-desktop {
    display: none;
    flex: 1;
    gap: 1.5rem;
    justify-content: center;
    min-width: 0;
}

@media (min-width: 768px) {
    .v2-nav-desktop {
        display: flex;
    }
}

.v2-nav-link {
    color: var(--v2-muted-foreground);
    padding-block: 0.25rem;
    padding-inline: 0.75rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.v2-nav-link:hover,
.v2-nav-link--active {
    color: var(--v2-foreground);
}

.v2-nav-forum {
    position: relative;
}

button.v2-nav-forum-button {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    gap: 0.25rem;
}

.v2-forum-menu {
    background-color: var(--v2-background);
    border: 1px solid var(--v2-border);
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    left: 0;
    min-width: 9rem;
    padding: 0.375rem;
    position: absolute;
    top: calc(100% + 0.35rem);
    z-index: 40;
}

.v2-forum-menu[hidden] {
    display: none;
}

.v2-forum-menu-link {
    color: var(--v2-muted-foreground);
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.v2-forum-menu-link:hover,
.v2-forum-menu-link--active,
.v2-forum-menu-link:focus-visible {
    color: var(--v2-foreground);
}

.v2-nav-forum-button:focus-visible {
    color: var(--v2-foreground);
    outline: 1px solid var(--v2-foreground);
    outline-offset: 2px;
}

.v2-nav-link--unready {
    cursor: default;
    overflow: hidden;
    pointer-events: none;
    position: relative;
}

.v2-nav-link--unready::after {
    background-color: color-mix(in oklch, var(--v2-muted-foreground) 50%, transparent);
    content: "";
    height: 2px;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 120%;
}

.v2-header-actions {
    --v2-header-auth-width: 4.25rem;
    align-items: center;
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-inline-start: auto;
}

@media (min-width: 768px) {
    .v2-header-actions {
        gap: 1rem;
    }
}

.v2-search {
    align-items: center;
    border: 1px solid var(--v2-input);
    color: var(--v2-muted-foreground);
    display: none;
    font-size: var(--v2-text-sm);
    gap: 0.5rem;
    height: 2rem;
    padding-inline: 0.5rem;
    text-decoration: none;
    transition: border-color 0.15s ease;
    width: 10rem;
}

.v2-search:hover {
    border-color: color-mix(in oklch, var(--v2-foreground) 40%, transparent);
}

.v2-search--active {
    border-color: var(--v2-foreground);
    color: var(--v2-foreground);
}

@media (min-width: 1024px) {
    .v2-search {
        display: inline-flex;
    }
}

.v2-search-icon {
    flex-shrink: 0;
    font-size: 1.65rem;
    line-height: 1;
}

.v2-record-cta {
    align-items: center;
    box-sizing: border-box;
    display: none;
    height: 2rem;
    line-height: 1;
    padding: 0 0.75rem;
}

@media (min-width: 640px) {
    .v2-record-cta {
        display: inline-flex;
    }
}

.v2-login-link {
    align-items: center;
    box-sizing: border-box;
    color: var(--v2-muted-foreground);
    display: inline-flex;
    height: 2rem;
    justify-content: flex-end;
    min-width: var(--v2-header-auth-width);
    text-decoration: none;
    transition: color 0.15s ease;
}

.v2-login-link:hover {
    color: var(--v2-foreground);
}

.v2-account-icon {
    align-items: center;
    border: 1px solid var(--v2-input);
    color: var(--v2-muted-foreground);
    display: grid;
    flex-shrink: 0;
    height: 2rem;
    justify-content: center;
    margin-inline-end: 0;
    margin-inline-start: calc(var(--v2-header-auth-width) - 2rem);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
    width: 2rem;
}

.v2-account-icon:hover {
    border-color: color-mix(in oklch, var(--v2-foreground) 50%, transparent);
    color: var(--v2-foreground);
}

.v2-account-icon--active {
    border-color: var(--v2-foreground);
    color: var(--v2-foreground);
}

.v2-account-icon svg {
    display: block;
    height: 1.125rem;
    width: 1.125rem;
}

.v2-nav-toggle {
    align-items: center;
    background: transparent;
    border: 1px solid var(--v2-input);
    color: var(--v2-foreground);
    cursor: pointer;
    display: grid;
    flex-shrink: 0;
    font-size: var(--v2-text-md);
    height: 2rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 2rem;
}

@media (min-width: 768px) {
    .v2-nav-toggle {
        display: none;
    }
}

.v2-nav-toggle-icon--close {
    display: none;
}

.v2-nav-toggle[aria-expanded="true"] .v2-nav-toggle-icon--open {
    display: none;
}

.v2-nav-toggle[aria-expanded="true"] .v2-nav-toggle-icon--close {
    display: block;
}

.v2-nav-drawer {
    border-top: 1px solid var(--v2-rule);
    display: none;
    overflow: hidden;
}

@media (min-width: 768px) {
    .v2-nav-drawer {
        display: none !important;
    }
}

.v2-nav-drawer.is-open {
    display: block;
}

.v2-nav-drawer-inner {
    display: flex;
    flex-direction: column;
    margin-inline: auto;
    max-width: var(--v2-shell-max);
    padding: 0.5rem 1rem 1rem;
    width: 100%;
}

.v2-nav-drawer-forum {
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

button.v2-nav-drawer-forum-button {
    align-items: center;
    appearance: none;
    background: transparent;
    border-inline: 0;
    border-top: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    gap: 0.35rem;
    justify-content: flex-start;
    margin: 0;
    padding-block: 0.75rem;
    padding-inline: 0;
    text-align: left;
    width: 100%;
}

button.v2-nav-drawer-forum-button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

button.v2-nav-drawer-forum-button:focus-visible {
    color: var(--v2-foreground);
    outline: 1px solid var(--v2-foreground);
    outline-offset: -2px;
}

.v2-nav-drawer-forum-menu {
    display: flex;
    flex-direction: column;
}

.v2-nav-drawer-forum-menu[hidden] {
    display: none;
}

.v2-nav-drawer-link {
    border-bottom: 1px solid var(--v2-border);
    color: var(--v2-muted-foreground);
    padding-block: 0.75rem;
    text-decoration: none;
}

.v2-nav-drawer-link--nested {
    padding-inline-start: 1.5rem;
}

.v2-nav-drawer-link:last-child {
    border-bottom: 0;
}

.v2-nav-drawer-link.v2-nav-link--active {
    color: var(--v2-foreground);
}

.v2-nav-drawer-link--unready {
    cursor: default;
    overflow: hidden;
    pointer-events: none;
    position: relative;
}

.v2-nav-drawer-link--unready::after {
    background-color: color-mix(in oklch, var(--v2-muted-foreground) 50%, transparent);
    content: "";
    height: 2px;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 120%;
}

.v2-nav-drawer-record {
    margin-block: 0.75rem 0.5rem;
    text-align: center;
}


/* Footer */

.v2-footer {
    border-top: 1px solid var(--v2-rule);
    margin-top: 6rem;
}

.v2-footer-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-block: 2.5rem;
}

@media (min-width: 768px) {
    .v2-footer-main {
        align-items: flex-start;
        flex-direction: row;
        justify-content: flex-start;
    }

    .v2-footer-columns {
        flex: 1 1 auto;
        justify-content: center;
    }
}

.v2-footer-blurb {
    max-width: 24rem;
}

.v2-footer-title {
    font-size: var(--v2-text-base);
    font-weight: 600;
}

.v2-footer-copy {
    font-size: var(--v2-text-base);
    line-height: 1.625;
    margin-block: 0.5rem 0;
}

.v2-footer-columns {
    display: grid;
    gap: 1.5rem 2.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .v2-footer-columns {
        display: flex;
        gap: 2.5rem;
    }
}

.v2-footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.v2-footer-link {
    color: var(--v2-foreground);
    font-size: var(--v2-text-base);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.v2-footer-link:hover {
    opacity: 0.75;
    text-decoration: underline;
    text-decoration-color: var(--v2-foreground);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.v2-footer-tagline {
    border-top: 1px solid var(--v2-border);
    padding-block: 1.25rem;
}

.v2-footer-tagline p {
    margin: 0;
}
