/*
Theme Name: Twenty Twenty-Five Child
Author: Michael Bates
Description: A child theme with semantic link families and refined architecture.
Version: 1.1.8
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 6.9
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive-child
*/

/* ---------------------------
   1. ROOT TOKENS & GLOBAL ADJUSTMENTS
--------------------------- */

:root {
    color-scheme: light dark;

    --content-max-width: 1200px;

    /* Button tokens */
    --button-bg: var(--wp--preset--color--button-bg);
    --button-text: var(--wp--preset--color--button-text);

    /* Hover/active darkening for light mode */
    --button-bg-hover: color-mix(in srgb, var(--button-bg) 85%, black);
    --button-bg-active: color-mix(in srgb, var(--button-bg) 75%, black);

    --focus-ring: 0 0 0 1.5px var(--wp--preset--color--focus-ring);
}

/* Global focus ring */
:focus {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: inherit;
}

/* Global default inline-link hover */
a:hover {
    text-decoration: underline;
}


/* ---------------------------
   2. GLOBAL LAYOUT & HEADER SYSTEM
--------------------------- */

/* Admin bar fix */
#wpadminbar {
    position: fixed !important;
}

/* Sticky header wrapper */
.sticky-header-wrapper {
    position: sticky;
    top: calc(var(--wp-admin--admin-bar--height, 0px));
    z-index: 999;
}

/* Header template part */
header.wp-block-template-part {
    padding-left: var(--wp--preset--spacing--50);
    padding-right: var(--wp--preset--spacing--50);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background-color: var(--wp--preset--color--base-3);
    color: var(--wp--preset--color--contrast);
    border-bottom: 1px solid var(--wp--preset--color--contrast-3);
}

/* 2A. HEADER LAYOUT */
.header-inner {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

.header {
    min-height: 50px;
}

.header-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wp--preset--spacing--30);
}

.header-title-group {
    display: flex;
    flex-direction: column;
    gap:2px;
}

.header-right {
    column-gap: 24px; /* Same as nav gap */
}

/* 2B. HEADER TYPOGRAPHY */
.wp-block-site-title a {
    font-size: clamp(1.4rem, 1rem + .81vw, 1.75rem); 
    line-height: 1.2;
    letter-spacing: 0;
    font-weight: 600;
}

.wp-block-site-tagline {
    font-size: var(--wp--preset--font-size--small);
    line-height: 1;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* 2C. HEADER NAVIGATION */
.header-nav .wp-block-navigation-item__content {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
    display: inline-block;        /* stabilizes width */
    min-width: 2.75rem;           /* tuned for About/People */
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.header-nav .wp-block-navigation-item__content:hover {
    color: var(--wp--preset--color--accent-2);
}

.header-nav .wp-block-navigation-item__content[aria-current="page"] {
    color: var(--wp--preset--color--accent-2);
    font-weight: 600;
    /* text-decoration: underline; */
    text-underline-offset: 4px;
}

/* 2D. HEADER ICON CONTROLS */
.search-toggle,
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
    background: transparent;
    border: none;
    padding: 0.5rem;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.wp-block-navigation__responsive-container-open:hover,
.wp-block-navigation__responsive-container-close:hover {
    opacity: 0.75;
}

.search-toggle {
    padding: 4px;
    color: var(--wp--preset--color--contrast);
}

.search-toggle:hover{
    color: var(--wp--preset--color--accent-2);
}

.search-toggle svg path {
    transform: scale(1.08);
    transform-origin: center;
}

.search-toggle svg {
    height: 24px;
    width: 24px;
    fill: currentColor;
    stroke:currentColor;
    stroke-width: .1px;
    /* stroke: none; */ /* Optional*/
}

/* 2E. FOOTER LAYOUT */
.footer-inner {
    max-width: var(--content-max-width);
}


/* ---------------------------
   3. LINK FAMILIES (semantic styles)
--------------------------- */

/* DIRECTORY LINK */
.wp-block-latest-posts a,
.is-style-link-directory a {
    color: var(--wp--preset--color--accent-2);
    text-decoration: none;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.wp-block-latest-posts a:hover,
.wp-block-latest-posts a:focus,
.is-style-link-directory a:hover,
.is-style-link-directory a:focus {
    color: var(--wp--preset--color--contrast);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* NAVIGATION LINK */
.is-style-link-nav a {
    text-decoration: none;
    font-weight: 500;
    color: var(--wp--preset--color--contrast);
    transition: color 0.15s ease;
}

.is-style-link-nav a:hover,
.is-style-link-nav a:focus {
    color: var(--wp--preset--color--accent-2);
    text-decoration: none;
}

/* TAG LINK */
.tag-cloud-link,
.is-style-link-tag a {
    color: var(--wp--preset--color--accent-2);
    text-decoration: none;
    transition: color 0.15s ease;
}

.tag-cloud-link:hover,
.tag-cloud-link:focus,
.is-style-link-tag a:hover,
.is-style-link-tag a:focus {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
}

/* TITLE LINK PATTERN — applies to all headline-as-link elements */
.is-style-link-title a,
.wp-block-latest-posts__post-title,
.in-this-article a {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
    transition: color 0.15s ease;
    display: inline-block; /* ensures rectangular outline */
}

/* Hover + focus color */
.is-style-link-title a:hover,
.is-style-link-title a:focus,
.is-style-link-title a:focus-visible,
.wp-block-latest-posts__post-title:hover,
.wp-block-latest-posts__post-title:focus,
.wp-block-latest-posts__post-title:focus-visible,
.in-this-article a:hover,
.in-this-article a:focus,
.in-this-article a:focus-visible {
    color: var(--wp--preset--color--accent-2);
}

/* Override global focus ring */
.is-style-link-title a:focus,
.is-style-link-title a:focus-visible,
.in-this-article a:focus,
.in-this-article a:focus-visible {
    box-shadow: none;                     /* disable global ring */
    outline: 2px solid currentColor;      /* clean rectangle */
    outline-offset: 2px;
}

/* Fix Latest Posts focus color */
.wp-block-latest-posts .wp-block-latest-posts__post-title:focus,
.wp-block-latest-posts .wp-block-latest-posts__post-title:focus-visible {
    box-shadow: none !important;
    outline: 2px solid var(--wp--preset--color--accent-2);
    outline-offset: 2px;
}


/* ---------------------------
   4. CONTENT CONTAINER
   Global wrapper for page, post, card, sidebar, etc. 
--------------------------- */

.wp-block-group.content-container {
    padding: 30px;
    background-color: var(--wp--preset--color--base-4);
    color: var(--wp--preset--color--contrast);
    border: 1px solid var(--wp--preset--color--contrast-6);
    border-radius: 1rem;
    min-height: 3rem;
}


/* ----------------------------------------------------
   5. BUTTON SYSTEM — Unified Token-Driven Architecture
   ----------------------------------------------------
   theme.json provides:
     --wp--preset--color--button-bg
     --wp--preset--color--button-text

   :root aliases them to:
     --button-bg
     --button-text
     --button-bg-hover
     --button-bg-active

   Core buttons + plugin buttons all consume these.
---------------------------------------------------- */

/* ---------------------------
   Core button styles
--------------------------- */

.button,
.wp-block-button__link {
  display: inline-block;
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.button:hover,
.wp-block-button__link:hover {
  background-color: var(--button-bg-hover);
}

.button:active,
.wp-block-button__link:active {
  background-color: var(--button-bg-active);
}

/* ---------------------------
   Plugin buttons
--------------------------- */

/* Mailchimp (MC4WP) */
.mc4wp-form input[type="submit"] {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}

.mc4wp-form input[type="submit"]:hover {
  background-color: var(--button-bg-hover);
}

.mc4wp-form input[type="submit"]:active {
  background-color: var(--button-bg-active);
}

/* Nelio */
.nelio-form .submit,
.nelio-form button[type="submit"] {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}

.nelio-form .submit:hover,
.nelio-form button[type="submit"]:hover {
  background-color: var(--button-bg-hover);
}

.nelio-form .submit:active,
.nelio-form button[type="submit"]:active {
  background-color: var(--button-bg-active);
}

/* Search block button */
.wp-block-search__button {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
  border-radius: 4px;
}

.wp-block-search__button:hover {
  background-color: var(--button-bg-hover);
}

.wp-block-search__button:active {
  background-color: var(--button-bg-active);
}

/* Comment form submit */
.wp-block-post-comments-form input[type="submit"] {
  background-color: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}
.wp-block-post-comments-form input[type="submit"]:hover {
  background-color: var(--button-bg-hover);
}
.wp-block-post-comments-form input[type="submit"]:active {
  background-color: var(--button-bg-active);
}


/* ---------------------------
   6. PAGE STRUCTURE & UTILITIES
--------------------------- */

:where(.wp-site-blocks) > .page-region {
    margin-block-start: 0;
}

.layout-wrapper {
    max-width: var(--content-max-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Spacing above/below article title area */
.article-header {
    padding: 1.2rem .25rem .75rem;
}

.article-meta-bar {
    min-height: 1rem;
    margin-block-end: .25rem !important;
}

/* Prevent internal wrapping of metadata items */
.article-meta-bar > * {
    white-space: nowrap;     /* each item stays on one line */
    min-width: max-content;  /* each item wraps as a unit */
}

/* Allow Categories block to wrap internally */
.article-meta-bar .wp-block-post-terms {
    white-space: normal;
    min-width: auto;
}

.article-meta-bar .wp-block-post-terms__separator {
  display: none;
}

.article-meta-bar a {
    letter-spacing: 1px;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    margin-right: 1rem;
}

.article-meta-bar a:hover {
    text-decoration: underline;
}

.article-header h1 {
    margin-top: 0;
}

.article-columns {
    margin-block-start: 0 ;
}


/* ---------------------------
   7. LIST SYSTEMS
--------------------------- */

/* Unified sidebar list styling */
.sidebar-list {
    margin-top: .5rem;
    margin-left: 5px;
}

.sidebar-list a {
    display: block;
    font-size: clamp(17px, 0.95rem + 0.2vw, 19px);
    font-weight: 400;
    margin-bottom: .4rem;
}

/* Remove commas only for Post Terms lists */
.sidebar-list .wp-block-post-terms__separator {
    display: none;
}

/* Optional: spacing above headings inside sidebar lists */
.in-this-article h3 {
    margin-block-start: .7rem;
}

/* Lists on pages */
.surnames-list,
.people-list,
.tags-list {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 400;
    columns: 3 9em;
    column-gap: 2em;
}

.people-list {
    column-width: 13em;
}

/* Unified list-style link behavior */
.sidebar a,
.in-this-article a,
.surnames-list a,
.people-list a,
.tags-list a {
    color: var(--wp--preset--color--accent-2);
    text-decoration: none;
}


/* -----------------------------------------
   7B. UNIFIED LIST-STYLE LINK BEHAVIOR
   -----------------------------------------
   Contextual override for navigational lists.

   These lists (sidebar, In‑This‑Article, surname/people
   directories, tag cloud) serve a navigational purpose,
   not an editorial one. Their links must present clear
   affordance across devices, including touch screens.

   This override unifies all list-style links to:
     • accent‑2 at rest
     • underline + contrast on hover/focus
     • consistent underline offset
     • predictable, mobile-friendly behavior

   Semantic link families (Editorial, Title, Directory,
   Navigation, Tag) remain intact elsewhere.
------------------------------------------ */
.sidebar a:hover,
.sidebar a:focus,
.in-this-article a:hover,
.in-this-article a:focus,
.surnames-list a:hover,
.surnames-list a:focus,
.people-list a:hover,
.people-list a:focus,
.tags-list a:hover,
.tags-list a:focus {
    color: var(--wp--preset--color--contrast);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ---------------------------
   8. BLOCK-SPECIFIC COMPONENT STYLES
--------------------------- */

.post-card h2.wp-block-post-title {
    line-height: 1;
}

/* Excerpt arrow */
.wp-block-post-excerpt__more-link a:after {
    content: " →";
}

.wp-block-post-excerpt__more-text,
.wp-block-post-excerpt__more-link {
    text-align: right;
}

/* List marker color */
ul li::marker,
ol li::marker {
    color: var(--wp--preset--color--accent-2);
}

/* Latest Posts block spacing */
.wp-block-latest-posts li {
    margin-bottom: 4px;
}

.is-style-link-nav .wp-block-navigation-item__content:hover {  
    color: var(--wp--preset--color--accent-2);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: inherit; /* ensure no weight jump */
}

.footer-nav .wp-block-navigation a[aria-current="page"] {
    color: var(--wp--preset--color--accent-2);
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
}

.wp-block-comments h2 {    
    margin-bottom: 0;
}
.wp-block-post-comments-form {
    padding-block: 0;
    padding-bottom: 0;
}

.wp-block-post-comments-form textarea#comment {
    --wp--custom--form--textarea--min-height: 80px;
    min-height: 7lh;
    height: 7lh;
}

/* ---------------------------
   9. SEARCH BLOCK ENHANCEMENTS
--------------------------- */

.wp-block-search {
    margin-block-end: 0;
}

.wp-block-search__input::placeholder {
    color: var(--wp--preset--color--contrast-2);
}

.wp-block-search__input {
    background: var(--wp--preset--color--surface-input);
    border-radius: 0.4rem;
    border: none;
}


/* ---------------------------
   10. MC4WP (MAILCHIMP) FORM
--------------------------- */

.mc4wp-form {
    margin-block-start: 0;
    max-width: 500px;
    margin: 0 auto;
}

.mc4wp-form-fields br {
    display: none;
}

.mc4wp-form-fields {
    container-name: subscribe;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    row-gap: 1rem;
}

.mc4wp-name-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mc4wp-form input {
    font-size: large;
    box-sizing: border-box;
    padding: 0.6rem;
    max-width: 500px;
    width: 100%;
    background: var(--wp--preset--color--surface-input);
    border-radius: .4rem;
    border: none;
}

.mc4wp-form input::placeholder {
    color: var(--wp--preset--color--contrast-2);
}

.subscribe-agreement a {
    text-decoration: underline;
}

@container subscribe (width > 300px) {
    .mc4wp-name-fields {
        flex-direction: row;
    }
}


/* ---------------------------
   11. NELIO FORMS (CONTACT)
--------------------------- */

.nelio-form {
    padding: 2rem 1rem !important;
}

.nelio-forms-submit {
    width: auto;
}

.contact-field input,
.contact-field textarea {
    border-radius: 5px !important;
    padding: 12px !important;
    font-size: 18px !important;
}

.contact-field textarea {
    border-bottom-right-radius: 0 !important;
}

.nelio-forms__response.nelio-forms__response--success {
    color: #4CC552 !important;
}


/* ---------------------------
   12. RESPONSIVE RULES
--------------------------- */

/* Mobile defaults (0–599px) */
@media (max-width: 600px) {
    .has-global-padding {
        padding-inline: 10px;
    }

    .wp-block-site-tagline { 
        display: none;
    }
}

/* Tablet and up (≥600px) */
@media (min-width: 600px) {
    .post-link-image {
        max-width: 200px !important;
        margin-bottom: 0 !important;
    }

    /* Show tagline hidden on mobile */
    .wp-block-site-tagline {
        display: block;
    }

    .wp-block-post-title,
    .wp-block-post-title a {
        display: inline;
    }

    /* Left align post titles centered on mobile */
    .wp-block-post-title {
        text-align: left !important;
    }

    .sidebar,
    .in-this-article {
        display: block !important;
    }
}

/* Tablet layout (≤1024px) */
@media (max-width: 1024px) {
    .article-columns {
        flex-wrap: wrap !important;
    }

    .article-columns > .wp-block-column {
        flex-basis: 100% !important;
    }
}