/*
Theme Name: Legalize 2026
Theme URI: https://homeworlds.space
Description: Designed exclusively for JeremyNGayed.com
Version: 1.0
Author: Homeworlds LLC
Author URI: https://homeworlds.space
*/

/******************************
    GLOBAL
******************************/

html {
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    margin: 0;
    scroll-behavior: smooth;
    scroll-padding-top: 250px;
}

*, *::before, *::after {
    box-sizing: inherit;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex.col { flex-direction: column; }
.flex.row { flex-flow: row wrap; }

.rad5  { border-radius: 5px; }
.rad10 { border-radius: 10px; }
.rad20 { border-radius: 20px; }
.rad30 { border-radius: 30px; }

:root {
    --slate: rgb(24 42 55 / 1.0);
    --slatefaded: rgb(24 42 55 / 0.7);
    --gilding: rgb(248 228 120 / 1.0);
    --naval: rgb(14 44 91 / 1.0);
    --default: "EB Garamond", serif;
}

@font-face {
    font-family: "EB Garamond";
    src: url("type/EBGaramond.ttf");
}

a {
    color: white;
    text-decoration: none;
    transition: color 0.5s ease;
}

a img { display: block; }

a:hover,
a:active {
    color: var(--gilding);
}

@media (max-width: 1099px) {
    .desktoponly { display: none !important; }
}

@media (max-width: 767px) {
    .desktoptabonly { display: none !important; }
    img { transform: none !important; }
}

@media (max-width: 767px),
       (min-width: 1100px) {
    .tabonly { display: none !important; }
}

@media (min-width: 768px) {
    .mobonly { display: none !important; }
}

.aligncenter { display: block; margin: 10px auto; }
.center { text-align: center; }
.clear { clear: both; }
strong { font-weight: 600; }
.italic { font-style: italic; }
ol ol.letters { list-style-type: lower-alpha; }
.nowrap { white-space: nowrap; }
small { display: block; font-size: .9em; font-variant: small-caps; text-align: center; }

/******************************
    BODY
******************************/

body {
    margin: 0;
    color: white;
    font-family: var(--default);
    background: var(--slate) url("exhibits/slatepalette.jpg") no-repeat fixed center top;
    background-size: cover;
}

/******************************
    HEADER
******************************/

header {
    height: clamp(50px, calc(100vw * 450 / 1900), 450px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--naval);
    background-image: url("exhibits/header-jeremyngayed-new.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    -webkit-mask-image: linear-gradient(to bottom, #000 95%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 95%, transparent 100%);
    pointer-events: none;
}

header > * {
    position: relative;
    z-index: 1;
}

@media (max-width: 600px) {
    header {
        height: auto;
        aspect-ratio: 1900 / 450;
        width: 100%;
    }
}

header.is-shrunk {
    height: 160px;
}

/******************************
    NAV
******************************/

nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, calc(8px + 3vw), 40px);
    height: clamp(50px, 4vw, 60px);
    padding-inline: clamp(40px, 4vw, 70px);
    width: 100%;
    position: sticky;
    top: clamp(130px, calc(100vw * 140 / 1900), 140px);
    z-index: 100;
    overflow: hidden;
    background-color: var(--naval);
}

nav > * {
    position: relative;
    z-index: 1;
}

nav .option {
    font-size: clamp(14px, 4vw, 20px);
    font-weight: 500;
    line-height: clamp(30px, 4vw, 42px);
    text-transform: lowercase;
}

nav .logo a {
    display: block;
    width: 30px;
    height: 30px;
    background-color: #fff;
    -webkit-mask: var(--logo) center / contain no-repeat;
    mask: var(--logo) center / contain no-repeat;
    transition: background-color 0.2s ease;
}

nav .logo.ig a { --logo: url("exhibits/logo-ig.png"); }
nav .logo.x a  { --logo: url("exhibits/logo-x.png"); }

nav .logo a:hover,
nav .logo a:active {
    background-color: var(--gilding);
}

/******************************
    NAV: TABLET AND MOBILE
******************************/

#menu-toggle { display: none; }

.menu-icon {
    position: fixed;
    top: 5px;
    right: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1001;
}

.menu-icon span,
.menu-icon span::before,
.menu-icon span::after {
    content: "";
    position: absolute;
    right: 0;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: top 0.3s ease, transform 0.3s ease, width 0.3s ease, background 0.3s ease;
}

.menu-icon span {
    width: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.menu-icon span::before {
    width: 30px;
    top: -10px;
}

.menu-icon span::after {
    width: 15px;
    top: 10px;
}

#menu-toggle:checked + .menu-icon span {
    background: transparent;
}

#menu-toggle:checked + .menu-icon span::before,
#menu-toggle:checked + .menu-icon span::after {
    width: 100%;
    top: 0;
    background: white;
}

#menu-toggle:checked + .menu-icon span::before { transform: rotate(45deg); }
#menu-toggle:checked + .menu-icon span::after  { transform: rotate(-45deg); }

#mobilemenu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    padding: 10px;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    background-color: var(--slate);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#menu-toggle:checked ~ #mobilemenu {
    opacity: 1;
    visibility: visible;
}

#mobilemenu #menuitems {
    display: flex;
    flex-flow: column wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-size: 2em;
    margin: auto;
}

#mobilemenu #menuitems img,
footer img {
    display: block;
    height: auto;
    max-width: 400px;
    width: 100%;
}

/******************************
    HOMEPAGE
******************************/

main {
    gap: clamp(20px, calc(8px + 3vw), 50px);
    margin-top: clamp(50px, calc(100vw * 450 / 1900), 450px);
}

@media (max-width: 1100px) {
    main {
        width: 100%;
        max-width: 1100px;
    }
}

@media (max-width: 500px) {
    main {
        gap: 0;
        margin-bottom: 0;
        max-width: 500px;
    }
    main > * { padding-bottom: 30px; }
}

section {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: clamp(20px, 4vw, 70px);
    padding: clamp(5px, 4vw, 50px);
    min-height: 200px;
    font-size: clamp(18px, 4vw, 24px);
}

section#novelintro,
section#authorintro {
    align-items: start;
    flex-flow: row wrap;
}

@media (max-width: 1140px) {
    section#novelintro.home {
        flex-direction: column-reverse;
        align-items: center;
    }
}

section#subscribe,
section#books,
section#briefings,
section#single,
section#comments,
section#contact {
    flex-flow: column;
}

section#subscribe article { align-items: center; }

#bookdetails {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-flow: row wrap;
    gap: 30px;
}

#bookdetails .purchaselinks {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-block: 20px;
}

#bookdetails .purchaselinks img {
    width: 240px !important;
    box-shadow: 0 0 2px #ffffff;
}

@media (min-width: 767px) {
    section#subscribe,
    section#books,
    section#briefings,
    section#single,
    section#comments,
    section#contact {
        background-color: var(--slatefaded);
    }
}

section#briefings section#postpreview {
    flex-flow: row wrap;
    gap: 50px;
}

section img {
    border-radius: 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: brightness(1);
    height: auto;
    max-width: 400px;
    width: 100%;
}

section a:hover img {
    transform: scale(1.1);
    filter: brightness(0.75);
}

article,
.read-more-rest.is-open {
    display: flex;
    flex-flow: column;
    max-width: 800px;
    gap: 20px;
}

@media (max-width: 600px) {
    article {
        max-width: none;
        min-width: 0;
        width: 100%;
    }
}

h1, h2, h3 { margin: 0; }

h1 {
    color: var(--gilding);
    font-size: clamp(30px, 4vw, 50px);
    font-weight: 600;
    line-height: clamp(36px, 4vw, 60px);
    text-align: center;
}

h2 {
    color: var(--gilding);
    font-size: clamp(26px, 4vw, 36px);
    line-height: clamp(30px, 4vw, 42px);
    text-align: center;
}

h3 {
    color: var(--gilding);
    font-size: clamp(16px, 4vw, 26px);
    line-height: 30px;
    margin: 20px 0 0 0;
    text-align: center;
}

article blockquote {
    margin: 20px 40px;
    display: flex;
    flex-flow: column;
    gap: 15px;
}

article p,
article blockquote p {
    margin: 0;
    font-size: clamp(22px, 4vw, 24px);
    line-height: clamp(30px, 4vw, 34px);
}

aside#bookstats,
.postportal {
    flex: 0 1 400px;
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    max-width: 400px;
    border-radius: 10px;
    background-color: var(--naval);
}

aside#bookstats a { display: block; }

aside#bookstats img {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
}

section.fade {
    position: relative;
    margin-top: 100px;
    margin-bottom: 100px;
    overflow: visible;
    background: rgba(24, 42, 55, 0.85);
}

section.fade > * {
    position: relative;
    z-index: 1;
}

section.fade::before,
section.fade::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
    z-index: 0;
}

section.fade::before {
    top: -100px;
    background: linear-gradient(to bottom, transparent, rgba(24, 42, 55, 0.85));
}

section.fade::after {
    bottom: -100px;
    background: linear-gradient(to bottom, rgba(24, 42, 55, 0.85), transparent);
}

main > section {
    width: 100%;
    min-width: 0;
}

article ul li { padding-bottom: 10px; }

article img.alignright {
    float: right;
    padding: 0 0 20px 20px;
    border-radius: 20px;
}

/******************************
    COMMENTS AND CONTACT
******************************/

#comments,
#commentlist,
#commentform,
#respond {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    font-family: var(--default);
}

.commentlist { list-style: none; margin: 0; padding: 0; }
.commentlist .comment { margin: 1.5em 0; }

.commentlist .comment-body {
    display: flex;
    flex-flow: column;
    gap: 15px;
}

.comment-author.vcard {
    display: flex;
    flex-direction: row wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.comment-author img {
    border-radius: 50%;
    max-width: 50px;
    height: auto;
}

.commentlist cite { font-style: normal; }

.comment-meta,
.reply {
    font-size: 0.75em;
    font-style: italic;
}

#commentform p.logged-in-as {
    font-size: 18px;
    line-height: 30px;
    font-style: italic;
    font-weight: 200;
    max-width: 450px;
    text-align: center;
}

#commentform label,
form label { display: none; }

#commentform p { margin: 0 0 1em; }

.wpforms-field-container,
.wpforms-field-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px auto;
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea {
    font-family: var(--default);
    font-size: 18px;
    font-weight: 200;
    line-height: 22px;
    padding: 10px;
    width: 100%;
    border: 1px solid var(--slate);
}

#submit,
form.fluent_form_1 .ff-btn-submit:not(.ff_btn_no_style),
button {
    padding: 10px;
    width: 100%;
    border-color: transparent;
    font-family: var(--default);
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    color: white;
    background-color: var(--naval);
    cursor: pointer;
    transition: all 0.25s ease-out;
}

#submit:hover,
form.fluent_form_1 .ff-btn-submit:not(.ff_btn_no_style):hover,
button:hover {
    color: var(--naval);
    background-color: var(--gilding);
}

/******************************
    FOOTER
******************************/

footer {
    display: flex;
    flex-flow: column;
    gap: clamp(20px, 4vw, 50px);
    padding: 50px;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: auto;
    margin-top: 50px;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: gray;
    background-image: url("exhibits/footerbricks.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-blend-mode: multiply;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 5%);
    mask-image: linear-gradient(to bottom, transparent, #000 5%);
    pointer-events: none;
}

footer > * {
    position: relative;
    z-index: 1;
}

footer #designcredit {
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

footer p {
    margin: 0;
    color: var(--gilding);
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 400;
}

footer #designcredit img { max-width: 300px; }

footer #legalities {
    font-size: .7em;
    padding-block: 20px;
    max-width: 700px;
    text-align: center;
}

/******************************
    FORM INSTRUCTIONS
******************************/

.storytext form {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
}

.storytext form input[type="text"],
.storytext form input[type="email"],
.storytext form textarea {
    color: black;
    padding: 10px;
    width: 360px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    font: 400 1em var(--default);
    border-radius: 20px;
    text-align: center;
}

.wpcf7-checkbox {
    display: flex;
    flex-flow: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
    font: 400 .8em var(--default);
    line-height: 1.2em;
    padding: 10px;
}

.wpcf7-list-item {
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    text-align: center;
}

input[type="checkbox"],
input[type="radio"] {
    height: 20px;
    width: 20px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    vertical-align: middle;
    transform: scale(1.2);
    padding: 3px;
    accent-color: var(--gilding);
    transition: accent-color 0.3s ease;
}

input[type="submit"] {
    background-color: var(--naval);
    border: none;
    color: white;
    display: block;
    cursor: pointer;
    font: 500 1em var(--default);
    margin: 0 auto;
    padding: 10px;
    width: 200px;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: var(--slatefaded);
}

.wpcf7-not-valid-tip { display: none !important; }

/******************************
    ASSORTED FIXES
******************************/

p:has(> span[id^="more-"]) {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
}

span[id^="more-"] { display: none !important; }

form.formkit-form[data-format="inline"] {
    margin-bottom: 0 !important;
}

li.widget_block { list-style-type: none; }

/******************************
    SPECIAL EFFECTS
******************************/

.read-more-rest {
    overflow: hidden;
    height: 0;
    transition: height 0.45s ease;
}

/* height cannot animate to auto; JS should set an explicit pixel height */
.read-more-rest.is-open {
    height: auto;
}

.lightbox-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

a.lightbox-link { cursor: zoom-in; }

.lightbox-content img {
    max-width: 100%;
    max-height: 100vh;
    height: auto;
    width: auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox-overlay.is-open .lightbox-content img {
    opacity: 1;
    transform: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    z-index: 10000;
    line-height: 1;
    transition: color 0.3s ease;
}

.lightbox-close:hover { color: var(--gilding); }

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}