/* Base Layout */
body {
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
    font-family: 'Times New Roman', Times, serif, Georgia, "Times New Roman", serif;
    line-height: 1.2;
    overflow: hidden;
    justify-content: center;
}

/* Typography */
h1 {
    font-family: futura-pt, Futura, "Trebuchet MS", Arial, sans-serif;
    font-size: 2em;
    margin-bottom: 1em;
    break-after: avoid;
    font-weight: 400;
}

h2 {
    font-family: futura-pt, Futura, "Trebuchet MS", Arial, sans-serif;
    font-size: 1.5em;
    margin: 0.2em;
    color: #000000;
    break-after: avoid;
    font-weight: 1200;
    font-style: bold;
}

h3 {
    font-family: futura-pt, Futura, "Trebuchet MS", Arial, sans-serif;
    font-size: 1.35em;
    margin: 0.2em;
    color: #000000;
    break-after: avoid;
    font-weight: 300;
    font-style: light;
}

p {
    font-size: 1.2em;
    font-weight: 400;
    font-style: normal;
    line-height: inherit;

    /* Spacing */
    margin-top: 0;
    margin-bottom: 0.7em;
    word-spacing: -0.01em;        /* Tighter for serif fonts */
    letter-spacing: 0;            /* Natural serif spacing */
    
    /* Alignment */
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 3;  /* Minimum word length to hyphenate: 6, before break: 3, after break: 3 */
    hyphenate-limit-lines: 2;      /* Maximum consecutive hyphenated lines */
    hyphenate-limit-zone: 8%;      /* Flexibility zone at the end of lines */
    text-rendering: optimizeLegibility;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    font-kerning:normal;
    font-variant-ligatures: common-ligatures;
    font-feature-settings: "kern", "liga", "clig", "calt", "onum";
}

/* Navigation */
.nav-bar {
    background: #ffffff;
    padding: 20px;
    min-width: 100px;
    height: 100vh;
    position: fixed;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-bar ul {
    list-style: none;
    padding: 0;
    margin: 1em 0;
}

.nav-bar a {
    color: #000;
    text-decoration: none;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.2em;
    font-weight: 400;
    text-transform: lowercase;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    line-height: 1.25;
    letter-spacing: 0;
    position: relative;
    outline-offset: 3px;
}

.nav-bar a:hover {
    letter-spacing: 0.1em;
}

.nav-bar a.is-active,
.nav-bar a:focus-visible.is-active {
  text-decoration: underline;
}

.nav-bar a:focus-visible {
  outline: 2px solid #000;
}

.nav-bar h1 a{
    font-family: futura-pt, Futura, "Trebuchet MS", Arial, sans-serif;
    font-size: 1em;
    margin-bottom: 1em;
    break-after: avoid;
    font-weight: 400;
}

.nav-bar h1 a:hover {
    letter-spacing: 0;
}


/* Navigation Footer */
.nav-footer {
    margin-top: auto;
    padding-bottom: 2em;
}

/* Vertical Divider */
.nav-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 40px;
    bottom: 70px;
    width: 1px;
    background: #000;
    z-index: 10;
}

/* Ensure nav bar stays on top */
.nav-bar {
    z-index: 10;
}

/* Nav Toggle */
#nav-toggle {
    font-size: 1.5em;
    font-family: Futura-pt, Futura, "Trebuchet MS", Arial, sans-serif;
    position: fixed;
    top: 10px;
    right: 10px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 7px;
    padding: 0.2em;
    cursor: pointer;
    visibility: hidden;
}

.nav-bar {
  transform: translateX(0);
  transition: transform .3s ease;
}

@media (max-width:700px) {
    #nav-toggle { visibility: visible;}
  .nav-bar { transform: translateX(-100%); }
  .nav-bar.nav-open { transform: translateX(0); }
}


/* Main Content Area */

.content {
        --col: 300px;
        --gutter: 0;

        margin-left: 180px;
        margin-right: 0;
        padding: 30px 60px 30px 60px;
        background-color: rgb(255, 255, 255);

        width: calc(100vw - 240px);
        max-width: calc((var(--col) + var(--gutter)) * 5 + var(--gutter));
        min-width: var(--col);
        height: calc(100vh - 40px);

        column-gap: var(--gutter);
        column-width: var(--col);
        column-count: 2;
        column-fill: auto;

        overflow-x: auto;
        overflow-y: hidden;
        position: relative;
}

/* Content Edge Gradients */
.content::before,
.content::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 2;
}

.content::before {
    left: 180px; /* Align with content left edge */
    background: linear-gradient(to right,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

.content::after {
    right: 0;
    background: linear-gradient(to left,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 100%
    );
}

/* Articles */
.article {
    background-color: rgb(255, 255, 255);
    margin: 10px;
    padding: 7px;
    border-bottom: 0px solid #565656;
    border-radius: 14px;
  
}

.article-header {
    break-inside: avoid;
}

.article a{
    color: #000000;
    text-decoration: none;
}

/* Article meta and preview link styles */
.article-meta {
  font-size: 0.9em;
  opacity: 0.7;
  margin-bottom: 0.8em;
}

/* Images */
.img-container {
    break-inside: avoid;
    margin: 0;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 7px;
}

img.image-error {
  opacity: 0.6;
  filter: grayscale(100%);
}

/* Column Breaks */
.column {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Column count breakpoints - add another column roughly every 360px of viewport width (after nav space) */
@media (min-width: 701px) {
    .content { column-count: 2; }
}


@media (min-width: 900px) {
    .content { column-count: 3; }
}

@media (min-width: 1400px) {
    .content { column-count: 4; }
}

@media (min-width: 1680px) {
    .content { column-count: 5; }
}

@media (min-width: 2040px) {
    .content { column-count: 6; }
}

/* Responsive Design */
@media (max-width: 700px) {
    body{
        overflow: visible;

}

     .content {
        margin-left: 0;
        box-sizing: border-box;
        margin-left: calc(100vw-150px);
        margin-right: calc(100vw-150px);
        width: 500px;
        max-width: 100vw;
        padding-right: 30px;
        overflow-y: auto;               /* enable vertical scrolling */
        -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
        overflow-x: scroll;
        overflow-y: scroll;
        column-count: 1;                /* force single column */
        column-width: 100%;             /* ensure 1-column flow */
    }

    .article {
    margin-bottom: 0px;
    padding-bottom: 20px;
}

    .nav-bar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-bar:hover {
        transform: translateX(0);
    }
    .content::before,
    .content::after {
    visibility: hidden;
}
}

/* Skip Link Styles */
.skip-link {
  position:absolute;
  left:-999px;
  top:0;
}
.skip-link:focus {
  left:10px;
  top:10px;
  background:#fff;
  padding:0.5em;
  border:1px solid #000;
  z-index:100;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.read-more {
  text-decoration: underline;
  display: inline-block;
  margin-top: 0.4em;
  size: 1.2em;
}