/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3 {
    line-height: 1.2;
    font-weight: var(--font-weight-bold);
    position: relative;
    z-index: 1
}

h1 {
    font-size: var(--font-size-h1);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h2 {
    font-size: var(--font-size-h2);
    margin-bottom: .75rem;
}

h3 {
    font-size: var(--font-size-h3);
    margin-bottom: .5rem;
}

p,
label,
input,
textarea,
button,
select {
    font-family: "Adobe Garamond Regular", serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    font-weight: var(--font-weight-normal);
    position: relative;
    z-index: 1;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

main {
    flex: 1 1 auto;
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column
}

header {
    background-color: transparent;
    padding: 1rem;
    box-shadow: none;
    position: relative;
    z-index: 1
}

.header-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem
}

.blog-title {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .3);
    text-align: center;
    margin: 0;
    padding: 1rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1
}

.blog-subtitle {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-primary);
    opacity: 0.6;
    text-align: center;
    margin: 0;
    padding: 0 1rem;
    position: absolute;
    top: 4rem;
    /* Positioned below title */
    left: 0;
    right: 0;
    z-index: 1;
    line-height: 1.4;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, .1);
}

.toolbar {
    position: fixed;
    top: 1rem;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    padding: 0.5rem 0.25rem;
    width: 62px;
    background: transparent
}

.toolbar-btn {
    background-color: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    padding: .45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-default), transform var(--transition-default), color var(--transition-default);
    border: 2px solid var(--text-primary);
    width: 52px;
    min-width: 44px;
    max-width: 52px;
    height: 52px;
    white-space: nowrap;
    position: relative;
    box-sizing: border-box !important;
}

.toolbar-btn:hover,
.toolbar-btn:focus {
    background-color: rgba(74, 74, 74, .9);
    color: var(--highlight-accent);
    outline: 0;
    width: 52px;
    max-width: 52px;
    height: 52px
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 0;
    transition: color var(--transition-default);
}

.toolbar-btn:hover svg,
.toolbar-btn:focus svg {
    color: var(--highlight-accent) !important
}

.toolbar-btn span {
    opacity: 0;
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    padding: 0.2rem 0.45rem;
    font-size: var(--font-size-base);
    color: var(--highlight-accent);
    background: rgba(0, 0, 0, 0.75);
    border-radius: var(--border-radius);
    white-space: nowrap;
    transition: opacity var(--transition-default), transform var(--transition-default);
}

.toolbar-btn:hover span,
.toolbar-btn:focus span {
    opacity: 1 !important;
    transform: translate(4px, -50%)
}

.toolbar-btn.languages .flags {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    margin-left: .5rem;
    transition: opacity var(--transition-default);
    padding-left: .75rem
}

.language-flag {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    transition: all .2s ease
}

.language-flag:hover {
    background: var(--secondary-bg);
    transform: scale(1.1)
}

.language-flag.active {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: var(--highlight-accent);
}

.language-flag:focus {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px
}

.toolbar-btn.languages:hover {
    width: 160px;
    max-width: none
}

.toolbar-btn.languages {
    max-width: none
}

.toolbar-btn.languages:hover .flags,
.toolbar-btn.languages:focus .flags {
    opacity: 1
}

.search-bar {
    display: flex;
    justify-content: center;
    margin: 0.05rem 0 0.9rem 0
}

.search-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(220, 220, 220, 0.7);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    width: min(520px, 88vw)
}

.search-field svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0
}

.search-input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    outline: none;
    padding-right: 2rem;
}

.search-clear {
    background: transparent;
    border: none;
    padding: 2px;
    margin-left: -1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-medium);
    transition: color 0.15s ease, transform 0.1s ease;
    z-index: 2;
    border-radius: 50%;
}

.search-clear:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.search-clear svg {
    width: 16px;
    height: 16px;
}

.search-input::placeholder {
    color: var(--text-medium)
}

.search-bar {
    position: relative;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    background: color-mix(in srgb, var(--secondary-bg) 28%, var(--highlight-accent) 72%);
    border: 1px solid color-mix(in srgb, var(--accent-gray) 35%, transparent 65%);
    box-shadow: var(--shadow-medium);
    border-radius: 12px;
    padding: 0.5rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 420px;
    overflow: auto;
}

.search-suggestion {
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    color: var(--text-primary);
}

.search-suggestion:hover,
.search-suggestion:focus-visible {
    background: color-mix(in srgb, var(--secondary-bg) 18%, var(--highlight-accent) 82%);
    outline: none;
    transform: translateY(-1px);
}

.search-suggestion.empty {
    cursor: default;
    color: var(--text-secondary);
}

.suggestion-row {
    display: grid;
    grid-template-columns: 22ch 1fr auto;
    align-items: center;
    column-gap: 0.8rem;
    width: 100%;
}

.suggestion-title {
    font-weight: var(--font-weight-bold);
    font-size: 0.95rem;
    color: var(--text-primary);
    padding-right: 0.25rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-snippet {
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.suggestion-snippet mark {
    background: rgba(255, 231, 163, 0.9);
    padding: 0 0.1rem;
    border-radius: 3px;
}