/* =========================================================
   ALON HISTORYVERSE 24
   V100 GLOBAL STYLE SYSTEM
   File: css/style.css
========================================================= */


/* =========================================================
   ROOT VARIABLES
========================================================= */

:root {
    --gold: #d7b35a;
    --gold2: #f0d27a;

    --bg: #05080f;
    --bg2: #070b12;

    --panel: #0d1521;
    --panel2: #101b2a;

    --text: #f4f1e8;
    --muted: #a9b0bb;

    --line: rgba(215, 179, 90, 0.28);
    --line-strong: rgba(240, 210, 122, 0.55);

    --success: #76d69a;
    --danger: #ff8b8b;

    --radius: 15px;
    --shadow: 0 12px 35px rgba(0, 0, 0, 0.28);

    --max-width: 1200px;
}


/* =========================================================
   RESET
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            rgba(215, 179, 90, 0.06),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            var(--bg),
            var(--bg2)
        );

    color: var(--text);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    line-height: 1.6;
}


/* =========================================================
   GLOBAL ELEMENTS
========================================================= */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--gold2);
    outline-offset: 3px;
}


/* =========================================================
   MAIN PAGE CONTAINER
========================================================= */

.page {
    width: min(
        var(--max-width),
        calc(100% - 30px)
    );

    margin-inline: auto;
    padding-bottom: 30px;
}


/* =========================================================
   HEADER
========================================================= */

.page-header {
    padding: 38px 0 25px;
}

.page-header > a:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 18px;

    color: var(--gold2);
    font-weight: 700;
}

.page-header > a:first-child:hover {
    text-decoration: underline;
}

.page-header h1 {
    margin: 0 0 10px;

    color: var(--gold2);

    font-size:
        clamp(2rem, 6vw, 4rem);

    line-height: 1.1;
}

.page-header p {
    max-width: 800px;
    margin: 0;

    color: var(--muted);

    line-height: 1.7;
}


/* =========================================================
   ALON HISTORYVERSE 24 LOGO
   Logo file:
   images/historyverse-logo.svg

   NOTE:
   The file path is used in HTML.
   CSS only controls logo appearance.
========================================================= */

.ah-logo {
    width: 220px;
    max-width: 100%;
    height: auto;

    display: block;

    object-fit: contain;

    border-radius: 12px;

    margin: 0 0 18px;

    filter:
        drop-shadow(
            0 8px 18px rgba(0, 0, 0, 0.28)
        );

    transition:
        transform 0.18s ease,
        filter 0.18s ease;
}

.ah-logo:hover {
    transform: translateY(-2px);

    filter:
        drop-shadow(
            0 12px 24px rgba(0, 0, 0, 0.38)
        );
}


/* =========================================================
   CONTENT SECTIONS
========================================================= */

.content {
    display: block;

    margin: 20px 0;
    padding: clamp(18px, 3vw, 28px);

    border:
        1px solid var(--line);

    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(13, 21, 33, 0.98),
            rgba(10, 17, 27, 0.98)
        );

    box-shadow: var(--shadow);
}

.content h2 {
    margin-top: 0;
    margin-bottom: 12px;

    color: var(--gold2);

    font-size:
        clamp(1.45rem, 3vw, 2.2rem);
}

.content h3 {
    color: var(--gold2);
}

.content p {
    color: var(--muted);
    line-height: 1.75;
}


/* =========================================================
   GRID
========================================================= */

.grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(210px, 1fr)
        );

    gap: 15px;

    margin-top: 20px;
}


/* =========================================================
   CARDS
========================================================= */

.card {
    display: block;

    padding: 20px;

    border:
        1px solid var(--line);

    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            var(--panel),
            #0a111c
        );

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.card:hover {
    border-color: var(--gold2);

    background:
        linear-gradient(
            145deg,
            var(--panel2),
            #0c1522
        );

    transform: translateY(-3px);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.28);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 8px;

    color: var(--gold2);

    line-height: 1.3;
}

.card p {
    margin-bottom: 0;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    padding: 11px 18px;

    border: 1px solid var(--gold);
    border-radius: 10px;

    background: var(--gold);
    color: #080a0e;

    font-weight: 700;

    transition:
        transform 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.btn:hover {
    background: var(--gold2);
    border-color: var(--gold2);

    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}


/* =========================================================
   SEARCH AREA
========================================================= */

.search-area {
    margin: 20px 0;
}

.search-area label {
    display: block;

    margin-bottom: 8px;

    color: var(--gold2);

    font-weight: 700;
}

.searchbox {
    width: 100%;
    max-width: 700px;

    min-height: 46px;

    padding: 12px 14px;

    border:
        1px solid var(--line);

    border-radius: 10px;

    background: #080d16;
    color: var(--text);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.searchbox::placeholder {
    color: #7f8793;
}

.searchbox:hover {
    border-color: var(--line-strong);
}

.searchbox:focus {
    border-color: var(--gold2);

    box-shadow:
        0 0 0 3px rgba(240, 210, 122, 0.08);
}


/* =========================================================
   FORM ELEMENTS
========================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-group label,
.content form label {
    display: block;

    margin-bottom: 7px;

    color: var(--gold2);

    font-weight: 700;
}

textarea.searchbox {
    min-height: 150px;
    resize: vertical;
}

select.searchbox {
    appearance: auto;
}


/* =========================================================
   STATUS MESSAGES
========================================================= */

.status {
    min-height: 24px;

    margin-top: 12px;

    color: var(--muted);
}

.status.success {
    color: var(--success);
}

.status.error {
    color: var(--danger);
}


/* =========================================================
   ARTICLE / READING AREA
========================================================= */

.article-reader {
    margin-top: 20px;
}

.article-reader .card {
    width: 100%;
}

#article-content,
#reading-content {
    line-height: 1.85;
}

#article-content p,
#reading-content p {
    margin: 0 0 18px;
}


/* =========================================================
   TIMELINE
========================================================= */

[data-timeline-filter] {
    width: 100%;

    border: 1px solid var(--line);

    color: var(--text);

    text-align: left;
}

[data-timeline-filter]:hover {
    border-color: var(--gold2);
}


/* =========================================================
   EMPTY / LOADING STATES
========================================================= */

.loading,
.empty-state,
.error-state {
    padding: 20px;

    border:
        1px dashed var(--line);

    border-radius: var(--radius);

    color: var(--muted);

    text-align: center;
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    margin-top: 50px;
    padding: 30px 15px;

    border-top:
        1px solid var(--line);

    color: var(--muted);

    text-align: center;

    line-height: 1.8;
}

.footer a {
    color: var(--gold2);
}

.footer a:hover {
    text-decoration: underline;
}


/* =========================================================
   HORIZONTAL RULE
========================================================= */

hr {
    border: 0;

    border-top:
        1px solid var(--line);

    margin: 25px 0;
}


/* =========================================================
   SMALL DEVICES
========================================================= */

@media (max-width: 700px) {

    .page {
        width: min(
            100% - 20px,
            var(--max-width)
        );
    }

    .page-header {
        padding: 28px 0 18px;
    }

    .content {
        padding: 17px;
        margin: 14px 0;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        padding: 17px;
    }

    .page-header h1 {
        font-size: clamp(
            1.9rem,
            10vw,
            3rem
        );
    }

    .btn {
        width: 100%;
    }

    .searchbox {
        max-width: none;
    }

    .footer {
        margin-top: 35px;
        padding: 25px 10px;
    }

    /* Logo on mobile */
    .ah-logo {
        width: 190px;
        margin-bottom: 15px;
    }
}


/* =========================================================
   VERY SMALL DEVICES
========================================================= */

@media (max-width: 380px) {

    .page {
        width: calc(100% - 14px);
    }

    .page-header {
        padding-top: 22px;
    }

    .content {
        padding: 14px;
    }

    .card {
        padding: 15px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .content h2 {
        font-size: 1.35rem;
    }

    /* Smaller logo for very small screens */
    .ah-logo {
        width: 165px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}