/* Cosmo Arts Clinic Blog - responsive global styles */
:root {
  --blog-bg: #f6f8fb;
  --blog-text: #202631;
  --blog-muted: #6c757d;
  --blog-border: #e8edf3;
  --blog-radius: 12px;
  --blog-shadow: 0 3px 14px rgba(20, 35, 55, .07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--blog-bg);
  color: var(--blog-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
}

img, video, iframe {
  max-width: 100%;
}

main.container {
  width: 100%;
}

main h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.25;
  font-weight: 700;
}

/* Homepage article cards */
.card {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow);
  background: #fff;
}

.card-img-top {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #eef1f5;
}

.card .card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
}

.card .card-body h2 {
  font-size: 1.05rem;
  line-height: 1.4;
  margin-bottom: .55rem;
  overflow-wrap: anywhere;
}

.card .card-body p {
  color: #596273;
  font-size: .94rem;
  margin-bottom: .85rem;
  overflow-wrap: anywhere;
}

.card .card-body a {
  margin-top: auto;
  font-weight: 600;
  text-decoration: none;
}

.card .card-body a:hover { text-decoration: underline; }

/* Article detail page */
article > h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  line-height: 1.2;
  font-weight: 750;
  overflow-wrap: anywhere;
}

article > img.img-fluid {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border-radius: var(--blog-radius);
  background: #eef1f5;
}

.article-content {
  max-width: 100%;
  font-size: 1rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: normal;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 1.5em;
  margin-bottom: .55em;
  line-height: 1.3;
  font-weight: 700;
}

.article-content p { margin-bottom: 1.1em; }

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;
  border-radius: 8px;
}

.article-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.article-content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border-radius: 8px;
  background: #eef1f5;
}

.article-content blockquote {
  margin: 1.25rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid #315b86;
  background: #edf3f9;
}

/* Keep the navbar usable on narrow screens */
.navbar-brand {
  max-width: 75%;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

@media (max-width: 767.98px) {
  main.container { padding-left: 16px; padding-right: 16px; }
  main.container.py-5 { padding-top: 1.75rem !important; padding-bottom: 1.75rem !important; }
  .card .card-body { padding: .9rem; }
  .card .card-body h2 { font-size: 1rem; }
  article > img.img-fluid { max-height: 360px; }
  .article-content { font-size: .98rem; line-height: 1.75; }
}

@media (max-width: 575.98px) {
  /* Bootstrap col-md-6/col-lg-4 naturally become one full-width card below 768px. */
  .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .card-img-top { aspect-ratio: 16 / 9; }
  .navbar .container { align-items: center; }
  .navbar-brand { font-size: .98rem; }
  article > h1 { font-size: 1.65rem; }
  .article-content h2 { font-size: 1.35rem; }
  .article-content h3 { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .18s ease, box-shadow .18s ease; }
  .card:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(20, 35, 55, .11); }
}
