/*
Theme Name: EquineSpine
Theme URI: https://nerd4hire.me/
Author: Nerd4Hire
Author URI: https://nerd4hire.me/
Description: A warm, editorial WordPress theme designed for equine chiropractic and natural-horsemanship practitioners. Built as a modern recreation of the original EquineSpine.com seminar site, with classic equestrian typography (Playfair Display + Lora), a parchment palette, chestnut accents, and full support for menus, widgets, custom logo, and featured images.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: equinespine
Tags: blog, business, education, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* =========================================================
   1. Design tokens (CSS custom properties)
   ========================================================= */

:root {
    /* Palette */
    --es-parchment:        #f6efe1;
    --es-parchment-deep:   #ede2cc;
    --es-cream:            #fbf7ee;
    --es-ink:              #1f160e;       /* near-black saddle brown */
    --es-ink-soft:         #3a2a1d;
    --es-ink-mute:         #6b5a48;
    --es-chestnut:         #9a3a1f;       /* primary accent: bay/chestnut */
    --es-chestnut-deep:    #6e2613;
    --es-sage:             #6b7a5a;       /* secondary accent: sage */
    --es-rule:             #c9b88f;       /* warm hairline rule */
    --es-rule-soft:        #e2d6b6;
    --es-shadow:           rgba(31, 22, 14, 0.10);

    /* Typography */
    --es-display: "Playfair Display", "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --es-body:    "Lora", Georgia, "Times New Roman", serif;
    --es-meta:    "Lora", Georgia, "Times New Roman", serif;

    /* Sizing */
    --es-content-width: 760px;
    --es-wide-width:    1140px;
    --es-radius:        2px;

    /* Motion */
    --es-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* =========================================================
   2. Reset & base
   ========================================================= */

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

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

body {
    margin: 0;
    background-color: var(--es-parchment);
    color: var(--es-ink);
    font-family: var(--es-body);
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Subtle paper texture using layered gradients */
    background-image:
        radial-gradient(at 20% 10%, rgba(154, 58, 31, 0.04) 0, transparent 40%),
        radial-gradient(at 85% 80%, rgba(107, 122, 90, 0.05) 0, transparent 45%);
    background-attachment: fixed;
}

img, svg, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--es-chestnut);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 0.2s var(--es-ease);
}

a:hover, a:focus {
    color: var(--es-chestnut-deep);
}

p { margin: 0 0 1.25em; }

hr {
    border: 0;
    height: 1px;
    background: var(--es-rule);
    margin: 2.5rem 0;
}

::selection {
    background: var(--es-chestnut);
    color: var(--es-cream);
}

/* Skip link */
.skip-link.screen-reader-text {
    position: absolute;
    top: -100px;
    left: 1rem;
    background: var(--es-ink);
    color: var(--es-cream);
    padding: 0.75rem 1rem;
    z-index: 9999;
    text-decoration: none;
    border-radius: var(--es-radius);
}
.skip-link.screen-reader-text:focus { top: 1rem; }

.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;
    word-wrap: normal !important;
}

/* =========================================================
   3. Typography
   ========================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--es-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--es-ink);
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h4 { font-size: 1.2rem; }

.entry-title a {
    color: inherit;
    text-decoration: none;
}
.entry-title a:hover { color: var(--es-chestnut); }

blockquote {
    margin: 2rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    border-left: 3px solid var(--es-chestnut);
    font-style: italic;
    color: var(--es-ink-soft);
    font-size: 1.08em;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-style: normal;
    font-size: 0.9em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--es-ink-mute);
}

code, pre, kbd, samp {
    font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: var(--es-parchment-deep);
    padding: 0.1em 0.35em;
    border-radius: var(--es-radius);
}
pre {
    padding: 1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.55;
}

/* Decorative section divider — three small diamonds */
.es-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 2.75rem 0;
    color: var(--es-rule);
}
.es-divider::before,
.es-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--es-rule);
    max-width: 6rem;
}
.es-divider span {
    width: 6px; height: 6px;
    transform: rotate(45deg);
    background: var(--es-chestnut);
    box-shadow: -14px 0 0 var(--es-rule), 14px 0 0 var(--es-rule);
}

/* =========================================================
   4. Layout containers
   ========================================================= */

.es-container {
    width: 100%;
    max-width: var(--es-wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}
.es-container--narrow { max-width: var(--es-content-width); }

/* =========================================================
   5. Header
   ========================================================= */

.site-topbar {
    background: var(--es-ink);
    color: var(--es-parchment);
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    padding: 0.55rem 0;
}
.site-topbar a { color: var(--es-parchment); text-decoration: none; }
.site-topbar a:hover { color: var(--es-rule); }
.site-topbar__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    align-items: center;
}
.site-topbar__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
}
.site-topbar__contact span::before {
    content: "";
    display: inline-block;
    width: 4px; height: 4px;
    background: var(--es-chestnut);
    border-radius: 50%;
    margin-right: 0.6rem;
    vertical-align: middle;
    transform: translateY(-2px);
}
.site-topbar__tag {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--es-rule);
}

.site-header {
    padding: 2.5rem 0 0;
    background-color: var(--es-cream);
    border-bottom: 1px solid var(--es-rule-soft);
}
.site-header__inner {
    text-align: center;
    padding-bottom: 1.25rem;
}
.site-branding { margin-bottom: 0.5rem; }
.site-title {
    font-family: var(--es-display);
    font-size: clamp(1.8rem, 4.2vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}
.site-title a {
    color: var(--es-ink);
    text-decoration: none;
}
.site-title a:hover { color: var(--es-chestnut); }
.site-description {
    font-style: italic;
    color: var(--es-ink-mute);
    font-size: 1.05rem;
    margin: 0.4rem 0 0;
}
.custom-logo-link img {
    max-height: 90px;
    width: auto;
    margin: 0 auto;
}

/* Navigation */
.main-navigation {
    margin-top: 1.5rem;
    border-top: 1px solid var(--es-rule-soft);
    border-bottom: 1px solid var(--es-rule-soft);
    background: var(--es-cream);
}
.main-navigation ul {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.main-navigation li { position: relative; }
.main-navigation a {
    display: block;
    padding: 1rem 1.25rem;
    color: var(--es-ink-soft);
    text-decoration: none;
    font-family: var(--es-body);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.2s var(--es-ease);
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a {
    color: var(--es-chestnut);
}
.main-navigation a::after {
    content: "";
    display: block;
    width: 0;
    height: 2px;
    background: var(--es-chestnut);
    transition: width 0.25s var(--es-ease);
    margin-top: 0.35rem;
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after,
.main-navigation .current_page_item > a::after { width: 100%; }

/* Submenu */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    background: var(--es-cream);
    border: 1px solid var(--es-rule-soft);
    min-width: 220px;
    padding: 0.5rem 0;
    box-shadow: 0 8px 24px var(--es-shadow);
    z-index: 100;
}
.main-navigation ul li:hover > ul,
.main-navigation ul li:focus-within > ul { display: block; }
.main-navigation ul ul { flex-direction: column; }
.main-navigation ul ul a { padding: 0.6rem 1.25rem; letter-spacing: 0.1em; }

/* Mobile toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--es-rule);
    color: var(--es-ink);
    padding: 0.6rem 1rem;
    margin: 0.6rem auto;
    font-family: var(--es-body);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--es-radius);
    transition: all 0.2s var(--es-ease);
}
.menu-toggle:hover {
    background: var(--es-ink);
    color: var(--es-cream);
    border-color: var(--es-ink);
}
.menu-toggle .hamburger {
    display: inline-block;
    width: 18px; height: 2px;
    background: currentColor;
    margin-right: 0.6rem;
    vertical-align: middle;
    position: relative;
}
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
    content: "";
    position: absolute;
    left: 0; width: 18px; height: 2px;
    background: currentColor;
}
.menu-toggle .hamburger::before { top: -6px; }
.menu-toggle .hamburger::after  { top:  6px; }

@media (max-width: 820px) {
    .menu-toggle { display: inline-block; }
    .main-navigation .menu-container {
        display: none;
        padding: 0.5rem 0 1rem;
    }
    .main-navigation.toggled .menu-container { display: block; }
    .main-navigation ul { flex-direction: column; }
    .main-navigation ul ul {
        position: static;
        border: 0;
        box-shadow: none;
        padding-left: 1rem;
    }
}

/* =========================================================
   6. Hero (front page)
   ========================================================= */

.es-hero {
    position: relative;
    background: var(--es-ink);
    color: var(--es-cream);
    padding: clamp(4rem, 10vw, 7rem) 0;
    overflow: hidden;
    text-align: center;
}
.es-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image: var(--es-hero-image, none);
    background-size: cover;
    background-position: center;
    opacity: 0.42;
    z-index: 0;
}
.es-hero::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(31,22,14,0.82) 0%, rgba(110,38,19,0.55) 100%);
    z-index: 1;
}
.es-hero > * { position: relative; z-index: 2; }
.es-hero__eyebrow {
    font-size: 0.85rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--es-rule);
    margin-bottom: 1rem;
}
.es-hero__title {
    font-family: var(--es-display);
    font-weight: 700;
    color: var(--es-cream);
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    line-height: 1.05;
    margin: 0 auto 1rem;
    max-width: 18ch;
}
.es-hero__subtitle {
    font-size: 1.15rem;
    color: var(--es-parchment);
    max-width: 50ch;
    margin: 0 auto 2rem;
    font-style: italic;
}
.es-hero__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.es-button {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    font-family: var(--es-body);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    background: var(--es-chestnut);
    color: var(--es-cream);
    border: 1px solid var(--es-chestnut);
    border-radius: var(--es-radius);
    transition: all 0.2s var(--es-ease);
    cursor: pointer;
}
.es-button:hover {
    background: var(--es-chestnut-deep);
    border-color: var(--es-chestnut-deep);
    color: var(--es-cream);
    transform: translateY(-1px);
}
.es-button--ghost {
    background: transparent;
    color: var(--es-cream);
    border-color: var(--es-rule);
}
.es-button--ghost:hover {
    background: var(--es-cream);
    color: var(--es-ink);
    border-color: var(--es-cream);
}

/* =========================================================
   7. Main content
   ========================================================= */

.site-main {
    padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.es-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
.es-layout--with-sidebar {
    grid-template-columns: minmax(0, 1fr) 280px;
}
@media (max-width: 900px) {
    .es-layout--with-sidebar { grid-template-columns: 1fr; }
}

.entry-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--es-rule-soft);
}
.entry-header .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--es-chestnut);
    margin-bottom: 0.75rem;
}
.entry-title {
    margin-bottom: 0.4rem;
}
.entry-meta {
    font-size: 0.86rem;
    color: var(--es-ink-mute);
    letter-spacing: 0.05em;
}
.entry-meta a {
    color: var(--es-ink-mute);
    text-decoration: none;
    border-bottom: 1px dotted var(--es-ink-mute);
}
.entry-meta a:hover { color: var(--es-chestnut); border-color: var(--es-chestnut); }

.entry-content {
    max-width: var(--es-content-width);
    margin: 0 auto;
}
.entry-content > * { margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 1000px; }
.entry-content > .alignfull { max-width: none; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); width: 100vw; }

.entry-content img {
    border-radius: var(--es-radius);
    margin: 1.5rem auto;
    box-shadow: 0 12px 32px var(--es-shadow);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.4rem;
    margin: 0 auto 1.5rem;
}
.entry-content li { margin-bottom: 0.35rem; }
.entry-content ul li::marker { color: var(--es-chestnut); }

.entry-content strong { color: var(--es-ink); }

.post-thumbnail {
    margin: 0 0 2.5rem;
    text-align: center;
}
.post-thumbnail img {
    max-height: 480px;
    width: auto;
    margin: 0 auto;
}

/* WP alignment helpers */
.alignleft  { float: left;  margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 600px) {
    .alignleft, .alignright { float: none; margin: 1rem auto; display: block; }
}

/* =========================================================
   8. Testimonial styling helpers
   ========================================================= */

.es-testimonial {
    border-top: 1px solid var(--es-rule-soft);
    border-bottom: 1px solid var(--es-rule-soft);
    padding: 2rem 0;
    margin: 1.5rem 0;
    position: relative;
}
.es-testimonial::before {
    content: "“";
    position: absolute;
    top: -0.4rem; left: -0.5rem;
    font-family: var(--es-display);
    font-size: 4.5rem;
    line-height: 1;
    color: var(--es-chestnut);
    opacity: 0.35;
}

/* =========================================================
   9. Sidebar / widgets
   ========================================================= */

.widget-area {
    font-size: 0.96rem;
}
.widget {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--es-rule-soft);
}
.widget:last-child { border-bottom: 0; }
.widget-title {
    font-family: var(--es-display);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--es-chestnut);
    display: inline-block;
}
.widget ul {
    list-style: none;
    padding: 0; margin: 0;
}
.widget li { padding: 0.4rem 0; border-bottom: 1px dotted var(--es-rule); }
.widget li:last-child { border-bottom: 0; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }

/* Search form */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--es-rule);
    background: var(--es-cream);
    color: var(--es-ink);
    font-family: var(--es-body);
    font-size: 0.95rem;
    border-radius: var(--es-radius);
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--es-chestnut);
    box-shadow: 0 0 0 3px rgba(154, 58, 31, 0.15);
}
.search-form button,
.search-form input[type="submit"] {
    padding: 0.65rem 1rem;
    background: var(--es-ink);
    color: var(--es-cream);
    border: 1px solid var(--es-ink);
    cursor: pointer;
    font-family: var(--es-body);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: var(--es-radius);
    transition: background 0.2s var(--es-ease);
}
.search-form button:hover { background: var(--es-chestnut); border-color: var(--es-chestnut); }

/* =========================================================
   10. Posts loop / archive
   ========================================================= */

.post-card {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--es-rule-soft);
}
.post-card:last-child { border-bottom: 0; }
.post-card .entry-header {
    text-align: left;
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 1rem;
}
.post-card .entry-summary { color: var(--es-ink-soft); }
.read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
}
.read-more::after {
    content: "→";
    display: inline-block;
    margin-left: 0.4rem;
    transition: transform 0.2s var(--es-ease);
}
.read-more:hover::after { transform: translateX(3px); }

/* Pagination */
.pagination, .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 2.5rem;
}
.pagination a, .pagination span,
.nav-links a, .nav-links span {
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--es-rule);
    text-decoration: none;
    color: var(--es-ink-soft);
    font-size: 0.9rem;
    border-radius: var(--es-radius);
}
.pagination .current,
.nav-links .current {
    background: var(--es-ink);
    color: var(--es-cream);
    border-color: var(--es-ink);
}
.pagination a:hover, .nav-links a:hover {
    background: var(--es-chestnut);
    color: var(--es-cream);
    border-color: var(--es-chestnut);
}

/* =========================================================
   11. Comments
   ========================================================= */

.comments-area {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--es-rule-soft);
}
.comments-title { margin-bottom: 1.5rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--es-rule-soft);
}
.comment-meta { font-size: 0.85rem; color: var(--es-ink-mute); margin-bottom: 0.5rem; }
.comment-author { font-weight: 600; color: var(--es-ink); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--es-rule);
    background: var(--es-cream);
    font-family: var(--es-body);
    font-size: 1rem;
    border-radius: var(--es-radius);
    margin-top: 0.4rem;
}
.comment-form label {
    display: block;
    margin-top: 1rem;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--es-ink-mute);
}
.comment-form .submit {
    margin-top: 1.25rem;
    padding: 0.85rem 1.75rem;
    background: var(--es-chestnut);
    color: var(--es-cream);
    border: 0;
    cursor: pointer;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: var(--es-radius);
}
.comment-form .submit:hover { background: var(--es-chestnut-deep); }

/* =========================================================
   12. Footer
   ========================================================= */

.site-footer {
    background: var(--es-ink);
    color: var(--es-parchment);
    padding: clamp(2.5rem, 5vw, 4rem) 0 1.5rem;
    margin-top: 4rem;
}
.site-footer a { color: var(--es-parchment); }
.site-footer a:hover { color: var(--es-chestnut); }

.site-footer__top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(226, 214, 182, 0.18);
}
.site-footer__col h3 {
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--es-cream);
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--es-chestnut);
    display: inline-block;
}
.site-footer__col p { font-size: 0.95rem; color: var(--es-rule-soft); }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col li { padding: 0.25rem 0; font-size: 0.95rem; }

.site-footer__bottom {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.84rem;
    color: var(--es-rule-soft);
    letter-spacing: 0.06em;
}
.site-footer__bottom span { color: var(--es-chestnut); }

/* =========================================================
   13. 404
   ========================================================= */

.error-404 {
    text-align: center;
    padding: 4rem 1rem;
}
.error-404 .page-title {
    font-size: clamp(3rem, 10vw, 6rem);
    color: var(--es-chestnut);
    margin-bottom: 0.5rem;
}

/* =========================================================
   14. Print
   ========================================================= */

@media print {
    .site-topbar, .main-navigation, .site-footer, .menu-toggle { display: none; }
    body { background: #fff; color: #000; }
}
