/*
Theme Name: Integrated NBDE
Theme URI: https://integratednbde.com/
Author: Integrated NBDE
Description: A study-focused theme for dentists preparing for the INBDE. Features a clickable 32-tooth study chart, a personal exam countdown, an automatic "On this page" list, and a customizable homepage.
Version: 1.0.0
Requires at least: 6.3
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: integrated-nbde
*/

:root {
	--ink: #12263A;
	--ink-soft: #42586C;
	--enamel: #F4F8F7;
	--paper: #FFFFFF;
	--mint: #D6EEE6;
	--teal: #0F766E;
	--teal-dark: #0A5650;
	--coral: #D9503C;
	--marker: #FFE680;
	--line: #CFDDD9;
	--font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
	--font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--enamel); color: var(--ink); font: 400 1.0625rem/1.65 var(--font-body); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
mark { background: linear-gradient(transparent 55%, var(--marker) 55%); color: inherit; padding: 0 .15em; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 1.25rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: .75rem; top: -4rem; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: .75rem; color: #fff; }

/* Buttons and links */
.btn { display: inline-block; background: var(--teal); color: #fff; border: 2px solid var(--teal); border-radius: 10px; padding: .7rem 1.25rem; font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.text-link { font-weight: 600; }

/* Top bar and header */
.topbar { background: var(--ink); color: #E7F1EE; font-size: .92rem; }
.topbar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding-block: .5rem; }
.topbar p { margin: 0; }
.exam-date { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.exam-date input { font: inherit; background: #1d3a52; color: #fff; border: 1px solid #4b6a82; border-radius: 6px; padding: .15rem .4rem; color-scheme: dark; }
.exam-date output { font-weight: 600; color: var(--marker); }

.site-header { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand-link { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.3rem/1 var(--font-head); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand-icon { width: 1.5rem; fill: var(--mint); stroke: var(--teal); stroke-width: 1.6; stroke-linejoin: round; }
.custom-logo { max-height: 3.25rem; width: auto; }

.nav-toggle { background: none; border: 2px solid var(--ink); border-radius: 8px; padding: .4rem .8rem; font: 600 1rem var(--font-body); color: var(--ink); cursor: pointer; }
.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; }
.primary-nav.is-open { display: block; }
.menu, .sub-menu, .footer-menu { list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: .5rem 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.primary-nav a:hover { color: var(--teal); }
.sub-menu { padding-left: 1rem; }
.sub-menu a { font-weight: 400; }
.current-menu-item > a, .current_page_item > a { color: var(--teal); }

@media (min-width: 860px) {
	.nav-toggle { display: none; }
	.primary-nav { display: block; position: static; border: 0; padding: 0; background: none; }
	.primary-nav .menu { display: flex; gap: .25rem 1.4rem; flex-wrap: wrap; justify-content: flex-end; }
	.primary-nav a { padding: .4rem 0; font-size: .98rem; }
	.menu-item-has-children { position: relative; }
	.sub-menu { display: none; position: absolute; left: -1rem; top: 100%; min-width: 13rem; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: .4rem 1rem; box-shadow: 0 10px 24px rgba(18, 38, 58, .12); }
	.menu-item-has-children:hover > .sub-menu, .menu-item-has-children:focus-within > .sub-menu { display: block; }
}

/* Hero with the study chart */
.hero { padding-block: 3.5rem 4rem; border-bottom: 1px solid var(--line);
	background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
	background-size: 32px 32px; background-position: -1px -1px; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { max-width: 16ch; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.5rem; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1fr 1.1fr; gap: 3.5rem; } }

.chart { background: var(--paper); border: 2px solid var(--ink); border-radius: 20px; padding: 1.25rem 1.25rem 1rem; box-shadow: 8px 8px 0 var(--mint); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1rem; }
.chart h2 { font-size: 1.3rem; margin: 0; }
.chart-count { margin: 0; font-weight: 600; color: var(--teal-dark); }
.chart-help { margin: .25rem 0 1rem; color: var(--ink-soft); font-size: .98rem; }
.arch { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 2px; }
.arch-gap { border: 0; border-top: 2px dashed var(--line); margin: .6rem 0; }
.tooth { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; background: none; border: 0; cursor: pointer; color: var(--ink-soft); font: 600 .62rem/1 var(--font-body); }
.arch-lower .tooth { flex-direction: column-reverse; }
.tooth svg { width: 100%; max-height: 36px; fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; overflow: visible; }
.arch-lower .tooth svg { transform: scaleY(-1); }
.tooth:hover svg { fill: var(--mint); }
.tooth[aria-pressed="true"] { color: var(--teal-dark); }
.tooth[aria-pressed="true"] svg { fill: var(--teal); stroke: var(--teal-dark); }
.chart-reset { margin-top: 1rem; background: none; border: 0; padding: 0; font: 600 .95rem var(--font-body); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.chart-reset:hover { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) { .tooth svg { transition: fill .15s ease; } }
@media (max-width: 640px) { .arch { grid-template-columns: repeat(8, minmax(0, 1fr)); row-gap: .5rem; } .tooth { font-size: .72rem; } }

/* Homepage sections */
.section { padding-block: 3.5rem; }
.section-tint { background: var(--mint); }
.section-title { max-width: 22ch; }
.section-lead { max-width: 60ch; color: var(--ink-soft); font-size: 1.1rem; }

.start-list { list-style: none; margin: 1.5rem 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.start-list li { display: grid; gap: .25rem 2rem; padding: 1.4rem 0; border-top: 1px solid var(--line); align-items: baseline; }
.start-list h3, .start-list p { margin: 0; }
@media (min-width: 800px) { .start-list li { grid-template-columns: 14rem 1fr auto; } }

.steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.5rem; counter-reset: none; }
.steps li { position: relative; padding-left: 3.4rem; }
.steps h3 { margin-bottom: .25rem; }
.steps p { margin: 0; }
.step-n { position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; font: 700 1.1rem var(--font-head); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.2rem; top: 2.7rem; bottom: -1.3rem; border-left: 2px dashed var(--teal); }
@media (min-width: 800px) {
	.steps { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
	.steps li { padding: 3.4rem 0 0; }
	.steps li:not(:last-child)::after { left: 2.8rem; right: -1.5rem; top: 1.2rem; bottom: auto; border-left: 0; border-top: 2px dashed var(--teal); }
}

.facts { display: grid; gap: 2rem; }
.facts-list { margin: 0; }
.facts-list > div { display: grid; gap: .1rem 1.5rem; padding: 1rem 0; border-top: 2px solid var(--ink); }
.facts-list > div:last-child { border-bottom: 2px solid var(--ink); }
.facts-list dt { color: var(--ink-soft); font-weight: 600; }
.facts-list dd { margin: 0; font: 700 clamp(1.4rem, 3vw, 1.9rem)/1.2 var(--font-head); letter-spacing: -0.02em; }
@media (min-width: 900px) { .facts { grid-template-columns: 1fr 1.2fr; gap: 4rem; } .facts-list > div { grid-template-columns: 10rem 1fr; align-items: baseline; } }

.res-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 800px) { .res-grid { grid-template-columns: repeat(3, 1fr); } }
.res { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; display: flex; flex-direction: column; }
.res.is-free { border: 2px solid var(--teal); }
.res h3 { margin-bottom: .4rem; }
.res-price { margin: 0 0 .5rem; }
.res-price span { font: 700 2.2rem/1 var(--font-head); letter-spacing: -0.03em; }
.res-price small { color: var(--ink-soft); font-size: .95rem; }
.res-tag { display: inline-block; align-self: flex-start; margin: 0 0 .75rem; padding: .1rem .6rem; background: var(--mint); color: var(--teal-dark); border-radius: 99px; font-weight: 600; font-size: .9rem; }
.res .text-link { margin-top: auto; }

/* Posts */
.post-grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 760px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.post-card-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card-body { padding: 1.1rem 1.25rem 1.3rem; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--teal); text-decoration: underline; }
.meta { color: var(--ink-soft); font-size: .92rem; margin-bottom: .4rem; }
.post-card p:last-child { margin-bottom: 0; }

/* Pages and posts */
.page-head { background: var(--mint); border-bottom: 1px solid var(--line); padding-block: 2.5rem; }
.page-head h1 { margin: 0; max-width: 22ch; font-size: clamp(2rem, 4vw, 2.9rem); }
.page-head .meta { margin-bottom: .5rem; }
.entry-layout { display: grid; gap: 1.5rem; padding-block: 2.5rem 3.5rem; grid-template-areas: "toc" "main"; }
.toc { grid-area: toc; }
.entry { grid-area: main; min-width: 0; max-width: 72ch; }
@media (min-width: 960px) {
	.entry-layout { grid-template-columns: minmax(0, 1fr) 17rem; grid-template-areas: "main toc"; gap: 3rem; }
	.toc { position: sticky; top: 6rem; align-self: start; }
}
.toc details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; }
.toc summary { font: 700 1rem var(--font-head); cursor: pointer; }
.toc ol { margin: .75rem 0 0; padding-left: 1.2rem; font-size: .98rem; }
.toc li { margin-bottom: .35rem; }
.entry-content { font-size: 1.125rem; line-height: 1.7; }
.entry-content h2 { margin-top: 2.2em; }
.entry-content h3 { margin-top: 1.8em; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: .35em; }
.entry-content img { border-radius: 12px; }
.entry-content blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--teal); color: var(--ink-soft); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.entry-content th { background: var(--mint); font-family: var(--font-head); }
.entry-thumb { margin-bottom: 1.5rem; }
.entry-footer { margin-top: 2.5rem; }
.tags a { display: inline-block; margin: 0 .3rem .3rem 0; padding: .1rem .7rem; background: var(--mint); border-radius: 99px; text-decoration: none; font-size: .92rem; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 1rem; }

.callout { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 5px solid var(--teal); border-radius: 0 10px 10px 0; background: var(--mint); }
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: block; font-family: var(--font-head); margin-bottom: .25rem; }
.callout-warning { border-color: var(--coral); background: #FCE7E2; }
.callout-note { border-color: var(--ink); background: #E5ECF2; }

/* Forms */
.search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-form input[type="search"], .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { font: inherit; width: 100%; padding: .65rem .8rem; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.search-form input[type="search"] { flex: 1 1 12rem; width: auto; }
.search-form input:focus, .comment-form textarea:focus { border-color: var(--teal); }
.comments { margin-top: 3rem; padding-bottom: 3rem; max-width: 72ch; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment-body { padding: 1rem 0; border-top: 1px solid var(--line); }
.comment-form input[type="submit"] { background: var(--teal); color: #fff; border: 0; border-radius: 10px; padding: .7rem 1.3rem; font: 600 1rem var(--font-body); cursor: pointer; }
.navigation.pagination { margin-top: 2rem; }
.nav-links .page-numbers { display: inline-block; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-decoration: none; margin-right: .3rem; }
.nav-links .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Footer */
.site-footer { background: var(--ink); color: #D5E3EA; margin-top: 0; padding-top: 3rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2rem; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; } }
.footer-brand { font: 700 1.3rem var(--font-head); color: #fff; margin-bottom: .4rem; }
.footer-note { font-size: .95rem; max-width: 42ch; }
.footer-menu li { margin-bottom: .4rem; }
.footer-base { border-top: 1px solid #2f4a61; padding-block: 1.2rem; font-size: .92rem; }
.footer-base p { margin: 0; }
.site-footer .search-form input[type="search"] { background: #1d3a52; border-color: #4b6a82; color: #fff; }
.site-footer .btn { background: #fff; color: var(--ink); border-color: #fff; }

.alignwide { max-width: 1120px; }
.wp-caption-text, figcaption { font-size: .92rem; color: var(--ink-soft); }
