/*
Theme Name: Course Tailor
Theme URI: https://coursetailor.com
Author: Bushra Maayah
Description: Plain, professional theme for Course Tailor, a training company that designs and delivers custom courses online and in person. Includes a Courses post type, an Enquiries post type and a contact form.
Version: 2.0.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: tailormade
*/

:root {
  --bg: #FFFFFF;
  --bg-alt: #F5F7FA;
  --text: #1B1F24;
  --muted: #5B6470;
  --line: #E3E6EA;
  --accent: #0B3B6F;
  --accent-hover: #082C53;
  --accent-soft: #E8EFF8;
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1120px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--text); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 62ch; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head p { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: 1rem; text-decoration: none; padding: .75rem 1.25rem; border-radius: var(--radius); border: 1.5px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; min-width: 0; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; align-items: center; }
.site-nav a { color: var(--text); text-decoration: none; font-size: .97rem; font-weight: 500; padding: .3rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current_page_parent > a { border-bottom-color: var(--accent); }
.header-cta { flex: none; padding: .6rem 1rem; font-size: .95rem; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: var(--radius); font: inherit; font-weight: 600; padding: .45rem .8rem; cursor: pointer; flex: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .header-cta { display: none; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: #fff; border-bottom: 1px solid var(--line); padding: .75rem var(--gutter) 1.25rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .site-nav a { font-size: 1.05rem; display: block; padding: .5rem 0; }
}
html, body { overflow-x: clip; }

/* Hero */
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); }
.hero h1 { max-width: 20ch; }
.hero .lede { margin-top: .5rem; }

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); margin-bottom: 0; }
.card ul { margin: .75rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.card li { margin-bottom: .3rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; padding-top: .5rem; border-top: 3px solid var(--accent); }
.steps li::before { content: counter(step); display: inline-block; font-weight: 700; color: var(--accent); margin-bottom: .4rem; }
.steps h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.steps p { color: var(--muted); font-size: .97rem; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Course cards */
.courses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.course-card:hover { border-color: var(--accent); }
.course-card h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.course-card p { color: var(--muted); font-size: .97rem; margin-bottom: 1rem; }
.course-meta { margin-top: auto; font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .3rem .9rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.course-topic { font-size: .82rem; font-weight: 600; color: var(--accent); margin-bottom: .5rem; display: block; }
@media (max-width: 900px) { .courses { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .courses { grid-template-columns: 1fr; } }
.section-foot { margin-top: 2rem; }

/* CTA band */
.cta-band { background: var(--accent); color: #fff; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { margin: 0; color: #fff; }
.cta-band .btn { background: #fff; color: var(--accent); border-color: #fff; }
.cta-band .btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); }

/* Page content */
.page-hero { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.page-hero h1 { max-width: 20ch; }
.entry { max-width: 68ch; }
.entry h2 { font-size: 1.5rem; margin-top: 2rem; }
.entry h3 { margin-top: 1.5rem; }
.entry ul, .entry ol { padding-left: 1.3rem; }
.entry li { margin-bottom: .4rem; }
.entry blockquote { margin: 1.5rem 0; padding: 0 0 0 1.2rem; border-left: 3px solid var(--accent); color: var(--muted); }
.entry table { border-collapse: collapse; width: 100%; font-size: .97rem; margin: 1.25rem 0; }
.entry th, .entry td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry th { font-weight: 600; }
.entry figure { margin: 1.25rem 0; }
.wp-block-button__link { font-weight: 600; background: var(--accent); color: #fff; border-radius: var(--radius); padding: .75rem 1.25rem; text-decoration: none; }
.post-meta { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }

/* Blog list */
.post-list { max-width: 760px; }
.post-item { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.post-item h2 { font-size: 1.4rem; margin-bottom: .4rem; }
.post-item h2 a { text-decoration: none; color: var(--text); }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { color: var(--muted); }
.read-more { font-weight: 600; text-decoration: none; }
.pagination { display: flex; gap: 1rem; margin-top: 2rem; }

/* Course single */
.course-spec { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1.5rem 0 2rem; max-width: 860px; }
.course-spec div { background: var(--bg-alt); border-radius: var(--radius); padding: .9rem 1rem; }
.course-spec dt { font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.course-spec dd { margin: 0; font-weight: 600; }
@media (max-width: 640px) { .course-spec { grid-template-columns: 1fr 1fr; } }
.course-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.course-aside { position: sticky; top: 90px; background: var(--bg-alt); border-radius: var(--radius); padding: 1.4rem; }
.course-aside h3 { font-size: 1.1rem; }
.course-aside p { font-size: .97rem; color: var(--muted); }
.outline { padding-left: 1.3rem; }
.outline li { padding: .35rem 0; }
@media (max-width: 860px) { .course-layout { grid-template-columns: 1fr; } .course-aside { position: static; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filters a { font-size: .9rem; font-weight: 500; text-decoration: none; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.filters a.is-active, .filters a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Contact form */
.enquiry { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(32px, 5vw, 64px); align-items: start; }
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.field { margin-bottom: 1.1rem; }
.field label, .field legend { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.field .hint { font-size: .9rem; color: var(--muted); margin: -.1rem 0 .5rem; }
.field input[type="text"], .field input[type="email"], .field select, .field textarea { width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid #C9CFD6; border-radius: var(--radius); background: #fff; color: var(--text); }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 140px; resize: vertical; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-label { font-size: .92rem; font-weight: 500; padding: .4rem .8rem; border: 1px solid #C9CFD6; border-radius: 999px; cursor: pointer; display: inline-block; }
.chip-input:checked + .chip-label { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip-input:focus-visible + .chip-label { outline: 3px solid var(--accent); outline-offset: 2px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; }
.notice { padding: .9rem 1.1rem; border-left: 4px solid var(--accent); background: var(--bg-alt); margin-bottom: 1.25rem; font-size: .97rem; }
.aside-card { background: var(--bg-alt); border-radius: var(--radius); padding: 1.4rem; font-size: .97rem; }
.aside-card h3 { font-size: 1.05rem; }
.aside-card ul { padding-left: 1.1rem; color: var(--muted); }
@media (max-width: 860px) { .enquiry { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: clamp(36px, 5vw, 56px) 0 1.5rem; font-size: .95rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { color: var(--text); font-size: .95rem; margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-brand .brand { display: inline-block; margin-bottom: .5rem; }
.footer-brand p { max-width: 36ch; }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; font-size: .85rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Admin bar offset */
body.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
