/*
Theme Name: FinToolSet
Theme URI: https://fintoolset.com
Author: FinToolSet
Author URI: https://fintoolset.com
Description: A clean, professional financial tools theme with full customizer support, editable sections, and shortcode-ready calculator integration. Built for FinToolSet.
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fintoolset
Tags: financial, calculators, blog, clean, responsive, customizer
*/

/* ============================================================
   CSS VARIABLES (matches original sky-800/sky-600/gray palette)
   ============================================================ */
:root {
    --color-primary:       #0369a1; /* sky-700 */
    --color-primary-dark:  #075985; /* sky-800 */
    --color-primary-light: #0ea5e9; /* sky-500 */
    --color-primary-btn:   #0284c7; /* sky-600 */
    --color-primary-hover: #0369a1; /* sky-700 */
    --color-text:          #374151; /* gray-700 */
    --color-text-muted:    #6b7280; /* gray-500 */
    --color-bg:            #ffffff;
    --color-bg-alt:        #f3f4f6; /* gray-100 */
    --color-border:        #e5e7eb; /* gray-200 */
    --color-shadow:        rgba(0,0,0,0.08);
    --color-footer-bg:     #f1f5f9; /* slate-100 */
    --font-sans:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --radius:              0.5rem;
    --max-width:           1200px;
    --transition:          0.2s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    font-size: 16px;
}

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

a { color: var(--color-primary-btn); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-hover); }

h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary-dark);
    line-height: 1.25;
    font-weight: 700;
}

p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main { flex: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-branding a {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color var(--transition);
}
.site-branding a:hover { color: #bae6fd; }

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}
.main-navigation ul li a {
    color: #e0f2fe;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition);
}
.main-navigation ul li a:hover,
.main-navigation ul li a.current { color: #fff; }

/* Mobile nav toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}
.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: all var(--transition);
}

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-primary-dark);
        padding: 1rem 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .main-navigation.is-open { display: block; }
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }
    .main-navigation ul li a {
        display: block;
        padding: 0.75rem 1.5rem;
    }
    .main-navigation ul li a:hover { background: rgba(255,255,255,0.1); }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    text-align: center;
    padding: 5rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: #fff;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    color: #fff;
    margin-bottom: 1.25rem;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.hero-section p {
    font-size: 1.15rem;
    color: #bae6fd;
    max-width: 560px;
    margin: 0 auto 2rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--color-primary-btn);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2,132,199,0.35);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: #fff;
}

/* ============================================================
   SECTION STYLES
   ============================================================ */
.section-title {
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    text-align: center;
    color: var(--color-primary-dark);
    margin-bottom: 3rem;
}

.section-light { padding: 5rem 0; background: var(--color-bg); }
.section-alt   { padding: 5rem 0; background: var(--color-bg-alt); }

/* ============================================================
   CARD GRID
   ============================================================ */
.card-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 1px 4px var(--color-shadow);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}
.card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.15rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.6rem;
}

.card p {
    color: var(--color-text-muted);
    font-size: 0.93rem;
    flex: 1;
    margin-bottom: 1.25rem;
}

.card .btn { align-self: flex-start; margin-top: auto; }

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.feature-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1.75rem 1.25rem;
    text-align: center;
    box-shadow: 0 1px 4px var(--color-shadow);
    transition: box-shadow var(--transition);
}
.feature-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

.feature-icon {
    font-size: 2.25rem;
    color: var(--color-primary-btn);
    margin-bottom: 0.75rem;
    display: block;
}

.feature-card h3 {
    font-size: 1rem;
    color: var(--color-primary-btn);
    margin-bottom: 0.4rem;
}
.feature-card p { font-size: 0.88rem; color: var(--color-text-muted); margin: 0; }

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
    text-align: center;
    padding: 5rem 1.5rem;
    background: var(--color-bg);
}
.cta-section h2 { margin-bottom: 1rem; }
.cta-section p  { color: var(--color-text-muted); margin-bottom: 1.75rem; max-width: 520px; margin-left: auto; margin-right: auto; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-text);
    padding: 1.75rem 0;
    border-top: 1px solid var(--color-border);
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-copy { font-size: 0.875rem; color: var(--color-text-muted); }

.footer-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-nav a { font-size: 0.875rem; color: var(--color-text); }
.footer-nav a:hover { text-decoration: underline; }

.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
    color: var(--color-text);
    font-size: 1.1rem;
    transition: color var(--transition);
}
.footer-social a:hover { color: var(--color-primary-btn); }
.footer-social svg { width: 20px; height: 20px; fill: currentColor; }

/* ============================================================
   PAGE CONTENT (for standard WP pages)
   ============================================================ */
.page-content { padding: 3rem 0; }
.page-content .entry-title { margin-bottom: 2rem; font-size: 2rem; }
.page-content .entry-content { max-width: 780px; }
.page-content .entry-content h2,
.page-content .entry-content h3 { margin: 1.5rem 0 0.75rem; }
.page-content .entry-content p  { margin-bottom: 1rem; }
.page-content .entry-content ul,
.page-content .entry-content ol { margin-bottom: 1rem; }

/* ============================================================
   BLOG ARCHIVE
   ============================================================ */
.blog-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.blog-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px var(--color-shadow); display: flex; flex-direction: column; transition: box-shadow var(--transition); }
.blog-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.11); }
.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-body .post-date { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.blog-card-body h2 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.blog-card-body h2 a { color: var(--color-primary-dark); }
.blog-card-body h2 a:hover { color: var(--color-primary-btn); }
.blog-card-body p { font-size: 0.9rem; color: var(--color-text-muted); flex: 1; }
.blog-card-footer { padding: 0 1.5rem 1.25rem; }

/* single post */
.single-post { padding: 3rem 0; }
.single-post .post-header { margin-bottom: 2rem; }
.single-post .post-meta { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.single-post .post-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.single-post .post-thumbnail { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; }
.single-post .post-content { max-width: 780px; }
.single-post .post-content p { margin-bottom: 1.1rem; }
.single-post .post-content h2,
.single-post .post-content h3 { margin: 2rem 0 0.75rem; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.content-sidebar-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; padding: 3rem 0; align-items: start; }
@media (max-width: 900px) { .content-sidebar-wrap { grid-template-columns: 1fr; } }

.widget { background: #fff; border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 4px var(--color-shadow); }
.widget-title { font-size: 1rem; color: var(--color-primary-dark); border-bottom: 2px solid var(--color-primary-btn); padding-bottom: 0.5rem; margin-bottom: 1rem; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
    background: var(--color-bg-alt);
    padding: 0.75rem 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}
.breadcrumbs a { color: var(--color-primary-btn); }
.breadcrumbs span + span::before { content: " / "; margin: 0 0.35rem; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; gap: 0.5rem; justify-content: center; padding: 2rem 0; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-text);
    transition: all var(--transition);
}
.pagination a:hover, .pagination .current {
    background: var(--color-primary-btn);
    color: #fff;
    border-color: var(--color-primary-btn);
}

/* ============================================================
   CALCULATOR WRAPPER (used when shortcodes render on WP pages)
   ============================================================ */
.fts-calculator-wrap {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px var(--color-shadow);
    overflow: hidden;
    margin: 1.5rem 0;
}

/* ============================================================
   CUSTOMIZER LIVE PREVIEW helpers
   ============================================================ */
.hero-section,
.site-header,
.btn-primary { transition: background-color 0.15s ease, color 0.15s ease; }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
:focus-visible { outline: 2px solid var(--color-primary-btn); outline-offset: 2px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .site-header, .site-footer, .main-navigation, .menu-toggle { display: none; }
    body { font-size: 12pt; color: #000; }
}
