/*
Theme Name: OT Chronicles
Theme URI: https://otchronicles.com
Author: OT Chronicles
Description: A clean, clinical, mobile-first theme for the OT Chronicles surgical education blog.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: otchronicles
*/

:root {
	--teal: #0b6e72;
	--teal-600: #0a5f63;
	--teal-700: #084b4e;
	--teal-50: #eef7f7;
	--teal-100: #d6ebeb;
	--ink: #10212b;
	--ink-2: #33454f;
	--muted: #5f707a;
	--line: #e2e9ec;
	--bg: #ffffff;
	--bg-soft: #f5f9fa;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(16, 33, 43, .04), 0 8px 28px rgba(16, 33, 43, .07);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--w: 1160px;
	--w-narrow: 720px;
	--gutter: 16px;
}

@media (min-width: 720px) { :root { --gutter: 28px; } }

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

img, svg, video, iframe { max-width: 100%; height: auto; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-700); }
:focus-visible { outline: 3px solid var(--teal-100); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 .5em; }

.sr-only, .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { width: 100%; max-width: calc(var(--w-narrow) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(180%) blur(10px);
	-webkit-backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 36px; height: 36px; color: var(--teal); flex: none; }
.brand-text { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand-ot { color: var(--teal); }

.nav-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px;
	background: #fff; color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav { display: none; }
.site-nav.is-open {
	display: block; position: absolute; left: 0; right: 0; top: 100%;
	background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
	padding: 8px var(--gutter) 20px;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
	display: block; padding: 12px 4px; text-decoration: none; color: var(--ink-2);
	font-weight: 600; font-size: 1rem; border-bottom: 1px solid var(--line);
}
.nav-list .current-menu-item > a, .nav-list a:hover { color: var(--teal); }
.site-nav .search-form { margin-top: 16px; }

@media (min-width: 900px) {
	.nav-toggle { display: none; }
	.site-nav, .site-nav.is-open {
		display: flex; align-items: center; gap: 20px; position: static;
		padding: 0; border: 0; box-shadow: none; background: transparent;
	}
	.nav-list { display: flex; gap: 4px; }
	.nav-list a { border: 0; padding: 8px 12px; border-radius: 8px; font-size: .95rem; }
	.nav-list .current-menu-item > a { background: var(--teal-50); }
	.site-nav .search-form { margin: 0; width: 220px; }
}

/* ---------- Search ---------- */
.search-form { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 16px; }
.search-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }
.search-form input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .95rem; color: var(--ink); padding: 6px 0; }
.search-form button { flex: none; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.search-form button:hover { background: var(--teal-700); }
.search-form button svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, var(--teal-50) 0%, #fff 100%); border-bottom: 1px solid var(--line); padding: 44px 0 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin: 0 0 14px; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-100); }
.hero-title { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; max-width: 16ch; margin-bottom: 8px; }
.hero-title span { color: var(--teal); }
.pulse { display: block; width: 220px; height: 36px; color: var(--teal); margin: 4px 0 16px; }
.pulse path { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 2.4s ease-out .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse path { animation: none; stroke-dashoffset: 0; } }
.hero-sub { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; margin: 0 0 24px; }
.hero .search-form { max-width: 460px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.hero .search-form button { width: 42px; height: 42px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; font-weight: 600; text-decoration: none; }
.chips a:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Home intro ---------- */
.intro { display: grid; gap: 24px; padding-top: 44px; padding-bottom: 8px; align-items: center; }
@media (min-width: 860px) { .intro { grid-template-columns: 5fr 7fr; gap: 48px; } }
.intro-quote { margin: 0; background: var(--teal); color: #fff; border-radius: 20px; padding: 28px 28px 32px; position: relative; overflow: hidden; }
.intro-quote::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.intro-mark { display: block; font-size: 5rem; line-height: .8; font-weight: 800; color: #a9dfe1; height: 44px; }
.intro-quote blockquote { margin: 0; font-size: clamp(1.35rem, 4.6vw, 1.75rem); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.intro-text h2 { font-size: clamp(1.45rem, 4.5vw, 1.9rem); font-weight: 800; margin-bottom: 12px; }
.intro-text p { color: var(--ink-2); margin: 0 0 12px; }
.intro-text .eyebrow { margin-bottom: 8px; }

/* ---------- Sections & cards ---------- */
.section { padding: 40px var(--gutter) 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-title { font-size: 1.35rem; font-weight: 800; margin: 0; }

.archive-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 36px 0 30px; }
.archive-head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; margin-bottom: 6px; }
.archive-head p { color: var(--muted); margin: 0; max-width: 60ch; }

.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--teal-50); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: radial-gradient(circle at 30% 20%, #fff 0%, var(--teal-50) 45%, var(--teal-100) 100%); }
.card-placeholder svg { width: 56px; height: 56px; color: var(--teal); opacity: .85; }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat, .post-cat { align-self: flex-start; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); text-decoration: none; margin-bottom: 8px; }
.card-title { font-size: 1.15rem; font-weight: 750; margin: 0 0 8px; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--teal); }
.card-excerpt { color: var(--ink-2); font-size: .95rem; margin: 0 0 14px; }
.card-meta { margin: auto 0 0; color: var(--muted); font-size: .85rem; }

.empty-state { text-align: center; padding: 48px 20px; background: var(--bg-soft); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.pagination .page-numbers.current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- Single post ---------- */
.post-header { padding-top: 36px; padding-bottom: 20px; }
.post-title { font-size: clamp(1.9rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -0.025em; margin: 0 0 12px; }
.post-lede { font-size: 1.15rem; color: var(--ink-2); margin: 0 0 18px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--teal-50); color: var(--teal-700); font-weight: 700; font-size: .8rem; }
.badge svg { width: 14px; height: 14px; }

.post-hero { margin: 8px auto 28px; max-width: 980px; padding: 0 var(--gutter); }
.post-hero img { width: 100%; border-radius: var(--radius); display: block; }

.entry-content { font-size: 1.08rem; line-height: 1.75; color: var(--ink-2); }
.entry-content > * { margin-top: 0; margin-bottom: 1.25em; }
.entry-content h2 { font-size: 1.55rem; font-weight: 800; color: var(--ink); margin-top: 1.8em; }
.entry-content h3 { font-size: 1.25rem; font-weight: 750; color: var(--ink); margin-top: 1.5em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li::marker { color: var(--teal); }
.entry-content img { border-radius: 10px; }
.entry-content figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 8px; }
.entry-content blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--teal); color: var(--ink); font-size: 1.12rem; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--bg-soft); color: var(--ink); }
.entry-content .alignwide { max-width: 980px; margin-left: auto; margin-right: auto; }
.entry-content .alignfull { width: 100vw; position: relative; left: 50%; margin-left: -50vw; }
.entry-content .wp-block-image { margin-left: 0; margin-right: 0; }

.callout, .disclaimer { border-radius: 12px; padding: 16px 18px; font-size: .92rem; line-height: 1.6; }
.disclaimer { display: flex; gap: 12px; margin: 36px 0 24px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); }
.disclaimer svg { flex: none; width: 22px; height: 22px; color: var(--teal); margin-top: 2px; }
.disclaimer strong { color: var(--ink); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.post-tags a { font-size: .85rem; padding: 5px 12px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.share-label { font-weight: 700; font-size: .9rem; margin-right: 4px; }
.share a, .share button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--teal); color: var(--teal); }

.related { background: var(--bg-soft); border-top: 1px solid var(--line); }

.ad-slot { margin: 28px 0; text-align: center; min-height: 0; }

/* ---------- Pages ---------- */
.page-header { padding-top: 40px; padding-bottom: 8px; }
.page-header h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; }
.page-content { padding-bottom: 56px; }

/* ---------- Comments ---------- */
.comments { padding-top: 8px; padding-bottom: 56px; }
.comments-title { font-size: 1.3rem; font-weight: 800; }
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .children { list-style: none; padding-left: 20px; border-left: 2px solid var(--line); }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { font-size: .8rem; margin: 2px 0 8px 50px; }
.comment-metadata a { color: var(--muted); text-decoration: none; }
.comment-content { margin-left: 50px; color: var(--ink-2); }
.reply { margin-left: 50px; font-size: .85rem; font-weight: 700; }
.comment-respond { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.comment-reply-title { font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; }
.comment-notes, .logged-in-as { font-size: .88rem; color: var(--muted); }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], textarea, select {
	width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
	border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-100); }
label { font-weight: 600; font-size: .92rem; }
.comment-form p, .wpcf7-form p { margin: 0 0 14px; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; font-size: .85rem; color: var(--muted); }
input[type="submit"], .button, .wp-block-button__link, .wpcf7-submit {
	display: inline-block; font: inherit; font-weight: 700; font-size: 1rem; color: #fff !important;
	background: var(--teal); border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer; text-decoration: none;
}
input[type="submit"]:hover, .button:hover, .wp-block-button__link:hover { background: var(--teal-700); }
.wpcf7-response-output { border-radius: 10px; margin: 16px 0 0 !important; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 72px var(--gutter); }
.not-found .code { font-size: 4.5rem; font-weight: 800; color: var(--teal); letter-spacing: -0.04em; margin: 0; }
.not-found .search-form { max-width: 420px; margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c7d3d9; padding: 44px 0 24px; font-size: .93rem; }
.site-footer a { color: #e8f0f2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr; } }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer .brand-mark { color: #19a3a8; }
.site-footer .brand-ot { color: #5fd0d4; }
.footer-about { max-width: 46ch; margin: 0; }
.footer-nav .nav-list a { color: #e8f0f2; border-color: rgba(255, 255, 255, .08); font-weight: 500; }
@media (min-width: 720px) { .footer-nav .nav-list a { border: 0; padding: 4px 0; } }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .82rem; color: #93a6ae; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* ---------- WordPress core alignment helpers ---------- */
.alignleft { float: left; margin: .3em 1.2em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: .85rem; color: var(--muted); }
.sticky .card { border-color: var(--teal); }
