/**
 * Global Typography System - Kontomistrz
 * Professional Financial Theme Typography
 *
 * Fonts:
 * - Headings: Manrope (modern, professional, excellent readability)
 * - Body: Inter (clean, optimized for screens, financial industry standard)
 */

/* ============================================
   GOOGLE FONTS IMPORT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

/* ============================================
   CSS VARIABLES - Typography
   ============================================ */
:root {
    /* Font Families */
    --font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;

    /* Font Sizes - Desktop */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    --text-4xl: 36px;
    --text-5xl: 48px;
    --text-6xl: 60px;

    /* Line Heights */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.65;
    --leading-loose: 1.8;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;

    /* Text Colors */
    --color-text-primary: #1F2937;
    --color-text-secondary: #4B5563;
    --color-text-muted: #6B7280;
    --color-text-light: #9CA3AF;
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body,
.page {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

/* ============================================
   HEADINGS - Manrope
   ============================================ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
    letter-spacing: var(--tracking-tight);
    margin: 0;
}

h1, .h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    line-height: 1.05;
}

h2, .h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
}

h3, .h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
}

h4, .h4 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-snug);
}

h5, .h5 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    line-height: var(--leading-normal);
}

h6, .h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    line-height: var(--leading-normal);
}

/* ============================================
   PARAGRAPHS & BODY TEXT
   ============================================ */
p {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
    margin: 0 0 16px 0;
}

/* Lead paragraph */
.lead,
p.lead {
    font-size: var(--text-lg);
    line-height: var(--leading-loose);
    color: var(--color-text-secondary);
}

/* Small text */
small,
.text-sm {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
}

.text-xs {
    font-size: var(--text-xs);
    line-height: var(--leading-normal);
}

/* ============================================
   LINKS
   ============================================ */
a {
    font-family: var(--font-body);
    font-weight: var(--font-normal);
    color: #493EFB;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #FFA135;
}

/* ============================================
   LISTS
   ============================================ */
ul, ol {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

li {
    font-weight: var(--font-normal);
    margin-bottom: 8px;
}

/* ============================================
   LABELS & FORM ELEMENTS
   ============================================ */
label {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
}

input,
textarea,
select {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    color: var(--color-text-primary);
}

input::placeholder,
textarea::placeholder {
    font-family: var(--font-body);
    color: var(--color-text-light);
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.btn,
input[type="submit"],
input[type="button"] {
    font-family: var(--font-body);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
}

/* ============================================
   TABLES
   ============================================ */
table {
    font-family: var(--font-body);
    font-size: var(--text-base);
}

th {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

td {
    font-weight: var(--font-normal);
    color: var(--color-text-secondary);
}

/* ============================================
   BLOCKQUOTES
   ============================================ */
blockquote {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    font-style: italic;
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

blockquote cite {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-style: normal;
    font-weight: var(--font-medium);
}

/* ============================================
   CODE
   ============================================ */
code,
pre,
kbd {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

/* ============================================
   SPECIFIC COMPONENTS TYPOGRAPHY
   ============================================ */

/* Hero titles */
.hero__title,
[class*="hero"]__title,
[class*="-hero"]__title {
    font-family: var(--font-heading);
    font-weight: var(--font-extrabold);
    letter-spacing: var(--tracking-tight);
}

/* Section titles */
.section__title,
[class*="section"]__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Card titles */
.card__title,
[class*="card"]__title {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
}

/* Navigation */
.nav,
.menu,
nav a {
    font-family: var(--font-body);
    font-weight: var(--font-medium);
}

/* Breadcrumbs */
.breadcrumbs,
.breadcrumbs-custom {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
}

/* Badges & Tags */
.badge,
.tag {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* Captions */
.caption,
figcaption {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

/* ============================================
   PAGE-SPECIFIC OVERRIDES
   ============================================ */

/* Policy pages */
.policy__title {
    font-family: var(--font-heading);
    font-weight: var(--font-extrabold);
}

.policy__content h2,
.policy__content h3,
.policy__content h4,
.policy__content h5,
.policy__content h6 {
    font-family: var(--font-heading);
}

.policy__content p,
.policy__content li {
    font-family: var(--font-body);
    font-weight: var(--font-normal);
}

/* Contact pages */
.contacts-hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-extrabold);
}

.contacts-hero__text p {
    font-family: var(--font-body);
    font-weight: var(--font-normal);
}

/* About pages */
.about__title,
.about-hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-extrabold);
}

/* Article pages */
.article__title,
.article-hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Ratings/Rankings pages */
.ratings__title,
.ratings-hero__title,
.ranking__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Offer pages */
.offer__title,
.offer-hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Promotions */
.promotions__title,
.promotion__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Banks */
.bank__title,
.bank-hero__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Calculator pages */
.calculator__title,
.kalkulatory__title {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
}

/* Comments */
.article-comment__form label {
    font-family: var(--font-body);
    font-weight: var(--font-semibold);
}

.review-author__name,
.author-name {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
}

.review-content p {
    font-family: var(--font-body);
    font-weight: var(--font-normal);
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
@media (max-width: 1200px) {
    :root {
        --text-5xl: 42px;
        --text-6xl: 52px;
    }
}

@media (max-width: 900px) {
    :root {
        --text-4xl: 32px;
        --text-5xl: 38px;
        --text-6xl: 44px;
    }
}

@media (max-width: 640px) {
    :root {
        --text-3xl: 26px;
        --text-4xl: 28px;
        --text-5xl: 32px;
        --text-6xl: 36px;
    }

    body,
    .page {
        font-size: 15px;
    }

    p {
        font-size: 15px;
    }
}

/* ============================================
   DARK BACKGROUND SECTIONS - Override for hero sections
   ============================================ */
.savings-hero,
.ratings-hero,
.bank-hero,
.offer-hero,
.institutions-hero,
.promo-hero,
.calc-hero,
.articles-hero,
[class*="-hero"][style*="background"] {
    color: #FFFFFF;
}
/* .reviews-hero has its own styles in reviews-hero.css */

.savings-hero *,
.ratings-hero *:not(.ratings-hero__title),
.institutions-hero *:not(.institutions-hero__title),
.promo-hero *:not(.promo-hero__title):not(.promo-hero__featured-card):not(.promo-hero__featured-card *):not([class*="promo-hero__featured"]),
.calc-hero *:not(.calc-hero__title),
.articles-hero *:not(.articles-hero__title-word) {
    color: inherit;
}

/* Hero titles with gradient effects - DO NOT override -webkit-text-fill-color */
/* These titles have their own gradient effects defined in their respective CSS files:
   - .reviews-hero__title (reviews-hero.css) - animated gradient white/orange
   - .institutions-hero__title (ratings-page-design.css) - animated gradient with gold accent
   - .promo-hero__title (promotions-premium.css) - animated gradient gold/pink/purple
   - .calc-hero__title (calculators-premium.css) - animated gradient cyan/green/purple
   - .articles-hero__title-word (articles-premium.css) - animated gradient white/cyan/purple
   - .ratings-hero__title (ratings-page-design.css) - animated gradient white/purple
*/

/* Only .savings-hero__title needs white override (no gradient effect defined) */
.savings-hero__title,
.savings-hero h1 {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
}

/* Text content */
.savings-hero__text,
.savings-hero__text p,
.ratings-hero__text,
.ratings-hero__text p,
.institutions-hero__text,
.institutions-hero__text p,
.promo-hero__text,
.promo-hero__text p,
.calc-hero__text,
.calc-hero__text p,
.articles-hero__desc,
.articles-hero__desc p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.savings-hero p,
.ratings-hero p,
.institutions-hero p,
.promo-hero > .promo-hero__container p,
.promo-hero__main p,
.promo-hero__text p,
.calc-hero p,
.articles-hero p {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================
   FEATURED PROMO CARD - Explicit color overrides
   Light background card needs dark text
   ============================================ */

/* Reset all colors in featured card to visible values */
.promo-hero .promo-hero__featured,
.promo-hero .promo-hero__featured-card,
.promo-hero .promo-hero__featured-card *,
.promo-hero .promo-hero__featured-content,
.promo-hero .promo-hero__featured-content * {
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
}

/* Featured card label - orange badge with white text */
.promo-hero .promo-hero__featured-label,
.promo-hero__featured-label {
    display: inline-flex !important;
    align-items: center !important;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 50px !important;
    width: fit-content !important;
}

/* Featured card title - dark text on white */
.promo-hero .promo-hero__featured-title,
.promo-hero__featured-title,
h3.promo-hero__featured-title {
    font-size: 24px !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    -webkit-text-fill-color: #1e293b !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    background: none !important;
}

.promo-hero__featured-card:hover .promo-hero__featured-title {
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
}

/* Featured card excerpt - gray text */
.promo-hero .promo-hero__featured-excerpt,
.promo-hero__featured-excerpt,
p.promo-hero__featured-excerpt {
    font-size: 15px !important;
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
    line-height: 1.7 !important;
    margin: 0 !important;
    background: none !important;
}

/* Featured card CTA button - white text on purple */
.promo-hero .promo-hero__featured-cta,
.promo-hero__featured-cta,
span.promo-hero__featured-cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 16px 32px !important;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    text-decoration: none !important;
}

.promo-hero__featured-cta svg,
.promo-hero .promo-hero__featured-cta svg {
    color: #ffffff !important;
}

/* Featured badge in card */
.promo-hero .promo-hero__featured-badge,
.promo-hero__featured-badge {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Links - exclude featured card */
.savings-hero a,
.ratings-hero a,
.institutions-hero a,
.promo-hero a:not(.promo-hero__featured-card):not(.promo-hero__featured-cta),
.calc-hero a,
.articles-hero a {
    color: #FFA135 !important;
}

.savings-hero a:hover,
.ratings-hero a:hover,
.institutions-hero a:hover,
.promo-hero a:hover,
.calc-hero a:hover,
.articles-hero a:hover {
    color: #FFFFFF !important;
}

/* Breadcrumbs in dark hero */
.savings-hero .breadcrumbs,
.savings-hero .breadcrumbs a,
.ratings-hero .breadcrumbs,
.ratings-hero .breadcrumbs a,
.institutions-hero .breadcrumbs,
.institutions-hero .breadcrumbs a,
.promo-hero .breadcrumbs,
.promo-hero .breadcrumbs a,
.calc-hero .breadcrumbs,
.calc-hero .breadcrumbs a,
.articles-hero .breadcrumbs,
.articles-hero .breadcrumbs a,
.savings-hero .breadcrumbs-custom,
.savings-hero .breadcrumbs-custom a,
.institutions-hero .km-breadcrumbs,
.institutions-hero .km-breadcrumbs a,
.promo-hero__breadcrumb,
.promo-hero__breadcrumb a,
.calc-hero__breadcrumb,
.calc-hero__breadcrumb a,
.articles-hero__breadcrumb,
.articles-hero__breadcrumb a,
.articles-hero__breadcrumb-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

.savings-hero .breadcrumbs a:hover,
.ratings-hero .breadcrumbs a:hover,
.institutions-hero .breadcrumbs a:hover,
.promo-hero .breadcrumbs a:hover,
.calc-hero .breadcrumbs a:hover,
.articles-hero .breadcrumbs a:hover,
.savings-hero .breadcrumbs-custom a:hover,
.institutions-hero .km-breadcrumbs a:hover,
.promo-hero__breadcrumb a:hover,
.calc-hero__breadcrumb a:hover,
.articles-hero__breadcrumb a:hover,
.articles-hero__breadcrumb-link:hover {
    color: #FFA135 !important;
}

/* Stats in hero */
.savings-hero__stat,
.ratings-hero__stat,
.institutions-hero__stat,
.promo-hero__stat,
.calc-hero__stat,
.articles-hero__stat {
    color: #FFFFFF !important;
}

.savings-hero .stat-number,
.ratings-hero .stat-number,
.institutions-hero .stat-number,
.promo-hero__stat-value,
.calc-hero__stat-value,
.articles-hero__stat-value {
    color: #FFA135 !important;
}

.savings-hero .stat-label,
.ratings-hero .stat-label,
.institutions-hero .stat-label,
.promo-hero__stat-label,
.calc-hero__stat-label,
.articles-hero__stat-label {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Author section in hero */
.savings-hero__author,
.savings-hero__name,
.savings-hero__name a {
    color: #FFFFFF !important;
}

/* Badge in hero */
.promo-hero__badge,
.calc-hero__badge,
.articles-hero__badge {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Breadcrumb separators */
.promo-hero__breadcrumb-sep,
.calc-hero__breadcrumb-sep,
.articles-hero__breadcrumb-sep {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.font-heading {
    font-family: var(--font-heading) !important;
}

.font-body {
    font-family: var(--font-body) !important;
}

.font-mono {
    font-family: var(--font-mono) !important;
}

.text-primary {
    color: var(--color-text-primary) !important;
}

.text-secondary {
    color: var(--color-text-secondary) !important;
}

.text-muted {
    color: var(--color-text-muted) !important;
}

.font-normal {
    font-weight: var(--font-normal) !important;
}

.font-medium {
    font-weight: var(--font-medium) !important;
}

.font-semibold {
    font-weight: var(--font-semibold) !important;
}

.font-bold {
    font-weight: var(--font-bold) !important;
}
