/*
Theme Name:  deal3dp
Theme URI:   https://deal3dp.com
Description: Custom WordPress theme for deal3dp blog
Author:      Deal3DP
Version:     1.0.0
Text Domain: deal3dp
*/

/* ─── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
    background: #f4f4f4;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    margin: 0 0 1rem;
    font-weight: 700;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

/* ─── CSS Variables ───────────────────────────────────────── */
:root {
    --dp-blue:        #2c7be5;
    --dp-blue-dark:   #1a63c5;
    --dp-green:       #2fb886;
    --dp-border:      #e8e8e8;
    --dp-bg-light:    #f9f9f9;
    --dp-text-muted:  #666;
    --dp-radius:      8px;
    --dp-radius-sm:   5px;
    --dp-content-max: 960px;
    --dp-calc-max:    1280px;
}

/* ─── Layout ──────────────────────────────────────────────── */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding: 2rem 20px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════ */

.dp-header {
    background: #151922;
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky;
    top: 0;
    z-index: 9000;
}

.dp-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.dp-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.dp-header__logo svg {
    width: 48px;
    height: 48px;
}

.dp-header__blog-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: 2px 7px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 4px;
    line-height: 1.4;
}

/* Desktop nav */
.dp-header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.dp-header__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .2s;
}

.dp-header__nav-link:hover {
    color: #fff;
    text-decoration: none;
}

/* Desktop main nav (wp_nav_menu) */
.dp-header__nav .dp-nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dp-header__nav .dp-nav-menu li { margin: 0; }

.dp-header__nav .dp-nav-menu a {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color .2s;
}

.dp-header__nav .dp-nav-menu a:hover,
.dp-header__nav .dp-nav-menu .current-menu-item > a {
    color: #fff;
}

/* ─── Language switcher — shared base ────────────────────── */
ul.dp-header__lang,
ul.dp-footer__lang {
    display: flex !important;
    align-items: center;
    border-radius: 20px;
    padding: 2px !important;
    gap: 2px;
    list-style: none !important;
    margin: 0 !important;
}

ul.dp-header__lang li,
ul.dp-footer__lang li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

ul.dp-header__lang li a,
ul.dp-footer__lang li a {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    transition: background .2s, color .2s;
}

ul.dp-header__lang { background: rgba(255,255,255,.08); }
ul.dp-header__lang li a { color: rgba(255,255,255,.5); }
ul.dp-header__lang li.current-lang a,
ul.dp-header__lang li a:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
}

ul.dp-footer__lang { background: rgba(255,255,255,.06); }
ul.dp-footer__lang li a { color: rgba(255,255,255,.35); }
ul.dp-footer__lang li.current-lang a,
ul.dp-footer__lang li a:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
    text-decoration: none;
}

/* ─── Burger button ───────────────────────────────────────── */
.dp-header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
}

.dp-header__burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,.7);
    border-radius: 1px;
    transition: transform .25s, opacity .25s;
}

.dp-header__burger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.dp-header__burger.is-active span:nth-child(2) { opacity: 0; }
.dp-header__burger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile menu ─────────────────────────────────────────── */
.dp-mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
}

.dp-mobile-menu.is-open { display: block; }

.dp-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.dp-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 100vw);
    height: 100%;
    background: #151922;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s ease;
    overflow-y: auto;
}

.dp-mobile-menu.is-open .dp-mobile-menu__panel {
    transform: translateX(0);
}

.dp-mobile-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 60px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.dp-mobile-menu__close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.6);
    padding: 8px;
    display: flex;
    align-items: center;
    transition: color .2s;
    line-height: 1;
}

.dp-mobile-menu__close:hover { color: #fff; }

.dp-mobile-menu__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-bottom: 24px;
}

.dp-mobile-menu__ext-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: color .2s;
}

.dp-mobile-menu__ext-link:hover { color: #fff; text-decoration: none; }

/* Mobile nav menu */
.dp-mobile-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dp-mobile-nav li { margin: 0; }

.dp-mobile-nav a {
    display: block;
    padding: 16px 20px;
    font-size: 15px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    transition: color .2s;
}

.dp-mobile-nav a:hover,
.dp-mobile-nav .current-menu-item > a { color: #fff; }

.dp-mobile-menu__lang-wrap {
    padding: 16px 20px;
    margin-top: auto;
}

body.dp-menu-open { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */

.dp-footer {
    background: #0f1318;
    border-top: 1px solid rgba(255,255,255,.06);
    margin-top: 4rem;
}

.dp-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 24px 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
}

.dp-footer__brand {
    display: flex;
    flex-direction: column;
}

.dp-footer__logo {
    display: inline-block;
    margin-bottom: .75rem;
    text-decoration: none;
}

.dp-footer__logo svg { width: 56px; height: 56px; }

.dp-footer__tagline {
    font-size: 13px;
    color: rgba(255,255,255,.35);
    line-height: 1.6;
    margin: 0;
}

.dp-footer__col-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    margin-bottom: 1rem;
}

.dp-footer__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.dp-footer__col ul a {
    font-size: 14px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: color .2s;
}

.dp-footer__col ul a:hover { color: #fff; text-decoration: none; }

.dp-footer__bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 24px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,.25);
}

/* ═══════════════════════════════════════════════════════════
   CONTENT — Posts & Pages
═══════════════════════════════════════════════════════════ */

.entry {
    background: #fff;
    border-radius: var(--dp-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.entry-header { margin-bottom: 1.5rem; }

.entry-title {
    font-size: 1.75rem;
    margin: 0 0 .5rem;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

.entry-title a:hover { color: var(--dp-blue); }

.entry-meta {
    font-size: 13px;
    color: var(--dp-text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.entry-content {
    font-size: 1rem;
    line-height: 1.8;
}

.entry-content h2 { font-size: 1.4rem; margin-top: 2rem; }
.entry-content h3 { font-size: 1.2rem; margin-top: 1.5rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.entry-content li { margin-bottom: .4rem; }
.entry-content a { color: var(--dp-blue); }
.entry-content a:hover { color: var(--dp-blue-dark); }
.entry-content img { border-radius: var(--dp-radius-sm); margin: 1rem 0; }
.entry-content blockquote {
    border-left: 3px solid var(--dp-blue);
    margin: 1.5rem 0;
    padding: .75rem 1.25rem;
    background: var(--dp-bg-light);
    border-radius: 0 var(--dp-radius-sm) var(--dp-radius-sm) 0;
    color: var(--dp-text-muted);
}

/* ─── Archive / Blog list ─────────────────────────────────── */
.posts-archive {
    max-width: var(--dp-content-max);
    margin: 0 auto;
}

.post-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    background: #fff;
    border-radius: var(--dp-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s;
}

.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); text-decoration: none; color: inherit; }

.post-card__thumb {
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-card__title {
    font-size: 1.2rem;
    margin: 0 0 .5rem;
    color: #1a1a1a;
}

.post-card__excerpt {
    font-size: .9rem;
    color: var(--dp-text-muted);
    margin: 0 0 .75rem;
}

.post-card__meta {
    font-size: 12px;
    color: var(--dp-text-muted);
}

/* ─── Single post ─────────────────────────────────────────── */
.single-post-wrap {
    max-width: var(--dp-content-max);
    margin: 0 auto;
}

/* ─── Page ────────────────────────────────────────────────── */
.page-wrap {
    max-width: var(--dp-content-max);
    margin: 0 auto;
}

/* ─── 404 ─────────────────────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 4rem 1rem;
}

.error-404 h1 { font-size: 6rem; margin: 0; color: var(--dp-border); }
.error-404 h2 { font-size: 1.5rem; margin: .5rem 0 1rem; }

/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: .5rem;
    justify-content: center;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--dp-radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    background: #fff;
    color: #333;
    border: 1px solid var(--dp-border);
    transition: background .2s, color .2s;
}

.pagination a:hover { background: var(--dp-blue); color: #fff; border-color: var(--dp-blue); }
.pagination .current { background: var(--dp-blue); color: #fff; border-color: var(--dp-blue); }

/* ═══════════════════════════════════════════════════════════
   CALCULATOR CPT
═══════════════════════════════════════════════════════════ */

/* ─── Calculator: iframe wrap ─────────────────────────────── */
.calculator-wrap {
    position: relative;
    width: 100%;
    background: var(--dp-bg-light);
    border-radius: var(--dp-radius);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
}

.calculator-wrap iframe {
    display: block;
    width: 100%;
    height: 780px;
    border: none;
    transition: height .3s ease;
}

.calculator-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--dp-border);
    gap: 8px;
}

.calculator-toolbar .calc-status-badge { margin-right: auto; }

.calc-status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.calc-status-badge--free { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e44; }
.calc-status-badge--beta { background: #f59e0b22; color: #f59e0b; border: 1px solid #f59e0b44; }
.calc-status-badge--pro  { background: #6366f122; color: #6366f1; border: 1px solid #6366f144; }
.calc-status-badge--soon { background: #94a3b822; color: #94a3b8; border: 1px solid #94a3b844; }

.btn-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: var(--dp-blue);
    border: none;
    border-radius: var(--dp-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}

.btn-fullscreen:hover { background: var(--dp-blue-dark); color: #fff; }
.btn-fullscreen svg { flex-shrink: 0; }

.calculator-wrap.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

.calculator-wrap.is-fullscreen iframe { flex: 1; height: auto; }

.btn-close {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    background: #f0f0f0;
    border: none;
    border-radius: var(--dp-radius-sm);
    cursor: pointer;
    transition: background .2s;
}

.btn-close:hover { background: #e0e0e0; }

/* ─── Single Calculator page ──────────────────────────────── */
.calculator-single .entry-header {
    max-width: var(--dp-calc-max);
    margin: 0 auto 1.5rem;
    padding: 2rem;
    background: #fff;
    border-radius: var(--dp-radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.calculator-single .calc-type-label {
    display: block;
    margin-bottom: .5rem;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--dp-blue);
    text-decoration: none;
}

.calculator-single .calc-type-label:hover { color: var(--dp-blue-dark); }
.calculator-single .entry-title { margin-bottom: .5rem; }

.calculator-single .calc-intro {
    color: var(--dp-text-muted);
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.6;
}

.calculator-single .calc-iframe-wrap {
    max-width: var(--dp-calc-max);
    margin: 0 auto 3rem;
}

.calculator-single .entry-content {
    max-width: var(--dp-content-max);
    margin: 0 auto 3rem;
    padding: 2.5rem;
    background: #fff;
    border-radius: var(--dp-radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ─── Archive: /calculators/ ─────────────────────────────── */
.calculators-archive {
    max-width: 1100px;
    margin: 0 auto;
}

.calculators-archive .archive-header { margin-bottom: 2.5rem; }
.calculators-archive .archive-header h1 { margin-bottom: .5rem; }
.calculators-archive .archive-header p { color: var(--dp-text-muted); font-size: 1.05rem; margin: 0; }

.calc-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.calc-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--dp-border);
    border-radius: 10px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
    height: 100%;
}

.calc-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.calc-card__thumbnail {
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.calc-card__thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }

.calc-card__meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.calc-card__type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--dp-blue);
}

.calc-card__badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.calc-card__title { font-size: 1.15rem; margin: 0 0 .5rem; line-height: 1.3; }
.calc-card__excerpt { color: var(--dp-text-muted); font-size: .9rem; margin: 0 0 1rem; flex: 1; line-height: 1.5; }

.calc-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .875rem;
    font-weight: 600;
    color: var(--dp-blue);
    margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE
═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .dp-header__nav { display: none; }
    .dp-header__burger { display: flex; }

    .calculator-wrap iframe { height: 600px; }

    .post-card {
        grid-template-columns: 1fr;
    }

    .dp-footer__inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .dp-footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .site-main { padding: 1rem 16px; }
}

/* ─── Cookie banner ───────────────────────────────────────── */
#dp-cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99997;
    background: #1e2530;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--dp-radius);
    padding: 16px 20px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

#dp-cookie-banner p {
    margin: 0;
    font-size: 13px;
    color: rgba(255,255,255,.7);
    line-height: 1.5;
}

#dp-cookie-banner p a {
    color: var(--dp-blue);
    text-decoration: none;
}

.dp-cookie-banner__buttons {
    display: flex;
    gap: 8px;
}

#dp-cookie-accept {
    flex: 1;
    padding: 8px 16px;
    background: var(--dp-blue);
    color: #fff;
    border: none;
    border-radius: var(--dp-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

#dp-cookie-accept:hover { background: var(--dp-blue-dark); }

#dp-cookie-decline {
    flex: 1;
    padding: 8px 16px;
    background: transparent;
    color: rgba(255,255,255,.5);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--dp-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

#dp-cookie-decline:hover {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.8);
}

@media (max-width: 768px) {
    #dp-cookie-banner {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: 16px;
    }
}