/*
Theme Name: Bastine Law
Theme URI: https://anchor.host
Author: Anchor Hosting
Author URI: https://anchor.host
Description: Custom WordPress theme for Bastine Law Group, recreating their previous site design. Pairs with the Bastine Law Blocks plugin for content sections.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: bastinelaw
*/

/* ---------------------------------------------------------------------------
   Fonts (bundled locally — no external requests)
--------------------------------------------------------------------------- */
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/eb-garamond-400.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('assets/fonts/eb-garamond-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/eb-garamond-500.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/eb-garamond-600.woff2') format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/eb-garamond-700.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('assets/fonts/roboto-400.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: italic; font-weight: 400; font-display: swap; src: url('assets/fonts/roboto-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/roboto-500.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/roboto-700.woff2') format('woff2'); }

/* ---------------------------------------------------------------------------
   Design tokens (carried over from the original site)
--------------------------------------------------------------------------- */
:root {
  --primary: #282828;
  --secondary: #B50817;
  --accent: #282828;
  --accent-alt: #F2F2F2;
  --link: #B50817;
  --link-alt: #D63037;
  --main-bg: #F4F4F4;
  --main-bg-alt: #282828;
  --inner-bg: #FFFFFF;
  --inner-bg-alt: #000000;
  --text: #282828;
  --text-alt: #FFFFFF;
  --font-title: 'EB Garamond', Georgia, serif;
  --font-main: 'Roboto', -apple-system, sans-serif;
  --container: 1240px;
  --radius-btn: 2rem;
  --shadow-card: 0 10px 30px rgba(0,0,0,.08);
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--main-bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; transition: color .2s ease; }
a:hover { color: var(--link-alt); }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.15;
  color: var(--primary);
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
h4 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.4em; }
blockquote {
  margin: 1.5em 0; padding: 1em 1.5em;
  border-left: 4px solid var(--secondary);
  background: var(--inner-bg);
  font-family: var(--font-title);
  font-size: 1.15rem;
}
.screen-reader-text {
  border: 0; clip-path: inset(50%); height: 1px; width: 1px;
  margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.skip-link { position: fixed; top: 0; left: 0; z-index: 100; background: var(--secondary); color: #fff; padding: .6em 1.2em; transform: translateY(-101%); transition: transform .2s; }
.skip-link:focus { transform: none; color: #fff; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* Buttons — round pill style from the original */
.btn, .wp-block-button__link, button[type=submit], input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-main); font-weight: 500; font-size: .95rem;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  color: #fff; background: var(--secondary);
  border: 2px solid var(--secondary); border-radius: var(--radius-btn);
  padding: 1rem 1.75rem; cursor: pointer; line-height: 1.2;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.btn:hover, .wp-block-button__link:hover, button[type=submit]:hover, input[type=submit]:hover {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn.btn-outline:hover { background: #fff; color: var(--primary); border-color: #fff; }
.btn.btn-dark { background: var(--primary); border-color: var(--primary); }
.btn.btn-dark:hover { background: var(--secondary); border-color: var(--secondary); }

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */
.site-topbar { background: var(--main-bg-alt); color: var(--text-alt); font-size: .85rem; }
.site-topbar .container { display: flex; justify-content: flex-end; gap: 1.5em; padding-top: .45em; padding-bottom: .45em; }
.site-topbar a { color: var(--text-alt); text-decoration: none; letter-spacing: .05em; text-transform: uppercase; font-weight: 500; }
.site-topbar a:hover { color: #f8b7bc; }

.site-header { background: var(--inner-bg); position: relative; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.site-header .header-main { display: flex; align-items: center; justify-content: space-between; gap: 2em; padding-top: 16px; padding-bottom: 16px; }
.site-logo img { max-height: 74px; width: auto; display: block; }
.header-contact { display: flex; align-items: center; gap: 1.5em; }
.header-phone { text-align: right; line-height: 1.3; }
.header-phone .phone-label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); font-weight: 500; }
.header-phone a { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; color: var(--secondary); text-decoration: none; }
.header-phone a:hover { color: var(--primary); }

/* Main navigation */
.site-nav { background: var(--main-bg-alt); }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > .container > ul { display: flex; flex-wrap: wrap; }
.site-nav li { position: relative; }
.site-nav a {
  display: block; padding: 1em 1.2em; color: var(--text-alt);
  font-size: .9rem; font-weight: 500; letter-spacing: .07em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: var(--secondary); }
.site-nav li.current-menu-item > a, .site-nav li.current-menu-ancestor > a { color: #fff; background: rgba(181,8,23,.85); }
.site-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 260px; z-index: 60;
  background: var(--inner-bg); box-shadow: var(--shadow-card);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.site-nav .sub-menu a { color: var(--primary); text-transform: none; letter-spacing: 0; font-size: .95rem; padding: .7em 1.2em; border-bottom: 1px solid var(--accent-alt); white-space: normal; }
.site-nav .sub-menu a:hover { color: #fff; }
.site-nav .sub-menu .sub-menu { top: 0; left: 100%; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: 0; padding: .5em; cursor: pointer; }
.submenu-toggle { display: none; }
.nav-toggle span { display: block; width: 26px; height: 3px; background: var(--primary); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
@media (max-width: 1023px) {
  .site-topbar { display: none; }
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 100px); overflow: auto; }
  .site-nav > .container { padding: 0; }
  .site-nav > .container > ul { display: block; }
  .site-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; display: none; box-shadow: none; background: #333; }
  .site-nav .sub-menu a { color: #ddd; border-bottom-color: #3d3d3d; }
  .site-nav li.is-expanded > .sub-menu { display: block; }
  .submenu-toggle { display: block; position: absolute; top: 0; right: 0; width: 48px; height: 48px; background: none; border: 0; color: #fff; font-size: 1.2rem; cursor: pointer; }
  .header-phone .phone-label { display: none; }
  .header-phone a { font-size: 1.2rem; white-space: nowrap; }
  .site-logo { flex-shrink: 0; }
  .site-logo img { max-height: 56px; }
}
@media (max-width: 640px) {
  .site-header .header-main { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .header-contact { gap: .8em; }
  .header-contact .btn { display: none; }
  .header-phone a { font-size: 1.05rem; }
  .site-logo img { max-height: 44px; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------------------------------------------------------------------------
   Page banner (interior pages)
--------------------------------------------------------------------------- */
.page-banner {
  position: relative; background: var(--main-bg-alt); color: #fff;
  padding: clamp(60px, 9vw, 120px) 0;
  background-size: cover; background-position: center top;
}
.page-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(20,20,20,.72), rgba(20,20,20,.72)); }
.page-banner.is-slim { padding: clamp(36px, 5vw, 64px) 0; }
.page-banner .container { position: relative; text-align: center; }
.page-banner h1 { color: #fff; margin-bottom: .2em; }
.breadcrumbs { font-size: .85rem; letter-spacing: .05em; color: rgba(255,255,255,.75); }
.breadcrumbs a { color: #fff; text-decoration: none; }
.breadcrumbs a:hover { color: var(--link-alt); }
.breadcrumbs .sep { margin: 0 .5em; opacity: .5; }

/* ---------------------------------------------------------------------------
   Content area
--------------------------------------------------------------------------- */
.site-main { background: var(--main-bg); }
.entry-content-wrap { padding: clamp(40px, 6vw, 80px) 0; }
.entry-content > .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.entry-content > .alignwide { max-width: var(--container); margin-left: auto; margin-right: auto; }

/* Constrain plain flow content on pages without the sidebar layout */
.entry-content > :not(.alignfull):not(.alignwide):not(.blg-section) { max-width: var(--container); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.entry-content > .alignfull + * { margin-top: 1.2em; }

/* Pages that open/close with a full-bleed band shouldn't get wrap padding */
.entry-content-wrap:has(> .entry-content > .blg-section:first-child) { padding-top: 0; }
.entry-content-wrap:has(> .entry-content > .blg-section:last-child) { padding-bottom: 0; }

/* ---------------------------------------------------------------------------
   Blog
--------------------------------------------------------------------------- */
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; padding: clamp(40px, 6vw, 80px) 24px; max-width: var(--container); margin: 0 auto; }
@media (max-width: 900px) { .blog-layout { grid-template-columns: 1fr; } }
.post-card { background: var(--inner-bg); box-shadow: var(--shadow-card); margin-bottom: 32px; padding: 36px 40px; }
.post-card .post-meta, .single-post-meta { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #767676; margin-bottom: .5em; }
.post-card h2 { font-size: 1.7rem; margin-bottom: .4em; }
.post-card h2 a { color: var(--primary); text-decoration: none; }
.post-card h2 a:hover { color: var(--secondary); }
.post-card .read-more { font-weight: 500; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; text-decoration: none; }
.single-article { background: var(--inner-bg); box-shadow: var(--shadow-card); padding: clamp(28px, 5vw, 56px); }
.single-article h1.entry-title { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }

.blog-sidebar .widget { background: var(--inner-bg); box-shadow: var(--shadow-card); padding: 28px 32px; margin-bottom: 32px; }
.blog-sidebar .widget h3 { font-size: 1.35rem; border-bottom: 2px solid var(--secondary); padding-bottom: .4em; }
.blog-sidebar .widget ul { list-style: none; padding: 0; margin: 0; }
.blog-sidebar .widget li { border-bottom: 1px solid var(--accent-alt); }
.blog-sidebar .widget li:last-child { border-bottom: 0; }
.blog-sidebar .widget a { display: block; padding: .55em 0; text-decoration: none; color: var(--text); }
.blog-sidebar .widget a:hover { color: var(--secondary); }
.blog-sidebar .widget a.btn { display: inline-flex; color: #fff; padding: 1rem 1.75rem; }
.blog-sidebar .widget a.btn:hover { color: #fff; background: var(--primary); border-color: var(--primary); }

.pagination { display: flex; gap: .4em; flex-wrap: wrap; margin-top: 24px; }
.pagination .page-numbers { display: inline-block; padding: .5em 1em; background: var(--inner-bg); color: var(--text); text-decoration: none; border-radius: 4px; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--secondary); color: #fff; }

/* Post navigation */
.post-nav { display: flex; justify-content: space-between; gap: 1em; margin-top: 32px; }
.post-nav a { text-decoration: none; font-weight: 500; }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer { background: var(--main-bg-alt); color: var(--text-alt); padding: clamp(48px, 6vw, 80px) 0 32px; }
.site-footer a { color: var(--text-alt); text-decoration: none; }
.site-footer a:hover { color: var(--link-alt); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr; gap: 40px; }
@media (max-width: 900px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-brand img { max-width: 220px; margin-bottom: 1em; }
.footer-brand .footer-call-label { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; font-weight: 500; margin-bottom: .2em; }
.footer-brand .footer-phone { font-family: var(--font-title); font-size: 1.7rem; font-weight: 700; color: #fff; }
.footer-brand .footer-phone:hover { color: var(--link-alt); }
.site-footer h4 { color: #fff; font-size: 1.15rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-main); font-weight: 700; margin-bottom: 1em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5em; }
.footer-location { margin-bottom: 1.4em; font-style: normal; }
.footer-location strong { display: block; color: #fff; }
.footer-location a { color: var(--link-alt); font-size: .9rem; }
.footer-social { display: flex; gap: .8em; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; }
.footer-social a:hover { background: var(--secondary); border-color: var(--secondary); color: #fff; }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; gap: 1em; flex-wrap: wrap; font-size: .85rem; color: rgba(255,255,255,.7); }
.footer-disclaimer { flex-basis: 100%; font-size: .8rem; color: rgba(255,255,255,.55); margin-bottom: .6em; }
.footer-bottom a { color: rgba(255,255,255,.7); }
.footer-bottom a:hover { color: #fff; }

/* ---------------------------------------------------------------------------
   Forms (native styling for search + comment forms)
--------------------------------------------------------------------------- */
input[type=text], input[type=email], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: .8em 1em; border: 1px solid #ccc; border-radius: 6px;
  font-family: var(--font-main); font-size: 1rem; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
.search-form { display: flex; gap: .6em; }
.search-form .search-field { flex: 1; }

/* 404 / search results */
.page-simple { max-width: 800px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) 24px; text-align: center; }

/* Highlighted call-to-action paragraph carried over from the old site */
.txt-hlt {
  background: var(--inner-bg); border-left: 4px solid var(--secondary);
  box-shadow: var(--shadow-card); padding: 26px 30px; text-align: center;
}

/* Plain full-width content band (light + dark variants) */
.bl-plain-section { padding: clamp(40px, 6vw, 72px) 24px; }
.bl-plain-section > * { max-width: var(--container); margin-left: auto; margin-right: auto; }
.bl-plain-section.is-dark { background: var(--main-bg-alt); color: var(--text-alt); }
.bl-plain-section.is-dark h2, .bl-plain-section.is-dark h3 { color: #fff; }

/* WordPress alignment/core block compat */
.wp-block-image img { height: auto; }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.wp-block-separator { border: 0; border-top: 2px solid var(--accent-alt); }
