:root {
    --header-background: #66635B;
    --main-background: #A3A19D;
    --text-color: #fff;
    --card-background-grid: #EDECEB; /*#5C5954;*/
    --card-background-list: #EDECEB;
    --card-text-color-grid: #414141;
    --card-text-color-list: #414141; /*#414141*/
    --card-text-color-dark: #000;
    --post-title-font: 'Helvetica Neue Condensed Bold', Helvetica, Arial, sans-serif;
    --filter-element-height: 2em;
    --filter-element-font-size: 1rem;
    --category-bg-color: #CBCBCB;
    --category-active-bg-color: #66635B;
    --category-hover-bg-color: #66635B;
    --category-text-color: #fff;
    --category-text-font: 'Helvetica Neue Condensed Bold', Helvetica, Arial, sans-serif;
    --article-image-size-list: 250px;
}

body {
    font-family: Calibri, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--header-background);
  width: 100%;
  box-sizing: border-box;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 2rem;
    font-family: 'Medium', Arial, Helvetica, sans-serif !important;
    margin: 0;
    
}

.view-controls {
    display: flex;
    align-items: center;
}

.view-controls button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 1rem;
    font-size: 1rem;
}

.view-controls button.active {
    font-weight: bold;
}

main {
    background-color: var(--main-background);
    padding: 2rem 0;
    min-height: calc(100vh - 80px); /* Adjust based on your header height */
    margin-top: 0; /* Remove any top margin if present */
}

#posts-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

#posts-container.list-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.post-card {
    background-color: var(--card-background-grid);
    color: var(--card-text-color-grid);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.post-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.post-card h2 {
    color: var(--card-text-color-grid);
    padding-top: 5px;
    padding-bottom: 5px;
    margin: 0;
    font-size: 1.75rem;
    font-family: var(--post-title-font);
    font-weight: bold;
    text-transform: uppercase;
}

.post-card:hover img {
    transform: scale(1.05);
}


.grid-view .image-wrapper {
    height: 250px; /* Adjust as needed for grid view */
}

.list-view .image-wrapper {
    height: 400px; /* Adjust as needed for list view */
}

.post-card .content {
    background-color: var(--card-background-grid);
    position: relative;
}

.post-card .preview-text {
    padding: 0 1rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.4;
    max-height: 7em; /* 4 lines of text */
    overflow: hidden;
    position: relative;
    font-family: Calibri, sans-serif !important;
}

/* List view specific styles */
.list-view .post-card {
    width: 100%;
    max-width: 450px;
    background-color: var(--card-background-list);
    color: var(--card-text-color-list);
}

.list-view .post-card h2 {
    color: var(--card-text-color-list);
}

.list-view .post-card .preview-text {
    color: var(--card-text-color-dark);
    font-family: Calibri, sans-serif !important;
}

.list-view .post-card .list-image {
    height: 400px; /* Adjust this value as needed */
    width: 100%; /* This allows the image to maintain its aspect ratio */
}


.overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.overlay-content {
    position: relative;
    background-color: #ffffff;
    color: #000;
    margin: 2% auto;
    width: 80%;
    max-width: 1200px;
    border-radius: 4px;
    overflow: hidden;
    min-height:1200px;
}

.overlay-content h2,
.overlay-content p,
.overlay-content .post-details {
    color: var(--card-text-color-dark);
}

.overlay-content h2 {
    font-family: var(--post-title-font);
    font-size: 2em;
    text-transform: uppercase;
    margin-block-start: 0;
    margin-block-end: 0;
}

.overlay-content p {
    font-family: Calibri, sans-serif !important;
    font-weight: 300;
    line-height: 1.4;
    margin-block-start: 0;
    margin-block-end: 1em;
}

#overlay-post-content {
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove any padding */
    align-items: center;
}

.cover-image-container {
    width: 100%;
    height: 600px;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#overlay-post-content .cover-image-container img:first-child {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    object-position: bottom;
}

#overlay-post-content h2 {
    margin-top: 1rem;
}

#overlay-post-content h2, 
#overlay-post-content p,
#overlay-post-content .completion-date,
#overlay-post-content .post-description,
.post-details,
.additional-images {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
    box-sizing: border-box;
    text-align: justify;
}

.completion-date {
    color: #666;
    font-size: 0.75em;
    font-family: Calibri, sans-serif;
}

.close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: 0.3s;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover,
.close:focus {
    color: #bbb;
    background-color: rgba(0, 0, 0, 0.7);
}

.category-tag {
    display: inline-flex;
    align-items: center;
    height: var(--filter-element-height);
    background-color: var(--category-bg-color);
    color: var(--category-text-color);
    padding: 0 1em;
    border-radius: calc(var(--filter-element-height) / 2);
    font-size: var(--filter-element-font-size);
    font-weight: bold;
    font-family: var(--category-text-font);
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: right;
    white-space: nowrap;
}

.category-tag:hover,
.category-tag.active {
  background-color: var(--category-active-bg-color);
}

.category-filter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 1000;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: var(--filter-font-size);
  transition: transform 0.3s ease, opacity 0.3s ease;
  padding-left: 10px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  -webkit-overflow-scrolling: touch;
}

/* Style the scrollbar for webkit browsers */
.category-filter::-webkit-scrollbar {
  width: 6px;
}

.category-filter::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.category-filter::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.filter-toggle-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--filter-element-height);
    height: var(--filter-element-height);
    border-radius: 50%;
    background-color: var(--category-bg-color);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 1001;
    padding: 0;
    align-items: center;
    justify-content: center;
    font-size: var(--filter-element-font-size);
    transition: background-color 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.filter-toggle-btn.active {
    background-color: var(--category-active-bg-color);
}

.filter-toggle-btn:hover {
    background-color: var(--category-hover-bg-color);
}


.filter-toggle-btn svg {
  width: 60%;
  height: 60%;
  stroke: var(--category-text-color);
}

article h2, article p {
    padding: 0 1rem;
    margin: 0.5rem 0;
}

.post-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.post-category {
    display: inline-flex;
    align-items: center;
    height: calc(0.8*var(--filter-element-height));
    background-color: var(--category-bg-color);
    color: var(--category-text-color);
    padding: 0 1em;
    border-radius: calc(var(--filter-element-height) / 2);
    font-size: calc(0.8*var(--filter-element-font-size));
    font-weight: bold;
    font-family: var(--category-text-font);
    text-transform: uppercase;
    text-align: right;
    white-space: nowrap;
}

/*
.post-category::before {
    content: '#';
    margin-right: 0.1rem;
}
*/

.additional-images {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    overflow-x: auto;
}

.additional-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
}
.view-toggle {
  position: relative;
  width: 62px;
  height: 28px;
}

.view-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.view-toggle label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D3D3D3;
  border-radius: 15px;
  transition: .4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
}

.view-toggle .slider {
  position: absolute;
  height: 22px;
  width: 29px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 15px;
  transition: .4s;
  z-index: 1;
}

.view-toggle input:checked + label .slider {
  transform: translateX(27px);
}

.view-toggle .grid-icon,
.view-toggle .list-icon {
  width: 12px;
  height: 12px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
}

.view-toggle .grid-icon {
  background-image: url('resources/grid.svg');
}

.view-toggle .list-icon {
  background-image: url('resources/list.svg');
}

.view-toggle input:checked + label .grid-icon,
.view-toggle input:not(:checked) + label .list-icon {
  opacity: 0.75;
}


.clear-categories-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--filter-element-height);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: var(--header-background);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
    padding: 0; /* Ensure no padding affects the shape */
    overflow: hidden; /* Ensure content doesn't overflow */
    position: relative;
}
.clear-categories-btn:hover {
  background-color: #4a4845;
}

.clear-categories-btn svg {
    width: 50%;
    height: 50%;
    stroke: #fff;
}




/* Font declarations - adjust the paths as necessary if self-hosting */
@font-face {
    font-family: 'Helvetica Neue Condensed Bold';
    src: url('fonts/HelveticaNeue-CondensedBold.woff2') format('woff2'),
         url('fonts/HelveticaNeue-CondensedBold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Medium';
    src: url('fonts/Medium.woff2') format('woff2'),
         url('fonts/Medium.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


@media (max-width: 768px) {
    .category-filter {
    transform: translateX(120%);
    opacity: 0;
    }

    .category-filter.visible {
    transform: translateX(0);
    opacity: 1;
    }
    
    .category-filter .category-tag:last-child {
    margin-bottom: calc(var(--filter-element-height) + 10px);
    }

    .filter-toggle-btn {
    display: flex;
    }
    
    #posts-container {
        grid-template-columns: repeat(2, 1fr);
    }
    h1 {
        font-size: 4vw;
    }
        
    .overlay-content {
    margin: 0 auto;
    width: 100%;
    }
    
    #overlay-post-content h2, 
    #overlay-post-content p,
    #overlay-post-content .completion-date,
    #overlay-post-content .post-description,
    .post-details,
    .additional-images {
        max-width: 500px;
    }
    
}

@media (max-width: 480px) {
    #posts-container {
        grid-template-columns: 1fr;
    }
}
