@font-face {
    font-family: 'GoudyBookletter';
    src: url(fonts/GoudyBookletter1911.otf);
}

@font-face {
    font-family: 'caption-font';
    src: url(fonts/LiberationSans-Regular.ttf);
}

@font-face {
    font-family: 'caption-font';
    src: url(fonts/LiberationSans-Italic.ttf);
    font-style: italic;
    font-weight: 400;
}

@font-face {
    font-family: 'caption-font';
    src: url(fonts/LiberationSans-Bold.ttf);
    font-style: normal;
    font-weight: 700;
}

@font-face {
    font-family: 'caption-font';
    src: url(fonts/LiberationSans-BoldItalic.ttf);
    font-style: italic;
    font-weight: 700;
}

body {
        background-color: #4b4b30;
        margin: 2em;
}

body.post-open {
    overflow: hidden;
    height: 100vh;
}

/* Admin Page Styles */
.admin-container {
    max-width: 1200px;
    font-family: 'caption-font', sans-serif;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.admin-container h1 {
    color: black;
    padding: 1em 0;
    margin: 0;
    text-align: center;
}

.home-link,
.explore-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 2px solid #333;
    color: #333;
    text-decoration: none;
    font-family: 'GoudyBookletter', serif;
    font-size: 1rem;
    background: #fff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.home-link:hover,
.explore-link:hover {
    background: #f5f5f5;
    border-color: #111;
}

.explore-link {
    left: auto;
    right: 0;
}


#pending-posts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5em;
    align-items: start;
    padding: 0.75em 0;
    margin-top: 0.5em;
    min-height: 60vh;
}

.pending-post-column {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

@media (max-width: 1400px) {
    #pending-posts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    #pending-posts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    #pending-posts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pending-post {
    background-color: #d2ecff;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, box-shadow 0.25s ease, transform 0.2s ease;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
}

.pending-post:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1.2rem;
    margin-bottom: 0;
}

.post-header h3 {
    margin: 0;
    color: black;
    font-size: 1.4em;
    flex-grow: 1;
    font-family: 'caption-font', sans-serif;
    white-space: pre-line;
}

.post-date {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
}

.post-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-bottom: 0;
    background-color: #f5f5f5;
}

.post-carousel {
    width: 100%;
    margin-bottom: 0.4rem;
    background-color: transparent;
    position: relative;
}

.post-carousel-track {
    display: flex;
    overflow-x: auto;
    direction: ltr;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.post-carousel-track::-webkit-scrollbar {
    display: none;
}

.post-carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    object-fit: cover;
    scroll-snap-align: start;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}

.carousel-arrow.prev {
    left: 0.5rem;
}

.carousel-arrow.next {
    right: 0.5rem;
}

.carousel-arrow span {
    font-size: 1.6rem;
    line-height: 1;
    display: block;
    transform: translateY(-1px);
}

.carousel-arrow.prev span {
    transform: translate(0px, -1px);
}

.carousel-arrow.next span {
    transform: translate(1px, -1px);
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.75);
}

.carousel-arrow.hidden {
    display: none;
}

.post-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0 0.2rem;
}

.post-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
}

.post-carousel-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

.post-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 0.4rem;
    background-color: #000;
    overflow: hidden;
}


.post-video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}


.no-image-text {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
}

.post-caption {
    color: #000000;
    line-height: 1.3;
    margin: 0.4rem 1rem 0.4rem;
    padding-bottom: 0.6rem;
    display: flex;
    flex-direction: column;
}

.pending-post.no-media .post-caption {
    margin-top: 0;
}

.pending-post.no-media .post-header {
    padding-bottom: 0;
}

.post-caption p {
    font-family: 'caption-font', sans-serif;
    margin-bottom: 0.6rem;
}

.post-caption .caption-text {
    white-space: pre-line;
    word-wrap: break-word;
    width: 100%;
}

.post-caption.is-overflowing .caption-text {
    display: -webkit-box;
    -webkit-line-clamp: 10;
    line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-caption.expanded .caption-text {
    display: block;
    -webkit-line-clamp: initial;
    line-clamp: initial;
    overflow: visible;
    white-space: pre-wrap;
}

.post-caption.expanded .toggle-caption-btn {
    margin-top: 0.5rem;
    margin-bottom: 0.15rem;
}

.toggle-caption-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.35rem auto 0.35rem;
    align-self: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    width: 1.75rem;
    height: 1.75rem;
}

.toggle-caption-btn .toggle-caret {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-left: 2px solid #6f4128;
    border-bottom: 2px solid #6f4128;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
}

.toggle-caption-btn.expanded .toggle-caret {
    transform: rotate(135deg);
}

.post-tags {
    margin: 0.2rem 0 0.6rem;
    color: #9a9a9a;
    font-family: 'caption-font', sans-serif;
    font-size: 1rem;
    line-height: 1.3;
}

.pending-post .post-tags {
    display: none;
}

.post-caption.is-overflowing .post-tags {
    display: none;
}

.post-caption.is-overflowing.expanded .post-tags {
    display: none;
}

.post-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 0 1.2rem 1.2rem;
}

.approve-btn,
.reject-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'GoudyBookletter', serif;
    font-size: 1em;
    transition: background-color 0.2s ease;
}

.approve-btn {
    background-color: #4CAF50;
    color: white;
}

.approve-btn:hover {
    background-color: #45a049;
}

.reject-btn {
    background-color: #f44336;
    color: white;
}

.reject-btn:hover {
    background-color: #da190b;
}

/* Post detail modal */
#post-detail-screen.screen {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 2rem;
}

#post-detail-screen.screen.active {
    display: flex;
}

.post-detail-card {
    background: white;
    width: fit-content;
    max-width: 50vw;
    min-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.post-detail-card.text-only {
    width: min(50vw, calc(100vw - 4em));
    min-width: min(400px, calc(100vw - 4em));
}

.post-detail-card.has-video {
    min-width: fit-content;
}

.post-detail-card h2 {
    margin: 0 0 1rem 0;
    width: fit-content;
    max-width: 100%;
    font-size: 2rem;
    color: #111;
    text-align: left;
    padding: 0;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    font-family: 'caption-font', sans-serif;
}

.post-detail-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.post-detail-carousel {
    width: 100%;
    display: none;
    flex-direction: column;
    gap: 0.6rem;
    position: relative;
}

.post-detail-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 12px;
}

.post-detail-carousel-track::-webkit-scrollbar {
    display: none;
}

.post-detail-carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    object-fit: contain;
    scroll-snap-align: start;
}

.detail-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.detail-carousel-arrow.prev {
    left: 0.6rem;
}

.detail-carousel-arrow.next {
    right: 0.6rem;
}

.detail-carousel-arrow.hidden {
    display: none;
}

.post-detail-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}

.post-detail-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
}

.post-detail-dot.active {
    background: rgba(0, 0, 0, 0.7);
}

.post-detail-video-embed {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    display: none;
}

.post-detail-video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

#post-detail-caption {
    margin: 0;
    color: #111;
    text-align: left;
    width: 100%;
    font-family: 'caption-font', sans-serif;
    white-space: pre-wrap;
}

.post-detail-tags {
    width: 100%;
    color: #6f4128;
    font-family: 'caption-font', sans-serif;
    text-align: left;
}

.no-posts,
.loading,
.error {
    text-align: center;
    color: #333;
    font-size: 1.2em;
    padding: 40px;
}

.loading {
    color: rgba(0, 0, 0, 0.5);
}

.error {
    color: #d32f2f;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }
}
