/* Medium-Style UI Design for HuxBlog */

/* ===== MEDIUM TYPOGRAPHY SYSTEM ===== */

/* Medium's typography is built on a 21px base font size with careful line height ratios */
body {
  font-family: "Charter", "Georgia", "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.58;
  color: #292929;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Medium's signature heading hierarchy */
h1 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  color: #292929;
  margin: 56px 0 24px 0;
  letter-spacing: -0.02em;
}

h2 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: #292929;
  margin: 48px 0 20px 0;
  letter-spacing: -0.02em;
}

h3 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #292929;
  margin: 40px 0 16px 0;
  letter-spacing: -0.01em;
}

h4 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #292929;
  margin: 32px 0 12px 0;
}

h5, h6 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #292929;
  margin: 24px 0 8px 0;
}

/* Medium paragraph styling */
p {
  margin: 0 0 24px 0;
  color: #292929;
  font-size: 21px;
  line-height: 1.58;
}

/* ===== MEDIUM COLOR SCHEME ===== */

:root {
  --medium-green: #1a8917;
  --medium-green-hover: #156512;
  --medium-black: #292929;
  --medium-gray-900: #292929;
  --medium-gray-700: #3c4043;
  --medium-gray-600: #5f6368;
  --medium-gray-500: #8e918f;
  --medium-gray-400: #b3b3b3;
  --medium-gray-300: #dadce0;
  --medium-gray-200: #e8eaed;
  --medium-gray-100: #f1f3f4;
  --medium-gray-50: #f8f9fa;
  --medium-white: #ffffff;
  --medium-border: rgba(41, 41, 41, 0.13);
}

/* ===== MEDIUM NAVIGATION IMPROVEMENTS ===== */

/* Fix navbar visibility on white backgrounds */
.navbar-custom .navbar-brand {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  color: var(--medium-black) !important;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus {
  color: var(--medium-gray-700) !important;
}

.navbar-custom .nav li a {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--medium-gray-600) !important;
}

.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
  color: var(--medium-black) !important;
}

/* Ensure toggle button is visible */
.navbar-custom .navbar-toggle .icon-bar {
  background-color: var(--medium-black) !important;
}

/* Override any white text from original theme */
@media only screen and (min-width: 768px) {
  .navbar-custom .navbar-brand {
    color: var(--medium-black) !important;
  }

  .navbar-custom .nav li a {
    color: var(--medium-gray-600) !important;
  }

  .navbar-custom .nav li a:hover,
  .navbar-custom .nav li a:focus {
    color: var(--medium-black) !important;
  }
}

/* ===== MEDIUM HEADER/INTRO SECTION ===== */

.intro-header {
  background: var(--medium-white);
  padding: 120px 0 80px 0;
  margin-bottom: 0;
  border-bottom: none;
}

.intro-header .site-heading {
  text-align: center;
  padding: 0;
}

.intro-header .site-heading h1 {
  font-size: 60px;
  font-weight: 700;
  color: var(--medium-black);
  margin: 0 0 16px 0;
  line-height: 1.1;
}

.intro-header .site-heading .subheading {
  font-family: "Charter", Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--medium-gray-600);
  line-height: 1.4;
  margin: 0;
  font-style: italic;
}

/* ===== MEDIUM ARTICLE CARDS ===== */

.post-preview > a {
  color: inherit;
  text-decoration: none;
}

.post-preview > a:hover {
  text-decoration: none;
  color: inherit;
}

.post-title {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--medium-black);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
}

.post-preview > a:hover .post-title {
  color: var(--medium-gray-700);
}

.post-subtitle {
  font-family: "Charter", Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--medium-gray-600);
  margin: 0 0 16px 0;
}

.post-meta {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--medium-gray-500);
  font-style: normal;
  margin: 0;
}

/* Style HR between posts */
hr {
  border: none;
  border-top: 1px solid var(--medium-gray-200);
  margin: 48px 0;
}

/* ===== MEDIUM CONTAINER & LAYOUT ===== */

/* Don't override container styles - let Bootstrap handle layout */

/* ===== MEDIUM PAGINATION ===== */

.pager {
  margin: 80px 0;
  padding: 0;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pager li > a,
.pager li > span {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--medium-green);
  background: none;
  border: 1px solid var(--medium-green);
  border-radius: 24px;
  padding: 8px 20px;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.2s ease;
}

.pager li > a:hover {
  background: var(--medium-green);
  color: white;
  text-decoration: none;
}

/* ===== MEDIUM SIDEBAR & CATALOG ===== */

/* Only style catalog appearance, don't change layout */
.side-catalog {
  background: var(--medium-gray-50);
  border: 1px solid var(--medium-border);
  border-radius: 8px;
  padding: 16px;
}

.side-catalog h5 {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--medium-gray-700);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.side-catalog h5 a {
  color: inherit;
  text-decoration: none;
}

.catalog-body {
  list-style: none;
  padding: 0;
  margin: 0;
}

.catalog-body li {
  margin-bottom: 4px;
}

.catalog-body a {
  display: block;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--medium-gray-600);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.catalog-body a:hover {
  background: var(--medium-gray-100);
  color: var(--medium-black);
}

.catalog-body .active a {
  background: var(--medium-gray-200);
  color: var(--medium-black);
  font-weight: 600;
}

/* Different levels of headings in catalog */
.catalog-body .h1_nav a,
.catalog-body .h2_nav a {
  font-weight: 500;
  padding-left: 8px;
}

.catalog-body .h3_nav a {
  padding-left: 16px;
  font-size: 12px;
}

.catalog-body .h4_nav a,
.catalog-body .h5_nav a,
.catalog-body .h6_nav a {
  padding-left: 24px;
  font-size: 12px;
  color: var(--medium-gray-500);
}

/* ===== MEDIUM FOOTER ===== */

footer {
  background: var(--medium-gray-50);
  padding: 48px 0;
  margin-top: 80px;
  border-top: 1px solid var(--medium-border);
}

footer .copyright {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--medium-gray-500);
  text-align: center;
}

footer .copyright a {
  color: var(--medium-gray-600);
}

footer .copyright a:hover {
  color: var(--medium-black);
}

/* ===== MEDIUM LINKS ===== */

a {
  color: var(--medium-green);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover, a:focus {
  color: var(--medium-green-hover);
  text-decoration: underline;
}

/* ===== MEDIUM CODE BLOCKS ===== */

code {
  font-family: "SF Mono", "Monaco", "Menlo", "Courier New", monospace;
  font-size: 16px;
  background: var(--medium-gray-100);
  color: var(--medium-black);
  padding: 2px 6px;
  border-radius: 4px;
  border: none;
}

pre {
  background: var(--medium-gray-50);
  border: 1px solid var(--medium-border);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}

/* ===== MEDIUM BLOCKQUOTES ===== */

blockquote {
  border-left: 4px solid var(--medium-border);
  padding: 0 0 0 20px;
  margin: 32px 0;
  font-style: italic;
  color: var(--medium-gray-600);
  background: none;
}

/* Keep original layout but improve styling only */

/* ===== MEDIUM RESPONSIVE DESIGN ===== */

/* Medium screens use original layout */

@media (max-width: 768px) {
  body {
    font-size: 19px;
    line-height: 1.6;
  }

  .intro-header .site-heading h1 {
    font-size: 48px;
  }

  .intro-header .site-heading .subheading {
    font-size: 20px;
  }

  .post-title {
    font-size: 24px !important;
    line-height: 1.3;
  }

  .post-subtitle {
    font-size: 16px;
  }

  .post-meta {
    font-size: 13px;
  }

  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
  h4 { font-size: 18px; }
}

@media (max-width: 480px) {
  body {
    font-size: 18px;
  }

  .intro-header .site-heading h1 {
    font-size: 40px;
  }

  .post-title {
    font-size: 22px !important;
  }
}

/* ===== MEDIUM ANIMATIONS & INTERACTIONS ===== */

.post-preview {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(41, 41, 41, 0.08);
}

/* ===== READING PROGRESS INDICATOR ===== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--medium-green);
  z-index: 1001;
  transition: width 0.3s ease;
}

/* ===== MEDIUM TAGS ===== */

.tags a, .tags .tag {
  font-family: "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--medium-gray-100);
  color: var(--medium-gray-700);
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  margin: 0 4px 4px 0;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tags a:hover, .tags .tag:hover {
  background: var(--medium-gray-200);
  color: var(--medium-black);
}

/* Additional overrides to ensure consistency */
.post-preview .post-title {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
}

/* ===== MEDIUM POST CONTENT STYLING ===== */

/* Only style typography, don't change layout */
.post-container p {
  color: var(--medium-black);
}

.post-container h1,
.post-container h2,
.post-container h3,
.post-container h4,
.post-container h5,
.post-container h6 {
  font-family: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  color: var(--medium-black);
  font-weight: 700;
}

.post-container a {
  color: var(--medium-green);
  text-decoration: underline;
}

.post-container a:hover {
  color: var(--medium-green-hover);
}

/* ===== ADDITIONAL MEDIUM ENHANCEMENTS ===== */

/* Better focus states */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--medium-green);
  outline-offset: 2px;
}

/* Medium-style selection color */
::selection {
  background-color: var(--medium-green);
  color: white;
}

::-moz-selection {
  background-color: var(--medium-green);
  color: white;
}

/* Improved mobile navigation */
@media (max-width: 768px) {
  .navbar-custom {
    padding: 8px 0;
  }

  .navbar-custom .navbar-brand {
    font-size: 18px;
  }

  .navbar-custom .nav li a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* Better image styling */
.post-container img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(41, 41, 41, 0.1);
}

/* Medium-style table styling */
.post-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 16px;
}

.post-container th,
.post-container td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--medium-border);
}

.post-container th {
  font-weight: 600;
  background-color: var(--medium-gray-50);
}

/* Enhanced loading states */
.loading-shimmer {
  background: linear-gradient(90deg, var(--medium-gray-200) 25%, var(--medium-gray-100) 50%, var(--medium-gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Print styles for better readability */
@media print {
  .navbar-custom,
  .reading-progress,
  footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    color: black !important;
    background: white !important;
  }

  .post-container {
    max-width: none;
    padding: 0;
  }
}