/*
Theme Name: CalcGiant
Theme URI: https://calcgiant.com
Author: CalcGiant
Description: 15 free high-precision calculators. Dark professional theme.
Version: 4.0
License: GNU General Public License v2 or later
Text Domain: calcgiant
*/

:root {
    --bg: #1C1F26;
    --surface: #252A36;
    --card: #2A2F3E;
    --card-hover: #2F3547;
    --border: #333B52;
    --border-active: #3A4460;
    --chrome: #171A21;
    --blue: #4B8EF8;
    --blue-s: rgba(75,142,248,0.1);
    --blue-g: rgba(75,142,248,0.18);
    --emerald: #2DD4A0;
    --amber: #F6BE45;
    --purple: #9B7AFA;
    --rose: #F06B8A;
    --muted: #4A5568;
    --text: #E8EDF5;
    --soft: #8492A6;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Satoshi', 'DM Sans', system-ui, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    line-height: 1.5; 
    overflow-x: hidden; 
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
img { max-width: 100%; height: auto; }

/* ── WORDPRESS ALIGNMENT ── */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }

/* ── FRONT PAGE STYLES ── */
.hero {
    text-align: center;
    padding: 80px 24px 60px;
    background: linear-gradient(180deg, var(--chrome) 0%, var(--bg) 100%);
}
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--soft);
    margin-bottom: 24px;
}
.pill-live {
    background: var(--emerald);
    color: #000;
    padding: 3px 10px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
}
.pill-dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.hero h1 {
    font-family: 'Cabinet Grotesk', 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: clamp(38px, 7vw, 72px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}
.hero h1 span {
    display: block;
    background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 18px;
    color: var(--soft);
    margin-bottom: 36px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hero-search-wrap {
    max-width: 540px;
    margin: 0 auto;
    position: relative;
}
.hero-search-ico {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--muted);
    pointer-events: none;
}
.hero-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 100px 16px 52px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-s);
}
.hero-search::placeholder { color: var(--muted); }
.hero-kbd {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--chrome);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    pointer-events: none;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 24px 40px;
    max-width: 900px;
    margin: 0 auto;
}
.fp {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--soft);
    cursor: pointer;
    transition: all .15s;
}
.fp:hover { background: var(--card); color: var(--text); }
.fp.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.section-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 60px;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.section-header h2 {
    font-family: 'Cabinet Grotesk', system-ui, sans-serif;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
}
.badge-new {
    background: linear-gradient(135deg, var(--amber) 0%, var(--rose) 100%);
    color: #000;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
}
.header-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}
.bento-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all .2s;
    position: relative;
    overflow: hidden;
}
.bento-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-active);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.bento-card.hidden { display: none; }

.card-1 { grid-column: span 8; }
.card-2 { grid-column: span 4; }
.card-3 { grid-column: span 5; }
.card-4 { grid-column: span 4; }
.card-5 { grid-column: span 3; }

@media (max-width: 1024px) {
    .card-1, .card-2, .card-3, .card-4, .card-5 { grid-column: span 12; }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .card-1, .card-2 { grid-column: span 6; }
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}
.card-emoji {
    font-size: 32px;
    line-height: 1;
}
.tag-badges {
    display: flex;
    gap: 6px;
}
.tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tag.new {
    background: var(--emerald);
    color: #000;
}
.tag.hot {
    background: linear-gradient(135deg, var(--amber), var(--rose));
    color: #000;
}

.tool-name {
    font-family: 'Cabinet Grotesk', system-ui, sans-serif;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 8px;
}
.tool-desc {
    color: var(--soft);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.teaser-box {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}
.teaser-box span {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    font-family: 'Cabinet Grotesk', monospace;
}
.teaser-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.usage-ctr {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 14px;
}
.usage-ctr .ctr {
    font-weight: 700;
    color: var(--text);
}

.cta {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    color: #000;
}
.cta.blue { background: var(--blue); }
.cta.amber { background: var(--amber); }
.cta.purple { background: var(--purple); }
.cta.emerald { background: var(--emerald); }
.cta.rose { background: var(--rose); }

/* Utility Grid */
.utility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.utility-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all .2s;
    position: relative;
}
.utility-card:hover {
    background: var(--card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}
.utility-card.hidden { display: none; }

.popular-badge {
    position: absolute;
    top: -8px;
    right: 16px;
    background: linear-gradient(135deg, var(--amber), var(--rose));
    color: #000;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.utility-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.utility-content {
    flex: 1;
}
.utility-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    line-height: 1.3;
}
.utility-desc {
    color: var(--soft);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}
.utility-usage {
    font-size: 11px;
    color: var(--muted);
}
.utility-usage .ctr {
    font-weight: 700;
    color: var(--text);
}
.utility-arrow {
    color: var(--muted);
    font-size: 18px;
    transition: transform .2s;
}
.utility-card:hover .utility-arrow {
    transform: translateX(4px);
}

.no-results {
    display: none;
    text-align: center;
    padding: 60px 24px;
    color: var(--muted);
}

/* ── PAGE & POST CONTENT ── */
.page-wrap, .post-wrap {
    max-width: 840px;
    margin: 0 auto;
    padding: 60px 24px;
}
.page-content h1, .post-content h1 {
    font-family: 'Cabinet Grotesk', system-ui, sans-serif;
    font-size: 42px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
}
.page-content p, .post-content p {
    margin-bottom: 20px;
    line-height: 1.7;
    color: var(--soft);
}
.page-content h2, .post-content h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 36px 0 16px;
}
.page-content ul, .post-content ul {
    margin: 16px 0;
    padding-left: 24px;
}
.page-content li, .post-content li {
    margin-bottom: 8px;
    color: var(--soft);
}
.post-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

/* ── TOOL PAGE WRAPPER ── */
.tool-page-wrap {
    min-height: 60vh;
}

/* ── 404 ERROR ── */
.error-404 {
    max-width: 600px;
    margin: 0 auto;
    padding: 120px 24px;
    text-align: center;
}
.error-404 h1 {
    font-family: 'Cabinet Grotesk', system-ui, sans-serif;
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 16px;
}
.error-404 p {
    color: var(--soft);
    font-size: 18px;
    margin-bottom: 32px;
}
.error-404 a {
    display: inline-block;
    background: var(--blue);
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 700;
    transition: transform .2s;
}
.error-404 a:hover {
    transform: translateY(-2px);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .hero { padding: 60px 20px 40px; }
    .hero h1 { font-size: 36px; }
    .section-wrap { padding: 0 20px 40px; }
    .utility-grid { grid-template-columns: 1fr; }
}
