/*
Theme Name: Lawdika
Theme URI: https://lawdika.gr
Author: VoovodeNET
Author URI: https://voovode.net
Description: Bilingual (Greek/English) editorial theme built by VoovodeNET for the law office of Dimitropoulos, Karipidou & Associates. Dark "Evolved Signature" design — warm charcoal surface, muted brass accent, Literata + Commissioner type.
Version: 2.0.0
Requires at least: 6.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: lawdika
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
    /* Color — OKLCH, warm-tinted neutrals, single muted-brass accent */
    --bg:           oklch(0.165 0.008 75);
    --surface:      oklch(0.205 0.010 75);
    --surface-2:    oklch(0.245 0.012 75);
    --border:       oklch(0.32 0.012 78);
    --border-strong:oklch(0.40 0.014 78);

    --text:         oklch(0.945 0.006 82);
    --text-muted:   oklch(0.76 0.012 82);
    --text-faint:   oklch(0.60 0.012 82);

    --brass:        oklch(0.78 0.090 84);
    --brass-bright: oklch(0.86 0.095 86);
    --brass-deep:   oklch(0.52 0.058 80);

    --paper:        oklch(0.955 0.008 85);
    --ink:          oklch(0.22 0.010 75);

    /* Typography */
    --font-display: "Literata", Georgia, "Times New Roman", serif;
    --font-body:    "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;

    --text-xs:   0.8125rem;
    --text-sm:   0.9375rem;
    --text-base: 1.0625rem;
    --text-lg:   clamp(1.20rem, 1.0rem + 0.7vw, 1.40rem);
    --text-xl:   clamp(1.55rem, 1.2rem + 1.3vw, 2.10rem);
    --text-2xl:  clamp(2.10rem, 1.5rem + 2.6vw, 3.40rem);
    --text-3xl:  clamp(2.90rem, 1.9rem + 4.6vw, 5.40rem);

    --leading-tight: 1.12;
    --leading-snug:  1.3;
    --leading-body:  1.72;

    /* Spacing & rhythm */
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 4.5rem;
    --section-y: clamp(5rem, 10vh, 9rem);
    --container: 1280px;
    --measure: 68ch;
    --gutter: clamp(1.25rem, 5vw, 4rem);

    /* Form */
    --radius: 4px;
    --radius-lg: 8px;

    /* Elevation (warm, low) */
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 10px 30px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 24px 60px oklch(0 0 0 / 0.45);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 160ms;
    --t-base: 280ms;
    --t-slow: 600ms;

    --header-h: 84px;
}

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

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

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-body);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a { color: var(--brass); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--brass-bright); }

ul, ol { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--brass); color: var(--bg); }

:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ==========================================================================
   3. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text);
    font-weight: 800;
    line-height: var(--leading-tight);
    letter-spacing: -0.012em;
    margin: 0 0 var(--space-3);
    text-wrap: balance;
}

h1 { font-size: var(--text-3xl); line-height: 1.04; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); font-weight: 700; }
h4 { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.008em; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

.lead {
    font-size: var(--text-lg);
    line-height: 1.55;
    color: var(--text);
}

strong, b { font-weight: 700; }
em, i { font-style: italic; }

blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: var(--text-xl);
    line-height: 1.35;
    color: var(--text);
    margin: var(--space-6) 0;
    padding-left: var(--space-4);
    border-left: 2px solid var(--brass-deep);
}

/* Brass kicker — single use per section, never a stacked label grammar */
.kicker {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: var(--space-3);
}
.kicker::before {
    content: "";
    display: inline-block;
    width: 1.75rem;
    height: 1px;
    background: var(--brass-deep);
    vertical-align: middle;
    margin-right: 0.7rem;
    transform: translateY(-0.18em);
}

/* ==========================================================================
   4. Layout primitives
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.container--narrow { max-width: 860px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(3rem, 6vh, 5rem); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--paper h1, .section--paper h2, .section--paper h3, .section--paper h4 { color: var(--ink); }
.section--surface { background: var(--surface); }

.section-head { max-width: 52ch; margin-bottom: var(--space-6); }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: var(--space-5); }
.flow > * + * { margin-top: var(--space-4); }

/* Rich text (page/post content) */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-6); }
.prose h3 { margin-top: var(--space-5); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose ul { list-style: none; }
.prose ul li { position: relative; padding-left: 1.4rem; margin-bottom: 0.5rem; }
.prose ul li::before {
    content: ""; position: absolute; left: 0; top: 0.72em;
    width: 6px; height: 6px; background: var(--brass); border-radius: 50%;
}
.prose ol { list-style: decimal; }
.prose ol li { margin-bottom: 0.5rem; padding-left: 0.4rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brass-deep); }

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.95rem 1.9rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: background-color var(--t-base) var(--ease-out),
                color var(--t-base) var(--ease-out),
                border-color var(--t-base) var(--ease-out),
                transform var(--t-fast) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--brass);
    color: var(--bg);
    border-color: var(--brass);
}
.btn-primary:hover {
    background: var(--brass-bright);
    border-color: var(--brass-bright);
    color: var(--bg);
    box-shadow: 0 8px 26px oklch(0.78 0.09 84 / 0.22);
}

.btn-outline {
    background: transparent;
    color: var(--brass);
    border-color: var(--brass-deep);
}
.btn-outline:hover {
    background: var(--brass);
    color: var(--bg);
    border-color: var(--brass);
}

.btn-ghost {
    padding-inline: 0;
    color: var(--text);
    border: 0;
    background: none;
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--text-base);
}
.btn-ghost .arrow { transition: transform var(--t-base) var(--ease-out); color: var(--brass); }
.btn-ghost:hover { color: var(--brass-bright); }
.btn-ghost:hover .arrow { transform: translateX(6px); }

/* ==========================================================================
   6. Site header (top, transparent over hero, condenses on scroll)
   ========================================================================== */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background-color var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out),
                border-color var(--t-base) var(--ease-out),
                height var(--t-base) var(--ease-out);
    border-bottom: 1px solid transparent;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}
.site-header.is-scrolled {
    height: 68px;
    background: color-mix(in oklch, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}
.brand img, .custom-logo { height: 54px; width: auto; transition: height var(--t-base) var(--ease-out); }
.site-header.is-scrolled .brand img, .site-header.is-scrolled .custom-logo { height: 44px; }
.brand-word {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1;
}
.brand-word b { color: var(--brass); font-weight: 800; }

/* Primary nav */
.primary-nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.4rem); }
.primary-nav ul { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2.4rem); }
.primary-nav a {
    position: relative;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding-block: 0.4rem;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1.5px;
    background: var(--brass);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-base) var(--ease-out);
}
.primary-nav a:hover, .primary-nav .current-menu-item > a { color: var(--brass); }
.primary-nav a:hover::after, .primary-nav .current-menu-item > a::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-4); }

/* Language switcher — flag chips */
.lang-switch ul { display: flex; align-items: center; gap: 0.6rem; }
.lang-switch a { display: inline-flex; padding: 0; }
.lang-switch .flag {
    display: block;
    width: 26px;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--border) inset;
    opacity: 0.45;
    filter: saturate(0.85);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.lang-switch .flag svg { width: 100%; height: 100%; display: block; }
.lang-switch a:hover .flag { opacity: 0.85; transform: translateY(-1px); }
.lang-switch .current-lang .flag { opacity: 1; box-shadow: 0 0 0 1.5px var(--brass) inset; filter: none; }
.lang-switch img { display: none; }

/* Hamburger (mobile) */
.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    background: none; border: 0;
    position: relative;
}
.nav-toggle span {
    position: absolute; left: 10px; right: 10px; height: 1.5px;
    background: var(--text);
    transition: transform var(--t-base) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
    position: fixed; inset: 0; z-index: 99;
    background: var(--bg);
    display: flex; flex-direction: column; justify-content: center;
    padding: var(--gutter);
    gap: var(--space-5);
    opacity: 0; visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility var(--t-base);
}
.mobile-nav.is-open { opacity: 1; visibility: visible; transform: none; }
.mobile-nav ul { display: flex; flex-direction: column; gap: var(--space-4); }
.mobile-nav a {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text);
}
.mobile-nav a:hover, .mobile-nav .current-menu-item > a { color: var(--brass); }
.mobile-nav .lang-switch { margin-top: var(--space-5); }
.mobile-nav .lang-switch a { font-size: var(--text-base); }

/* ==========================================================================
   7. Page header (interior pages)
   ========================================================================== */
.page-header {
    position: relative;
    padding-top: calc(var(--header-h) + clamp(3rem, 8vh, 6rem));
    padding-bottom: clamp(3rem, 8vh, 6rem);
    background-size: cover;
    background-position: center;
    isolation: isolate;
}
.page-header::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg,
        color-mix(in oklch, var(--bg) 70%, transparent) 0%,
        color-mix(in oklch, var(--bg) 86%, transparent) 100%);
}
.page-header--plain {
    padding-top: calc(var(--header-h) + clamp(2.5rem, 6vh, 4rem));
    border-bottom: 1px solid var(--border);
}
.page-header .kicker { color: var(--brass-bright); }
.page-title { margin: 0; }

/* ==========================================================================
   8. Footer
   ========================================================================== */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--brass-deep);
    padding-block: var(--space-7) var(--space-5);
    margin-top: var(--section-y);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-6);
    align-items: start;
}
.footer-brand .brand-word { font-size: 1.7rem; }
.footer-logo { height: 60px; width: auto; }
.footer-tagline { color: var(--text-muted); margin-top: var(--space-4); max-width: 36ch; }
.footer-col h4 { font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); font-family: var(--font-body); margin-bottom: var(--space-3); }
.footer-col p, .footer-col a { color: var(--text-muted); font-size: var(--text-sm); }
.footer-col a:hover { color: var(--brass); }
.footer-contact li { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; align-items: flex-start; }
.footer-contact i { color: var(--brass-deep); margin-top: 0.2rem; flex: 0 0 1rem; text-align: center; }
.footer-contact li span, .footer-contact li a { color: var(--text-muted); font-size: var(--text-sm); font-weight: 400; line-height: 1.55; }
.footer-contact li a:hover { color: var(--brass); }
.footer-social { display: flex; gap: 0.75rem; margin-top: var(--space-4); }
.footer-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border); border-radius: 50%;
    color: var(--text-muted);
    transition: border-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out), background var(--t-base) var(--ease-out);
}
.footer-social a:hover { color: var(--bg); background: var(--brass); border-color: var(--brass); }
.footer-badges { display: flex; gap: var(--space-4); align-items: center; margin-top: var(--space-4); flex-wrap: wrap; }
.footer-badges img { height: 46px; width: auto; opacity: 0.8; filter: saturate(0.85); transition: opacity var(--t-base); }
.footer-badges img:hover { opacity: 1; }
.footer-bottom {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    column-gap: var(--space-4); row-gap: var(--space-2);
    color: var(--text-faint); font-size: var(--text-xs);
}
.footer-bottom > p { margin: 0; }
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--brass); }
.footer-bottom__mid { text-align: center; }
.powered-by { justify-self: end; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.powered-by a { display: inline-flex; align-items: center; }
.voovstub { display: none; }
.voovodenet-logo { height: 19px; width: auto; opacity: 0.82; transition: opacity var(--t-base); }
.powered-by a:hover .voovodenet-logo { opacity: 1; }
.voovodenet-wm { font-family: var(--font-body); font-weight: 600; letter-spacing: 0.01em; color: var(--text-muted); transition: color var(--t-base); }
.voovodenet-wm b { color: var(--brass); font-weight: 700; }
.powered-by a:hover .voovodenet-wm { color: var(--text); }

/* ==========================================================================
   9. Utilities & a11y
   ========================================================================== */
.text-center { text-align: center; }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.is-clipped { overflow: hidden; }

.screen-reader-text {
    border: 0; clip: rect(1px,1px,1px,1px);
    clip-path: inset(50%);
    height: 1px; width: 1px; margin: -1px; padding: 0;
    overflow: hidden; position: absolute !important; word-wrap: normal !important;
}
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 1000;
    background: var(--brass); color: var(--bg);
    padding: 0.75rem 1.25rem; font-weight: 600;
}
.skip-link:focus { left: var(--gutter); top: 0.75rem; }

/* Back-to-top button */
.to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    z-index: 90;
    width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in oklch, var(--surface) 78%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--brass);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    font-size: 0.95rem;
    box-shadow: 0 6px 18px oklch(0 0 0 / 0.35);
    opacity: 0; visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out),
                border-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover {
    color: var(--brass-bright);
    border-color: var(--brass);
    transform: translateY(-3px);
}
.to-top:hover i { animation: toTopNudge var(--t-base) var(--ease-out); }
@keyframes toTopNudge { 0% { transform: translateY(2px); } 100% { transform: translateY(0); } }

/* Scroll-reveal — only hidden when JS is present (progressive enhancement:
   no-JS users always see content). */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--t-slow) var(--ease-out-expo), transform var(--t-slow) var(--ease-out-expo); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* WordPress core */
.alignwide { width: min(100% , 1100px); margin-inline: auto; }
.alignfull { width: 100%; }
.wp-caption-text, .gallery-caption { font-size: var(--text-sm); color: var(--text-faint); }
.sticky, .bypostauthor { display: block; }

/* ==========================================================================
   10. Responsive — header/footer
   ========================================================================== */
@media (max-width: 940px) {
    .primary-nav, .header-actions .lang-switch { display: none; }
    .nav-toggle { display: block; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    :root { --header-h: 70px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .footer-bottom .powered-by { justify-self: center; }
}

/* ==========================================================================
   11. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .js .reveal { opacity: 1; transform: none; }
}
