/* Define CSS Variables for Light Theme (default) */
:root {
    --bg-primary: #ffffff; /* FT background color */
    --bg-secondary: #f3f4f6;
    --text-primary: #1a1a1a; /* Dark text for light mode */
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --active-border: #990000; /* FT red */
    --nav-text-active: #1a1a1a;
    --nav-text-inactive: #6b7280;
}

/* Define CSS Variables for Dark Theme */
html.dark {
    --bg-primary: #101a23;
    --bg-secondary: #182634;
    --text-primary: #ffffff;
    --text-secondary: #90adcb;
    --border-color: #314d68;
    --active-border: #0c7ff2;
    --nav-text-active: #ffffff;
    --nav-text-inactive: #90adcb;
}

/* Ensure proper scaling on mobile */
html {
    font-size: 16px; /* Default base size (1rem = 16px) */
    -webkit-text-size-adjust: 100%; /* Prevent iOS shrinking text */
}

/* Body text defaults */
body {
    font-size: 1rem; /* 16px */
    line-height: 1.6; /* More vertical spacing for readability */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Headings: make them larger, similar to time.mk */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: bold;
}

h2 { font-size: 2rem; }      /* ~32px */
h3 { font-size: 1.75rem; }   /* ~28px */
h4 { font-size: 1.5rem; }    /* ~24px */

/* Paragraphs, links, general text */
p, .theme-text-primary, .theme-text-secondary, a {
    font-size: 1rem; /* ~16px base */
}

.small-text, .meta-info, .tags, .theme-text-secondary {
    font-size: 0.9rem; /* ~14px for metadata */
}

/* Responsive font scaling */
@media (min-width: 576px) {
    html { font-size: 17px; }
}
@media (min-width: 768px) {
    html { font-size: 18px; }
}
@media (min-width: 1024px) {
    html { font-size: 19px; }
}

/* Apply variables to elements */
.theme-bg-primary { background-color: var(--bg-primary); }
.theme-bg-secondary { background-color: var(--bg-secondary); }
.theme-text-primary { color: var(--text-primary); }
.theme-text-secondary { color: var(--text-secondary); }
.theme-border-color { border-color: var(--border-color); }
.theme-active-border { border-color: var(--active-border); }
.theme-nav-text-active { color: var(--nav-text-active); }
.theme-nav-text-inactive { color: var(--nav-text-inactive); }

/* Hide scrollbar for overflow-x-auto but allow scrolling */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* General styles */
.max-w-7xl { max-width: 80rem; } /* 1280px */
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }

.border-b { border-bottom-width: 1px; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.rounded-lg { border-radius: 0.5rem; }
.overflow-hidden { overflow: hidden; }

/* Articles grid */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem; /* Tailwind gap-6 */
}
.article-card {
    display: flex;
    flex-direction: column;
    padding: 1rem; /* Increased padding for readability */
}
.article-card img {
    width: 100%;
    height: 200px;
    max-width: 300px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}
.article-card-content { padding-top: 1rem; }
.article-card a { text-decoration: none; }
.hover\:underline:hover { text-decoration: underline; }

.article-card h3 {
    font-size: 1.25rem; /* ~20px */
    line-height: 1.4;
}
.article-card p {
    font-size: 1rem;
    line-height: 1.5;
}
.meta-info {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Article detail */
.article-detail-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
@media (min-width: 1024px) {
    .lg\:flex-row { flex-direction: row; }
    .lg\:gap-8 { gap: 2rem; }
    .lg\:w-3\/4 { width: 75%; }
    .lg\:w-1\/4 { width: 25%; }
    .lg\:mt-0 { margin-top: 0; }
}

/* Weather city buttons */
.weather-city-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border-width: 1px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.weather-city-link.theme-bg-secondary { background-color: var(--bg-secondary); }
.weather-city-link.theme-text-primary { color: var(--text-primary); }
.weather-city-link.theme-border-color { border-color: var(--border-color); }
.weather-city-link:hover { background-color: #e5e7eb; }
html.dark .weather-city-link:hover { background-color: #3b4959; }

/* Iframe container */
.iframe-container {
    width: 100%;
    height: 600px;
    border-width: 1px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    margin-top: 2.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* ---------------------------
   Markdown Content Styling
   --------------------------- */


/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.prose table th,
.prose table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.prose table th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
}

/* Zebra stripes for readability */
.prose table tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}
html.dark .prose table tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Lists */
.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Task lists (GitHub-style checkboxes) */
.prose input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.1);
}
