/* ---------------------------  Reset & core  --------------------------- */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto,
        Helvetica, Arial, sans-serif;
    color: #111;
}

* {
    box-sizing: border-box
}

/* ---------------------------  Layout shell  --------------------------- */
.layout {
    display: flex;
    min-height: 100vh
}

.sidebar {
    flex: 1;
    background: #e5e7eb;
    /* light-grey “border” */
}

.content {
    flex: 0 1 960px;
    /* centred column, max 960 px wide */
    width: 100%;
    background: #f9fafb;
    /* subtle warm grey */
    padding: 2.5rem 3rem;
    box-shadow: 0 0 25px rgba(0, 0, 0, .06);
}

/* Hide borders on phones */
@media(max-width:768px) {
    .sidebar {
        display: none
    }

    .content {
        flex: 1;
        padding: 1.25rem 1rem;
        box-shadow: none;
    }
}

/* ---------------------------  Header  --------------------------- */
.site-header {
    text-align: center;
    margin-bottom: 0.5rem;

}

.site-header h1 {
    /* clamps from 3.2 vw on desktops down to 1.8 rem on phones */
    font-size: clamp(1.8rem, 3.2vw, 2.75rem);
    margin: 0;
    text-transform: lowercase;
    letter-spacing: .5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .08);
    /* allow wrapping instead of overflowing */
    overflow-wrap: break-word;
}

.site-header h1 a {
    color: inherit;
    text-decoration: none
}

.controls {
    display: flex;
    flex-wrap: wrap;
    /* allow wrapping instead of column switch */
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin: -.25rem 0 1rem;
    /* tighter on mobile */
}

.controls-left {
    display: flex;
    gap: .5rem;
    flex: 1 1 auto
}

@media(max-width:600px) {
    .sort-btn {
        margin-left: auto
    }
}

/* ---------------------------  Post list  --------------------------- */
.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem
}

.post-list li {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .625rem;
    padding: 1.25rem 1.5rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.post-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
}

.post-title {
    font-size: 1.25rem;
    color: #1e3a8a;
    text-decoration: none;
    line-height: 1.3;
    font-weight: 600;
}

.post-meta {
    font-size: .8125rem;
    color: #6b7280;
    margin: .25rem 0 .65rem;
}

.post-blurb {
    margin: 0;
    font-size: .95rem;
    color: #374151;
    line-height: 1.55
}

/* smaller, right-aligned pin badge */
.pin-badge {
    font-size: .7rem;
    color: #d97706;
    display: flex;
    /* takes line height of parent */
    align-items: center;
    margin-left: .4rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}


/* ---------------------------  Utilities  --------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0
}

/* -------------------  Post page tweaks  ------------------- */
.post-body iframe {
    max-width: 100%;
    border: 0;
    height: 315px;
    width: 560px
}

@media(max-width:640px) {
    .post-body iframe {
        height: 200px;
        width: 100%
    }
}

.post-body h2,
h3,
h4 {
    margin-top: 2rem
}

.post-body p {
    line-height: 1.7;
    margin: .9rem 0
}


/* ----------  filter chips  ---------- */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    row-gap: .4rem
}

.chip {
    padding: .3rem .65rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 1rem;
    font-size: .8rem;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}

.chip.selected {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a
}

/* ----------  sort button  ---------- */
.sort-btn {
    margin-left: 1rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: .375rem;
    padding: .4rem .55rem;
    cursor: pointer;
}

.sort-btn .arrow {
    fill: none;
    stroke: #1e3a8a;
    stroke-width: 2;
    transition: transform .2s
}

.sort-btn.asc .arrow {
    transform: rotate(180deg)
}

.sort-btn .arrow path {
    stroke: currentColor
}

/* ----------  social links  ---------- */
.social-links {
    font-size: .9rem;
    margin: .4rem 0 1.1rem;
    letter-spacing: .3px
}

.social-links a {
    text-decoration: none;
    color: #1e3a8a
}

.social-links span {
    color: #6b7280;
    margin: 0 .25rem
}

/* toast notification */
.toast {
    position: fixed;
    /* bottom: 1.5rem; */
    top: 1.trem;

    left: 50%;
    /* transform: translateX(-50%) translateY(100%); */
    transform: translateX(-50%) translateY(-100%);
    background: #1e3a8a;
    color: white;
    padding: .75rem 1.25rem;
    border-radius: .375rem;
    font-size: .875rem;
    opacity: 0;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 999;
}

.toast.show {
    /* transform: translateX(-50%) translateY(0); */
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.post-body img {
    display: block;
    margin: 1rem auto;
    /* optionally constrain its max-width so it never overflows: */
    max-width: 100%;
    height: auto;
}