:root {
    --primary-orange: #2E7D32;
    --secondary-orange: #43A047;
    --primary-grey: #1A1F22;
    --light-grey: #5D6D7E;
    --bg-light: #F8F9FA;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--primary-grey);
    background: linear-gradient(150deg, #fff 0%, #f6f8fb 55%, #E8F5E9 100%);
    line-height: 1.75;
}

body.dark-mode {
    --primary-grey: #E6EDF3;
    --light-grey: #A9B4BF;
    --bg-light: #0B1220;
    background: linear-gradient(145deg, #0b1220 0%, #0f172a 65%, #1f2937 100%);
    color: var(--primary-grey);
}

main {
    max-width: 980px;
    margin: 0 auto;
    padding: 7.2rem 1.3rem 4rem;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.post-date {
    font-size: 0.92rem;
    color: #7a8794;
    font-weight: 600;
}

body.dark-mode .post-date {
    color: #9aa8b8;
}

.post-tag {
    display: inline-block;
    border: 1px solid rgba(46, 125, 50, 0.28);
    background: rgba(46, 125, 50, 0.08);
    color: var(--primary-orange);
    border-radius: 999px;
    padding: 0.23rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.post-title {
    font-size: clamp(2rem, 4.2vw, 3.1rem);
    line-height: 1.08;
    margin-bottom: 1.2rem;
}

.post-video {
    margin-bottom: 1.8rem;
}

.post-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(46, 125, 50, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
    background: #000;
}

.post-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.post-body {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(46, 125, 50, 0.12);
    border-radius: 18px;
    padding: clamp(1.2rem, 4vw, 2rem);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
}

body.dark-mode .post-body {
    background: rgba(17, 24, 39, 0.9);
    border-color: rgba(46, 125, 50, 0.28);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

/* Strip inline styles from pasted/editor content in dark mode */
body.dark-mode .post-body p,
body.dark-mode .post-body li,
body.dark-mode .post-body span,
body.dark-mode .post-body div,
body.dark-mode .post-body td,
body.dark-mode .post-body th,
body.dark-mode .post-body blockquote {
    background-color: transparent !important;
    color: #c9d1d9 !important;
}

body.dark-mode .post-body h1,
body.dark-mode .post-body h2,
body.dark-mode .post-body h3,
body.dark-mode .post-body h4,
body.dark-mode .post-body h5,
body.dark-mode .post-body h6,
body.dark-mode .post-body strong,
body.dark-mode .post-body b {
    background-color: transparent !important;
    color: #e6edf3 !important;
}

body.dark-mode .post-body a {
    color: var(--secondary-orange) !important;
}

body.dark-mode .post-body table {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.post-body p,
.post-body li {
    color: var(--light-grey);
    font-size: 1.05rem;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    color: var(--primary-grey);
    line-height: 1.25;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
}

.post-body a {
    color: var(--primary-orange);
}

/* Make post-body images fully visible and clickable */
.post-body img {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 1.2rem auto;
    border-radius: 10px;
    cursor: zoom-in;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.post-body img:hover {
    box-shadow: 0 8px 28px rgba(46, 125, 50, 0.22);
}

.post-footer-image {
    margin-top: 2rem;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(46, 125, 50, 0.14);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: transparent;
}

.post-footer-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.post-footer-carousel {
    margin-top: 2rem;
    border-radius: 18px;
    border: 1px solid rgba(46, 125, 50, 0.16);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.08);
    background: #fff;
    overflow: hidden;
}

body.dark-mode .post-footer-carousel {
    background: #111827;
    border-color: rgba(46, 125, 50, 0.3);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}

.post-footer-track-wrap {
    overflow: hidden;
    position: relative;
}

.post-footer-track {
    display: flex;
    transition: transform 0.35s ease;
    will-change: transform;
}

.post-footer-slide {
    min-width: 100%;
    margin: 0;
    background: linear-gradient(135deg, #3F5247, #6E8475);
}

.post-footer-slide img {
    width: 100%;
    height: auto;
    display: block;
    cursor: zoom-in;
}

.post-footer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(46, 125, 50, 0.14);
    background: rgba(255, 255, 255, 0.96);
}

body.dark-mode .post-footer-controls {
    background: rgba(15, 23, 42, 0.92);
    border-top-color: rgba(46, 125, 50, 0.3);
}

.post-footer-arrow {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(46, 125, 50, 0.26);
    background: #fff;
    color: var(--primary-orange);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

body.dark-mode .post-footer-arrow {
    background: #0f172a;
    border-color: rgba(46, 125, 50, 0.4);
    color: var(--secondary-orange);
}

.post-footer-arrow:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(46, 125, 50, 0.2);
}

.post-footer-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.post-footer-dots {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex: 1;
}

.post-footer-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 0;
    background: rgba(44, 53, 57, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

body.dark-mode .post-footer-dot {
    background: rgba(230, 237, 243, 0.25);
}

.post-footer-dot.is-active {
    background: var(--primary-orange);
    transform: scale(1.25);
}

.post-empty {
    color: var(--light-grey);
    font-size: 1.03rem;
}

/* Lightbox */
.gb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
}

.gb-lightbox.open {
    display: flex;
}

.gb-lightbox-img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
    user-select: none;
    transition: opacity 0.18s ease;
}

.gb-lightbox-img.fading {
    opacity: 0;
}

.gb-lightbox-close {
    position: fixed;
    top: 1.1rem;
    right: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10000;
}

.gb-lightbox-close:hover {
    background: rgba(46, 125, 50, 0.5);
}

.gb-lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    z-index: 10000;
}

.gb-lightbox-arrow:hover {
    background: rgba(46, 125, 50, 0.45);
}

.gb-lightbox-arrow:disabled {
    opacity: 0.2;
    cursor: default;
}

.gb-lightbox-prev { left: 1rem; }
.gb-lightbox-next { right: 1rem; }

.gb-lightbox-counter {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    z-index: 10000;
}

@media (max-width: 768px) {
    main {
        padding-top: 6rem;
    }

    .post-body p,
    .post-body li {
        font-size: 1rem;
    }
}
