/*
Theme Name: Pharmacology Mentor
Theme URI: https://pharmacologymentor.com
Author: Pharmacology Mentor Team
Author URI: https://pharmacologymentor.com
Description: A high-quality, editorial-style WordPress theme for pharmacology education. Highly customizable, with offline fonts and specific styling for drug cards and quizzes.
Version: 1.0.3
Requires at least: 5.8
Tested up to: 6.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pharmacology-mentor
Tags: blog, education, custom-colors, custom-menu, featured-images, footer-widgets, full-width-template, post-thumbnails, sticky-post, threaded-comments, translation-ready
*/

:root {
  /* Paper & ink */
  --paper:        #faf7f2;     /* warm off-white */
  --paper-2:      #f3ede1;     /* card / panel */
  --paper-3:      #ebe4d3;     /* deeper panel */
  --ink:          #14181f;     /* primary text */
  --ink-2:        #3a3f48;     /* body */
  --ink-3:        #6b6f78;     /* meta */
  --rule:         #d8d2c5;     /* hairline */
  --rule-strong:  #14181f;

  /* Accent: deep editorial navy */
  --accent:       #173a6b;
  --accent-deep:  #0e2a51;
  --accent-tint:  #e6ecf5;
  --accent-ink:   #ffffff;

  /* Secondary signal */
  --hot:          #b8332a;
  --hot-tint:     #f6e7e3;

  /* Success / quiz */
  --good:         #1f5e3a;
  --good-tint:    #e3ede5;

  /* Type */
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Georgia", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --fs-kicker: 12px;
  --fs-meta:   13px;
  --fs-body:   17px;
  --fs-lede:   20px;
  --fs-h6:     16px;
  --fs-h5:     20px;
  --fs-h4:     24px;
  --fs-h3:     32px;
  --fs-h2:     44px;
  --fs-h1:     64px;
  --fs-mega:   88px;

  --radius: 2px;
  
  /* Layout */
  --container-width: 1200px;
}

/* Reset bits */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* Typography utilities */
.pm-kicker {
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--fs-kicker);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.pm-kicker--hot { color: var(--hot); }
.pm-kicker--ink { color: var(--ink); }

.pm-meta {
  font-family: var(--sans);
  font-size: var(--fs-meta);
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

.pm-h1, h1 { font-family: var(--sans); font-weight: 800; font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.pm-h2, h2 { font-family: var(--sans); font-weight: 800; font-size: var(--fs-h2); line-height: 1.04; letter-spacing: -0.02em; margin: 0; }
.pm-h3, h3 { font-family: var(--sans); font-weight: 700; font-size: var(--fs-h3); line-height: 1.08; letter-spacing: -0.015em; margin: 0; }
.pm-h4, h4 { font-family: var(--sans); font-weight: 700; font-size: var(--fs-h4); line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
.pm-h5, h5 { font-family: var(--sans); font-weight: 700; font-size: var(--fs-h5); line-height: 1.2;  margin: 0; }
.pm-h6, h6 { font-family: var(--sans); font-weight: 700; font-size: var(--fs-h6); line-height: 1.25; margin: 0; }

.pm-body, p {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-2);
}
.pm-lede {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-lede);
  line-height: 1.45;
  color: var(--ink);
}

/* Hairlines */
.pm-rule       { height: 1px; background: var(--rule); border: 0; margin: 10px 0; }
.pm-rule-thick { height: 2px; background: var(--ink); border: 0; margin: 10px 0; }

/* Container */
.pm-wrap { max-width: var(--container-width); margin: 0 auto; padding: 0 32px; }

/* Buttons */
.pm-btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 12px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.pm-btn:hover { opacity: 0.9; }
.pm-btn--ghost { background: transparent; color: var(--ink); }
.pm-btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Tag pill */
.pm-tag {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
  display: inline-block;
}
.pm-tag--filled { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pm-tag--accent { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Image placeholder */
.pm-img {
  background:
    repeating-linear-gradient(45deg, rgba(20,24,31,0.06) 0 1px, transparent 1px 12px),
    var(--paper-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.pm-img::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(20,24,31,0.18);
  pointer-events: none;
}
.pm-img.has-thumbnail::after { display: none; }
.pm-img > img { width: 100%; height: 100%; object-fit: cover; display: block; flex-shrink: 0; }
.pm-img > span { position: relative; z-index: 1; background: rgba(250,247,242,0.85); padding: 4px 8px; }

/* Desktop Masthead Styles */
.pm-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.pm-header-top { display: flex; align-items: center; justify-content: space-between; padding: var(--top-bar-padding, 5px) 32px; font-size: 13px; color: var(--ink-3); min-height: var(--top-bar-height, 36px); }
.pm-header-top + .pm-rule { margin: 0; }
.pm-masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 28px 32px 22px; }
.pm-logo { text-decoration: none; display: flex; flex-direction: column; align-items: center; }
.pm-logo-text { font-family: var(--sans); font-weight: 900; font-size: 44px; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.pm-logo-tagline { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 14px; margin-top: 4px; }

/* Nav */
.pm-nav { background: var(--paper); border-bottom: 1px solid var(--rule); overflow: visible; }
.pm-nav-list { display: flex; gap: 0; padding: 0 32px; overflow: visible; list-style: none; margin: 0; }
.pm-nav-item { position: relative; list-style: none; }
.pm-nav-item.has-children { display: flex; align-items: stretch; }
.pm-nav-item.has-children > .pm-nav-link { flex: 1; }
.pm-nav-link {
    padding: 14px 18px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 3px solid transparent;
    display: block;
}
.pm-nav-link.active, .pm-nav-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ─── Dropdown submenu ──────────────────────────────────────────────────── */
.pm-nav-item > .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-top: 2px solid var(--accent);
    box-shadow: 0 6px 24px rgba(20,24,31,0.10);
    z-index: 500;
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.pm-nav .pm-nav-item:hover > .sub-menu,
.pm-nav-item.is-open > .sub-menu {
    display: block;
}
.pm-nav-item > .sub-menu .pm-nav-item { position: relative; display: block; }
.pm-nav-item > .sub-menu .pm-nav-link {
    padding: 10px 18px;
    border-bottom: none;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    font-size: 13px;
    white-space: nowrap;
}
.pm-nav-item > .sub-menu .pm-nav-link:hover,
.pm-nav-item > .sub-menu .pm-nav-link.active {
    background: rgba(20,24,31,0.04);
    color: var(--accent);
    border-bottom: none;
}

/* ─── Dropdown toggle chevron ───────────────────────────────────────────── */
.pm-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px 0 4px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.15s;
}
.pm-dropdown-toggle svg { transition: transform 0.2s ease; }
.pm-nav .pm-nav-item:hover > .pm-dropdown-toggle svg,
.pm-nav-item.is-open > .pm-dropdown-toggle svg { transform: rotate(180deg); color: var(--accent); }
.pm-dropdown-toggle:hover { color: var(--accent); }

/* ─── Mobile drawer submenus ────────────────────────────────────────────── */
.pm-mobile-drawer-list .pm-nav-item.has-children {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
}
.pm-mobile-drawer-list .pm-nav-item.has-children > .pm-nav-link {
    grid-column: 1;
    grid-row: 1;
}
.pm-mobile-drawer-list .pm-nav-item.has-children > .pm-dropdown-toggle {
    grid-column: 2;
    grid-row: 1;
    min-width: 48px;
    justify-content: center;
    padding: 0 16px;
}
.pm-mobile-drawer-list .pm-nav-item > .sub-menu {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    width: 100%;
    border: none;
    border-top: 1px solid var(--rule);
    box-shadow: none;
    padding: 4px 0 6px 0;
    margin: 0;
    background: rgba(20,24,31,0.025);
    min-width: 0;
}
.pm-mobile-drawer-list .pm-nav-item.is-open > .sub-menu { display: block; }
.pm-mobile-drawer-list .sub-menu .pm-nav-item {
    display: block;
    border-bottom: 0;
}
.pm-mobile-drawer-list .sub-menu .pm-nav-link {
    padding: 10px 20px 10px 32px;
    font-size: 14px;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
}
.pm-mobile-drawer-list .pm-nav-item.is-open > .pm-dropdown-toggle svg { transform: rotate(180deg); color: var(--accent); }

/* Footer */
.pm-footer { background: var(--ink); color: var(--paper); padding: 56px 32px 24px; }
.pm-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(250,247,242,0.16); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .pm-footer-grid { grid-template-columns: 1fr 1fr; }
    .pm-masthead { grid-template-columns: 1fr; gap: 20px; text-align: center; }
}

@media (max-width: 768px) {
    .pm-wrap { padding: 0 16px; }
    .pm-nav-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    :root {
        --fs-h1: 34px;
        --fs-h2: 24px;
        --fs-h3: 20px;
        --fs-h4: 18px;
        --fs-h5: 16px;
        --fs-body: 16px;
        --fs-lede: 17px;
    }
}

/* Single-post title — size controlled via Customizer > Single Post Options */
.pm-single-title { line-height: 1.1; margin-bottom: 24px; }
.pm-single-lede  { font-size: clamp(16px, 2.5vw, 22px); }

/* ─── Desktop-only / mobile-only visibility helpers ─────────────────────── */
/* NOTE: actual breakpoint switching is injected by pm_customize_css() in   */
/* customizer.php so it reflects the user's chosen breakpoint setting.      */
.pm-mobile-only  { display: none; }   /* shown by customizer CSS at breakpoint */
.pm-desktop-only { display: block; }  /* hidden by customizer CSS at breakpoint */

/* ─── Mobile bottom nav — base (always hidden until breakpoint fires) ───── */
.pm-mobile-nav-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;                            /* shown via @media in customizer CSS  */
    grid-template-columns: repeat(5, 1fr);   /* overridden by JS if < 5 items exist */
    align-items: stretch;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -2px 16px rgba(20,24,31,0.07);
    z-index: 1100;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* iPhone home bar */
}

/* ─── Individual tab items ───────────────────────────────────────────────── */
.pm-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 6px 10px;
    color: var(--nav-inactive, var(--ink-3));
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
    min-width: 0;
    flex: 1;
    position: relative;
}
.pm-mobile-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--nav-active, var(--accent));
    border-radius: 0 0 2px 2px;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.pm-mobile-nav-item.active::before {
    transform: scaleX(1);
}
.pm-mobile-nav-item.active,
.pm-mobile-nav-item:focus-visible {
    color: var(--nav-active, var(--accent));
    outline: none;
}
.pm-mobile-nav-item:hover {
    color: var(--nav-active, var(--accent));
}

/* ─── Icon ───────────────────────────────────────────────────────────────── */
.pm-mobile-nav-icon {
    flex-shrink: 0;
    transition: transform 0.15s;
}
.pm-mobile-nav-item.active .pm-mobile-nav-icon {
    transform: translateY(-1px);
}

/* ─── Label ──────────────────────────────────────────────────────────────── */
.pm-mobile-nav-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.pm-mobile-nav-item.active .pm-mobile-nav-label {
    font-weight: 700;
}

/* PLUGIN COMPATIBILITY STYLES */

/* Generic Quiz Styling (Targets common structures) */
.quiz-container, .wp-quiz, .hdq-quiz {
    background: var(--paper-2) !important;
    border: 1px solid var(--rule) !important;
    padding: 24px !important;
    font-family: var(--sans) !important;
}

.quiz-question {
    font-family: var(--sans) !important;
    font-weight: 700 !important;
    font-size: var(--fs-h5) !important;
    color: var(--ink) !important;
}

.quiz-answer-option {
    background: #fff !important;
    border: 1px solid var(--rule) !important;
    padding: 12px 16px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s ease !important;
}

.quiz-answer-option.correct {
    background: var(--good-tint) !important;
    border-color: var(--good) !important;
}

.quiz-answer-option.incorrect {
    background: var(--hot-tint) !important;
    border-color: var(--hot) !important;
}

/* Drug Card Plugin Styling */
.drug-card, .pm-drug-card {
    border: 2px solid var(--ink);
    margin: 32px 0;
    overflow: hidden;
}

.drug-card-header {
    background: var(--ink);
    color: var(--paper);
    padding: 20px;
}

.drug-card-title {
    font-family: var(--sans);
    font-weight: 900;
    font-size: 32px;
    margin: 0;
}

.drug-card-body {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.drug-card-field-label {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 11px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Gutenberg / Core Block Adjustments */
.wp-block-pullquote {
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    padding: 32px 0;
    margin: 48px 0;
}

.wp-block-pullquote blockquote p {
    font-family: var(--serif);
    font-style: italic;
    font-size: 28px;
    line-height: 1.3;
    color: var(--ink);
}

/* ─── Mobile nav drawer ─────────────────────────────────────────────────── */
.pm-mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 31, 0.55);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.pm-mobile-nav-overlay.is-visible {
    display: block;
    opacity: 1;
}
.pm-mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--paper);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(20,24,31,0.15);
}
.pm-mobile-nav-drawer.is-open {
    transform: translateX(0);
}
.pm-mobile-nav-close {
    background: transparent;
    border: 0;
    padding: 10px 16px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}
.pm-mobile-drawer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pm-mobile-drawer-list .pm-nav-item {
    border-bottom: 1px solid var(--rule);
}
.pm-mobile-drawer-list .pm-nav-link {
    display: block;
    padding: 14px 20px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15px;
    color: var(--ink-2);
    text-decoration: none;
}
.pm-mobile-drawer-list .pm-nav-link.active,
.pm-mobile-drawer-list .pm-nav-link:hover {
    color: var(--accent);
}
body.pm-nav-open {
    overflow: hidden;
}

/* ─── Sticky header ─────────────────────────────────────────────────────── */
.pm-header--sticky {
    position: sticky;
    top: 0;
    z-index: 900;
}
.pm-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(20,24,31,0.08);
}

/* ─── Mobile header (visibility controlled by customizer breakpoint CSS) ─── */
.pm-mobile-header {
    display: none;  /* shown by @media block injected from customizer */
    background: var(--mob-header-bg, var(--paper));
    border-bottom: 1px solid var(--mob-header-border, var(--rule));
    color: var(--mob-header-color, var(--ink));
    position: sticky;
    top: 0;
    z-index: 1000;
}
.pm-mobile-header a,
.pm-mobile-header button {
    color: var(--mob-header-color, var(--ink));
}
.pm-mobile-logo {
    color: inherit;
    font-family: var(--sans);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.02em;
    line-height: 1;
    text-decoration: none;
}
.pm-icon-btn {
    background: transparent;
    border: 0;
    padding: 6px;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* ─── Search trigger button ──────────────────────────────────────────────── */
.pm-search-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--rule);
    padding: 8px 12px;
    min-width: 230px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s;
}
.pm-search-trigger:hover {
    border-color: var(--accent);
}

/* ─── Subscribe button ───────────────────────────────────────────────────── */
.pm-subscribe-btn {
    background: var(--accent);
    color: #fff;
    padding: 6px 12px;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    border-radius: 2px;
    text-decoration: none;
    transition: background 0.15s;
}
.pm-subscribe-btn:hover,
.pm-subscribe-btn.pm-accent-hover:hover {
    background: var(--accent-deep);
    color: #fff;
}

/* ─── Search modal ───────────────────────────────────────────────────────── */
.pm-search-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
.pm-search-modal[hidden] {
    display: none;
}
.pm-search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 24, 31, 0.6);
    backdrop-filter: blur(3px);
}
.pm-search-modal-inner {
    position: relative;
    width: min(680px, 92vw);
    background: var(--paper);
    border: 1px solid var(--rule);
    box-shadow: 0 24px 64px rgba(20,24,31,0.22);
    padding: 6px 8px;
    border-radius: 4px;
}
.pm-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pm-search-icon {
    flex-shrink: 0;
    color: var(--ink-3);
    margin-left: 6px;
}
.pm-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    padding: 14px 8px;
    line-height: 1.3;
}
.pm-search-input::placeholder {
    color: var(--ink-3);
}
.pm-search-submit {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 8px 16px;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: 2px;
    white-space: nowrap;
    transition: background 0.15s;
}
.pm-search-submit:hover {
    background: var(--accent-deep);
}
.pm-search-close {
    background: transparent;
    border: 0;
    color: var(--ink-3);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.15s;
}
.pm-search-close:hover {
    color: var(--ink);
}
.pm-search-hint {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--ink-3);
    text-align: center;
    padding: 6px 0 10px;
    margin: 0;
}
body.pm-search-open {
    overflow: hidden;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.pm-footer {
    background: var(--ink);
    color: var(--paper);
    padding: 0;
    margin-top: 0;
}
.pm-footer-inner {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 56px 32px 32px;
}
.pm-footer-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(250,247,242,0.15);
}
@media (max-width: 768px) {
    .pm-footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
.pm-footer-logo {
    font-family: var(--sans);
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--paper);
    display: block;
    margin-bottom: 6px;
}
.pm-footer-desc {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.55;
    color: rgba(250,247,242,0.72);
    margin-top: 14px;
}
.pm-footer-social {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.pm-social-icon {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(250,247,242,0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    color: var(--paper);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.pm-social-icon:hover {
    border-color: var(--paper);
    color: var(--paper);
}
.pm-footer-col-heading {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 14px;
}
.pm-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.pm-footer-links a {
    color: rgba(250,247,242,0.72);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}
.pm-footer-links a:hover {
    color: var(--paper);
}
.pm-footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 22px;
    font-family: var(--sans);
    font-size: 12px;
    color: rgba(250,247,242,0.55);
}

/* ─── Sidebar layout ─────────────────────────────────────────────────────── */
.pm-content-wrap.pm-sidebar-layout--right,
.pm-content-wrap.pm-sidebar-layout--left {
    display: grid;
    gap: 48px;
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 32px;
}
.pm-content-wrap.pm-sidebar-layout--right { grid-template-columns: 1fr 300px; }
.pm-content-wrap.pm-sidebar-layout--left  { grid-template-columns: 300px 1fr; }
.pm-content-wrap.pm-sidebar-layout--left .pm-sidebar { order: -1; }
.pm-sidebar {
    padding-top: 56px;
}
.pm-has-sidebar { max-width: none !important; padding-left: 0 !important; padding-right: 0 !important; }
@media (max-width: 960px) {
    .pm-content-wrap.pm-sidebar-layout--right,
    .pm-content-wrap.pm-sidebar-layout--left { grid-template-columns: 1fr; }
    .pm-content-wrap.pm-sidebar-layout--left .pm-sidebar { order: 0; }
}

/* ─── Homepage — hero ────────────────────────────────────────────────────── */
.pm-hero-section { padding-top: 28px; padding-bottom: 12px; }
.pm-hero-grid {
    display: grid;
    grid-template-columns: 1.6fr 1px 1fr;
    gap: 32px;
    align-items: start;
}
.pm-hero-img    { height: 380px; margin-bottom: 18px; }
.pm-hero-title  { font-size: 56px; }
.pm-hero-lede   { margin-top: 16px; max-width: 720px; }
.pm-hero-divider { /* filled by inline background */ }
.pm-hero-rail   { display: flex; flex-direction: column; gap: 0; }

@media (max-width: 900px) {
    .pm-hero-grid { grid-template-columns: 1fr; }
    .pm-hero-divider { display: none; }
    .pm-hero-title { font-size: 36px; }
    .pm-hero-img   { height: 240px; }
}

/* ─── Homepage — briefing + most read ───────────────────────────────────── */
.pm-briefing-section { padding-top: 32px; padding-bottom: 8px; }
.pm-briefing-grid {
    display: grid;
    grid-template-columns: 2.6fr 1fr;
    gap: 40px;
    align-items: start;
}
.pm-briefing-grid--full { grid-template-columns: 1fr; }
.pm-briefing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

@media (max-width: 768px) {
    .pm-briefing-grid { grid-template-columns: 1fr; }
    .pm-most-read     { order: -1; }
}

/* Most Read list */
.pm-most-read-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pm-most-read-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
}
.pm-most-read-num {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 18px;
    color: var(--accent);
    min-width: 20px;
    flex-shrink: 0;
}
.pm-most-read-link {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.35;
    color: var(--ink);
    text-decoration: none;
}
.pm-most-read-link:hover { color: var(--accent); }

/* ─── Drug Spotlight Band ────────────────────────────────────────────────── */
.pm-drug-spotlight {
    background: var(--ink);
    color: var(--paper);
    padding: 56px 32px;
    margin-top: 56px;
}
.pm-drug-spotlight-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 48px;
    align-items: center;
}
.pm-kicker--light { color: #7ea1d6; }
.pm-drug-name {
    font-family: var(--serif);
    color: #fff;
    font-size: 84px;
    margin-top: 16px;
    line-height: 0.95;
}
.pm-drug-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: rgba(250,247,242,0.85);
    margin-top: 14px;
}
.pm-btn--inverse {
    display: inline-block;
    margin-top: 26px;
    padding: 10px 20px;
    background: #fff;
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    border-radius: 2px;
    transition: opacity 0.15s;
}
.pm-btn--inverse:hover { opacity: 0.88; }
.pm-drug-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    font-family: var(--sans);
}
.pm-drug-fact {
    border-top: 1px solid rgba(250,247,242,0.25);
    padding-top: 14px;
}
.pm-drug-fact-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #7ea1d6;
    font-weight: 800;
    text-transform: uppercase;
}
.pm-drug-fact-content {
    margin-top: 6px;
    font-size: 15px;
    color: rgba(250,247,242,0.92);
    line-height: 1.45;
}

@media (max-width: 768px) {
    .pm-drug-spotlight-inner { grid-template-columns: 1fr; }
    .pm-drug-name             { font-size: 56px; }
    .pm-drug-facts            { grid-template-columns: 1fr; }
}

/* ─── Demo placeholder cards ─────────────────────────────────────────────── */
.pm-demo-placeholder .pm-img {
    background: var(--paper-3, #ebe4d3);
}
.pm-demo-placeholder .pm-img span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--sans);
    font-weight: 900;
    font-size: 28px;
    color: var(--ink-3);
    letter-spacing: 0.05em;
}

/* ─── Footer responsive ──────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .pm-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .pm-footer-grid  { grid-template-columns: 1fr; }
    .pm-footer-inner { padding: 40px 20px 24px; }
}

/* Footer nav menu styling (wp_nav_menu output) */
.pm-footer-col .pm-footer-links,
.pm-footer ul.pm-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.pm-footer-col .pm-footer-links li a,
.pm-footer ul.pm-footer-links li a {
    color: rgba(250,247,242,0.72);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.15s;
}
.pm-footer-col .pm-footer-links li a:hover,
.pm-footer ul.pm-footer-links li a:hover {
    color: var(--paper);
}

/* Footer widget title */
.pm-footer-widget-title {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 14px;
}
.pm-footer-widget-area {
    margin-top: 20px;
}

/* ─── Google AdSense ad units ────────────────────────────────────────────── */
/* Hidden until JS confirms fill via .is-filled; unfilled = stays display:none */
.pm-ad-wrap { display: none; text-align: center; clear: both; }
.pm-ad-wrap.is-filled { display: block; margin: 32px auto; max-width: 100%; }
.pm-ad-label {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    margin: 0 0 6px;
}
/* Footer ad: constrain width and add vertical breathing room */
.pm-footer-ad { padding: 0 32px; }
.pm-footer-ad .pm-ad-wrap.is-filled { margin: 0 auto 40px; }
@media (max-width: 768px) {
    .pm-footer-ad { padding: 0 16px; }
}

/* ==========================================================================
   MOBILE LAYOUT OPTIMIZATIONS AND OFFLINE STYLES
   ========================================================================== */

/* 1. Global Viewport Safety & Word Wrapping */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6,
.pm-h1, .pm-h2, .pm-h3, .pm-h4, .pm-h5, .pm-h6,
body, p, .pm-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* 2. Gutenberg/Core Block Responsiveness */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
    width: 100%;
    border-collapse: collapse;
}

.entry-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

pre, code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* 3. Fluid Page and Layout Container Paddings */
.site-main {
    padding: 56px 32px;
}

.pm-content-wrap.pm-sidebar-layout--right,
.pm-content-wrap.pm-sidebar-layout--left {
    padding: 0 clamp(16px, 4vw, 32px);
}

@media (max-width: 768px) {
    .site-main {
        padding: 32px 16px;
    }
}

/* 4. Responsive Grid & Header Classes */
.pm-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 40px;
}

.pm-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pm-section-header h2 {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pm-section-header-link {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    padding-bottom: 2px;
}

.pm-post-nav {
    max-width: 800px;
    margin: 48px auto 0;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
}

.pm-post-nav > div {
    flex: 1;
    min-width: 0;
}

.pm-post-nav > div:last-child {
    text-align: right;
}

@media (max-width: 768px) {
    .pm-posts-grid {
        gap: 24px;
    }
    .pm-briefing-cards {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }
}

@media (max-width: 600px) {
    .pm-post-nav {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .pm-post-nav > div:last-child {
        text-align: left;
    }
}

/* 5. Responsive Drug Cards & Spotlight */
.pm-single-featured-image {
    height: 450px;
    margin-bottom: 48px;
}

@media (max-width: 768px) {
    .drug-card-body {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    .drug-card-title {
        font-size: 24px;
    }
    .pm-drug-spotlight {
        padding: 32px 16px;
        margin-top: 32px;
    }
    .pm-single-featured-image {
        height: clamp(200px, 50vw, 300px);
        margin-bottom: 32px;
    }
}

/* 6. 404 Page Optimizations */
.error-404-main {
    padding: 100px 32px;
    text-align: center;
}

.error-404-title {
    font-size: clamp(64px, 15vw, 120px);
    line-height: 1;
    margin: 20px 0;
}

.error-404-lede {
    font-size: clamp(18px, 4vw, 24px);
}

@media (max-width: 768px) {
    .error-404-main {
        padding: 60px 16px;
    }
}

/* 7. Stylish Offline Overlay (Glassmorphism & animations) */
.pm-offline-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 31, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pm-offline-overlay[hidden] {
    display: none !important;
}

@media (max-width: 768px) {
    .pm-offline-overlay.is-visible {
        display: flex;
        opacity: 1;
        pointer-events: auto;
    }
}

.pm-offline-card {
    background: var(--paper);
    border: 2px solid var(--rule-strong, var(--ink));
    padding: 40px 32px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: var(--radius);
}

.pm-offline-overlay.is-visible .pm-offline-card {
    transform: translateY(0);
}

.pm-offline-icon-container {
    margin-bottom: 24px;
    color: var(--hot);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pm-offline-icon-container svg {
    animation: pm-pulse-wifi 2s infinite ease-in-out;
}

.pm-offline-title {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 28px;
    color: var(--ink);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.pm-offline-text {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--ink-2);
    line-height: 1.5;
    margin: 0 0 32px;
}

.pm-offline-btn {
    width: 100%;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.pm-offline-btn:active {
    transform: scale(0.98);
}

.pm-offline-btn.is-checking {
    background: var(--ink-3);
    border-color: var(--ink-3);
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes pm-pulse-wifi {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

/* 8. Search Modal Mobile Optimizations */
@media (max-width: 600px) {
    .pm-search-modal {
        padding-top: 0;
    }
    .pm-search-modal-inner {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        padding: 24px 16px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        background: var(--paper);
    }
    .pm-search-form {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 8px;
        width: 100%;
        border-bottom: 2px solid var(--ink);
        padding-bottom: 12px;
    }
    .pm-search-icon {
        grid-column: 1;
        margin-left: 0;
    }
    .pm-search-input {
        grid-column: 2;
        font-size: 20px;
        padding: 10px 4px;
        width: 100%;
    }
    .pm-search-close {
        grid-column: 3;
        padding: 8px;
    }
    .pm-search-submit {
        grid-column: 1 / -1;
        width: 100%;
        padding: 14px;
        font-size: 15px;
        text-align: center;
        margin-top: 16px;
        display: block;
    }
    .pm-search-hint {
        text-align: center;
        padding: 12px 0 0;
        margin: 0;
    }
}

