/* ==========================================
   Portal Page Specific Styles
   (Uses shared styles from ../css/protected-pages.css)
   All common styles (.portal-section, .portal-container, etc.)
   are defined in protected-pages.css for consistency
   ========================================== */

/* Portal Title with gradient */
.portal-title {
    font-size: var(--font-size-h1, 3rem);
    font-weight: var(--font-weight-bold, 700);
    color: var(--text-primary);
    margin-bottom: 10px;
}

.portal-title span {
    /* Uses .gradient-text from protected-pages.css */
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portal-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-regular, 400);
}

/* Portal Description */
.portal-description {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 20px;
}

.portal-description p {
    font-size: var(--font-size-body, 1rem);
    line-height: var(--line-height-body, 1.5);
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
}

/* Grouped sections */
.portal-group {
    margin-bottom: 48px;
}
.portal-group-title {
    font-size: 0.95rem;
    font-weight: var(--font-weight-bold, 700);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Portal Features Grid */
.portal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 0;
}

/* Role-gated (disabled) tile — cosmetic only; server still enforces access */
.portal-card {
    position: relative;
}
.portal-card--disabled {
    opacity: 0.5;
    filter: grayscale(0.6);
}
.portal-card--disabled .card-link {
    pointer-events: none;
    color: var(--text-secondary);
}
.portal-card--disabled .card-link:hover {
    transform: none;
}
.portal-card-flag {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 3px 9px;
    white-space: nowrap;
}

/* ==========================================
   Card watermark
   ==========================================
   The tiles used to open with a 3rem emoji — thirteen of them down the dashboard, each
   drawn by the reader's operating system in full colour. The icon is now a large, very
   faint mark behind the text: it gives the tile a character to recognise without being
   the first thing the eye lands on, which should be the heading.

   Behind, not beside: .portal-card is position:relative and overflow:hidden already (it
   clips the hover accent bar), so the mark can hang off the corner and be cropped. */

/* Inset, not bled off the corner. It was at -14px, which cropped whichever part of the
   drawing reached its own edge — and most do: megaphone, map-pin, building, user and
   ticket all touch x=0, so a fifth of each was simply cut off by the card. A mark that
   loses a piece of itself reads as a mistake, not as a watermark. */
.card-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--primary-color);
    opacity: 0.07;
    pointer-events: none;
    line-height: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Size lives here rather than in a data-icon-size attribute: it is a layout decision that
   belongs with the rest of the tile, and it has to change with the breakpoints below.
   A CSS width beats the width attribute icons.js writes, so no !important is needed. */
.card-icon .gd-icon {
    width: 116px;
    height: 116px;
    stroke-width: 1.25;   /* a hairline at this size; 1.75 would read as a drawing */
}

/* On hover the mark comes up just enough to confirm the card is live — the same gesture
   as the accent bar at the top, not a second one competing with it. */
.portal-card:hover .card-icon {
    opacity: 0.13;
    transform: scale(1.04);
}

.portal-card--disabled .card-icon {
    color: var(--text-muted);
    opacity: 0.05;
}

.card-title {
    font-size: var(--font-size-h3, 1.5rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary);
    margin-bottom: 15px;
}

.card-description {
    font-size: var(--font-size-body, 1rem);
    line-height: var(--line-height-body, 1.5);
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.card-link {
    /* Uses .action-link from protected-pages.css */
    display: inline-flex;
    align-items: center;
    font-size: var(--font-size-body, 1rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.card-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* A card with more than one way out of it. Stacked rather than side by side: the tiles are
   narrow enough that two links in a row wrap mid-label at the first breakpoint. */
.card-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

/* The disabled state greys every link in the card, not just the first one — and the wizard
   action is a .btn, not a .card-link, so it has to be named too. */
.portal-card--disabled .card-links a {
    pointer-events: none;
    color: var(--text-secondary);
}

.portal-card--disabled .card-links .btn {
    opacity: 0.6;
}

/* Portal Stats Grid */
.portal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-value {
    font-size: var(--font-size-h2, 2.25rem);
    font-weight: var(--font-weight-bold, 700);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: var(--font-size-small, 0.875rem);
    color: var(--text-secondary);
    font-weight: var(--font-weight-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   Responsive Overrides
   ========================================== */

@media (max-width: 768px) {
    .portal-title {
        font-size: 2rem;
    }

    .portal-subtitle {
        font-size: var(--font-size-body, 1rem);
    }

    .portal-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Narrower tile, so the mark is cropped harder — shrink it or it becomes the tile. */
    .card-icon .gd-icon {
        width: 88px;
        height: 88px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .portal-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .portal-title {
        font-size: 1.625rem;
    }

    .portal-stats {
        grid-template-columns: 1fr;
    }
}
