/*
Theme Name:           Legacy Law
Author:               Code and Core
Author URI:           https://codeandcore.com/
Description:          Legacy Law is a professional legal services block theme built for Full Site Editing. Features a sophisticated dark green and gold color scheme, Outfit and Lexend typography, and flexible layouts for law firms and attorneys.
Requires at least:    6.7
Tested up to:         7.0
Requires PHP:         7.2
Version:              1.0.2
License:              GNU General Public License v2 or later
License URI:          https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:          legacy-law
Tags:                 one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, blog, portfolio, full-site-editing
*/

/*
 * Copyright (C) 2026 Code and Core
 * https://codeandcore.com/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see https://www.gnu.org/licenses/
 */

/* ─────────────────────────────────────────────
   WORDPRESS CORE CLASSES
   ───────────────────────────────────────────── */

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5em;
}

.wp-caption {
    margin-bottom: 1.5em;
    max-width: 100%;
}

.wp-caption-text {
    text-align: center;
    font-size: 0.8em;
    margin: 0.5307em 0;
}

.sticky {
    display: block;
}

.gallery-caption {
    display: block;
}

.bypostauthor {
    display: block;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #eee;
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    color: #444;
    display: block;
    font-size: 1em;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
}

/* ─────────────────────────────────────────────
   SKIP LINK (Accessibility — Required by WP.org)
   ───────────────────────────────────────────── */

/*
 * The .skip-link is visually hidden by default (via .screen-reader-text).
 * On :focus it becomes fully visible, allowing keyboard users to bypass
 * the header navigation and jump straight to the main content.
 */
.skip-link {
    background-color: #1B3E3F;
    color: #CB9A65;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 24px;
    position: absolute;
    top: -999px;
    left: 6px;
    z-index: 99999;
    border-radius: 0 0 4px 4px;
    text-decoration: none;
    transition: top 0s;
}

.skip-link:focus {
    top: 0;
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    height: auto;
    width: auto;
    overflow: visible;
    outline: 2px solid #CB9A65;
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────
   CONTENT LINK UNDERLINES
   (Accessibility — Required by WP.org TRT)
   Links within block-level content areas must be
   visually distinguishable from surrounding text.
   ───────────────────────────────────────────── */
.entry-content a:not(.wp-block-button__link):not(.wp-element-button),
.comment-content a,
.widget a,
.textwidget a,
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-element-button),
.wp-block-latest-posts a,
.wp-block-rss a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover,
.comment-content a:hover,
.widget a:hover,
.textwidget a:hover,
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-element-button):hover {
    text-decoration: none;
}

/* ─────────────────────────────────────────────
   KEYBOARD NAVIGATION FOCUS STYLES
   (Accessibility — Required by WP.org TRT)
   Uses both the modern :focus-visible standard
   and the JS-class fallback for older browsers.
   ───────────────────────────────────────────── */

/* Modern standard — supported in all major browsers */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #CB9A65 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(203, 154, 101, 0.2) !important;
}

/* JS-class fallback: theme.js adds `is-keyboard-user` on Tab keydown
   and removes it on mousedown. This ensures focus rings only show
   for keyboard users in environments where :focus-visible isn't supported. */
.is-keyboard-user a:focus,
.is-keyboard-user button:focus,
.is-keyboard-user input:focus,
.is-keyboard-user textarea:focus,
.is-keyboard-user select:focus,
.is-keyboard-user [tabindex]:focus {
    outline: 2px solid #CB9A65 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(203, 154, 101, 0.2) !important;
}

/* Explicitly style nav menu items for keyboard visibility */
.wp-block-navigation a:focus-visible,
.is-keyboard-user .wp-block-navigation a:focus {
    outline: 2px solid #CB9A65 !important;
    outline-offset: 3px !important;
    border-radius: 2px;
}

/* ─────────────────────────────────────────────
   NAVIGATION SUBMENU FIX
   ───────────────────────────────────────────── */
.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container {
    background-color: #ffffff !important;
}
.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    color: #1B3E3F !important;
}
.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    color: #CB9A65 !important;
}
