/* ============================
   Peripheral Edge Publishing
   Base Stylesheet
   Dark Minimalist Aesthetic
   ============================ */

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ROOT VARIABLES */
:root {
    --bg: #0d0d0f;
    --bg-alt: #141417;
    --text: #e6e6e6;
    --text-muted: #9a9a9a;
    --accent: #4a78ff;
    --border: #2a2a2d;
    --font-body: "Inter", "Segoe UI", sans-serif;
    --font-heading: "Inter", "Segoe UI", sans-serif;
}

/* GLOBAL */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body), sans-serif;
    line-height: 1.6;
}

/* TYPOGRAPHY */
h1, h2, h3, h4 {
    font-family: var(--font-heading), sans-serif;
    font-weight: 600;
    margin-bottom: 0.5em;
    color: var(--text);
}

p {
    margin-bottom: 1em;
    color: var(--text-muted);
}

/* LINKS */
a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* NAVIGATION */
header {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.2rem;
}

.site-logo {
    height: 90px; /* Adjust as needed */
    margin-right: 10px;
}

.brand-text {
    font-family: var(--font-heading), sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a {
    margin-left: 1.5rem;
    font-weight: 500;
    color: var(--text);
}

.nav-links a:hover {
    color: var(--accent);
}

/* HAMBURGER MENU */
.hamburger {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text);
    margin: 5px 0;
    transition: 0.4s;
}

/* When menu is open */
.hamburger.is-active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.is-active span:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* LAYOUT */
main,
.page-content {
    max-width: 1024px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* FOOTER */
footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--accent);
}

/* BOOK GRID */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book {
    background: var(--bg-alt);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

.book img {
    max-width: 155px; /* Ensure images don't exceed 155px width */
    height: auto;
    margin-bottom: 1rem;
    border-radius: 2px;
}

/* FORMS */
input, textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
    margin-bottom: 1rem;
}

button {
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    opacity: 0.9;
}

/* ============================
   SUBMISSIONS / TERMS / PRIVACY
   ============================ */

.page-content {
    max-width: 900px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* Hero */
.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Content Blocks */
.content-block {
    margin-bottom: 2.5rem;
}

.content-block h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

.content-block p {
    margin-bottom: 1rem;
}

.content-block ul {
    margin: 0.75rem 0 0.75rem 1.25rem;
    padding-left: 1.25rem; /* Added indent */
}

.content-block ul li {
    margin-bottom: 0.4rem;
}

.content-block ul ul {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    padding-left: 1.25rem; /* Added indent for nested lists */
}

.content-block ul ul li {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ============================
   INDEX.PHP LANDING PAGE
   ============================ */

.hero-index {
    background: var(--bg-alt);
    padding: 4rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 3rem;
}

.hero-index h1 {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.hero-index .tagline {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.hero-index p {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.hero-actions .button {
    margin: 0 0.5rem;
}

.button {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.button.primary {
    background-color: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}

.button.primary:hover {
    background-color: #3a67e0; /* Darker shade of accent for hover */
}

.button.secondary {
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.button.secondary:hover {
    background-color: var(--accent);
    color: #fff;
}

.featured-books {
    margin-bottom: 3rem;
    text-align: center;
}

.featured-books h2,
.for-writers h2,
.our-mission h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.featured-books .book-grid {
    justify-content: center;
}

.featured-books .book {
    background: var(--bg-alt);
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    text-align: center;
}

.featured-books .book img {
    max-width: 155px;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 2px;
}

.featured-books .view-all {
    margin-top: 2rem;
    font-size: 1.1rem;
}

.for-writers,
.our-mission {
    background: var(--bg-alt);
    padding: 3rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-bottom: 3rem;
}

.for-writers p,
.our-mission p {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.our-mission .read-more {
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

/* MEDIA QUERIES */
@media (max-width: 768px) {
    header {
        padding: 1rem 1rem;
    }

    .main-nav {
        flex-direction: row; /* Keep brand and hamburger on one line */
        justify-content: space-between;
        align-items: center;
    }

    .brand-link {
        margin-bottom: 0;
    }

    .hamburger {
        display: block; /* Show hamburger on small screens */
    }

    .nav-links {
        display: none; /* Hide nav links by default on small screens */
        flex-direction: column;
        width: 100%;
        background: var(--bg-alt);
        position: absolute;
        top: 60px; /* Adjust based on header height */
        left: 0;
        padding: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav-links.is-active {
        display: flex; /* Show nav links when active */
    }

    .nav-links a {
        margin: 0.5rem 0;
        text-align: center;
    }

    main,
    .page-content {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .content-block h2 {
        font-size: 1.2rem;
    }

    .book {
        padding: 1rem; /* Revert padding */
    }

    .book img {
        border-radius: 2px; /* Revert border-radius */
        max-width: 155px; /* Ensure images don't exceed 155px width */
    }

    .book-grid {
        grid-template-columns: 1fr; /* Stack books vertically on small screens */
    }

    .hero-index {
        padding: 3rem 1rem;
    }

    .hero-index h1 {
        font-size: 2.5rem;
    }

    .hero-index .tagline {
        font-size: 1.3rem;
    }

    .hero-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .hero-actions .button {
        margin: 0;
    }

    .featured-books h2,
    .for-writers h2,
    .our-mission h2 {
        font-size: 1.8rem;
    }

    .for-writers,
    .our-mission {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .site-logo {
        height: 25px;
    }

    .brand-text {
        font-size: 1rem;
    }

    .hero-index h1 {
        font-size: 2rem;
    }

    .hero-index .tagline {
        font-size: 1.1rem;
    }

    .hero-index p {
        font-size: 1rem;
    }

    .featured-books h2,
    .for-writers h2,
    .our-mission h2 {
        font-size: 1.5rem;
    }

    .button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
