/* Blog Extras — footer nav (global) + related articles (single posts) */
/* Always loaded on frontend pages */

/* ── Site Logo / Header Branding ── */
.site-branding[data-id="logo"] .site-logo-container {
    height: 80px;
}

.site-branding[data-id="logo"] .site-logo-container img.default-logo {
    height: 80px;
    width: auto;
}

.site-branding[data-id="logo"] .site-title {
    font-size: 30px;
    font-weight: 800;
    color: #023E73;
    letter-spacing: -0.01em;
}

@media (max-width: 768px) {
    .site-branding[data-id="logo"] .site-logo-container,
    .site-branding[data-id="logo"] .site-logo-container img.default-logo {
        height: 60px;
    }

    .site-branding[data-id="logo"] .site-title {
        font-size: 24px;
    }
}

:root {
    --stcdb-navy: #023E73;
    --stcdb-ocean: #0077B6;
    --stcdb-teal: #008080;
    --stcdb-sunset: #FF6B35;
    --stcdb-gray-50: #f9fafb;
    --stcdb-gray-100: #f3f4f6;
    --stcdb-gray-200: #e5e7eb;
    --stcdb-gray-400: #9ca3af;
    --stcdb-gray-500: #6b7280;
    --stcdb-gray-900: #111827;
}

/* ── Footer Navigation (global) ── */
.stcdb-footer-nav {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stcdb-footer-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
}

.stcdb-footer-nav a {
    color: inherit;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.75;
    transition: opacity 0.2s;
}

.stcdb-footer-nav a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ── Related Articles Section ── */
.stcdb-related {
    max-width: 100%;
    margin: 48px 0 0;
    padding: 40px 0 0;
    border-top: 1px solid var(--stcdb-gray-200);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.stcdb-related-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--stcdb-navy);
    margin: 0 0 20px;
}

.stcdb-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stcdb-related-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--stcdb-gray-200);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stcdb-related-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stcdb-related-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--stcdb-gray-100);
}

.stcdb-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stcdb-related-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stcdb-related-cat {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--stcdb-ocean);
    margin-bottom: 6px;
}

.stcdb-related-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--stcdb-gray-900);
    line-height: 1.3;
    flex: 1;
}

.stcdb-related-date {
    font-size: 0.75rem;
    color: var(--stcdb-gray-500);
}

/* ── Read Next Banner ── */
.stcdb-read-next {
    margin: 32px 0 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--stcdb-navy), #0a5694);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stcdb-read-next:hover {
    box-shadow: 0 6px 20px rgba(2,62,115,0.3);
    transform: translateY(-2px);
    color: #fff;
}

.stcdb-read-next-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 4px;
}

.stcdb-read-next-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.stcdb-read-next-arrow {
    flex-shrink: 0;
    font-size: 1.5rem;
    opacity: 0.7;
    transition: transform 0.2s;
}

.stcdb-read-next:hover .stcdb-read-next-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* ── Explore Database CTA ── */
.stcdb-blog-cta {
    margin: 32px 0 0;
    padding: 24px;
    background: var(--stcdb-gray-50);
    border: 1px solid var(--stcdb-gray-200);
    border-radius: 10px;
    text-align: center;
}

.stcdb-blog-cta p {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--stcdb-gray-500);
}

.stcdb-blog-cta-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.stcdb-blog-cta-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--stcdb-ocean);
    color: #fff;
    transition: background 0.2s;
}

.stcdb-blog-cta-link:hover {
    background: var(--stcdb-navy);
    color: #fff;
}

.stcdb-blog-cta-link.stcdb-blog-cta-outline {
    background: transparent;
    border: 1px solid var(--stcdb-gray-200);
    color: var(--stcdb-gray-500);
}

.stcdb-blog-cta-link.stcdb-blog-cta-outline:hover {
    border-color: var(--stcdb-ocean);
    color: var(--stcdb-ocean);
    background: transparent;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stcdb-related-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stcdb-read-next {
        padding: 16px 20px;
    }

    .stcdb-read-next-title {
        font-size: 0.95rem;
    }

    .stcdb-blog-cta-links {
        flex-direction: column;
        align-items: center;
    }
}

/* ── Subscribe Form (site-wide) ── */
.stcdb-subscribe-form {
    margin-top: 12px;
}

.stcdb-subscribe-row {
    display: flex;
    gap: 8px;
}

.stcdb-subscribe-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--stcdb-gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    min-width: 0;
}

.stcdb-subscribe-input:focus {
    outline: none;
    border-color: var(--stcdb-ocean);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.15);
}

.stcdb-subscribe-btn {
    padding: 10px 20px;
    background: var(--stcdb-ocean);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.stcdb-subscribe-btn:hover {
    background: var(--stcdb-navy);
}

.stcdb-subscribe-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.stcdb-subscribe-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
}

.stcdb-subscribe-ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.stcdb-subscribe-err {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ── Calculator guide back-links ── */
.stcdb-calc-guide-link {
    text-align: center;
    margin: 1.25rem 0 0;
    font-size: 0.92rem;
}

.stcdb-calc-guide-link a {
    color: var(--stcdb-ocean);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed var(--stcdb-ocean);
    transition: color 0.2s, border-color 0.2s;
}

.stcdb-calc-guide-link a:hover {
    color: var(--stcdb-navy);
    border-color: var(--stcdb-navy);
}

/* ── Site Footer (global) ── */
.stcdb-site-footer {
    background: #023E73;
    color: #fff;
    padding: 48px 0 24px;
}

.stcdb-site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.stcdb-site-footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 36px;
}

.stcdb-site-footer-col h4 {
    color: #FFF1E6;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
}

.stcdb-site-footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 4px 0;
    transition: color 0.2s;
}

.stcdb-site-footer-col a:hover {
    color: #FF6B35;
    text-decoration: none;
}

.stcdb-site-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    text-align: center;
}

.stcdb-site-footer-source {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 12px;
}

.stcdb-site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin-bottom: 12px;
}

.stcdb-site-footer-legal a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.stcdb-site-footer-legal a:hover {
    color: #fff;
    text-decoration: underline;
}

.stcdb-site-footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

@media (max-width: 640px) {
    .stcdb-site-footer-cols {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .stcdb-site-footer {
        padding: 32px 0 20px;
    }
}

/* ── Related Pages Nav (virtual pages cross-linking) ── */
.stcdb-related-pages {
    margin: 32px 0 0;
    padding: 24px;
    background: var(--stcdb-gray-50);
    border: 1px solid var(--stcdb-gray-200);
    border-radius: 10px;
}

.stcdb-related-pages-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--stcdb-gray-500);
    margin: 0 0 12px;
}

.stcdb-related-pages-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stcdb-related-pages-links a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--stcdb-gray-200);
    color: var(--stcdb-ocean);
    transition: border-color 0.2s, background 0.2s;
}

.stcdb-related-pages-links a:hover {
    border-color: var(--stcdb-ocean);
    background: rgba(0, 119, 182, 0.05);
    color: var(--stcdb-navy);
}

@media (max-width: 640px) {
    .stcdb-related-pages-links {
        flex-direction: column;
    }

    .stcdb-related-pages-links a {
        text-align: center;
    }
}

/* ── Tea Temperature Badge ── */
.stcdb-tea-temp {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--stcdb-gray-50);
    border: 1px solid var(--stcdb-gray-200);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stcdb-tea-temp:hover {
    border-color: var(--tea-color, var(--stcdb-gray-400));
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
}

/* "Tea Temp" prefix label */
.stcdb-tea-prefix {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--stcdb-gray-400);
    border-right: 1px solid var(--stcdb-gray-200);
    padding-right: 10px;
    white-space: nowrap;
}

/* Single post: sits between header and content */
.stcdb-tea-temp--single {
    margin: 0 0 24px;
}

.stcdb-tea-thermo {
    display: flex;
    gap: 3px;
    align-items: center;
}

.stcdb-tea-seg {
    display: block;
    width: 16px;
    height: 7px;
    border-radius: 3px;
    background: var(--stcdb-gray-200);
    transition: background 0.3s;
}

.stcdb-tea-seg--filled {
    background: var(--tea-color, #94a3b8);
}

.stcdb-tea-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stcdb-tea-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.stcdb-tea-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--tea-color, var(--stcdb-gray-500));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Numeric score */
.stcdb-tea-score {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--stcdb-gray-400);
    margin-left: 2px;
}

/* Pulse animation for level 5 */
.stcdb-tea-temp--pulse {
    animation: stcdb-tea-pulse 2s ease-in-out infinite;
}

@keyframes stcdb-tea-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50%      { box-shadow: 0 0 8px 2px rgba(220, 38, 38, 0.15); }
}

/* Compact badge for card/listing contexts */
.stcdb-tea-temp--card {
    padding: 4px 10px;
    margin: 0 0 8px;
    gap: 6px;
    border-radius: 16px;
}

.stcdb-tea-temp--card .stcdb-tea-prefix {
    display: none;
}

.stcdb-tea-temp--card .stcdb-tea-seg {
    width: 10px;
    height: 5px;
}

.stcdb-tea-temp--card .stcdb-tea-label {
    font-size: 0.65rem;
}

.stcdb-tea-temp--card .stcdb-tea-icon {
    font-size: 0.8rem;
}

.stcdb-tea-temp--card .stcdb-tea-score {
    display: none;
}

/* ── Print: hide extras ── */
@media print {
    .stcdb-related,
    .stcdb-read-next,
    .stcdb-blog-cta,
    .stcdb-footer-nav,
    .stcdb-site-footer,
    .stcdb-subscribe-form,
    .stcdb-related-pages,
    .stcdb-tea-temp {
        display: none;
    }
}
