/*
   Clean responsive stylesheet for the existing Artisteer-style HTML.
   Replace old style.css + style.responsive.css + script.js + script.responsive.js with this file.
   Existing class names in HTML are preserved: art-main, art-sheet, art-content-layout,
   art-layout-cell, art-postcontent, art-hmenu, art-footer, etc.
*/

:root {
  --page-max-width: 1600px;
  --page-padding: clamp(12px, 2vw, 28px);
  --content-padding: clamp(16px, 2.2vw, 34px);
  --font-main: Arial, "Arial Unicode MS", Helvetica, sans-serif;
  --text: #1f2933;
  --muted: #5f6b76;
  --background: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --border: #d8e0e7;
  --border-strong: #b8c7d3;
  --link: #cc3300;
  --link-hover: #0b6fae;
  --nav-bg: #0a2838;
  --nav-link: #1b6c97;
  --nav-link-active: #2491cb;
  --nav-link-hover: #49aade;
  --shadow: 0 8px 24px rgba(10, 40, 56, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 280px;
  color: var(--text);
  background: linear-gradient(180deg, #c9d4dc 0, var(--background) 250px, #ffffff 100%);
  font-family: var(--font-main);
  font-size: 18px;
  line-height: 1.6;
}

#art-main {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.clearfix::after,
.art-nav::after,
.art-sheet::after,
.art-footer::after,
.art-content-layout::after,
ul.art-hmenu::after {
  content: "";
  display: table;
  clear: both;
}

/* Top navigation */
.art-nav {
  width: 100%;
  margin: 0 auto;
  padding: 8px var(--page-padding) 0;
  background: var(--nav-bg);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 10;
}

.art-nav ul,
ul.art-hmenu,
ul.art-hmenu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.art-hmenu {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: var(--page-max-width);
  margin: 0 auto;
}

ul.art-hmenu li {
  position: relative;
  margin: 0;
}

ul.art-hmenu > li > a,
ul.art-hmenu > li > a:link,
ul.art-hmenu > li > a:visited {
  display: block;
  min-height: 38px;
  padding: 7px 18px;
  border-radius: 6px 6px 0 0;
  background: var(--nav-link);
  color: #eef8ff;
  font-size: 20px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

ul.art-hmenu > li > a.active,
ul.art-hmenu > li > a.active:link,
ul.art-hmenu > li > a.active:visited {
  background: var(--nav-link-active);
  color: #ffffff;
}

ul.art-hmenu > li > a:hover,
ul.art-hmenu > li:hover > a {
  background: var(--nav-link-hover);
  color: #031620;
}

/* Optional dropdowns, if some pages contain nested menu items. */
ul.art-hmenu ul {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0 0 8px 8px;
  background: var(--nav-bg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

ul.art-hmenu li:hover > ul {
  display: block;
}

ul.art-hmenu ul a {
  display: block;
  padding: 8px 12px;
  color: #eef8ff;
  text-decoration: none;
  border-radius: 5px;
}

ul.art-hmenu ul a:hover {
  background: var(--nav-link-hover);
  color: #031620;
}

/* Main page shell */
.art-sheet {
  width: min(calc(100% - 24px), var(--page-max-width));
  margin: 14px auto 0;
  padding: var(--content-padding);
  background: var(--surface);
  border: 1px solid rgba(184, 199, 211, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.art-layout-wrapper,
.art-post,
.art-article,
.art-postcontent {
  width: 100%;
}

.art-post {
  margin: 0;
  padding: 0;
}

.art-content-layout {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.art-content-layout-row {
  display: table-row;
}

.art-layout-cell {
  display: table-cell;
  vertical-align: top;
  padding: 0;
}

.art-content {
  width: 100%;
}

/* Typography */
.art-postcontent,
.art-postcontent li,
.art-postcontent table,
.art-postcontent a,
.art-postcontent a:link,
.art-postcontent a:visited {
  font-family: var(--font-main);
  font-size: clamp(17px, 1.18vw, 20px);
}

.art-postcontent p {
  margin: 0 0 0.8em;
}

.art-postcontent h1,
.art-postcontent h2,
.art-postcontent h3,
.art-postcontent h4,
.art-postcontent h5,
.art-postcontent h6 {
  margin: 1.05em 0 0.45em;
  color: #143f5a;
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.25;
}

.art-postcontent h1:first-child,
.art-postcontent h2:first-child,
.art-postcontent h3:first-child {
  margin-top: 0;
}

.art-postcontent h1 {
  font-size: clamp(26px, 2.3vw, 38px);
}

.art-postcontent h2 {
  font-size: clamp(23px, 1.9vw, 32px);
}

.art-postcontent h3 {
  font-size: clamp(20px, 1.55vw, 26px);
  padding-top: 0.35em;
  border-top: 1px solid rgba(216, 224, 231, 0.75);
  clear: both;
}

.art-postcontent h4 {
  font-size: clamp(18px, 1.25vw, 22px);
}

.art-postcontent a,
.art-postcontent a:link {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(204, 51, 0, 0.25);
}

.art-postcontent a:visited {
  color: #9b3b20;
}

.art-postcontent a:hover,
.art-postcontent a.hovered {
  color: var(--link-hover);
  border-bottom-color: rgba(11, 111, 174, 0.4);
}

.art-postcontent b,
.art-postcontent strong {
  color: #111827;
}

.art-postcontent em {
  color: #334155;
}

/* Header block with logo and alphabet links. Works with existing inline widths. */
.art-postcontent > .art-content-layout:first-child {
  margin-bottom: 1.2rem;
  padding: clamp(10px, 1.5vw, 18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.art-postcontent > .art-content-layout:first-child .art-layout-cell:first-child {
  width: 160px !important;
  text-align: center;
}

.art-postcontent > .art-content-layout:first-child img {
  max-width: 130px;
  height: auto;
}

.art-postcontent > .art-content-layout:first-child p {
  margin-bottom: 0.55em;
}

/* Alphabet line: make many letter links wrap cleanly. */
.art-postcontent > .art-content-layout:first-child p a {
  display: inline-block;
  margin: 0 0.22em 0.28em 0;
  padding: 0.1em 0.05em;
  line-height: 1.25;
}

/* Long directory pages: each medicine link remains readable. */
.art-postcontent > p > a:only-child {
  line-height: 1.45;
}

/* Lists */
.art-postcontent ul,
.art-postcontent ol,
.art-post ul,
.art-post ol {
  margin: 0.9em 0 1em 1.4em;
  padding: 0;
}

.art-postcontent li,
.art-post li {
  margin: 0.35em 0;
  color: var(--text);
}

/* Tables from medicine instructions */
.art-article table,
table.art-article,
.art-postcontent table {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: clamp(15px, 1vw, 18px);
  overflow-wrap: anywhere;
}

.art-article th,
.art-article td,
.art-postcontent th,
.art-postcontent td {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  vertical-align: top;
  text-align: left;
}

.art-article th,
.art-postcontent th {
  background: #eaf2f7;
  color: #15384f;
  font-weight: 700;
}

.art-article tr:nth-child(even) td,
.art-postcontent tr:nth-child(even) td {
  background: #fbfdff;
}

/* Images and embedded media */
img,
.art-article img,
img.art-article,
.art-block img,
.art-footer img {
  max-width: 100%;
  height: auto;
  border: 0;
}

.art-article img,
.art-postcontent img {
  margin: 5px;
}

.art-responsive-embed {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
}

.art-responsive-embed iframe,
.art-responsive-embed object,
.art-responsive-embed embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

blockquote {
  margin: 1rem 0;
  padding: 0.9rem 1rem 0.9rem 1.2rem;
  border-left: 5px solid var(--nav-link-active);
  background: #eaf6fc;
  color: #123246;
  font-style: italic;
}

pre,
code {
  font-family: Consolas, "Courier New", monospace;
}

pre {
  max-width: 100%;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f3f6f8;
}

/* Legacy inline style helper classes from page <style> blocks. */
.art-content .art-postcontent-0 .layout-item-old-0 {
  margin-bottom: 5px;
}

.art-content .art-postcontent-0 .layout-item-old-1 {
  border-spacing: 10px 0;
  border-collapse: separate;
}

.art-content .art-postcontent-0 .layout-item-old-2 {
  padding-right: 10px;
  padding-left: 10px;
  border: 1px solid #bbc5c9;
}

/* Footer */
.art-footer {
  width: 100%;
  margin: 18px auto 0;
  padding: 0 var(--page-padding) 18px;
  color: #31404c;
  font-size: 14px;
}

.art-footer-inner {
  width: min(calc(100% - 24px), var(--page-max-width));
  margin: 0 auto;
  padding: 12px var(--content-padding);
  border-radius: var(--radius) var(--radius) 0 0;
  background: #cfd8df;
}

.art-footer p {
  margin: 0;
}

.art-footer a,
.art-footer a:link,
.art-footer a:visited {
  color: #20303b;
}

.art-footer .layout-item-0,
.art-footer .layout-item-1 {
  padding: 5px;
}

/* Responsive behavior without JavaScript and without html.responsive classes. */
@media (max-width: 900px) {
  body {
    font-size: 17px;
  }

  .art-sheet,
  .art-footer-inner {
    width: min(calc(100% - 16px), var(--page-max-width));
  }

  .art-content-layout,
  .art-content-layout-row,
  .art-layout-cell {
    display: block;
    width: 100% !important;
  }

  .art-postcontent > .art-content-layout:first-child {
    text-align: left;
  }

  .art-postcontent > .art-content-layout:first-child .art-layout-cell:first-child {
    width: 100% !important;
    text-align: left;
  }

  .art-postcontent > .art-content-layout:first-child img {
    max-width: 110px;
  }

  .art-footer .art-layout-cell {
    padding: 6px 0;
  }
}

@media (max-width: 700px) {
  :root {
    --page-padding: 8px;
    --content-padding: 14px;
  }

  .art-nav {
    padding-top: 6px;
  }

  ul.art-hmenu {
    display: block;
  }

  ul.art-hmenu > li {
    display: block;
    width: 100%;
    margin: 0 0 4px;
  }

  ul.art-hmenu > li > a,
  ul.art-hmenu > li > a:link,
  ul.art-hmenu > li > a:visited,
  ul.art-hmenu > li > a.active {
    border-radius: 7px;
    text-align: center;
  }

  ul.art-hmenu ul {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
    border-radius: 7px;
    box-shadow: none;
  }

  .art-postcontent h3 {
    padding-top: 0.55em;
  }

  .art-postcontent table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: normal;
  }

  .art-article th,
  .art-article td,
  .art-postcontent th,
  .art-postcontent td {
    min-width: 130px;
    padding: 7px 8px;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 16px;
    line-height: 1.55;
  }

  .art-sheet {
    margin-top: 8px;
    border-radius: 9px;
  }

  .art-postcontent > .art-content-layout:first-child p a {
    margin-right: 0.12em;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .art-nav,
  .art-footer {
    display: none;
  }

  .art-sheet {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .art-postcontent a {
    color: #000;
    border-bottom: 0;
    text-decoration: underline;
  }
}
/* Search by medicine name */
.drug-search-box {
  margin: 22px 0 24px;
  padding: 18px;
  border: 1px solid #d6dee6;
  border-radius: 14px;
  background: #f7fafc;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.drug-search-label {
  display: block;
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.drug-search-input {
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #b8c2cc;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 18px;
  line-height: 1.4;
  outline: none;
}

.drug-search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.drug-search-clear {
  display: inline-block;
  min-height: 42px;
  margin: 10px 0 0 8px;
  padding: 8px 16px;
  border: 1px solid #b8c2cc;
  border-radius: 10px;
  background: #fff;
  color: #1f2937;
  font-size: 16px;
  cursor: pointer;
}

.drug-search-clear:hover {
  background: #eef2f7;
}

.drug-search-counter {
  margin-top: 10px;
  color: #4b5563;
  font-size: 15px;
}

@media (max-width: 600px) {
  .drug-search-box {
    padding: 14px;
  }

  .drug-search-input {
    max-width: none;
    font-size: 16px;
  }

  .drug-search-clear {
    display: block;
    width: 100%;
    margin-left: 0;
  }
}
/* Alphabet navigation */
.alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 8px 0 18px;
  padding: 12px;
  border: 1px solid #d6dee6;
  border-radius: 14px;
  background: #f7fafc;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.alphabet-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #c9d3df;
  border-radius: 9px;
  background: #ffffff;
  color: #1f2937;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.alphabet-nav a:hover {
  border-color: #2563eb;
  background: #eaf2ff;
  color: #174ea6;
}

.alphabet-nav a.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

@media (max-width: 700px) {
  .alphabet-nav {
    gap: 6px;
    padding: 10px;
    margin-bottom: 16px;
  }

  .alphabet-nav a {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 16px;
  }
}
.home-intro {
  margin: 24px 0;
  padding: 22px;
  border: 1px solid #d6dee6;
  border-radius: 14px;
  background: #f7fafc;
}

.home-intro h1 {
  margin-top: 0;
}

.home-intro h2 {
  margin-top: 22px;
}

.home-intro p {
  margin: 12px 0;
  line-height: 1.65;
}