/* =========================
   BLOG PAGE — teal + white, Gen Z theme
   Same token system as about.css / contact.css.
========================= */

body {
    background: #ffffff;
}

.blog-page {
    --teal: #088178;
    --teal-dark: #066a62;
    --mint: #e6f6f4;
    --ink: #0a1f1c;
    --white: #ffffff;

    font-family: 'Inter', sans-serif;
    color: var(--ink);
}

/* =========================
   PAGE HEADER
========================= */

#page-header.blog-header {
    background: var(--teal);
    background-image: none;
    min-height: 46vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
    padding: 0 8%;
}

.hero-badge {
    position: relative;
    z-index: 2;
    display: inline-block;
    background: var(--white);
    color: var(--teal-dark);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 7px 14px;
    border-radius: 999px;
    margin-bottom: 18px;
}

#page-header.blog-header h2 {
    position: relative;
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.15;
    color: var(--white);
    margin-bottom: 12px;
}

#page-header.blog-header p {
    position: relative;
    z-index: 2;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 460px;
}

.hero-blob {
    position: absolute;
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 44% 56% 62% 38% / 45% 40% 60% 55%;
    top: -90px;
    right: -70px;
    z-index: 1;
}

/* =========================
   BLOG GRID
========================= */

#blog {
    max-width: 1400px;
    margin: auto;
    padding: 70px 40px;
    position: relative;
    z-index: 1;
}

#blog .blog-box {
    position: relative;
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 40px;
    background: var(--white);
    padding: 30px;
    border-radius: 24px;
    margin-bottom: 40px;
    border: 1px solid rgba(8, 129, 120, 0.12);
    box-shadow: 0 16px 36px rgba(8, 129, 120, 0.08);
    transition: 0.3s;
    overflow: hidden;
}

#blog .blog-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(8, 129, 120, 0.16);
}

#blog .blog-img {
    overflow: hidden;
    border-radius: 18px;
    position: relative;
    width: 50%;
    flex-shrink: 0;
}

#blog .blog-img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}

#blog .blog-img img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    transition: 0.5s;
}

#blog .blog-box:hover img {
    transform: scale(1.08);
}

#blog .blog-details {
    width: 50%;
}

#blog .blog-details h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 26px;
    margin-bottom: 16px;
    color: var(--ink);
}

#blog .blog-details p {
    color: #435855;
    line-height: 26px;
    margin-bottom: 26px;
}

#blog .blog-details a {
    display: inline-block;
    text-decoration: none;
    background: var(--teal);
    color: #fff;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.02em;
    transition: 0.25s;
}

#blog .blog-details a:hover {
    background: var(--teal-dark);
    transform: translateY(-3px);
}

#blog .blog-box h1 {
    position: absolute;
    top: 20px;
    right: 24px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    background: var(--ink);
    padding: 8px 16px;
    border-radius: 999px;
    z-index: 1;
    margin: 0;
}

#pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

#pagination a {
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: var(--mint);
    color: var(--teal-dark);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(8, 129, 120, 0.1);
    transition: 0.25s;
    text-decoration: none;
}

#pagination a:hover {
    background: var(--teal);
    color: #fff;
    transform: translateY(-4px);
}

.active-page {
    background: var(--teal) !important;
    color: #fff !important;
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Tablet */
@media (max-width: 799px) {
    #blog { padding: 60px 40px 0 40px; }
}

/* Mobile */
@media (max-width: 477px) {
    #blog { padding: 60px 20px 0 20px; }

    #blog .blog-box {
        flex-direction: column;
        align-items: flex-start;
    }

    #blog .blog-img {
        width: 100%;
        margin-bottom: 24px;
    }

    #blog .blog-details {
        width: 100%;
    }
}

/* =========================
   SEARCH
========================= */

#blog-search {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px 10px;
    position: relative;
    z-index: 10000;
}

.search-box {
    position: relative;
    width: 500px;
    max-width: 100%;
    z-index: 10001;
}

.search-box:focus-within {
    transform: translateY(-3px);
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--teal);
}

#search-input {
    width: 100%;
    padding: 16px 25px 16px 55px;
    border: 1px solid rgba(8, 129, 120, 0.15);
    border-radius: 999px;
    background: var(--white);
    box-shadow: 0 10px 26px rgba(8, 129, 120, 0.08);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: 0.25s;
}

#search-input:focus {
    box-shadow: 0 14px 32px rgba(8, 129, 120, 0.16), inset 0 0 0 2px var(--teal);
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid rgba(8, 129, 120, 0.15);
    border-radius: 16px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 10002;
    box-shadow: 0 14px 32px rgba(8, 129, 120, 0.14);
}

.suggestion-item {
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: var(--mint);
}

.suggestion-title {
    font-weight: 600;
    color: var(--ink);
}

.suggestion-category {
    font-size: 12px;
    color: var(--teal-dark);
    background: var(--mint);
    padding: 4px 10px;
    border-radius: 999px;
    font-family: 'Space Mono', monospace;
}

/* =========================
   MODAL
========================= */

#blog-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 36, 33, 0.72);
    backdrop-filter: blur(8px);
    z-index: 99999;
    overflow: auto;
}

.modal-content {
    background: var(--white);
    width: 85%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 40px;
    margin: 40px auto;
    position: relative;
    transform: translateY(20px);
    animation: popup 0.35s ease forwards;
}

@keyframes popup {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--ink);
}

#modal-date {
    color: var(--teal-dark);
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    margin-bottom: 20px;
}

#modal-text {
    line-height: 32px;
    color: #435855;
    font-size: 16px;
}

#modal-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: 18px;
    margin: 20px 0;
}

#close-modal {
    position: absolute;
    top: 22px;
    right: 26px;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
    transition: 0.25s;
}

#close-modal:hover {
    color: var(--teal);
    transform: rotate(90deg);
}

@media (max-width: 799px) {
    #blog { padding: 60px 20px; }

    #blog .blog-box { flex-direction: column; }

    #blog .blog-img,
    #blog .blog-details { width: 100%; }

    #blog .blog-details h4 { font-size: 22px; }

    .modal-content { width: 95%; padding: 25px; }

    #modal-image { height: 220px; }
}

/* =========================
   MISC
========================= */

.read-time {
    color: var(--teal-dark);
    font-weight: 600;
    margin-bottom: 14px;
    font-size: 13px;
}

.category {
    display: inline-block;
    background: var(--mint);
    color: var(--teal-dark);
    padding: 7px 15px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.empty-blog {
    text-align: center;
    padding: 80px 20px;
    color: #6b8a86;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 14px 30px rgba(8, 129, 120, 0.08);
}

.empty-blog i {
    font-size: 50px;
    margin-bottom: 18px;
    color: var(--teal);
}

.empty-blog h2 {
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--ink);
}

/* =========================
   NEWSLETTER
========================= */

.blog-page #newsletter {
    background: var(--teal);
    border-radius: 28px;
    padding: 44px;
    color: var(--white);
    margin: 60px 8%;
}

.blog-page #newsletter .newstext h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--white);
}

.blog-page #newsletter .newstext p {
    color: rgba(255, 255, 255, 0.85);
}

.blog-page #newsletter .newstext p span {
    color: var(--white);
    font-weight: 700;
}

.blog-page #newsletter .form {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.newsletter-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 220px;
}

.newsletter-field input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 999px;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.newsletter-field input.invalid {
    outline: 2px solid var(--ink);
}

.field-error {
    display: none;
    font-size: 12.5px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 999px;
    margin-top: 8px;
    font-family: 'Space Mono', monospace;
    width: fit-content;
}

.field-error.show {
    display: block;
}

.blog-page #newsletter .normal,
#newsletter-submit {
    background: var(--white);
    color: var(--teal-dark);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

#newsletter-submit:hover:not([disabled]) {
    transform: translateY(-2px);
}

#newsletter-submit[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =========================
   TOASTS
========================= */

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    z-index: 9999;
}

.toast {
    font-size: 14px;
    font-weight: 600;
    padding: 13px 18px;
    border-radius: 999px;
    background: #088178;
    color: #fff;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
    animation: toastIn 0.3s ease;
    max-width: 300px;
}

.toast.toast--error {
    background: #e63946;
}

.toast.is-leaving {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 600px) {
    .blog-page #newsletter {
        margin: 44px 6%;
        padding: 30px 22px;
    }

    .blog-page #newsletter .form {
        flex-direction: column;
        align-items: stretch;
    }

    .toast-stack {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .toast { max-width: none; }
}

/* =========================
   DARK MODE
========================= */

body.dark-mode .blog-page {
    --mint: rgba(8, 129, 120, 0.12);
    --ink: #eafaf8;
}

body.dark-mode #blog .blog-box,
body.dark-mode .modal-content,
body.dark-mode #search-input,
body.dark-mode .empty-blog,
body.dark-mode #pagination a {
    background: #0c1a18;
    color: #eafaf8;
}

body.dark-mode #blog .blog-details p,
body.dark-mode #modal-text,
body.dark-mode #modal-date,
body.dark-mode .empty-blog p {
    color: #b7cfcb;
}

body.dark-mode .category,
body.dark-mode .suggestion-category {
    background: rgba(8, 129, 120, 0.2);
    color: #5fd6c8;
}

body.dark-mode #search-input::placeholder {
    color: #7d9c97;
}

body.dark-mode .suggestions-box {
    background: #0c1a18;
    border-color: rgba(8, 129, 120, 0.3);
}

body.dark-mode .suggestion-item:hover {
    background: rgba(8, 129, 120, 0.15);
}

/* ==========================================
   BLOG — DARK MODE FIX
========================================== */

body.dark-mode .blog-page {
    color: #eafaf8;
}

body.dark-mode .blog-page h1,
body.dark-mode .blog-page h2,
body.dark-mode .blog-page h3,
body.dark-mode .blog-page h4,
body.dark-mode .blog-page h5,
body.dark-mode .blog-page p,
body.dark-mode .blog-page span,
body.dark-mode .blog-page label {
    color: #eafaf8;
}

body.dark-mode #blog .blog-box {
    background: #1b1d22;
    border-color: #333;
}

body.dark-mode #blog .blog-details h4 {
    color: #ffffff;
}

body.dark-mode #blog .blog-details p {
    color: #b7cfcb;
}

body.dark-mode .read-time {
    color: #5fd6c8;
}

body.dark-mode .category {
    background: rgba(8,129,120,.2);
    color: #5fd6c8;
}

body.dark-mode .empty-blog {
    background: #1b1d22;
    color: #b7cfcb;
}

body.dark-mode .empty-blog h2 {
    color: #ffffff;
}

body.dark-mode #blog-modal {
    background: rgba(0,0,0,.75);
}

body.dark-mode .modal-content {
    background: #1b1d22;
    color: #eafaf8;
}

body.dark-mode #modal-title {
    color: #ffffff;
}

body.dark-mode #modal-date {
    color: #5fd6c8;
}

body.dark-mode #modal-text {
    color: #b7cfcb;
}

body.dark-mode #close-modal {
    color: #ffffff;
}

body.dark-mode #search-input {
    background: #24262c;
    color: #ffffff;
    border-color: #444;
}

body.dark-mode #search-input::placeholder {
    color: #9ca3af;
}

body.dark-mode #pagination a {
    background: #1b1d22;
    color: #ffffff;
    border-color: #333;
}

/* =========================================================
   BLOG — DARK MODE
========================================================= */

body.dark-mode {
    background: #0f1115;
    color: #eafaf8;
}

/* Main blog page */
body.dark-mode .blog-page {
    background: #0f1115;
    color: #eafaf8;
}

/* Blog headings */
body.dark-mode .blog-page h1,
body.dark-mode .blog-page h2,
body.dark-mode .blog-page h3,
body.dark-mode .blog-page h4,
body.dark-mode .blog-page h5 {
    color: #ffffff;
}

/* Paragraphs */
body.dark-mode .blog-page p {
    color: #cbd8d6;
}

/* Search */
body.dark-mode .blog-page input,
body.dark-mode .blog-page textarea,
body.dark-mode .blog-page select {
    background: #20242b;
    color: #ffffff;
    border-color: #3a414b;
}

body.dark-mode .blog-page input::placeholder {
    color: #8e9997;
}

/* Blog cards */
body.dark-mode .blog-card {
    background: #181b21;
    color: #eafaf8;
    border-color: #2c323a;
}

body.dark-mode .blog-card h3,
body.dark-mode .blog-card h4 {
    color: #ffffff;
}

body.dark-mode .blog-card p {
    color: #cbd8d6;
}

/* Blog metadata */
body.dark-mode .blog-date,
body.dark-mode .blog-category,
body.dark-mode .blog-time {
    color: #9aa8a6;
}

/* Blog links */
body.dark-mode .blog-card a {
    color: #20c7b9;
}

/* Blog content */
body.dark-mode .blog-content {
    color: #eafaf8;
}

body.dark-mode .blog-content p {
    color: #cbd8d6;
}

body.dark-mode .blog-content h2,
body.dark-mode .blog-content h3 {
    color: #ffffff;
}