/*
 * Public content pages (layouts/public.php): news, today, players, clans, FAQ,
 * the legal pages and the 404. Loaded after css/home.css, whose tokens, header,
 * footer, buttons and forms it builds on; this file only styles page content.
 */

/* ---------- Page frame ---------- */

.pub-main {
    padding-block: clamp(28px, 4vw, 52px) clamp(40px, 6vw, 72px);
    background:
        radial-gradient(ellipse 70% 320px at 50% 0, rgba(140, 16, 24, 0.16), transparent 70%),
        var(--dtg-bg);
}

.pub-main h1 {
    margin: 0 0 10px;
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.03em;
}

/* The page's own title gets the crimson-to-gold rule; titles inside heroes (clan, player) do not. */
.pub-wrap > h1,
.pub-wrap > article > h1,
.legal-title {
    padding-bottom: 12px;
    border-bottom: 1px solid;
    border-image: linear-gradient(90deg, var(--dtg-crimson-hover), var(--dtg-gold) 40%, transparent) 1;
}

.pub-main h2 {
    margin: 2.2rem 0 0.6rem;
    color: var(--dtg-gold);
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.03em;
}

.pub-main h3 {
    margin: 0 0 0.35rem;
    color: var(--dtg-text);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}

.pub-lede {
    margin: 0 0 1.6rem;
    color: var(--dtg-muted);
    font-family: var(--font-prose);
    font-size: 1.22rem;
    line-height: 1.5;
}

.pub-prose {
    color: #D6D0C6;
    font-family: var(--font-prose);
    font-size: 1.14rem;
    line-height: 1.7;
}

.pub-prose h2 {
    margin-top: 2rem;
}

.pub-prose h3 {
    margin-top: 1.5rem;
}

.pub-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.pub-prose strong {
    color: var(--dtg-text);
}

.pub-main a:not(.btn):not(.pub-card):not(.pub-article-row) {
    color: var(--dtg-gold-pale);
    text-decoration: underline;
    text-decoration-color: var(--gold-line);
    text-underline-offset: 3px;
    transition: color 180ms ease, text-decoration-color 180ms ease;
}

.pub-main a:not(.btn):not(.pub-card):not(.pub-article-row):hover {
    color: #fff;
    text-decoration-color: var(--dtg-gold);
}

.pub-meta {
    color: var(--dtg-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pub-breadcrumb {
    margin-bottom: 14px;
    color: var(--dtg-muted);
    font-size: 0.88rem;
}

.pub-badge {
    display: inline-block;
    padding: 2px 10px;
    color: var(--dtg-gold-pale);
    background: rgba(197, 161, 107, 0.12);
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pub-tag {
    color: var(--dtg-gold);
}

.pub-accent {
    color: var(--dtg-gold-pale);
    font-weight: 600;
}

/* ---------- Cards and grids ---------- */

.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: 16px;
}

.pub-card {
    position: relative;
    display: block;
    padding: 18px 20px;
    color: inherit;
    background: linear-gradient(180deg, var(--dtg-iron) 0%, #14181D 100%);
    border: 1px solid var(--dtg-steel);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-decoration: none;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

/* Gold corner mark, as on the homepage cards. */
.pub-card::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 10px;
    height: 10px;
    border-top: 1px solid var(--dtg-gold);
    border-left: 1px solid var(--dtg-gold);
    opacity: 0.6;
    pointer-events: none;
}

a.pub-card:hover {
    border-color: var(--dtg-gold);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(197, 161, 107, 0.25);
    transform: translateY(-2px);
}

/* A card's own title (an h2 on list pages, where the page has no other h2). */
.pub-main .pub-card-title {
    margin: 0 0 0.35rem;
    color: var(--dtg-text);
    font-size: 1.1rem;
}

.pub-card p {
    margin: 0;
    color: var(--dtg-muted);
    font-size: 0.92rem;
}

.pub-stat-value {
    margin: 4px 0 6px;
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.pub-stat-value .u {
    color: var(--dtg-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
}

.pub-empty {
    padding: 40px 24px;
    text-align: center;
}

.pub-empty p {
    font-size: 1rem;
}

.pub-empty .pub-empty-title {
    margin-bottom: 8px;
    color: var(--dtg-text);
    font-weight: 600;
}

/* ---------- News list ---------- */

.pub-article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pub-article-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    color: inherit;
    background: linear-gradient(180deg, var(--dtg-iron) 0%, #14181D 100%);
    border: 1px solid var(--dtg-steel);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 180ms ease, transform 180ms ease;
}

.pub-article-row:hover {
    border-color: var(--dtg-gold);
    transform: translateY(-2px);
}

/* Category avatar: --cat is the category colour set in public/articles.php. */
.pub-article-av {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
    line-height: 1;
    background: color-mix(in srgb, var(--cat, #C5A16B) 14%, #0E1115);
    border: 1px solid color-mix(in srgb, var(--cat, #C5A16B) 45%, transparent);
    border-radius: var(--radius);
}

/* The category emblem (images/home/news/<category>-360.*), transparent, on a 3:2 canvas. */
.pub-article-art {
    flex: 0 0 auto;
    width: 180px;
    aspect-ratio: 3 / 2;
    align-self: center;
}

.pub-article-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
    transition: transform 180ms ease;
}

.pub-article-row:hover .pub-article-art img {
    transform: scale(1.04);
}

/* The opened article shows the same emblem larger, over a faint crimson glow. */
.pub-article-hero {
    display: block;
    width: min(480px, 100%);
    margin: 0 auto 10px;
    background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(140, 16, 24, 0.3), transparent 72%);
}

.pub-article-hero img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6));
}

.pub-article-bd {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pub-article-bd .pub-badge {
    align-self: flex-start;
}

.pub-article-tt {
    color: var(--dtg-text);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.pub-article-row:hover .pub-article-tt {
    color: var(--dtg-gold-pale);
}

.pub-article-ex {
    color: var(--dtg-muted);
    font-family: var(--font-prose);
    font-size: 1.05rem;
    line-height: 1.5;
}

/* ---------- Clans and players ---------- */

.clan-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.clan-row-av,
.clan-row-ph {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
}

.clan-row-av {
    object-fit: cover;
    background: #0E1115;
}

.clan-row-ph,
.clan-hero-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-weight: 700;
    background: radial-gradient(circle at 50% 40%, rgba(197, 161, 107, 0.22), rgba(14, 17, 21, 0.9) 75%);
}

.clan-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.clan-hero h1 {
    margin: 0;
}

.clan-hero .pub-lede {
    margin: 6px 0 0;
}

.clan-hero-av,
.clan-hero-ph {
    flex: 0 0 auto;
    width: 104px;
    height: 104px;
    border: 1px solid var(--dtg-gold);
    border-radius: var(--radius);
    box-shadow: 0 0 0 4px rgba(197, 161, 107, 0.1);
}

.clan-hero-av {
    object-fit: cover;
}

.clan-hero-ph {
    font-size: 2.2rem;
}

.clan-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 0 0 1.8rem;
}

.clan-stat {
    container-type: inline-size;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--dtg-steel);
    border-radius: var(--radius);
}

.clan-stat .v {
    color: var(--dtg-gold-pale);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

/* The founded date ("Mar 2026" is the widest month, 120px at full size): full size where the tile has room, and
   only as much smaller as the tile needs (19.5% of its inner width) where it does not. No ellipsis, no marquee.
   It is a span inside a full-size .v, so the line keeps the full-size height and baseline: the date sits on the
   same baseline as the other numbers and the label under it stays level with theirs. */
.clan-stat .v--small {
    font-size: 1.1rem;
    font-size: min(1.5rem, 19.5cqi);
}

.clan-stat .v-max {
    color: var(--dtg-muted);
    font-size: 0.9rem;
}

.clan-stat .l {
    margin-top: 4px;
    color: var(--dtg-muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.perk-cat {
    margin: 1rem 0;
}

.pub-main .perk-cat h3 {
    margin: 0 0 10px;
    color: var(--dtg-muted);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.perk-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
    gap: 10px;
}

.perk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--dtg-steel);
    border-radius: var(--radius);
}

.perk-ic {
    flex: 0 0 auto;
    font-size: 1.25rem;
    line-height: 1;
}

.perk-tx {
    font-size: 0.86rem;
    line-height: 1.35;
}

.perk-tx b {
    color: var(--dtg-text);
    font-weight: 600;
}

.perk-tx span {
    color: var(--dtg-muted);
}

/* ---------- Today ---------- */

.war-side {
    color: var(--dtg-text);
}

.war-side.is-lead {
    color: var(--dtg-gold-pale);
    font-weight: 700;
}

.war-vs {
    color: var(--dtg-muted);
}

.pub-reset {
    margin: 0 0 1.2rem;
    padding: 22px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(197, 161, 107, 0.14), transparent 65%), linear-gradient(180deg, var(--dtg-iron), #14181D);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
}

.pub-reset-clock {
    color: var(--dtg-gold);
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1.15;
}

.pub-reset-clock .u {
    color: var(--dtg-gold-pale);
    font-size: 2.4rem;
    font-weight: 700;
}

.pub-reset .pub-meta {
    margin-top: 6px;
}

/* ---------- FAQ ---------- */

/* Questions on the left, the side cards on the right (sticky); one column below 1024 px, cards after the list. */
.faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 28px;
}

.pub-faq {
    display: grid;
    gap: 12px;
}

.faq-aside {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 16px;
}

.faq-side-card p + p {
    margin-top: 8px;
}

.faq-side-card .btn {
    margin-top: 16px;
}

/* The card's picture: luK's DTG CORE BOT art (images/home/faq/core-bot.*), or a gold chat mark without it. */
.faq-side-art {
    display: block;
    margin: -4px -4px 14px;
    border-radius: var(--radius);
}

.faq-side-art--photo {
    overflow: hidden;
    border: 1px solid var(--gold-line);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
}

.faq-side-art--photo img {
    width: 100%;
    height: auto;
}

.faq-side-art--icon {
    aspect-ratio: 3 / 2;
    display: grid;
    place-items: center;
    color: var(--dtg-gold);
    background:
        radial-gradient(circle at 50% 45%, rgba(197, 161, 107, 0.2), transparent 62%),
        linear-gradient(180deg, #1D2228, #0E1115);
    border: 1px solid var(--gold-line);
}

.faq-side-art--icon .icon {
    width: 64px;
    height: 64px;
    stroke-width: 1.4;
}

.faq-side-limit {
    color: var(--dtg-gold);
    font-size: 0.86rem;
    font-weight: 600;
}

.faq-side-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.faq-side-heading .pub-card-title {
    margin: 0;
}

.faq-side-heading .icon {
    width: 22px;
    height: 22px;
    fill: var(--dtg-gold);
    stroke: none;
}

/* The Oldskool Gaming Discord server icon, rounded like Discord shows it. */
.faq-side-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border: 1px solid var(--gold-line);
    border-radius: 14px;
}

.faq-side-avatar img {
    width: 100%;
    height: 100%;
}

/* Guests: the bot needs an account, so a way in for those who already have one. */
.pub-card p.faq-side-signin {
    margin-top: 10px;
    text-align: center;
    font-size: 0.9rem;
}

.faq-side-signin a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.pub-faq-item h2 {
    margin: 0 0 8px;
    color: var(--dtg-gold-pale);
    font-size: 1.12rem;
}

.pub-faq-item p {
    color: #D6D0C6;
    font-family: var(--font-prose);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ---------- 404 (errors/404.php) ---------- */

.pub-notfound {
    max-width: 640px;
    margin: clamp(12px, 4vw, 40px) auto 0;
    text-align: center;
}

/* ---------- Lists in reading text (home.css resets ul globally for menus) ---------- */

.pub-prose ul,
.legal-content ul {
    list-style: disc;
}

.pub-prose ul,
.pub-prose ol {
    margin: 0 0 1rem;
    padding-left: 1.4rem;
}

.pub-prose li::marker {
    color: var(--dtg-gold);
}

/* ---------- Legal pages (Legal Notice, Privacy Policy, Terms) ---------- */

/* A reading width, instead of the phone-sized card they used to sit in. */
.legal-page {
    max-width: 820px;
    margin-inline: auto;
}

.legal-updated {
    margin: 0 0 1.4rem;
    color: var(--dtg-muted);
    font-size: 0.85rem;
}

.legal-content {
    color: #D6D0C6;
    font-family: var(--font-prose);
    font-size: 1.12rem;
    line-height: 1.7;
}

.legal-content section + section {
    margin-top: 1.8rem;
}

.pub-main .legal-content h2 {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
}

.pub-main .legal-content h3 {
    margin: 1.2rem 0 0.4rem;
    color: var(--dtg-gold-pale);
    font-size: 1.05rem;
}

.legal-content p {
    margin: 0 0 0.8rem;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 0.8rem;
    padding-left: 1.4rem;
}

.legal-content li {
    margin-bottom: 0.3rem;
}

.legal-content li::marker {
    color: var(--dtg-gold);
}

.legal-content strong {
    color: var(--dtg-text);
}

/* The model withdrawal form (Terms, section 6): set apart so it reads as a form to copy; no bullets, one line per field. */
.legal-content .legal-form {
    list-style: none;
    padding: 0.8rem 1rem;
    border-left: 2px solid var(--dtg-gold);
    background: rgba(255, 255, 255, 0.03);
}

.legal-back {
    margin-top: 2.2rem;
}

/* ---------- Closing call to action ---------- */

.pub-cta-band {
    margin-top: clamp(40px, 6vw, 64px);
    padding: clamp(28px, 4vw, 44px) 24px;
    text-align: center;
    background:
        radial-gradient(ellipse at top, rgba(140, 16, 24, 0.32), transparent 65%),
        linear-gradient(180deg, #171B21, #0E1115);
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
}

.pub-main .pub-cta-title {
    margin: 0 0 8px;
    color: var(--dtg-gold-pale);
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pub-cta-band p {
    margin: 0 auto 20px;
    max-width: 560px;
    color: var(--dtg-muted);
    font-family: var(--font-prose);
    font-size: 1.15rem;
}

/* With the page's scene behind it (partials/cta-art.php): taller, brighter text with a shadow. */
.pub-cta-band.has-art {
    padding-block: clamp(56px, 8vw, 104px);
}

.pub-cta-band.has-art .pub-cta-title {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

.pub-cta-band.has-art p {
    color: #E6E0D6;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

/* ---------- Tablet and below: the FAQ side cards move under the list, side by side while there is room ---------- */

@media (max-width: 1023px) {
    .faq-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .faq-aside {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
        align-items: start;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
    .pub-lede {
        font-size: 1.1rem;
    }

    .pub-article-row {
        gap: 12px;
        padding: 14px;
    }

    .pub-article-av {
        width: 46px;
        height: 46px;
        font-size: 1.35rem;
    }

    .pub-article-art {
        width: 104px;
        align-self: flex-start;
    }

    .pub-article-tt {
        font-size: 1.05rem;
    }

    .clan-hero {
        align-items: flex-start;
        gap: 14px;
    }

    .clan-hero-av,
    .clan-hero-ph {
        width: 72px;
        height: 72px;
    }

    .clan-hero-ph {
        font-size: 1.6rem;
    }

    .pub-reset-clock {
        font-size: 1.4rem;
    }

    .pub-reset-clock .u {
        font-size: 1.7rem;
    }

    .pub-cta-band .btn-lg {
        width: 100%;
        white-space: normal;
    }
}
