/* ===== CA PAGE - CLEAN & SIMPLE ===== */
/* CSS Variables - simplified */
:root {
    /* Colors */
    --color-primary: #0d5c38;
    --color-primary-dark: #084527;
    --color-primary-light: #e6f3ed; /* Very subtle green tint */
    --color-accent: #2e8b57; /* Sea green - more vibrant */
    /* Neutral professional palette */
    --color-neutral-25: #fdfdfd;   /* Backgrounds */
    --color-neutral-50: #fafafa;   /* Backgrounds */
    --color-neutral-75: #f8f8f8;  /* Cards, subtle backgrounds */
    --color-neutral-100: #f5f5f5;  /* Cards, subtle backgrounds */
    --color-neutral-150: #ececec;  /* Cards, subtle backgrounds */
    --color-neutral-200: #e5e5e5;  /* Borders, dividers */
    --color-neutral-300: #d4d4d4;  /* Hover borders */
    --color-neutral-500: #737373;  /* Lighter text */
    --color-neutral-700: #404040;  /* Body text */
    --color-neutral-800: #262626;  /* Headers */
    --color-neutral-900: #171717;  /* Strong emphasis */
    /* Functional colors */
    --color-success: #10b981;      /* Success states */
    --color-info: #3b82f6;         /* Informational - subtle blue */
    --color-warning: #f59e0b;      /* Warnings */
    --color-error: #dc2626;        /* Errors/alerts */
    /* Text hierarchy */
    --color-text: var(--color-neutral-800);
    --color-text-light: var(--color-neutral-700);
    --color-text-lighter: var(--color-neutral-500);
    /* Backgrounds */
    --color-background: var(--color-neutral-100);
    --color-section-bg: var(--color-neutral-25);
    --color-card-bg: var(--color-neutral-75);
    --color-info-bg: var(--color-neutral-150);
    --color-details-bg: #eff6ef;
    /* --color-mime-highlight: #e4f8e4; */
    /* Borders */
    --color-border: var(--color-neutral-200);
    --color-border-light: var(--color-neutral-100);
    --color-border-dark: var(--color-neutral-300);
    /* Fonts */
    --font-sans:
            "Liberation Sans",    /* High quality Libre font on X11/Wayland (unlikely to interfere) */
            "Noto Sans",          /* Modern FOSS font with notable coverage (unlikely to interfere) */
            -apple-system, BlinkMacSystemFont, /* Apple specific                  (won't interfere) */
            "Segoe UI",           /* Windows (7-11, adaptive) system font */
            sans-serif;           /* Platform default: Roboto or OEM font on Android & user preferences */
    --font-mono:
            "Liberation Mono",    /* High quality Libre font on X11/Wayland (unlikely to interfere) */
            "Noto Sans Mono",     /* Modern FOSS font with notable coverage (unlikely to interfere) */
            "SF Mono", "Monaco",  /* macOS specific */
            "Cascadia Mono", Consolas, /* Windows, better than legacy FOSS where available */
            monospace;            /* Platform default: Roboto or OEM font on Android & user preferences */
}

/* inline svg reservation */
.svg-sprite-container {
    display: none;
}

/* Reset & Base - minimal */
body {
    margin: 0;
    padding: 0;
    color: var(--color-text);
    background-color: var(--color-background);
}

.ca-container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 1rem;
}

/* Header - simple and clean */
header {
    padding: 1.5rem 0;
    text-align: center;
}

.ca-logo {
    margin-bottom: 1rem;
    height: 60px;
}

.ca-title {
    margin: 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--color-primary);
}

.ca-subtitle {
    margin: 0 auto;
    max-width: 600px;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-lighter);
}

/* Divider */
.ca-divider {
    margin: 0 auto 1.25rem;
    height: 3px;
    border-top: 2px solid black;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

/* Main Content */
main {
    margin: 0 auto;
    max-width: 1000px;
}

.ca-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--color-text-light);
}

/* Download section - huge card like */
.download-section {
    margin: 0 auto;
    padding: 0.5rem 2rem;
    line-height: 1.5;
    background: var(--color-section-bg);
    border-top: 1px solid var(--color-border);
}

.ca-download-header {
    font-family: var(--font-sans);
    margin: 0.5rem auto 0 5.125rem;
}

.ca-download-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-primary-dark);
}

/* ===== Certificate stripes  ===== */
.ca-certs-block {
    margin: 1rem 0;
    font-family: var(--font-sans);
}

.ca-cert-item {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap; /* allow ca-cert-tip to wrap */
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    line-height: 1.33;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ca-cert-main {
    flex: 1 0 63%; /* Outer 1st flex, allow shrinking */
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap; /* Allow children to wrap */
    align-items: center;
    gap: 1rem;
}

.ca-cert-stripe-icon {
    align-self: center;
    object-fit: contain;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.ca-cert-textblock {
    flex: 1; /* nested 1st fled */
    min-width: 13rem; /* ca-download-link wrapping breakpoint */
}

.ca-cert-header {
    margin-bottom: 0.5rem;
}

.ca-cert-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
}

.ca-cert-mime {
    display: inline-block;
    padding: 2px 0.5rem;
    background: var(--color-info-bg);
    vertical-align: middle;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-primary);
    white-space: nowrap; /* despite content can't have blanks */
    text-overflow: ellipsis;
    border: 1px solid rgba(13, 92, 56, 0.1); /* color-primary with alpha */
}

.ca-cert-desc {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* Download Links - Beautiful original style */
.ca-download-link {
    display: block; /* required for > a overflow: hiddent wo work! */
    line-height: 1.6;
    margin-left: auto;
    margin-right: auto;
}

/* stripe hover effect */
/* .ca-cert-item:hover .ca-cert-stripe-icon, */
.ca-cert-item:hover .ca-cert-mime {
    background: var(--color-details-bg);
    transition: background 0.2s ease;
}

/* ca-cert-item:hover triggers 1st of two a:hover effects */
.ca-cert-item:hover .ca-download-link a {
    opacity: 1;
}

.ca-download-link > a {
    display: inline-block;
    position: relative;
    padding: 4px 1.5rem;
    background: var(--color-neutral-500);
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
    opacity: 0.8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border: 1px solid var(--color-primary-dark);
    border-radius: 6px;
    color: white;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden; /* Clip the ::after element */
}

/* pseudo element for .ca-download-link > a:hover effect */
.ca-download-link a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.ca-download-link > a:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 8px 20px rgba(13, 92, 56, 0.3);
}

/* Chrome sees reversed gradient, so swap colors */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    .ca-download-link > a {
        background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    }

    .ca-download-link > a:hover {
        background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    }
}

.ca-download-link > a:hover::after {
    left: 100%;
}

/* Focus styles for keyboard accessibility */
/* Omit .ca-download-link > a:focus::after effect above! */
.ca-download-link a:focus {
    opacity: 1;
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 8px 20px rgba(13, 92, 56, 0.3);
}

.ca-cert-tip {
    flex: 1 1 30%; /* Allow tip to wrap */
    min-width: 14rem; /* outer-first wrap breakpoint */
    padding: 1.25rem;
    padding-right: 0.75rem;
    background: var(--color-info-bg);
    border-left: 1px solid var(--color-border-light);
    border-top: 1px solid var(--color-border-light); /* Add top border when wrapped */
}

/* Add a subtle icon before "Tip" */
.ca-cert-tip::before {
    content: "💡 ";
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.ca-cert-tip-content {
    display: inline; /* ::before icon */
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.ca-cert-tip-content strong {
    margin-right: 0.25rem;
    color: var(--color-primary);
    font-weight: 600;
}

.info-section {
    /* similar to .download-section */
    margin: 0 auto;
    padding: 0.5rem 2rem;
    min-height: 32rem;
    line-height: 1.5;
    background: var(--color-section-bg);
}

/* Certificate Details */
.ca-details {
    max-width: 48rem;
    padding: 1rem;
    margin: 0 auto 2rem;
    background-color: var(--color-details-bg);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    border: 1px solid var(--color-border);
}

.cert-paper {
    background-image:
        /* primary wave set */
        repeating-linear-gradient(
          to bottom,
          transparent 0px,
          transparent 15px
          rgba(180, 200, 180, 0.15) 15px,
          rgba(180, 200, 180, 0.15) 17px,
        ),
        repeating-linear-gradient(
          circle at 30% 50%,
          transparent 0px,
          transparent 12px
          rgba(160, 190, 160, 0.2) 12px,
          rgba(160, 190, 160, 0.2) 14px,
        );
    background-blend-mode: overlay;
    background-size: 100% 30px, 50px 50px;
}

/*
.vertlines-paper {
    background-image:
        repeating-linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.5) 0px,
          rgba(255, 255, 255, 0.5) 3px,
          transparent 3px,
          transparent 12px,
          rgba(240, 240, 240, 0.3) 12px,
          rgba(240, 240, 240, 0.3) 14px,
          transparent 14px,
          transparent 24px
        );
    background-image:
        repeating-linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.4) 0px,
          rgba(255, 255, 255, 0.4) 2px,
          transparent 2px,
          transparent 10px
        ),
        repeating-linear-gradient(
          92deg,
          rgba(240, 240, 240, 0.3) 0px,
          rgba(240, 240, 240, 0.3) 1px,
          transparent 1px,
          transparent 8px
        );
    background-blend-mode: normal;
}
*/
.vertlines-paper {
    background-image:
        repeating-linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.6) 0px,
          rgba(255, 255, 255, 0.6) 2px,
          transparent 2px,
          transparent 6px
        ),
        repeating-linear-gradient(
          90deg,
          rgba(240, 240, 240, 0.8) 6px,
          rgba(240, 240, 240, 0.8) 7px,
          transparent 7px,
          transparent 12px
        );
}

.ca-details-header {
    display: flex;
    align-items: center; /* Vertically center */
    gap: 1rem; /* Space between icon and title */
    margin-bottom: 0.5rem;
}

.ca-details-title {
    font-size: 1.3rem;
    color: var(--color-primary-dark);
    margin: 0.25rem 0 0.25rem 0.25rem;
    font-weight: 600;
}

.ca-details-attributes {
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
    gap: 1rem 1.5rem;
    line-height: 1.75;
}

.ca-detail-item {
    flex: 1;
    min-width: 12rem;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    margin: 0.5rem 0;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-card-bg) 0px,
        var(--color-card-bg) 1.75em,  /* em scales with container */
        white 1.75em,
        white 3.5em
    );
    background-size: 100% 3.5em; /* Ensures pattern repeats correctly */
    border: 1px solid var(--color-border);
}

.ca-detail-label,
.ca-fingerprint-alg {
    font-size: 0.75rem;
    color: var(--color-text-lighter);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    font-weight: 600;
}

.ca-detail-value {
    color: var(--color-text);
    word-break: break-word;
}

.ca-detail-value > a {
    font-family: var(--font-sans);
    color: var(--color-primary);
    text-decoration: none;
}

.ca-detail-value > a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.ca-detail-value > a:focus {
    outline: 1px solid var(--color-accent);
    outline-offset: 1px;
}

.ca-fingerprints {
    flex-basis: 100%;
    background: repeating-linear-gradient(
        to bottom,
        var(--color-card-bg) 0px,
        var(--color-card-bg) 1.75em,  /* em scales with container */
        white 1.75em,
        white 3.5em
    );
    background-size: 100% 3.5em; /* Ensures pattern repeats correctly */
}

.ca-fingerprint {
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    border: 1px solid var(--color-border-light);
    border-left: 3px solid var(--color-primary);
}

.ca-fingerprint-alg {
    display: block;
}

.ca-cert-text-expandable {
    margin-top: 1.5rem;
    background: var(--color-details-bg);
    border: 1px solid var(--color-border-light);
    border-top: 2px solid var(--color-border-dark);
}

.ca-details > details > summary {
    margin: 0;
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--color-primary-dark);
    font-size: 1.125rem;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.ca-details details > summary::-webkit-details-marker {
    display: none;
}

.ca-details > details > summary:before {
    content: '▶'; /* Custom icon */
    position: absolute;
    bottom: 0.875rem;
    left: 0.125em; /* Small indent when closed */
}

.ca-details > details > summary:after {
    content: '(Klicken zum Anzeigen)';
    font-size: 0.75rem;
    color:  var(--color-text-light);
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.75rem;
}

.ca-details > details.ca-cert-text-expandable[open] {
    margin-top: 0.25rem;
}
.ca-details > details.ca-cert-text-expandable[open] > summary::before {
    content: '▼'; /* Different icon when open */
    left: 0; /* no spacing when open */
}
.ca-details > details.ca-cert-text-expandable[open] > summary::after {
    content: '(RFC 5280 Text Representation)';
    font-size: 1rem;
    color:  var(--color-text-light);
    vertical-align: baseline;
}

.ca-details  > details > pre:focus-visible,
.ca-details > details > summary:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    box-shadow: 0 2px 8px rgba(13, 92, 56, 0.3);
    border-radius: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .ca-details > details > summary:hover {
        color: var(--color-accent);
    }
}

/* Certificate text styling (minimal) */
.ca-cert-text {
    margin: 0;
    max-height: 20rem;
    overflow: auto;
    font-size: 0.875rem;
    /* Printer paper stripes */
    background: repeating-linear-gradient(
        to bottom,
        white 0px,
        white 1.5em,
        var(--color-card-bg) 1.5em,
        var(--color-card-bg) 3em
    );
    background-attachment: local; /* Makes stripes move with content */
    scrollbar-width: thin;
    scrollbar-color: var(--color-info-bg) var(--color-section-bg);
}

.ca-cert-text code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5em; /* Critical! Matches gradient */
    white-space: pre;
    color: var(--color-text);
    /* Subtle syntax coloring */
    --color-keyword: var(--color-primary);
    --color-string: var(--color-accent);
    --color-number: #2e8b57;
    --color-comment: var(--color-text-lighter);
}

/* Footer */
.ca-footer {
    margin-top: auto;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--color-text-lighter);
    text-align: center;
}

.ca-footer-links {
    margin: 1rem 0;
}

.ca-footer-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.ca-footer-links a:hover {
    text-decoration: underline;
}

.ca-footer-valid {
    font-size: 0.8rem;
    color: #888;
    margin-top: 1rem;
    font-family: var(--font-mono);
}

.ca-vi-badge {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-light);
    background: var(--color-border-light);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ca-vi-badge::before {
    content: "✎ "; /* Pencil/editor symbol */
    font-size: 0.8rem;
    margin-right: 3px;
}

/* Remove focus for mouse users in modern browsers */
a:focus:not(:focus-visible) {
    outline: none;
}

/* Responsive adjustments - 1024px breakpoint */
@media (max-width: 65rem) {
    .ca-cert-main {
        flex-basis: 60%; /* Slightly less to encourage earlier wrap */
    }
    .ca-cert-tip {
        flex-basis: 35%; /* Slightly more */
        padding: 0.5rem 1.25rem;
        margin-top: 0.25rem;
    }
}
/* Responsive adjustments - 832px breakpint */
@media (max-width: 52rem) {
    .download-section,
    .info-section {
        padding: 0.5rem 1rem; /* Less padding on mobile */
    }
    .ca-title {
        font-size: 2rem; /* 1/2 rem smaller title on mobile */
    }
}
@media (max-height: 480px), (max-width: 51rem) {
    .ca-cert-tip {
        flex-basis: 100%; /* Take full width on mobile */
        border-left: none; /* Remove left border when full width */
        padding: 0.5rem 1.25rem;
        margin-top: 0.25rem;
    }
}
