/* FinancePebble Custom Theme - Option C: Premium Magazine Style with Dark Mode */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ============================================
   DARK MODE VARIABLES & TOGGLE
   ============================================ */
:root {
  --bg-primary: #fafafa;
  --bg-secondary: white;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --border-color: #e5e7eb;
  --shadow-color: rgba(0,0,0,0.08);
  --card-bg: white;
  --input-bg: white;
  --input-border: #e5e7eb;
}

[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #e5e5e5;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --border-color: #404040;
  --shadow-color: rgba(0,0,0,0.3);
  --card-bg: #2d2d2d;
  --input-bg: #3d3d3d;
  --input-border: #505050;
}

/* Dark Mode Toggle Button in Header */
.dark-mode-toggle-header {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.dark-mode-toggle-header:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.dark-mode-toggle-header:active {
  transform: scale(0.95);
}

[data-theme="dark"] .dark-mode-toggle-header {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .dark-mode-toggle-header:hover {
  background: rgba(251, 191, 36, 0.3);
  border-color: rgba(251, 191, 36, 0.5);
}

/* ============================================
   GLOBAL OVERRIDES
   ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}

/* ============================================
   HEADER WITH GRADIENT BACKGROUND
   ============================================ */
.site-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    border-top: none;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    padding: 0;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.site-header .wrapper {
    max-width: 1200px;
    padding: 2.5rem 2rem 2rem;
    position: relative;
    z-index: 2;
}

/* Site Title - Elegant Serif */
.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 800;
    color: white !important;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.site-title:hover {
    text-decoration: none;
    opacity: 0.95;
}

/* Tagline */
.site-tagline {
    color: rgba(255,255,255,0.95);
    font-size: 1.1rem;
    font-weight: 300;
    display: block;
    margin-top: 0.5rem;
}

/* ============================================
   NAVIGATION - FORCE VISIBLE
   ============================================ */
.site-nav {
    background: var(--card-bg);
    box-shadow: 0 2px 12px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    line-height: normal;
    margin-top: 2rem;
    transition: background-color 0.3s;
}

/* CRITICAL: Force navigation to always show */
.site-nav .nav-trigger {
    display: none !important;
}

.site-nav label[for="nav-trigger"] {
    display: none !important;
}

.site-nav .trigger {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    clip: auto !important;
    clip-path: none !important;
    gap: 0;
    flex-wrap: wrap;
}

.site-nav .page-link {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 1.25rem 1.5rem;
    color: var(--text-primary) !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.site-nav .page-link:hover {
    color: #1e40af !important;
    border-bottom-color: #1e40af;
    text-decoration: none;
    background: rgba(30, 64, 175, 0.05);
}

/* Override any Jekyll/Minima theme defaults that might hide nav */
@media screen {
    .site-nav .trigger {
        display: flex !important;
        clear: none !important;
    }
}

@media screen and (min-width: 600px) {
    .site-nav .trigger {
        display: flex !important;
    }
    
    .site-nav label[for="nav-trigger"] {
        display: none !important;
    }
    
    .site-nav .menu-icon {
        display: none !important;
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.page-content {
    padding: 4rem 0;
    background: var(--bg-primary);
    transition: background-color 0.3s;
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 4rem 3rem;
    margin-bottom: 4rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    text-align: center;
    transition: background-color 0.3s;
}

.hero-section h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   PORTAL CARDS - MAGAZINE STYLE
   ============================================ */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.portal-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.portal-card:hover {
    box-shadow: 0 8px 30px var(--shadow-color);
    transform: translateY(-6px);
    text-decoration: none;
}

.portal-icon {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

/* Gradient variations */
.portal-card:nth-child(1) .portal-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.portal-card:nth-child(2) .portal-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.portal-card:nth-child(3) .portal-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.portal-card:nth-child(4) .portal-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.portal-card:nth-child(5) .portal-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.portal-card:nth-child(6) .portal-icon {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.portal-card:nth-child(7) .portal-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.portal-card-content {
    padding: 2rem;
}

.portal-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.portal-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.2rem;
    margin: 3rem 0 1.5rem;
}

h3 {
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
}

.post-title,
.page-heading {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4rem 0 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 2.5rem;
    margin: 0;
}

.view-all {
    color: #1e40af;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.view-all:hover {
    gap: 0.75rem;
}

/* ============================================
   POST LIST
   ============================================ */
.post-list {
    list-style: none;
    margin-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.post-list > li {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px var(--shadow-color);
    transition: all 0.3s;
}

.post-list > li:hover {
    box-shadow: 0 8px 24px var(--shadow-color);
    transform: translateY(-4px);
}

.post-list-content {
    padding: 2rem;
}

.post-link {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    display: block;
    margin-bottom: 0.75rem;
}

.post-link:hover {
    color: #1e40af;
    text-decoration: none;
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    background: #eff6ff;
    color: #1e40af;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .category-badge {
    background: rgba(30, 64, 175, 0.2);
    color: #60a5fa;
}

/* ============================================
   INFO BOXES
   ============================================ */
.info-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-left: 4px solid #1e40af;
    padding: 2rem;
    border-radius: 12px;
    margin: 3rem 0;
    box-shadow: 0 2px 8px var(--shadow-color);
}

[data-theme="dark"] .info-box {
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.2), rgba(30, 64, 175, 0.1));
}

.info-box h3 {
    margin-top: 0;
    color: #1e40af;
}

[data-theme="dark"] .info-box h3 {
    color: #60a5fa;
}

/* ============================================
   NEWSLETTER CTA
   ============================================ */
.newsletter-cta {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin: 4rem 0;
    border-radius: 20px;
}

.newsletter-cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.newsletter-cta p {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2.5rem;
    background: white;
    color: #1e40af;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255,255,255,0.3);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn,
button[type="submit"] {
    background: #1e40af;
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
    font-size: 1rem;
}

.btn:hover,
button[type="submit"]:hover {
    background: #1e3a8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.3);
    text-decoration: none;
    color: white;
}

/* ============================================
   FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="number"],
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
    background: var(--input-bg);
    color: var(--text-primary);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ============================================
   TABLES
   ============================================ */
table {
    border-collapse: collapse;
    width: 100%;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
    box-shadow: 0 2px 8px var(--shadow-color);
}

th {
    background: #1e40af;
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: var(--bg-primary);
}

/* ============================================
   CODE BLOCKS
   ============================================ */
code {
    background: #1a2332;
    color: #22d3ee;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.9em;
}

pre {
    background: #1a2332;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2rem 0;
}

pre code {
    background: none;
    padding: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #1a1a1a;
    color: white;
    padding: 3rem 0;
    margin-top: 5rem;
}

.site-footer .wrapper {
    max-width: 1200px;
}

.site-footer h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: white;
}

.site-footer a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: white;
}

.footer-col-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-col {
    margin-bottom: 0;
}

.footer-col h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 968px) {
    .site-title {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .portal-grid {
        grid-template-columns: 1fr;
    }
    
    .post-list {
        grid-template-columns: 1fr;
    }
    
    .footer-col-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .wrapper {
        padding: 0 1rem;
    }
    
    .page-content {
        padding: 2rem 0;
    }
    
    .dark-mode-toggle-header {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Still force nav to show on mobile */
    .site-nav .trigger {
        display: flex !important;
        flex-direction: column;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 3rem;
}

.mb-4 {
    margin-bottom: 3rem;
}
