/*
Theme Name: Casterline
Theme URI: https://seancasterline.net/
Author: WebiMax
Description: A clean, navy-and-white personal brand theme for Sean Casterline, built to match the visual language of seancasterline.com. Includes a custom homepage, styled blog index and article layout, plus Press and Contact page templates.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: casterline
Tags: one-column, custom-menu, featured-images, blog, editor-style
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --navy:        #000b4e;
  --navy-deep:   #00072f;
  --navy-btn:    #18267b;
  --navy-btn-hi: #223399;
  --gray-bg:     #f3f3f3;
  --gray-line:   #e4e6ee;
  --text:        #333333;
  --text-muted:  #5d6275;
  --white:       #ffffff;

  --font: "Poppins", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --shadow-card: 0 6px 24px rgba(0, 11, 78, 0.07);
  --shadow-lift: 0 14px 38px rgba(0, 11, 78, 0.14);

  --radius-sm: 4px;
  --radius:    10px;
  --radius-lg: 20px;

  --wrap: 1240px;
  --gutter: 24px;
}

/* ==========================================================================
   2. Reset / base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--navy-btn); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--navy); margin: 0 0 0.6em; line-height: 1.18; }
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 300; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 500; }
h3 { font-size: 1.25rem; font-weight: 500; }

p { margin: 0 0 1.15em; }

a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 3px solid #ffd166;
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* WordPress accessibility helpers */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: var(--white); clip: auto; clip-path: none; color: var(--navy);
  display: block; font-weight: 600; height: auto; left: 12px; padding: 12px 20px;
  top: 12px; width: auto; z-index: 100000;
}
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 12px; }

/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: 84px 0; }
.section--gray { background: var(--gray-bg); }
.section--tight { padding: 56px 0; }

.section__head { text-align: center; max-width: 760px; margin: 0 auto 48px; }
.section__head p { color: var(--text-muted); }

.eyebrow {
  display: block; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--navy-btn); margin-bottom: 12px;
}

.grid { display: grid; gap: 28px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.center { text-align: center; }
.mt-32 { margin-top: 32px; }

/* ==========================================================================
   4. Buttons
   ========================================================================== */
.btn {
  display: inline-block; background: var(--navy-btn); color: var(--white);
  font-family: var(--font); font-size: 1rem; font-weight: 500; line-height: 1.2;
  padding: 15px 30px; border: 2px solid var(--navy-btn); border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn:hover {
  background: var(--navy-btn-hi); border-color: var(--navy-btn-hi);
  color: var(--white); text-decoration: none; transform: translateY(-1px);
}
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.75); }
.btn--ghost:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn--outline-navy { background: transparent; color: var(--navy-btn); border-color: var(--navy-btn); }
.btn--outline-navy:hover { background: var(--navy-btn); color: var(--white); }

/* ==========================================================================
   5. Header / navigation
   ========================================================================== */
.site-header { background: var(--navy); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 96px; padding: 16px var(--gutter); max-width: var(--wrap); margin: 0 auto;
}

.wordmark {
  font-size: clamp(1.25rem, 2.6vw, 2.25rem); font-weight: 700; letter-spacing: 0.01em;
  text-transform: uppercase; color: var(--white); margin: 0; line-height: 1.1;
}
.wordmark a { color: var(--white); }
.wordmark a:hover { text-decoration: none; opacity: 0.85; }
.custom-logo { max-height: 64px; width: auto; }

.nav-toggle {
  display: none; background: transparent; border: 2px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-sm); color: var(--white); font: inherit; font-weight: 600;
  padding: 8px 14px; cursor: pointer;
}

.site-nav ul { list-style: none; display: flex; align-items: center; gap: 34px; margin: 0; padding: 0; }
.site-nav li { position: relative; }
.site-nav a {
  color: var(--white); font-weight: 600; font-size: 1rem; padding: 6px 0;
  border-bottom: 2px solid transparent; display: inline-block;
}
.site-nav a:hover { text-decoration: none; border-bottom-color: rgba(255,255,255,0.8); }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .current-menu-parent > a { border-bottom-color: var(--white); }

/* Highlight the last top-level item (e.g. Delta Advisor) as an outlined button */
.site-nav .menu-item-cta > a,
.site-nav .nav-cta > a {
  border: 2px solid var(--white); border-radius: var(--radius-sm); padding: 12px 22px;
}
.site-nav .menu-item-cta > a:hover,
.site-nav .nav-cta > a:hover { background: var(--white); color: var(--navy); }

/* Dropdowns */
.site-nav .sub-menu {
  display: none; position: absolute; left: 0; top: 100%; min-width: 220px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  padding: 10px 0; flex-direction: column; gap: 0; z-index: 50;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { display: flex; }
.site-nav .sub-menu a { color: var(--navy); padding: 10px 20px; width: 100%; border: 0; }
.site-nav .sub-menu a:hover { background: var(--gray-bg); }

/* ==========================================================================
   6. Hero + page banner
   ========================================================================== */
.hero { background: var(--navy); padding: 36px 0 72px; }
.hero__card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: stretch;
  box-shadow: var(--shadow-lift);
}
.hero__text { padding: 72px 56px; align-self: center; }
.hero__text h1 { margin-bottom: 18px; }
.hero__kicker { font-size: 1.125rem; color: var(--text-muted); margin-bottom: 28px; }
.hero__media { position: relative; min-height: 420px; background: var(--gray-bg); }
.hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
}

.page-hero { background: var(--navy); padding: 64px 0 72px; color: var(--white); }
.page-hero h1 { color: var(--white); font-weight: 300; margin-bottom: 10px; }
.page-hero p { color: rgba(255,255,255,0.82); max-width: 640px; font-size: 1.0625rem; }
.page-hero .entry-meta { color: rgba(255,255,255,0.75); font-size: 0.9375rem; }
.breadcrumb {
  font-size: 0.875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); margin-bottom: 14px;
}
.breadcrumb a { color: rgba(255,255,255,0.9); }

/* ==========================================================================
   7. Cards
   ========================================================================== */
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-card);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.card__thumb {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-btn) 100%);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__thumb--placeholder::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 22%, rgba(255,255,255,0.16), transparent 58%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 16px);
}
.card:nth-child(3n+2) .card__thumb--placeholder {
  background: linear-gradient(135deg, var(--navy-btn) 0%, #3a49b8 100%);
}
.card:nth-child(3n+3) .card__thumb--placeholder {
  background: linear-gradient(160deg, #0b1a5e 0%, #2b3a8f 60%, #45539f 100%);
}
.card:nth-child(4n+4) .card__thumb--placeholder::after {
  background:
    radial-gradient(circle at 22% 78%, rgba(255,255,255,0.18), transparent 55%),
    repeating-linear-gradient(65deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 18px);
}

.card__body { padding: 26px 26px 30px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.1875rem; font-weight: 500; line-height: 1.35; margin-bottom: 10px; }
.card__title a { color: var(--navy); }
.card__title a:hover { color: var(--navy-btn); text-decoration: none; }
.card__meta { font-size: 0.875rem; font-weight: 600; color: var(--navy-btn); margin-bottom: 12px; }
.card__excerpt { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 18px; }
.card__more { margin-top: auto; font-weight: 600; font-size: 0.9375rem; }
.card__more::after { content: " \2192"; }

.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__thumb { flex: 0 0 32%; aspect-ratio: auto; min-height: 100%; }
.card--row .card__body { padding: 30px 32px; }

/* ==========================================================================
   8. Split content / stats / features
   ========================================================================== */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.split--reverse .split__media { order: 2; }
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow-card); width: 100%; display: block; }
.split__text h2 { margin-bottom: 20px; }

.stat {
  background: var(--white); border: 1px solid var(--gray-line); border-radius: var(--radius);
  padding: 26px 24px; text-align: center;
}
.stat__num { display: block; font-size: 1.75rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.stat__label { font-size: 0.875rem; color: var(--text-muted); }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.features li { position: relative; padding-left: 34px; color: var(--text-muted); }
.features strong { color: var(--navy); display: block; font-weight: 600; }
.features li::before {
  content: ""; position: absolute; left: 0; top: 9px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--navy-btn); box-shadow: 0 0 0 4px rgba(24,38,123,0.14);
}

/* ==========================================================================
   9. CTA band
   ========================================================================== */
.cta-band { background: var(--navy); color: var(--white); padding: 72px 0; text-align: center; }
.cta-band h2 { color: var(--white); font-weight: 300; }
.cta-band p { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0 auto 30px; }

/* ==========================================================================
   10. Press list
   ========================================================================== */
.press-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.press-item {
  background: var(--white); border: 1px solid var(--gray-line); border-radius: var(--radius);
  padding: 22px 26px; display: grid; grid-template-columns: 190px 1fr auto; gap: 20px;
  align-items: center; transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.press-item:hover { border-color: rgba(24,38,123,0.35); box-shadow: var(--shadow-card); }
.press-item__pub { font-weight: 600; color: var(--navy); font-size: 0.9375rem; }
.press-item__title { font-size: 1.0625rem; }
.press-item__title a { color: var(--navy); }
.press-item__date { font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; }

/* ==========================================================================
   11. Forms
   ========================================================================== */
.form-card {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: 44px; max-width: 760px; margin: 0 auto;
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { margin-bottom: 22px; }
.field label { display: block; font-weight: 600; font-size: 0.9375rem; color: var(--navy); margin-bottom: 8px; }
.field .req { color: #b3261e; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); padding: 13px 15px;
  border: 1px solid #c9ccd8; border-radius: var(--radius-sm); background: var(--white);
}
.field input:focus, .field textarea:focus { border-color: var(--navy-btn); }
.field textarea { min-height: 160px; resize: vertical; }
.form-note { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 26px; }
.form-hp { position: absolute; left: -9999px; }

.notice { border-radius: var(--radius); padding: 16px 20px; margin-bottom: 26px; font-size: 0.9375rem; }
.notice--ok { background: #e7f4ec; border: 1px solid #86c69f; color: #14512f; }
.notice--err { background: #fdecea; border: 1px solid #e2a19c; color: #7a1a13; }

/* ==========================================================================
   12. Long-form content
   ========================================================================== */
.prose { max-width: 780px; }
/* Centre the reading column on posts and pages, but leave nested prose
   (inside .split, .form-card) aligned with its container. */
.wrap > .prose,
.wrap > article > .prose { margin-left: auto; margin-right: auto; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2 { margin-top: 44px; font-size: 1.75rem; }
.prose h3 { margin-top: 32px; }
.prose ul, .prose ol { padding-left: 22px; color: var(--text-muted); }
.prose li { margin-bottom: 10px; }
.prose img { border-radius: var(--radius); }
.prose blockquote {
  margin: 32px 0; padding: 24px 28px; background: var(--gray-bg);
  border-left: 4px solid var(--navy-btn); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.0625rem; color: var(--navy);
}
.prose figure { margin: 32px 0; }
.prose figcaption { font-size: 0.875rem; color: var(--text-muted); margin-top: 8px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--gray-line); padding: 10px 12px; text-align: left; }

/* WordPress core alignment classes */
.alignleft { float: left; margin: 6px 28px 20px 0; }
.alignright { float: right; margin: 6px 0 20px 28px; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.sticky .card__meta::after { content: " \00b7 Featured"; }

.entry-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--gray-line); font-size: 0.9375rem; color: var(--text-muted); }
.entry-footer a { font-weight: 600; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.post-nav__item { background: var(--white); border: 1px solid var(--gray-line); border-radius: var(--radius); padding: 22px 24px; }
.post-nav__label { display: block; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.post-nav__item a { color: var(--navy); font-weight: 500; }
.post-nav__item--next { text-align: right; }

/* ==========================================================================
   12b. Comments
   ========================================================================== */
.comments-area { max-width: 780px; margin: 56px auto 0; }
.comments-title, .comment-reply-title { font-size: 1.5rem; font-weight: 500; color: var(--navy); }
.comment-list { list-style: none; margin: 0 0 40px; padding: 0; }
.comment-list li { margin-bottom: 20px; }
.comment-body {
  background: var(--gray-bg); border-radius: var(--radius); padding: 22px 24px;
}
.comment-list .children { list-style: none; margin: 20px 0 0 24px; padding: 0; }
.comment-meta { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 10px; }
.comment-author .fn { color: var(--navy); font-weight: 600; font-style: normal; }
.comment-form { display: block; }
.comment-form p { margin-bottom: 20px; }
.comment-form label { display: block; font-weight: 600; font-size: 0.9375rem; color: var(--navy); margin-bottom: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); padding: 13px 15px;
  border: 1px solid #c9ccd8; border-radius: var(--radius-sm); background: var(--white);
}
.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--navy-btn); }
.comment-form .comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 10px; }
.comment-form .comment-form-cookies-consent label { font-weight: 400; color: var(--text-muted); margin: 0; }
.comment-form input[type="submit"] {
  display: inline-block; background: var(--navy-btn); color: var(--white); font: inherit;
  font-weight: 500; padding: 15px 30px; border: 2px solid var(--navy-btn);
  border-radius: var(--radius-sm); cursor: pointer;
}
.comment-form input[type="submit"]:hover { background: var(--navy-btn-hi); border-color: var(--navy-btn-hi); }
.comment-notes, .comment-form .logged-in-as { color: var(--text-muted); font-size: 0.9375rem; }

/* ==========================================================================
   13. Footer
   ========================================================================== */
.site-footer {
  background: var(--navy-deep); color: rgba(255,255,255,0.78);
  padding: 64px 0 32px; font-size: 0.9375rem;
}
.site-footer a { color: var(--white); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.14);
}
.site-footer h4 {
  color: var(--white); font-size: 0.8125rem; letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 16px;
}
.site-footer .brand {
  font-size: 1.375rem; font-weight: 700; text-transform: uppercase;
  color: var(--white); margin-bottom: 12px;
}
.footer-links, .site-footer .menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.social {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0;
  padding: 0; list-style: none;
}
.social li { margin: 0; list-style: none; }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%; transition: background 0.18s ease;
}
.social a:hover { background: rgba(255,255,255,0.16); text-decoration: none; }
.social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-bottom {
  padding-top: 24px; display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: space-between; font-size: 0.875rem; color: rgba(255,255,255,0.6);
}

/* ==========================================================================
   14. Pagination
   ========================================================================== */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border: 1px solid var(--gray-line); border-radius: var(--radius-sm);
  color: var(--navy); font-weight: 600; background: var(--white);
}
.pagination a.page-numbers:hover {
  background: var(--navy-btn); color: var(--white); border-color: var(--navy-btn); text-decoration: none;
}
.pagination .page-numbers.current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ==========================================================================
   15. Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .hero__text { padding: 56px 40px; }
  .press-item { grid-template-columns: 160px 1fr; }
  .press-item__date { grid-column: 2; }
}

@media (max-width: 900px) {
  .section { padding: 64px 0; }

  .nav-toggle { display: inline-block; }
  .site-header__inner { flex-wrap: wrap; min-height: 0; }
  .site-nav { flex-basis: 100%; display: none; padding: 8px 0 16px; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .site-nav a { display: block; padding: 12px 0; width: 100%; }
  .site-nav .sub-menu { position: static; display: flex; box-shadow: none; background: transparent; padding: 0 0 0 16px; }
  .site-nav .sub-menu a { color: var(--white); }
  .site-nav .sub-menu a:hover { background: transparent; }
  .site-nav .menu-item-cta > a { display: inline-block; margin-top: 10px; }

  .hero { padding-bottom: 48px; }
  .hero__card { grid-template-columns: 1fr; }
  .hero__media { order: -1; min-height: 340px; }
  .hero__text { padding: 40px 28px 48px; }

  .grid--2, .grid--3 { grid-template-columns: 1fr; }

  .split { grid-template-columns: 1fr; gap: 34px; }
  .split--reverse .split__media { order: -1; }

  .card--row { flex-direction: column; }
  .card--row .card__thumb { flex: none; aspect-ratio: 16 / 9; min-height: 0; }

  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 28px 22px; }

  .press-item { grid-template-columns: 1fr; gap: 8px; }
  .press-item__date { grid-column: 1; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { text-align: left; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
