/* ==========================================================
   Shared stylesheet — used by the homepage and the chat page
   ========================================================== */

body {
    background-color: #f5f3ef;
    color: #1a1a1a;
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    margin: 0 auto;
    padding: 0 20px 40px;
    line-height: 1.6;
}

.accent-bar {
    height: 4px;
    background: linear-gradient(90deg, #2c5282, #4a90d9, #2c5282);
    margin: 0 -20px 30px;
}

a {
    color: #2c5282;
    transition: color 0.2s;
}

a:visited {
    color: #553c7b;
}

a:hover {
    color: #c0392b;
}

h1 {
    font-size: 32px;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

h2 {
    font-size: 20px;
    border-bottom: 2px solid #2c5282;
    padding-bottom: 4px;
    display: inline-block;
    margin-bottom: 14px;
}

hr {
    border: none;
    border-top: 1px solid #c8c4bc;
    margin: 28px 0;
}

ul {
    padding-left: 25px;
}

li {
    margin-bottom: 6px;
}

.header-area {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 10px;
}

.title-line {
    color: #555;
    font-size: 17px;
    margin-top: 2px;
    font-style: italic;
}

.contact-info {
    font-size: 15px;
    line-height: 1.7;
    margin-top: 8px;
}

.contact-info a {
    text-decoration: none;
    border-bottom: 1px dashed #2c5282;
}

.contact-info a:hover {
    border-bottom-style: solid;
}

.entry {
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #edeae4;
    border-left: 3px solid #2c5282;
    transition: border-color 0.2s, background 0.2s;
}

.entry:hover {
    border-left-color: #c0392b;
    background: #e8e5de;
}

.entry b {
    font-size: 16px;
}

.entry p {
    margin-top: 4px;
}

.entry .meta {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 30px;
    padding-left: 0;
    list-style: none;
}

.skills-grid li {
    padding: 4px 0;
    border-bottom: 1px dotted #c8c4bc;
}

.skills-grid li b {
    color: #2c5282;
}

.contact-section {
    background: #edeae4;
    padding: 16px 18px;
    border: 1px solid #d5d1c9;
    text-align: center;
}

.update-note {
    font-size: 13px;
    color: #888;
    font-style: italic;
    text-align: center;
}

@media (max-width: 500px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Chat page — same palette and type, full-height layout
   ========================================================== */

html:has(body.chat-page) {
    height: 100%;
}

body.chat-page {
    height: 100%;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

body.chat-page .accent-bar {
    flex-shrink: 0;
}

.chat-header {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 0 12px;
    border-bottom: 1px solid #c8c4bc;
}

.chat-header > div {
    flex: 1;
}

.chat-header h1 {
    margin: 0;
}

.chat-header .title-line {
    margin: 0;
}

.chat-page select,
.chat-page button,
.chat-page textarea {
    font: inherit;
    color: inherit;
}

.chat-page select,
.chat-page textarea {
    background: #fbfaf7;
    border: 1px solid #c8c4bc;
    border-radius: 0;
}

.chat-page select {
    padding: 5px 8px;
    max-width: 50vw;
}

.chat-page button {
    background: transparent;
    border: 1px solid #2c5282;
    color: #2c5282;
    padding: 5px 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chat-page button:hover {
    color: #c0392b;
    border-color: #c0392b;
}

.chat-page button.primary {
    background: #2c5282;
    color: #ffffff;
    font-weight: bold;
}

.chat-page button.primary:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #ffffff;
}

.chat-page button:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-page :focus-visible {
    outline: 2px solid #2c5282;
    outline-offset: 2px;
}

#log {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
}

.msg {
    max-width: 72ch;
    margin: 0 auto 18px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Assistant replies look like the homepage's .entry blocks */
.msg.assistant {
    padding: 12px 14px;
    background: #edeae4;
    border-left: 3px solid #2c5282;
}

.msg.user {
    width: fit-content;
    max-width: min(72ch, 85%);
    margin-left: auto;
    margin-right: max(0px, calc((100% - 72ch) / 2));
    padding: 10px 14px;
    background: #fbfaf7;
    border: 1px solid #d5d1c9;
}

.msg.error {
    color: #c0392b;
    border-left-color: #c0392b;
    font-style: italic;
}

.empty {
    max-width: 72ch;
    margin: 12vh auto 0;
    color: #888;
    font-style: italic;
    text-align: center;
}

.chat-form {
    display: flex;
    gap: 10px;
    padding: 14px 0 18px;
    border-top: 1px solid #c8c4bc;
}

.chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 44px;
    max-height: 200px;
    padding: 10px 12px;
}

/* ==========================================================
   Page tabs — hang from the accent bar on every page
   ========================================================== */

.site-tabs {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The tabs hang straight off the stripe, so it drops its bottom spacing */
.accent-bar.has-tabs {
    margin-bottom: 0;
}

.site-tabs li {
    margin: 0;
}

.site-tabs a,
.site-tabs a:visited {
    display: block;
    padding: 6px 16px 7px;
    background: #edeae4;
    border: 1px solid #d5d1c9;
    border-top: none;
    color: #2c5282;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s, background 0.2s, padding 0.2s;
}

.site-tabs a:hover {
    background: #e8e5de;
    color: #c0392b;
    padding-bottom: 10px;
}

.site-tabs a[aria-current="page"],
.site-tabs a[aria-current="page"]:hover {
    background: #2c5282;
    border-color: #2c5282;
    color: #ffffff;
    padding-bottom: 11px;
}

body.chat-page .site-tabs {
    flex-shrink: 0;
}

/* Button-style link used to open the chat from the homepage */
.entry .entry-link,
.entry .entry-link:visited {
    display: inline-block;
    margin-top: 2px;
    padding: 3px 14px;
    border: 1px solid #2c5282;
    color: #2c5282;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.entry .entry-link:hover {
    background: #2c5282;
    color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    .site-tabs a { transition: none; }
}
