/*
Theme Name: BooksOfMedicals
Theme URI: https://booksofmedicals.com/
Author: BooksOfMedicals
Description: A fast, responsive medical education and professional resources theme for BooksOfMedicals.com. Designed to work with the BooksOfMedicals Core plugin.
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: booksofmedicals
*/

:root {
  --bom-primary: #123b5d;
  --bom-primary-dark: #0c2b45;
  --bom-accent: #00a676;
  --bom-accent-dark: #087b5e;
  --bom-ink: #21313c;
  --bom-muted: #61717d;
  --bom-border: #dbe5eb;
  --bom-soft: #f4f8fa;
  --bom-white: #ffffff;
  --bom-shadow: 0 10px 30px rgba(25, 57, 78, 0.08);
  --bom-radius: 16px;
  --bom-max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--bom-ink);
  background: var(--bom-white);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}
a { color: var(--bom-primary); text-decoration: none; }
a:hover { color: var(--bom-accent-dark); }
img { max-width: 100%; height: auto; }

.bom-container { width: min(100% - 32px, var(--bom-max)); margin-inline: auto; }
.bom-section { padding: 64px 0; }
.bom-section--soft { background: var(--bom-soft); }
.bom-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:28px; }
.bom-section-head h2 { margin:0; font-size:clamp(1.6rem,3vw,2.25rem); line-height:1.2; }
.bom-section-head p { margin:6px 0 0; color:var(--bom-muted); max-width:720px; }
.bom-kicker { text-transform:uppercase; letter-spacing:.12em; font-weight:800; font-size:.78rem; color:var(--bom-accent-dark); }

.site-header { position:sticky; top:0; z-index:100; background:rgba(255,255,255,.97); border-bottom:1px solid var(--bom-border); backdrop-filter:blur(10px); }
.site-header__inner { min-height:74px; display:flex; align-items:center; justify-content:space-between; gap:24px; }
.site-branding { display:flex; align-items:center; gap:12px; min-width:220px; }
.site-branding .custom-logo { max-height:44px; width:auto; }
.site-title { margin:0; font-weight:800; font-size:1.15rem; color:var(--bom-primary-dark); }
.site-title a { color:inherit; }
.site-description { display:none; margin:0; color:var(--bom-muted); font-size:.82rem; }
.primary-menu { list-style:none; display:flex; gap:22px; align-items:center; margin:0; padding:0; }
.primary-menu li { margin:0; }
.primary-menu a { display:block; font-weight:700; font-size:.95rem; color:var(--bom-ink); padding:26px 0; }
.primary-menu a:hover { color:var(--bom-accent-dark); }
.menu-toggle { display:none; background:var(--bom-primary); color:#fff; border:0; border-radius:10px; padding:10px 13px; font-weight:700; cursor:pointer; }
.header-search { display:flex; align-items:center; }
.header-search a { display:inline-flex; width:38px; height:38px; align-items:center; justify-content:center; border:1px solid var(--bom-border); border-radius:50%; }

.bom-hero { background:linear-gradient(135deg, #f2f8fb 0%, #f7fffc 100%); border-bottom:1px solid var(--bom-border); padding:80px 0 70px; }
.bom-hero__grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr); align-items:center; gap:52px; }
.bom-hero h1 { margin:.35rem 0 1rem; color:var(--bom-primary-dark); font-size:clamp(2.5rem,5vw,4.6rem); line-height:1.03; letter-spacing:-.035em; }
.bom-hero p { font-size:1.12rem; color:var(--bom-muted); max-width:760px; }
.bom-search { display:flex; gap:0; max-width:720px; margin-top:26px; box-shadow:var(--bom-shadow); }
.bom-search input[type="search"] { flex:1; min-width:0; border:1px solid var(--bom-border); border-right:0; border-radius:14px 0 0 14px; padding:16px 18px; font-size:1rem; background:#fff; }
.bom-search button { border:0; border-radius:0 14px 14px 0; padding:0 24px; background:var(--bom-accent); color:white; font-weight:800; cursor:pointer; }
.bom-hero__panel { background:var(--bom-primary-dark); color:white; border-radius:24px; padding:30px; box-shadow:var(--bom-shadow); }
.bom-hero__panel h2 { margin:0 0 18px; font-size:1.25rem; }
.bom-hero__links { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.bom-hero__links a { background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.12); color:white; padding:14px; border-radius:12px; font-weight:700; }
.bom-hero__links a:hover { background:rgba(255,255,255,.16); }

.bom-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:18px; }
.bom-card { background:#fff; border:1px solid var(--bom-border); border-radius:var(--bom-radius); overflow:hidden; box-shadow:0 4px 18px rgba(33,49,60,.04); transition:.2s ease; }
.bom-card:hover { transform:translateY(-3px); box-shadow:var(--bom-shadow); border-color:#c7d8e0; }
.bom-card__body { padding:20px; }
.bom-card h3 { margin:0 0 8px; font-size:1.08rem; line-height:1.35; }
.bom-card p { margin:0; color:var(--bom-muted); font-size:.93rem; }
.bom-card__meta { display:flex; flex-wrap:wrap; gap:8px; color:var(--bom-muted); font-size:.8rem; margin-top:12px; }
.bom-card__image { display:block; aspect-ratio:16/9; background:#eaf2f6; overflow:hidden; }
.bom-card__image img { width:100%; height:100%; object-fit:cover; transition:transform .25s ease; }
.bom-card:hover .bom-card__image img { transform:scale(1.025); }

.bom-specialty-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; }
.bom-specialty { display:block; padding:18px; border:1px solid var(--bom-border); border-radius:14px; background:white; color:var(--bom-ink); font-weight:800; min-height:82px; }
.bom-specialty small { display:block; margin-top:6px; font-size:.78rem; color:var(--bom-muted); font-weight:600; }
.bom-specialty:hover { border-color:var(--bom-accent); color:var(--bom-accent-dark); }

.bom-feature-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.bom-feature { padding:24px; background:white; border:1px solid var(--bom-border); border-radius:var(--bom-radius); }
.bom-feature__icon { width:42px; height:42px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:#e7f8f2; color:var(--bom-accent-dark); font-weight:900; margin-bottom:16px; }
.bom-feature h3 { margin:0 0 8px; }
.bom-feature p { margin:0 0 14px; color:var(--bom-muted); }

.bom-page-hero { padding:52px 0; background:var(--bom-soft); border-bottom:1px solid var(--bom-border); }
.bom-page-hero h1 { margin:0 0 10px; font-size:clamp(2rem,4vw,3.3rem); color:var(--bom-primary-dark); line-height:1.1; }
.bom-page-hero p { margin:0; color:var(--bom-muted); max-width:850px; }
.bom-breadcrumbs { font-size:.86rem; color:var(--bom-muted); margin-bottom:14px; }
.bom-breadcrumbs a { color:var(--bom-muted); }

.content-area { padding:48px 0 72px; }
.bom-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:44px; }
.entry-header h1 { margin:0 0 14px; font-size:clamp(2rem,4vw,3.15rem); line-height:1.14; color:var(--bom-primary-dark); }
.entry-meta { display:flex; flex-wrap:wrap; gap:10px 18px; color:var(--bom-muted); font-size:.88rem; margin-bottom:22px; }
.entry-content { font-size:1.05rem; }
.entry-content h2 { margin-top:2.2em; color:var(--bom-primary-dark); font-size:1.65rem; line-height:1.3; }
.entry-content h3 { margin-top:1.8em; color:var(--bom-primary-dark); }
.entry-content table { border-collapse:collapse; width:100%; margin:1.5em 0; display:block; overflow-x:auto; }
.entry-content th, .entry-content td { border:1px solid var(--bom-border); padding:10px 12px; text-align:left; }
.entry-content th { background:var(--bom-soft); }
.entry-content blockquote { margin:1.6em 0; padding:18px 22px; border-left:4px solid var(--bom-accent); background:var(--bom-soft); }
.entry-content .wp-block-image img { border-radius:12px; }
.bom-tax-chips { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 28px; }
.bom-chip { display:inline-flex; padding:7px 10px; background:var(--bom-soft); border:1px solid var(--bom-border); border-radius:999px; font-size:.8rem; font-weight:700; }

.bom-sidebar { position:relative; }
.bom-sidebar__box { position:sticky; top:96px; border:1px solid var(--bom-border); border-radius:var(--bom-radius); padding:22px; }
.bom-sidebar h3 { margin-top:0; }
.bom-sidebar ul { list-style:none; padding:0; margin:0; }
.bom-sidebar li + li { margin-top:10px; }

.bom-ad { margin:30px 0; min-height:90px; display:flex; align-items:center; justify-content:center; background:#fafcfd; border:1px dashed #cbd9e0; border-radius:12px; color:#7a8b95; font-size:.8rem; }

.bom-term-children { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:24px; }
.bom-term-children a { padding:14px 16px; border:1px solid var(--bom-border); border-radius:12px; background:white; font-weight:700; }

.pagination .nav-links { display:flex; gap:8px; margin-top:30px; flex-wrap:wrap; }
.pagination .page-numbers { padding:8px 12px; border:1px solid var(--bom-border); border-radius:9px; }
.pagination .current { background:var(--bom-primary); color:white; border-color:var(--bom-primary); }

.site-footer { margin-top:0; background:var(--bom-primary-dark); color:#dce9f0; }
.site-footer__top { padding:54px 0 38px; display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr; gap:38px; }
.site-footer h3 { color:white; margin-top:0; }
.site-footer a { color:#dce9f0; }
.site-footer a:hover { color:white; }
.site-footer ul { list-style:none; margin:0; padding:0; }
.site-footer li + li { margin-top:8px; }
.site-footer__bottom { border-top:1px solid rgba(255,255,255,.12); padding:18px 0; font-size:.86rem; color:#b7c9d3; }

.screen-reader-text { border:0; clip:rect(1px,1px,1px,1px); clip-path:inset(50%); height:1px; margin:-1px; overflow:hidden; padding:0; position:absolute; width:1px; word-wrap:normal!important; }

@media (max-width: 1024px) {
  .bom-grid { grid-template-columns:repeat(3,1fr); }
  .bom-specialty-grid { grid-template-columns:repeat(3,1fr); }
  .bom-feature-grid { grid-template-columns:repeat(2,1fr); }
  .bom-layout { grid-template-columns:1fr; }
  .bom-sidebar__box { position:static; }
  .site-footer__top { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 820px) {
  .menu-toggle { display:block; }
  .header-search { display:none; }
  .site-navigation { position:absolute; left:0; right:0; top:74px; background:white; border-bottom:1px solid var(--bom-border); display:none; }
  .site-navigation.is-open { display:block; }
  .primary-menu { display:block; padding:10px 20px 18px; }
  .primary-menu a { padding:12px 0; }
  .bom-hero__grid { grid-template-columns:1fr; }
  .bom-hero { padding:58px 0; }
  .bom-grid { grid-template-columns:repeat(2,1fr); }
  .bom-specialty-grid { grid-template-columns:repeat(2,1fr); }
  .bom-term-children { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 560px) {
  .bom-container { width:min(100% - 22px,var(--bom-max)); }
  .bom-section { padding:46px 0; }
  .bom-grid, .bom-feature-grid, .bom-specialty-grid, .bom-term-children, .site-footer__top { grid-template-columns:1fr; }
  .bom-search { display:grid; grid-template-columns:1fr; box-shadow:none; gap:8px; }
  .bom-search input[type="search"], .bom-search button { border:1px solid var(--bom-border); border-radius:12px; min-height:50px; }
  .bom-hero__links { grid-template-columns:1fr; }
  .site-branding { min-width:0; }
  .site-title { font-size:1rem; }
}

/* Phase 4: resource-specific templates */
.bom-resource-header { margin-bottom:28px; }
.bom-resource-kicker { display:flex; align-items:center; gap:10px; margin-bottom:12px; color:var(--bom-accent-dark); font-size:.82rem; font-weight:900; text-transform:uppercase; letter-spacing:.1em; }
.bom-resource-icon { width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 34px; border-radius:10px; background:#e7f8f2; color:var(--bom-accent-dark); font-size:.8rem; letter-spacing:0; }
.bom-resource-summary { margin:22px 0 16px; padding:20px 22px; border:1px solid var(--bom-border); border-radius:14px; background:#fff; box-shadow:0 3px 14px rgba(25,57,78,.035); }
.bom-resource-summary strong { display:block; margin-bottom:6px; color:var(--bom-primary-dark); }
.bom-resource-summary p { margin:0; color:var(--bom-muted); }
.bom-resource-notice { display:flex; gap:12px; align-items:flex-start; margin:16px 0; padding:14px 16px; border-radius:12px; background:var(--bom-soft); color:var(--bom-muted); font-size:.9rem; }
.bom-resource-notice > span { width:24px; height:24px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 24px; border-radius:50%; background:var(--bom-primary); color:white; font-size:.75rem; font-weight:900; }
.bom-resource-notice p { margin:0; }
.bom-review-panel { display:flex; gap:14px; align-items:flex-start; margin:18px 0; padding:16px 18px; border:1px solid #cde8de; border-radius:14px; background:#f3fbf8; }
.bom-review-panel__mark { width:30px; height:30px; flex:0 0 30px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--bom-accent); color:#fff; font-weight:900; }
.bom-review-panel p { margin:3px 0 0; color:var(--bom-muted); font-size:.88rem; }
.bom-crosslinks { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:18px 0 4px; }
.bom-crosslinks__label { font-size:.86rem; font-weight:800; color:var(--bom-muted); margin-right:2px; }
.bom-crosslinks a { display:inline-flex; padding:6px 10px; border:1px solid var(--bom-border); border-radius:999px; background:#fff; font-size:.79rem; font-weight:800; }
.bom-featured-media { margin:0 0 28px; }
.bom-featured-media img { display:block; width:100%; border-radius:16px; }
.bom-related-section { padding-bottom:0; }
.bom-resource-sidebar > p { color:var(--bom-muted); font-size:.9rem; }
.bom-sidebar-badge { width:44px; height:44px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:#e7f8f2; color:var(--bom-accent-dark); font-weight:900; margin-bottom:14px; }
.bom-resource-links a { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--bom-border); font-weight:700; }
.bom-resource-links li:last-child a { border-bottom:0; }
.bom-resource-links a::after { content:'›'; color:var(--bom-muted); }
.bom-resource-archive-hero .bom-resource-kicker { margin-bottom:12px; }
.bom-active-filter { display:inline-flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:20px; padding:9px 12px; border:1px solid var(--bom-border); border-radius:999px; background:#fff; font-size:.83rem; }
.bom-active-filter a { font-weight:800; }
.bom-empty-state { max-width:620px; padding:34px; border:1px solid var(--bom-border); border-radius:16px; background:var(--bom-soft); }

/* Author-facing semantic content classes. These can be added in the block editor's Additional CSS class field. */
.bom-question, .bom-case-box, .bom-study-box, .bom-drug-facts, .bom-calculator-panel, .bom-professional-box, .bom-procedure-box { margin:1.6em 0; padding:22px; border:1px solid var(--bom-border); border-radius:14px; background:#fff; box-shadow:0 3px 14px rgba(25,57,78,.035); }
.bom-question { border-left:4px solid var(--bom-primary); }
.bom-question .bom-answer, .bom-answer { margin-top:16px; padding:15px 17px; border-radius:10px; background:#f3fbf8; }
.bom-case-box { background:#f8fbfd; border-left:4px solid var(--bom-primary); }
.bom-study-box { background:#fbfdfd; border-left:4px solid var(--bom-accent); }
.bom-drug-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 24px; background:#f8fbfd; }
.bom-drug-facts > * { margin:0; }
.bom-calculator-panel { padding:26px; background:linear-gradient(180deg,#f8fcfb,#fff); border-color:#cde8de; }
.bom-calculator-panel label { display:block; margin:.9rem 0 .3rem; font-weight:800; }
.bom-calculator-panel input, .bom-calculator-panel select { width:100%; padding:11px 12px; border:1px solid var(--bom-border); border-radius:9px; font:inherit; }
.bom-calculator-panel button { margin-top:14px; padding:11px 16px; border:0; border-radius:9px; background:var(--bom-accent); color:#fff; font-weight:900; cursor:pointer; }
.bom-calculator-result { margin-top:16px; padding:15px; border-radius:10px; background:var(--bom-primary-dark); color:#fff; font-weight:800; }
.bom-professional-box { border-left:4px solid var(--bom-accent); }
.bom-procedure-box { border-left:4px solid var(--bom-primary); }
.bom-step-list { counter-reset:bom-step; list-style:none; padding-left:0; }
.bom-step-list li { position:relative; padding:0 0 18px 48px; min-height:38px; }
.bom-step-list li::before { counter-increment:bom-step; content:counter(bom-step); position:absolute; left:0; top:0; width:30px; height:30px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--bom-primary); color:#fff; font-weight:900; }

/* Small visual differences by resource type. */
.bom-resource--bom_mcq .bom-resource-icon { background:#edf4ff; color:#34558b; }
.bom-resource--bom_case .bom-resource-icon { background:#fff2e8; color:#a75821; }
.bom-resource--bom_drug .bom-resource-icon { background:#f1efff; color:#5e4eb8; }
.bom-resource--bom_calculator .bom-resource-icon { background:#e8f8f2; color:#087b5e; }
.bom-resource--bom_professional .bom-resource-icon { background:#eef3f6; color:#334b5d; }

@media (max-width: 560px) {
  .bom-drug-facts { grid-template-columns:1fr; }
  .bom-resource-summary, .bom-question, .bom-case-box, .bom-study-box, .bom-drug-facts, .bom-calculator-panel, .bom-professional-box, .bom-procedure-box { padding:17px; }
  .bom-crosslinks { align-items:flex-start; }
  .bom-crosslinks__label { width:100%; }
}
