/* DS Tech Blog - Frontend Styles
   Palette: navy #04090f | blue #1a6ec6 | cyan #38aee0 / #06b6d4
   Fonts: Chakra Petch (headings) | Plus Jakarta Sans (body)
   ---------------------------------------------------------- */

:root {
    --ds-navy:       #04090f;
    --ds-navy-2:     #070e18;
    --ds-navy-3:     #0a1628;
    --ds-border:     #142236;
    --ds-border-2:   #1a3050;
    --ds-blue:       #1a6ec6;
    --ds-blue-dark:  #0d4a8a;
    --ds-cyan:       #38aee0;
    --ds-cyan-2:     #06b6d4;
    --ds-text:       #a0b4c8;
    --ds-text-dim:   #5a7a9a;
    --ds-text-bright:#ddeeff;
    --ds-radius:     8px;
    --ds-radius-sm:  5px;
    --ds-trans:      0.22s ease;
}

/* Scroll progress bar */
#ds-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--ds-blue), var(--ds-cyan));
    z-index: 9999;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.ds-input {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: var(--ds-navy-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-bright);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color var(--ds-trans), box-shadow var(--ds-trans);
    box-sizing: border-box;
}

.ds-input::placeholder { color: var(--ds-text-dim); }
.ds-input:focus {
    border-color: var(--ds-cyan);
    box-shadow: 0 0 0 3px rgba(56, 174, 224, 0.12);
}

.ds-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2338aee0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.ds-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--ds-blue) 0%, var(--ds-blue-dark) 100%);
    color: #fff;
    border: none;
    border-radius: var(--ds-radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity var(--ds-trans), box-shadow var(--ds-trans);
    white-space: nowrap;
}

.ds-btn:hover { opacity: 0.88; text-decoration: none; }
.ds-btn:active { opacity: 0.75; }

.ds-btn-glow:hover {
    box-shadow: 0 0 18px rgba(26, 110, 198, 0.5);
}

.ds-btn-sm {
    padding: 9px 18px;
    font-size: 13px;
}

.ds-btn-icon {
    padding: 11px 14px;
}

.ds-btn-ghost {
    background: transparent;
    border: 1px solid var(--ds-border);
    color: var(--ds-text-dim);
}

.ds-btn-ghost:hover {
    border-color: var(--ds-cyan);
    color: var(--ds-cyan);
}

/* =========================================================
   SUBSCRIBE BOX
   ========================================================= */
.ds-subscribe-box {
    background: linear-gradient(135deg, var(--ds-navy-3) 0%, var(--ds-navy-2) 100%);
    border: 1px solid var(--ds-border);
    border-top: 2px solid var(--ds-blue);
    border-radius: var(--ds-radius);
    padding: 40px 36px;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.ds-subscribe-icon {
    width: 56px;
    height: 56px;
    background: rgba(26, 110, 198, 0.15);
    border: 1px solid rgba(26, 110, 198, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--ds-cyan);
}

.ds-subscribe-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--ds-text-bright);
    margin: 0 0 10px;
    letter-spacing: 0.5px;
}

.ds-subscribe-desc {
    color: var(--ds-text-dim);
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 24px;
}

.ds-sub-form-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ds-sub-form-fields .ds-btn {
    width: 100%;
    justify-content: center;
}

.ds-form-msg {
    font-size: 13px;
    margin: 4px 0 0;
    min-height: 18px;
}

.ds-form-msg.ds-msg-ok    { color: #4ade80; }
.ds-form-msg.ds-msg-error { color: #f87171; }

/* =========================================================
   POST META BAR
   ========================================================= */
.ds-post-meta-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0 18px;
    border-bottom: 1px solid var(--ds-border);
    margin-bottom: 28px;
    font-size: 13px;
    color: var(--ds-text-dim);
}

.ds-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ds-meta-sep {
    color: var(--ds-border-2);
    font-size: 10px;
}

/* =========================================================
   SOCIAL SHARING
   ========================================================= */
.ds-social-share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px 0;
    margin: 28px 0;
    border-top: 1px solid var(--ds-border);
    border-bottom: 1px solid var(--ds-border);
}

.ds-share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 4px;
}

.ds-share-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ds-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--ds-radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--ds-trans);
    border: 1px solid var(--ds-border);
    color: var(--ds-text);
    background: var(--ds-navy-2);
}

.ds-share-btn:hover { text-decoration: none; }

.ds-share-li:hover { border-color: #0077b5; color: #0077b5; background: rgba(0, 119, 181, 0.1); }
.ds-share-tw:hover { border-color: #1da1f2; color: #1da1f2; background: rgba(29, 161, 242, 0.1); }
.ds-share-fb:hover { border-color: #1877f2; color: #1877f2; background: rgba(24, 119, 242, 0.1); }

/* =========================================================
   STAR RATINGS
   ========================================================= */
.ds-rating-block {
    padding: 24px 0;
    margin: 0 0 28px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-stars {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.ds-star {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform var(--ds-trans), color var(--ds-trans);
    line-height: 0;
}

.ds-star:hover { transform: scale(1.15); }
.ds-star-filled { color: #f59e0b; }
.ds-star-empty  { color: var(--ds-border-2); }

.ds-star:hover,
.ds-star:hover ~ .ds-star { color: #f59e0b; }

.ds-rating-summary {
    font-size: 13px;
    color: var(--ds-text-dim);
    margin: 0 0 6px;
}

.ds-rating-summary .ds-avg {
    font-size: 15px;
    font-weight: 700;
    color: #f59e0b;
}

.ds-rating-msg {
    font-size: 13px;
    margin: 4px 0 0;
    min-height: 18px;
    color: var(--ds-cyan);
}

/* =========================================================
   RELATED POSTS
   ========================================================= */
.ds-related-posts {
    margin: 36px 0 0;
    padding-top: 28px;
    border-top: 1px solid var(--ds-border);
}

.ds-related-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--ds-text-bright);
    margin: 0 0 20px;
    letter-spacing: 0.5px;
}

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

@media (max-width: 767px) {
    .ds-related-grid { grid-template-columns: 1fr; }
}

.ds-related-card {
    display: block;
    background: var(--ds-navy-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    overflow: hidden;
    text-decoration: none;
    transition: border-color var(--ds-trans), transform var(--ds-trans), box-shadow var(--ds-trans);
}

.ds-related-card:hover {
    border-color: var(--ds-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 110, 198, 0.2);
    text-decoration: none;
}

.ds-related-thumb {
    width: 100%;
    height: 130px;
    background-size: cover;
    background-position: center;
}

.ds-related-nothumb {
    background: var(--ds-navy-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-related-info {
    padding: 14px;
}

.ds-related-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ds-cyan);
    margin-bottom: 6px;
}

.ds-related-info h4 {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-text-bright);
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-related-date {
    font-size: 11px;
    color: var(--ds-text-dim);
}

/* =========================================================
   SEARCH BAR
   ========================================================= */
.ds-search-bar {
    display: flex;
    gap: 8px;
    max-width: 600px;
}

.ds-search-input { flex: 1; }

/* =========================================================
   NEWSLETTER ARCHIVE
   ========================================================= */
.ds-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
}

.ds-archive-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--ds-navy-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
}

.ds-filter-group { display: flex; flex: 1; min-width: 140px; }
.ds-filter-group .ds-input  { flex: 1; }
.ds-filter-group .ds-select { flex: 1; }

.ds-arch-search { max-width: 260px; flex: 2; }

.ds-filter-summary {
    font-size: 13px;
    color: var(--ds-text-dim);
    margin: 0 0 20px;
}

.ds-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .ds-archive-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
    .ds-archive-grid    { grid-template-columns: 1fr; }
    .ds-archive-filters { flex-direction: column; }
    .ds-filter-group    { min-width: 100%; }
}

.ds-archive-card {
    background: var(--ds-navy-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--ds-trans), transform var(--ds-trans), box-shadow var(--ds-trans);
}

.ds-archive-card:hover {
    border-color: var(--ds-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(26, 110, 198, 0.18);
}

.ds-arch-thumb-link { display: block; }

.ds-arch-thumb {
    width: 100%;
    height: 170px;
    background-size: cover;
    background-position: center;
}

.ds-arch-nothumb {
    background: var(--ds-navy-3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ds-arch-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ds-arch-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ds-arch-cat {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ds-cyan);
}

.ds-arch-date {
    font-size: 11px;
    color: var(--ds-text-dim);
}

.ds-arch-title {
    font-family: 'Chakra Petch', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;
    flex: 1;
}

.ds-arch-title a {
    color: var(--ds-text-bright);
    text-decoration: none;
    transition: color var(--ds-trans);
}

.ds-arch-title a:hover { color: var(--ds-cyan); }

.ds-arch-excerpt {
    font-size: 13px;
    color: var(--ds-text);
    line-height: 1.6;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-arch-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    font-size: 11px;
    color: var(--ds-text-dim);
    border-top: 1px solid var(--ds-border);
    padding-top: 10px;
}

.ds-arch-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ds-arch-read {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-cyan);
    text-decoration: none;
    transition: opacity var(--ds-trans);
}

.ds-arch-read:hover { opacity: 0.75; text-decoration: none; }

.ds-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ds-text-dim);
    padding: 48px 20px;
    font-size: 15px;
}

/* =========================================================
   PAGINATION
   ========================================================= */
.ds-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 36px;
}

.ds-pagination .page-numbers,
nav.ds-pagination a,
nav.ds-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--ds-navy-2);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--ds-trans);
}

.ds-pagination .page-numbers:hover,
nav.ds-pagination a:hover { border-color: var(--ds-cyan); color: var(--ds-cyan); text-decoration: none; }

.ds-pagination .current,
nav.ds-pagination .current {
    background: var(--ds-blue);
    border-color: var(--ds-blue);
    color: #fff;
    font-weight: 700;
}

/* WordPress native pagination (when shortcode generates it) */
.ds-archive-wrap .page-numbers { 
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px;
    background: var(--ds-navy-2); border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm); color: var(--ds-text);
    text-decoration: none; font-size: 13px; transition: all var(--ds-trans);
    margin: 0 3px;
}
.ds-archive-wrap .page-numbers:hover { border-color: var(--ds-cyan); color: var(--ds-cyan); }
.ds-archive-wrap .page-numbers.current { background: var(--ds-blue); border-color: var(--ds-blue); color: #fff; }

/* =========================================================
   SOURCE ATTRIBUTION (auto-generated posts)
   ========================================================= */
.ds-source-credit {
    font-size: 13px;
    color: var(--ds-text-dim);
    border-left: 2px solid var(--ds-blue);
    padding: 8px 0 8px 14px;
    margin: 28px 0 0;
    font-style: italic;
}
.ds-source-credit a { color: var(--ds-cyan); text-decoration: none; }
.ds-source-credit a:hover { text-decoration: underline; }

/* =========================================================
   COMMENTS — dark theme to match portfolio
   Removes the default white background on the comment area,
   form, and inputs.
   ========================================================= */
.comments-area,
.comment-respond,
#respond {
    background: transparent !important;
    color: var(--ds-text);
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--ds-border);
}

.comments-title,
.comment-reply-title {
    font-family: 'Chakra Petch', sans-serif !important;
    color: var(--ds-text-bright) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    margin-bottom: 20px !important;
}

.comment-list {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
}

.comment-list li {
    list-style: none;
}

.comment-body {
    background: var(--ds-navy-2) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius) !important;
    padding: 18px 20px !important;
    margin-bottom: 14px !important;
    color: var(--ds-text) !important;
}

.comment-list .children {
    list-style: none;
    margin-left: 24px;
    padding-left: 0;
}

.comment-author .fn,
.comment-author b {
    color: var(--ds-text-bright) !important;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
}

.comment-author .says { display: none; }

.comment-metadata,
.comment-metadata a {
    color: var(--ds-text-dim) !important;
    font-size: 12px !important;
    text-decoration: none;
}

.comment-content,
.comment-content p {
    color: var(--ds-text) !important;
    font-size: 14px;
    line-height: 1.7;
}

.comment-awaiting-moderation {
    color: var(--ds-cyan) !important;
    font-size: 12px;
    font-style: italic;
}

.reply .comment-reply-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 14px;
    background: rgba(26, 110, 198, 0.12);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    color: var(--ds-cyan) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ds-trans);
}
.reply .comment-reply-link:hover {
    border-color: var(--ds-cyan);
    background: rgba(26, 110, 198, 0.2);
}

/* Comment form */
.comment-form,
.comment-respond {
    color: var(--ds-text);
}

.comment-notes,
.logged-in-as,
.logged-in-as a {
    color: var(--ds-text-dim) !important;
    font-size: 13px;
}

.comment-form label {
    color: var(--ds-text) !important;
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea,
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
    width: 100%;
    background: var(--ds-navy-2) !important;
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius-sm) !important;
    color: var(--ds-text-bright) !important;
    padding: 11px 14px !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 14px;
    transition: border-color var(--ds-trans), box-shadow var(--ds-trans);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--ds-text-dim) !important;
}

.comment-form input:focus,
.comment-form textarea:focus,
#respond input:focus,
#respond textarea:focus {
    outline: none;
    border-color: var(--ds-cyan) !important;
    box-shadow: 0 0 0 3px rgba(56, 174, 224, 0.12) !important;
}

.comment-form .form-submit .submit,
#respond .form-submit .submit {
    display: inline-flex;
    align-items: center;
    padding: 11px 26px !important;
    background: linear-gradient(135deg, var(--ds-blue) 0%, var(--ds-blue-dark) 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--ds-radius-sm) !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: opacity var(--ds-trans), box-shadow var(--ds-trans);
    text-transform: none !important;
}
.comment-form .form-submit .submit:hover,
#respond .form-submit .submit:hover {
    opacity: 0.9;
    box-shadow: 0 0 18px rgba(26, 110, 198, 0.5);
}

.comment-form-cookies-consent label,
.comment-form-cookies-consent {
    color: var(--ds-text-dim) !important;
    font-size: 12px;
}

/* Pagination for comments */
.comment-navigation a,
.comments-pagination a {
    color: var(--ds-cyan) !important;
    text-decoration: none;
}

/* No-comments / closed message */
.no-comments,
.comments-area .nocomments {
    color: var(--ds-text-dim) !important;
    font-size: 13px;
}

/* ---- v3.0.0: ad containers ---- */
.ds-ad {
    margin: 28px 0;
    text-align: center;
    min-height: 1px;
}
.ds-ad-inarticle { clear: both; }
.ds-ad ins { display: block; }
.ds-ad::before {
    content: "Advertisement";
    display: block;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9fb6cc;
    opacity: 0.7;
    margin-bottom: 6px;
}
