@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-dark: #1c160c;
    --bg-card: #1f1f1f;
    --bg-card-alt: #343434;
    --gold: #ae7719;
    --gold-light: #b07817;
    --gold-hover: #c98a1e;
    --text-white: #ffffff;
    --text-light: #dddddd;
    --text-muted: #999999;
    --content-width: 1192px;
    --page-width: 1440px;
}

body {
    background: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Albert Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-hover); }

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

::selection { background: rgba(174,119,25,0.3); color: #fff; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(174,119,25,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(174,119,25,0.35); }

.content-wrap {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ====== HERO ====== */
.hero {
    width: 100%;
    height: 420px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.5);
    z-index: 0;
}
.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 662px;
    padding: 2rem;
}
.hero__logo {
    max-width: 650px;
    width: 100%;
    margin-bottom: 1.5rem;
}
.hero__quote {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-light);
    line-height: 1.5;
    opacity: 0.85;
}

/* ====== SECTION COMMON ====== */
.section {
    padding: 80px 0;
    position: relative;
}
.section--dark {
    background: var(--bg-dark);
}
.section--gradient {
    background: var(--bg-dark);
    position: relative;
}
.section--gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(174,119,25,0.06) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(174,119,25,0.04) 0%, transparent 60%);
    pointer-events: none;
}

/* ====== SECTION TITLE ====== */
.section-title {
    margin-bottom: 48px;
}
.section-title__top {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 16px;
}
.section-title__text h2 {
    font-size: 40px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
}
.section-title__text p {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: 2px;
}
.section-title__ornament {
    flex-shrink: 0;
    width: 210px;
    height: 63px;
    opacity: 0.4;
}
.section-title__divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--gold) 0%, rgba(174,119,25,0.2) 100%);
    position: relative;
}

/* ====== CARD GRID ====== */
.card-grid {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.card-grid--center {
    justify-content: center;
}

/* ====== CARD LIBRO (La Storia) ====== */
.card-libro {
    width: 274px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-decoration: none;
    transition: transform 0.3s;
}
.card-libro:hover {
    transform: translateY(-4px);
}
.card-libro__cover {
    width: 274px;
    height: 354px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--bg-card);
}
.card-libro__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
}
.card-libro__sub {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: -12px;
}

/* ====== CARD SCRITTI ====== */
.card-scritti {
    width: 412px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s;
    overflow: hidden;
    border-radius: 4px;
}
.card-scritti:hover {
    transform: translateY(-4px);
}
.card-scritti__thumb {
    width: 412px;
    height: 248px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.card-scritti__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.card-scritti__thumb-title {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    line-height: 1.2;
}
.card-scritti__info {
    padding: 16px 0;
}
.card-scritti__date {
    font-size: 18px;
    color: var(--text-muted);
}
.card-scritti__desc {
    font-size: 18px;
    color: var(--text-light);
}

/* ====== CARD CRONACHE ====== */
.card-cronache {
    width: 248px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s;
    border-radius: 4px;
    overflow: hidden;
}
.card-cronache:hover {
    transform: translateY(-4px);
}
.card-cronache__thumb {
    width: 248px;
    height: 248px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.card-cronache__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}
.card-cronache__thumb-title {
    position: relative;
    z-index: 1;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
    line-height: 1.2;
}
.card-cronache__info {
    padding: 16px 0;
}
.card-cronache__date {
    font-size: 18px;
    color: var(--text-muted);
}
.card-cronache__desc {
    font-size: 18px;
    color: var(--text-light);
    line-height: 1.4;
}

/* ====== SCHEDA (lista scritti) ====== */
.schede-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.scheda {
    display: block;
    text-decoration: none;
    padding: 16px 0;
    border-bottom: 1px solid rgba(174,119,25,0.1);
    transition: border-color 0.2s;
}
.scheda:hover {
    border-color: rgba(174,119,25,0.3);
}
.scheda__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
    margin-bottom: 8px;
}
.scheda__date {
    font-size: 18px;
    color: var(--text-muted);
}
.scheda__desc {
    font-size: 18px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    font-size: 18px;
    color: var(--text-muted);
}
.pagination a {
    color: var(--gold);
    padding: 4px 8px;
}
.pagination .active {
    color: var(--text-white);
    font-weight: 700;
}

/* ====== CIMITERO / EPILOGHI ====== */
.cimitero-group {
    display: flex;
    gap: 32px;
    margin-bottom: 48px;
    align-items: flex-start;
}
.cimitero-group__label {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    white-space: nowrap;
    padding: 16px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.05em;
    min-height: 306px;
}
.cimitero-group__cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.card-cimitero {
    width: 274px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s;
    border-radius: 4px;
    overflow: hidden;
}
.card-cimitero:hover {
    transform: translateY(-4px);
}
.card-cimitero__img {
    width: 274px;
    height: 200px;
    object-fit: cover;
    background: var(--bg-card);
}
.card-cimitero__info {
    padding: 16px 0;
}
.card-cimitero__name {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1.2;
}
.card-cimitero__book {
    font-size: 18px;
    color: var(--gold);
    margin-top: 2px;
}
.card-cimitero__dates {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ====== REGOLE ====== */
.regole-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 274px;
}
.regole-card__cover {
    width: 274px;
    height: 387px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-card);
}
.regole-card__title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-white);
}
.regole-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 18px;
    border-radius: 4px;
    transition: all 0.2s;
    text-decoration: none;
}
.regole-card__btn:hover {
    background: rgba(174,119,25,0.1);
}

/* ====== FOOTER ====== */
.footer {
    background: #0f0c08;
    padding: 60px 0 40px;
}
.footer__logo {
    display: block;
    max-width: 576px;
    margin: 0 auto 40px;
}
.footer__nav {
    display: flex;
    justify-content: center;
    gap: 48px;
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}
.footer__col {
    display: flex;
    gap: 16px;
}
.footer__col-bar {
    width: 2px;
    background: var(--gold);
    border-radius: 1px;
    flex-shrink: 0;
}
.footer__col-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.footer__col-links a {
    font-size: 18px;
    color: var(--text-light);
    transition: color 0.2s;
}
.footer__col-links a:hover {
    color: var(--gold);
}
.footer__col-links a.footer__heading {
    color: var(--text-white);
    font-weight: 600;
}

/* ====== SECTION DIVIDER ====== */
.section-divider {
    width: 100%;
    max-width: var(--content-width);
    margin: 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(174,119,25,0.3), transparent);
}

/* ====== LOGIN (preserve) ====== */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    flex-direction: column;
    padding: 2rem;
}
.login-box {
    background: linear-gradient(145deg, rgba(31,31,31,0.9) 0%, rgba(28,22,12,0.95) 100%);
    border: 1px solid rgba(174,119,25,0.12);
    box-shadow: 0 0 80px rgba(174,119,25,0.03), 0 20px 60px rgba(0,0,0,0.5);
    padding: 3rem 2.5rem;
    border-radius: 4px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-box h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
}
.login-box .divider {
    width: 60px;
    height: 2px;
    background: var(--gold);
    margin: 1.2rem auto 1rem;
}
.login-box .sub {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}
.login-box input {
    display: block;
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(174,119,25,0.15);
    color: var(--text-light);
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
    transition: border-color 0.3s;
}
.login-box input::placeholder { color: var(--text-muted); }
.login-box input:focus { outline: none; border-color: var(--gold); }
.login-box button {
    width: 100%;
    padding: 0.8rem;
    margin-top: 0.5rem;
    background: linear-gradient(180deg, rgba(174,119,25,0.15) 0%, rgba(174,119,25,0.08) 100%);
    border: 1px solid rgba(174,119,25,0.3);
    color: var(--gold);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.3s;
}
.login-box button:hover {
    background: linear-gradient(180deg, rgba(174,119,25,0.25) 0%, rgba(174,119,25,0.12) 100%);
    border-color: var(--gold);
}
.flash {
    background: rgba(139,48,48,0.15);
    border: 1px solid rgba(139,48,48,0.3);
    padding: 0.8rem 1.2rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    max-width: 380px;
}
