/*
Theme Name: Librapedia
Description: O bibliotecă ilustrată de povești pentru copii.
Version: 0.3.1
Requires PHP: 8.3
Text Domain: librapedia
*/
:root {
    --ink: #09243d;
    --night: #08243e;
    --paper: #fff2d2;
    --paper-light: #fff8e7;
    --amber: #df9b26;
    --rust: #a6410b;
    --leaf: #3c5b35;
    --line: #eacb8d;
    --serif: Georgia, 'Times New Roman', serif;
    --shell: 86rem;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper-light); color: var(--ink); font: 1rem/1.5 var(--serif); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #a3460c; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; }
.shell { width: min(var(--shell), calc(100% - clamp(2rem, 11vw, 12rem))); margin-inline: auto; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.skip-link:focus { position: absolute; z-index: 10; padding: .7rem; background: white; }
.night-ribbon {
    height: 2.5rem;
    background-color: #071d34;
    background-image: radial-gradient(1.6px 1.6px at 15% 28%, #ffdc87 95%, transparent),
        radial-gradient(1px 1px at 65% 68%, #ffe7b0 95%, transparent),
        radial-gradient(1px 1px at 37% 51%, #adc5d5 95%, transparent),
        linear-gradient(120deg, #061a2f, #0d2e50, #061a2f);
    background-size: 11rem 2.5rem, 7rem 2.5rem, 5rem 2.5rem, auto;
}
.site-header { position: relative; z-index: 2; background: #ffedc6; box-shadow: 0 1px 0 #c98e3145; }
.navigation { min-height: 5rem; display: flex; align-items: center; justify-content: space-between; gap: clamp(.8rem, 2vw, 2rem); }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; gap: .6rem; line-height: .98; text-decoration: none; font-size: clamp(1.75rem, 3vw, 3.3rem); font-weight: 700; letter-spacing: -.07em; }
.brand small { display: block; margin-top: .35rem; font-size: clamp(.7rem, 1.11vw, 1rem); font-weight: 400; letter-spacing: 0; }
.brand-mark { position: relative; display: flex; flex-direction: column; align-items: center; color: #96520e; font: 2.2rem/.7 var(--serif); }
.brand-mark span { position: absolute; right: .1rem; top: 0; font-size: .75rem; }
.navigation nav ul { list-style: none; margin: 0; padding: 0; }
.navigation .primary-menu { display: flex; flex-wrap: wrap; gap: .1rem .45rem; }
.navigation nav a { display: block; padding: .55rem .72rem; text-decoration: none; white-space: nowrap; border: 1px solid transparent; border-radius: 3rem; }
.navigation nav a:hover, .navigation [aria-current=page] { background: #ffdc86; border-color: #de9c2d; }
.header-search { display: flex; width: min(15.2rem, 22vw); border: 1px solid #b97819; border-radius: 2rem; background: #fff9e8; }
.header-search input { min-width: 0; width: 100%; border: 0; padding: .64rem .2rem .64rem .9rem; color: var(--ink); background: transparent; }
.header-search button { display: grid; place-items: center; padding: 0 .7rem; background: none; color: var(--ink); border: 0; }
.hero { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 20% 50%, #fff7e3, #f8dc99); }
.hero-art { position: absolute; z-index: -1; inset: 0 0 0 40%; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 56%; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #fbe7b6 0, #fbe7b6b0 13%, transparent 36%); }
.hero-inner { min-height: clamp(26rem, 33vw, 34rem); display: grid; align-items: center; padding-block: 2.8rem 4.5rem; }
.hero-copy { max-width: min(47rem, 56%); }
.hero h1 { max-width: 14em; font-size: clamp(2.7rem, 4.65vw, 4.65rem); font-weight: 700; letter-spacing: -.065em; text-wrap: balance; }
.hero p { font-size: clamp(1.1rem, 1.9vw, 1.8rem); line-height: 1.22; }
.hero-flourish { color: #ad660d; display: flex; width: 12rem; align-items: center; gap: .45rem; margin: .55rem auto .85rem 23%; }
.hero-flourish::before, .hero-flourish::after { content: ''; height: 2px; background: #d89723; flex: 1; border-radius: 100%; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.25rem; margin-top: 1.45rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 1px solid #823007; padding: .72rem 1.25rem; border-radius: 3rem; background: var(--rust); color: #fffaf0; text-decoration: none; font-weight: 700; }
.button:hover { background: #823007; }
.text-link { text-underline-offset: .25em; }
.featured { position: relative; margin-top: -.7rem; padding-block: 1rem 3.25rem; text-align: center; }
.featured::before { position: absolute; z-index: -1; content: ''; background: var(--paper-light); inset: 0 calc(-1 * clamp(1rem, 5.5vw, 6rem)) auto; height: 3rem; border-radius: 50% 50% 0 0; }
.decorated { display: flex; align-items: center; justify-content: center; gap: clamp(.4rem, 2vw, 1.4rem); font-size: clamp(1.8rem, 3.35vw, 3.35rem); font-style: italic; }
.decorated::before, .decorated::after { content: ''; height: 2px; width: clamp(1rem, 11vw, 10rem); background: linear-gradient(90deg, transparent, #c88b2a); }
.decorated::after { transform: scaleX(-1); }
.genre-list { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin: .9rem 0 1.1rem; }
.genre-list a { min-height: 2.45rem; display: grid; place-items: center; padding: .35rem 1rem; border: 1px solid #b87d29; text-decoration: none; background: #ffeec9; border-radius: 2rem; }
.genre-list a:hover { color: #fff5dd; background: var(--night); border-color: var(--night); }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.8rem, 1.75vw, 1.7rem); text-align: left; }
.story-card { position: relative; min-width: 0; background: #ffedc7; border: 1px solid #ebcb8c; border-radius: 1.2rem; box-shadow: 0 .25rem .7rem #71462120; overflow: hidden; }
.story-card a { display: block; height: 100%; text-decoration: none; }
.story-card a:focus-visible { outline-offset: -4px; }
.story-card a:hover h3 { text-decoration: underline; text-underline-offset: .15em; }
.story-card img, .story-placeholder { aspect-ratio: 2 / 1; width: 100%; object-fit: cover; object-position: center 38%; }
.story-placeholder { display: grid; place-items: center; color: #f7d995; background: var(--night); font-size: 3rem; }
.card-content { position: relative; min-height: 5rem; padding: .7rem 3.1rem .75rem .95rem; }
.card-content h3 { font-size: clamp(1.12rem, 1.65vw, 1.65rem); }
.story-meta { margin-top: .45rem; font-size: .88rem; color: #39382f; }
.card-arrow { position: absolute; right: .65rem; bottom: .8rem; width: 2rem; height: 2rem; display: grid; place-items: center; border: 1px solid #d29027; background: #ffda82; border-radius: 50%; font-size: 1.25rem; }
.about { background: #f8e5b8; padding-block: 2.7rem; }
.about h2 { font-size: 2rem; margin-bottom: .6rem; }
.about p { max-width: 58ch; }
.site-footer { background: var(--night); color: #fff0cc; padding-block: 1.65rem; }
.site-footer .shell { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem 1.4rem; }
.site-footer a:first-child { font-size: 1.45rem; font-weight: 700; }
.site-footer a:last-child { margin-inline-start: auto; }
.catalog { min-height: 60vh; padding-block: clamp(2.2rem, 5vw, 5rem); }
.catalog h1, .reading h1 { font-size: clamp(2.25rem, 5.6vw, 4.6rem); letter-spacing: -.055em; text-wrap: balance; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; padding: 1rem; margin-block: 1.4rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff0cd; }
.filters label { flex: 1 1 9rem; display: grid; gap: .28rem; min-width: 0; font-weight: bold; }
.filters input, .filters select { width: 100%; background: #fffaf0; color: var(--ink); border: 1px solid #a67236; border-radius: .55rem; min-height: 2.65rem; padding: .35rem .5rem; }
.catalog .pagination { margin-top: 1.5rem; }
.page-numbers { display: inline-block; padding: .4rem .6rem; }
.reading { width: min(100%, 53rem); margin-inline: auto; padding: clamp(2rem, 5vw, 4rem) 0; min-height: 60vh; }
.reading header { margin-block: 1.25rem; }
.reading-cover { width: 100%; max-height: 29rem; object-fit: cover; object-position: center 44%; border-radius: 1rem; }
.reading-text { width: min(100%, 64ch); margin: 1.8rem auto 0; font-size: clamp(1.13rem, 2.3vw, 1.42rem); line-height: 1.72; }
.reading-text > .wp-block-image { margin: 1.8rem 0 1.5rem; }
.reading-text > .wp-block-image:first-child { margin-top: 0; }
.reading-text > .wp-block-image img { width: 100%; border-radius: 1rem; }
.reading-text p + p { margin-top: 1em; }
@media (max-width: 850px) {
    .navigation { flex-wrap: wrap; padding-block: .65rem; }
    .header-search { width: min(15rem, 100%); }
    .hero-copy { max-width: 58%; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
    .night-ribbon { height: 1rem; }
    .navigation { display: grid; grid-template-columns: 1fr; gap: .45rem; }
    .navigation nav a { padding-block: .6rem; }
    .header-search { width: 100%; }
    .hero { display: flex; flex-direction: column; }
    .hero-inner { min-height: auto; order: -1; padding-block: 1.65rem .9rem; }
    .hero-copy { max-width: none; }
    .hero h1 { font-size: clamp(2.15rem, 10vw, 3.25rem); text-wrap: initial; }
    .hero-art { position: relative; inset: auto; width: 100%; }
    .hero-art img { height: auto; aspect-ratio: 1.43; object-position: center; }
    .hero-art::after { background: linear-gradient(180deg, #fbe7b6, transparent 16%); }
    .desktop-break { display: none; }
    .featured { margin-top: -.95rem; }
    .story-grid { grid-template-columns: 1fr; }
    .site-footer a:last-child { margin: 0; }
    .filters label { flex-basis: 100%; }
}

.story-date {
    position: absolute;
    top: .65rem;
    left: .65rem;
    z-index: 1;
    padding: .28rem .72rem;
    border-radius: 2rem;
    background: var(--night);
    color: var(--paper-light);
    font-size: .88rem;
    font-weight: bold;
    pointer-events: none;
}

.calendar-intro p { margin-top: .6rem; font-size: 1.12rem; }
.calendar-months {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.5rem 0 2rem;
    padding: .85rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 1rem;
}
.calendar-months a {
    display: inline-flex;
    align-items: center;
    min-height: 2.65rem;
    padding: .35rem .8rem;
    border: 1px solid transparent;
    border-radius: 2rem;
    text-decoration: none;
}
.calendar-months a:hover { border-color: var(--amber); }
.calendar-months [aria-current=page] { background: var(--night); color: var(--paper-light); }
.story-calendar h2 { margin-bottom: 1rem; font-size: clamp(1.55rem, 2.8vw, 2.5rem); }
.story-calendar h2::first-letter { text-transform: uppercase; }

@media (max-width: 580px) {
    .calendar-months {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: .5rem;
        gap: .2rem;
    }
    .calendar-months a {
        justify-content: center;
        padding-inline: .2rem;
        font-size: .94rem;
    }
}
