@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&display=swap");

:root {
    color-scheme: light;
    --accent: #267c9b;
    --accent-dark: #1d637d;
    --ink: #243139;
    --muted: #6d7b82;
    --line: #dce4e7;
    --paper: #fbfaf7;
    --tag: #e9f2f5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Merriweather, Georgia, serif;
    line-height: 1.7;
}

#title-area {
    padding: 3.25rem 1.25rem 2.5rem;
    background: var(--accent);
    color: white;
    text-align: center;
}

#title-area h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(2.5rem, 8vw, 4.25rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1;
}

#title-area p {
    margin: 0.8rem 0 0;
    opacity: 0.82;
    font-size: 0.9rem;
}

#navigation {
    display: grid;
    grid-template-columns: minmax(5.5rem, 1fr) minmax(12rem, 3fr) minmax(5.5rem, 1fr);
    align-items: stretch;
    min-height: 4rem;
    margin-bottom: 2.25rem;
    background: var(--accent);
    color: white;
}

#navigation[hidden] {
    display: none;
}

#navigation[hidden] + #content {
    margin-top: 2.25rem;
}

.today-button[hidden] {
    display: none;
}

#currentDate {
    align-self: center;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
}

button {
    border: 0;
    background: var(--accent-dark);
    color: white;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    transition: background 120ms ease, opacity 120ms ease;
}

button:hover:not(:disabled),
button:focus-visible {
    background: #164f64;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #f4c95d;
    outline-offset: -3px;
}

button:disabled {
    cursor: default;
    opacity: 0.45;
}

#content {
    width: min(46rem, calc(100% - 2.5rem));
    margin: 0 auto 7rem;
}

.today-button {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    z-index: 10;
    display: grid;
    grid-auto-flow: column;
    gap: 0.5rem;
    width: auto;
    height: 3.6rem;
    place-items: center;
    padding: 0 1.15rem;
    border-radius: 999px;
    box-shadow: 0 0.35rem 1.2rem rgb(20 49 59 / 28%);
    font-family: system-ui, sans-serif;
    font-weight: 700;
}

.today-button svg {
    width: 1.45rem;
    height: 1.45rem;
    fill: none;
    stroke: currentcolor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.article-card {
    padding: 0.4rem 0 2.35rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2.25rem;
}

.article-card.is-shared {
    padding: 1.35rem 1.4rem 1.55rem;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, white);
    border-left: 0.3rem solid var(--accent);
    border-radius: 0.35rem;
    background: white;
    box-shadow: 0 0.7rem 2rem rgb(29 99 125 / 10%);
    scroll-margin-top: 1.25rem;
}

.shared-card-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.shared-label {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    margin: 0;
    background: var(--accent);
    color: white;
    font-family: system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.back-to-edition {
    min-height: 2.25rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--accent-dark);
    font-family: system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.back-to-edition:hover:not(:disabled),
.back-to-edition:focus-visible {
    background: var(--tag);
    color: var(--accent-dark);
}

.article-meta {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-family: system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

h2 {
    margin: 0 0 0.9rem;
    font-family: Georgia, serif;
    font-size: clamp(1.6rem, 5vw, 2.15rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

a {
    color: inherit;
}

.article-title {
    text-decoration: none;
}

.article-title:hover,
.original-link:hover {
    color: var(--accent);
}

.article-summary {
    margin: 0 0 1.15rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0;
    margin: 0 0 1.25rem;
    list-style: none;
}

.tags li {
    padding: 0.22rem 0.62rem;
    border-radius: 999px;
    background: var(--tag);
    color: var(--accent-dark);
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
}

.original-link {
    color: var(--accent-dark);
    font-family: system-ui, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-underline-offset: 0.2em;
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.share-button {
    min-height: 2.35rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    color: var(--accent-dark);
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 750;
}

.share-button:hover:not(:disabled),
.share-button:focus-visible {
    background: var(--tag);
    color: var(--accent-dark);
}

.share-status {
    position: fixed;
    bottom: max(1.45rem, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 20;
    max-width: calc(100% - 10rem);
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 0.35rem 1.2rem rgb(20 49 59 / 22%);
    color: white;
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    transform: translateX(-50%);
}

.share-status[hidden] {
    display: none;
}

.status-message {
    padding: 4rem 1rem;
    color: var(--muted);
    text-align: center;
}

.status-message p {
    margin: 0;
}

@media (max-width: 560px) {
    #title-area {
        padding-top: 2.5rem;
    }

    #navigation {
        grid-template-columns: 5.5rem 1fr 5.5rem;
    }

    #currentDate {
        font-size: 0.76rem;
    }

    #content {
        width: min(100% - 1.5rem, 46rem);
    }

    .article-card.is-shared {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .shared-card-toolbar {
        gap: 0.65rem;
    }

    .share-status {
        bottom: 5.5rem;
        max-width: calc(100% - 2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
