/* Reset and base styles */
* {
    box-sizing: border-box;
}
html {
    /* Sets base size for rem unit */
    font-size: 16px;    
    cursor: url("/images/soft.svg") 25 32, pointer;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.2;
    color: #000;
    background: hsla(295, 6.7%, 82.0%, 1);
    max-width: 50rem;
    margin: 0 auto;
    padding: 1rem;
    text-align: center;
}

/* Links */
a {
    color: #000;
    text-decoration: none;
}
a:hover, a:visited {
    text-decoration: underline;
    cursor: url("/images/mid.svg") 25 32, pointer;
}

a:focus, a:active {
    text-decoration: underline;
    cursor: url("/images/hard.svg") 25 32, pointer;    
}

/* Header */
.site-header {
    display: block;
    margin: 4rem 0;
}
header h1 {
    font-size: 1rem;
    font-weight: 400;
}

.site-logo {;
    font-size: 2rem;
}
.site-logo sup {
    font-size: 70%;    
}
.site-logo sup,
.home-link {
    font-family: 'Chomsky';
    font-size: 2rem;
    color: hsla(0, 0.0%, 13.7%, 1);
    display: inline-block;    
}


/* Footer */

.site-footer {
    font-size: .8rem;
    margin: 4rem auto 1rem;
    padding-top: 2rem;
    border-top: 1px solid hsla(300, 2.8%, 73.1%, .5);
}

.spinner {
    display: inline-block;
    will-change: transform; /* hint for smoother animation */
    transform-origin: 50% 50%;  /* rotate around center */
    -webkit-animation: spin 4s linear infinite;
    animation: spin 4s linear infinite;
}

    /* prefers-reduced-motion: do not animate for users who opted out */
    @media (prefers-reduced-motion: reduce) {
      .spinner {
        -webkit-animation: none;
                animation: none;
      }
    }


    /* keyframes */
    @-webkit-keyframes spin {
      from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
      to   { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
    }
    @keyframes spin {
      from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
      to   { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
    }

/* Post list on home page */
.post-list {
    margin: 4rem 0 2rem;
}

.post-item {
    margin-bottom: 0;
    padding: 1rem 0;
    border-bottom: 1px solid hsla(300, 2.8%, 73.1%, .5);
}

.post-item a {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: baseline;    
}
.post-item a:hover, .post-item a:active, .post-item a:focus {
    text-decoration: underline;
}

.post-item a h1 {
    font-size: 1.4rem;
    font-weight: 400;
    display: inline-block;
}

.post-item a time {
    display: inline-block;
    margin-right: 0;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: block;
    margin: 6rem 0 4rem;
    font-size: 1.4rem;
    font-weight: 400;
}

.pagination .separator {
    margin: 0 .5rem;
}

/* Single post styles */
.single-post {
    max-width: 100%;
}

.post-header {
    margin: 0 auto;
}

.post-title {
    font-size: 1.4rem;;
/*    font-weight: 400;*/
/*    margin-bottom: 2rem;*/
/*    font-family: Helvetica, Arial, sans-serif;*/
}
.post-date-container {
    margin: 1rem auto;
}
.post-date {
    font-size: 1.4rem;
    color: #000;
    margin-bottom: 1rem;
    display: block;
}

.post-tags {
    margin-bottom: 1rem;
}

.post-tags .tag {
    font-size: 1.4rem;
    font-weight: 400;
    color: #000;
    margin-right: 1rem;
}

.post-image {
    margin: 4rem 0 2rem;
    text-align: center;
}

.post-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.post-content {
    margin: 1rem 0;
    line-height: 1.2;
    font-size: 1.4rem;
    font-weight: 400;
}

.post-content p {
    margin-bottom: 1rem;
}

/* Ensure all dates use 1rem font size */
time, .post-date, .post-item time {
/*    font-size: 1rem !important;*/
}

/* Post navigation */
.post-nav {
    position: absolute;
    top: calc(50vh - 1.2rem);
    margin: 0;
/*    display: flex;
    justify-content: space-between;*/
    font-size: 1rem;
    line-height: 1;
    font-weight: 400;
}

@media (max-width: 54rem) {
    .post-nav {
        top: 1rem;
    }   
}
.post-nav a,
.pagination a {
    text-decoration: none;
    padding: .5rem 1rem;
    box-sizing: border-box;
    border: 1px solid hsla(0, 0.0%, 13.7%, 1);;
    border-radius: 999rem;
    display: inline-block;    
}
.pagination {
    position: relative;
}
.pagination .next,
.pagination .prev {
    font-family: Chomsky, Helvetica;
    font-size: 2em;
    position: absolute;
    line-height: 1;
}
.pagination .prev {
    left: 0;
}
.pagination .next {
    right: 0;
}



.post-nav a.nav-next:hover, .post-nav a.nav-next:focus, .post-nav a.nav-next:active,
.post-nav a.nav-prev:hover, .post-nav a.nav-next:focus, .post-nav a.nav-prev:active,
.pagination a:hover, .pagination a:focus, .pagination a:active
 {
    white-space: nowrap;
    background: hsla(0, 0.0%, 13.7%, 1);
    color: hsla(295, 6.7%, 82.0%, 1);;    
}
.post-nav a.nav-next:hover, .post-nav a.nav-next:focus, .post-nav a.nav-next:active,
.post-nav a.nav-prev:hover, .post-nav a.nav-next:focus, .post-nav a.nav-prev:active,
.pagination a:hover, .pagination a:focus, .pagination a:active,
.nav-next.active, .nav-prev.active  {
    text-decoration: none;
    animation: pulsate 400ms ease-in-out 100ms infinite alternate both; 
}

@keyframes pulsate {0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1);} }

.nav-prev {
    margin-right: auto;
    position: fixed;
    left: 1rem;
    font-family: Chomsky, Helvetica;
    font-size: 2em;
}

.nav-next {
    margin-left: auto;
    position: fixed;
    right: 1rem;
    font-family: Chomsky, Helvetica;
    font-size: 2em;    
}

/* Post meta at bottom */
.post-meta-bottom {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: none;
    font-size: 1rem;
    font-weight: 400;
}



/* List page specific */
.post-list h2 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 15px;
    font-family: Helvetica, Arial, sans-serif;
}

.back-link {
    margin-top: 15px;
    font-size: 1.4rem;
    font-weight: 400;
}

.back-link a {
    color: #000;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 1.4rem;
    }
    
    .post-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-next {
        margin-left: 0;
        text-align: right;
    }
}



/* Grid */

.post-grid-container {
    display: block;
    margin: 4rem auto;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(8, auto);
    gap: 2rem;
    width: 100%;
}

.grid-item {
    display: flex;
    flex-direction: column;
}

.grid-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
/*    border-radius: 4px;*/
/*    border:1px solid #f5f5f5;*/
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 200ms ease;    
}

.grid-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;

}

.grid-link:hover .grid-thumbnail{
    transform: scale(1.6);
}
.grid-link:active .grid-thumbnail {
    border: 4px solid #D90404;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.placeholder-image::before {
    content: "📷";
    font-size: 2rem;
    opacity: 0.5;
}

.grid-date {
    margin-top: 0.5rem;
    font-size: 1.4rem;
    line-height: 1.2;
    color: hsla(0, 0.0%, 13.7%, 1);
    text-align: center;
}

/* Responsive breakpoints */
@media (max-width: 54rem) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(8, auto);
    }
}

@media (max-width: 40rem) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(12, auto);
    }
    
    .post-grid-container {
/*        padding: 0.5rem;*/
    }
}

@media (max-width: 25rem) {
    .post-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(24, auto);
    }
}