/* Variables */
:root {
  --bg-color: #ffffff;
  --text-color: #1f2933;
  --muted-text: #374151;
  --border-color: #000000;
  --link-color: #2563eb;
  --btn-border: #000000;
  --btn-bg: #ffffff;
  --btn-hover: #e0e0e0;
  font-size: 16px;
}

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

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
  animation: fadeIn 0.3s ease-out;
}

/* HTML */
html {
    background-color: var(--bg-color);
}

/* Body */
body {
    margin: 0;
    padding: 0 1rem;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.3;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Global layout */
header,
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 0;
}

/* Header */
header h1 {
    font-size: 2.2rem;
    margin: 0;
    text-align: center;
}

header p {
    font-size: 1.1rem;
    color: var(--muted-text);
    margin: 0;
    text-align: center;
}

address {
    font-style: normal;
    display: grid;
    gap: 0.5rem;
}

address a {
    color: var(--link-color);
    text-decoration: none;
}

address a:hover {
    text-decoration: underline;
}

/* Header actions */
div.header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1rem 0;
    gap: 0.5rem;
}

/* Language switcher */
.language-switcher ul,
.user-actions {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-width: 44px;
    height: 36px;
    text-align: center;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 50px;
    border: 1px solid var(--btn-border);
    transition: background-color 0.3s ease, transform 0.3s ease;
    background-color: var(--btn-bg);
    color: var(--text-color);
    cursor: pointer;
}

.btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-3px);
}

.btn.active {
    pointer-events: none;
    box-shadow: inset 0 -2px 0 var(--text-color);
    opacity: 0.7;
    font-weight: 700;
}

.social-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.social-links a {
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
}

.social-links a:hover {
    color: var(--link-color)
}

.social-icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* Sections */
section {
    margin-top: 3rem;
}

section h2 {
    font-size: 1.3rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.15rem;
}

/* Text */

p {
    margin: 0.7rem 0;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Lists */
ul {
    margin: 0.7rem 0;
    padding-left: 1.3rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Important */
strong {
    font-weight: 700;
}

/* Rirekisho */
.rirekisho {
    text-align: center;
}

.rirekisho a {
    text-decoration: none;
    color: var(--link-color);
    display: block;
}

.rirekisho a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 425px) {
    :root {
        font-size: 14px;
    }

    body h1 {
        font-size: 2rem;
        text-align: center;
    }

    body h2 {
        font-size: 1.3rem;
        text-align: center;
    }

    body h3 {
        font-size: 1.1rem;
        text-align: center;
    }

    body p {
        font-size: 1rem;
        text-align: center;
    }

    .btn {
        min-width: auto;
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .language-switcher ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .user-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

html.dark {
    --bg-color: #0f172a;
    --text-color: #e5e7eb;
    --muted-text: #cbd5f5;
    --border-color: #2a3a53;
    --link-color: #60a5fa;
    --btn-border: #e5e7eb;
    --btn-bg: #020617;
    --btn-hover: #1e293b;
}

/* Print */
@page {
    size: 21cm 29.7cm;
    margin-top: 1cm;
}

@media print {
    /* Force light mode */
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    /* Overrides the dark mode colors to get the light theme when printing */
    html.dark {
        --bg-color: #ffffff;
        --text-color: #000000;
        --muted-text: #000000;
        --border-color: #000000;
        --link-color: #000000;
        --btn-bg: #ffffff;
        --btn-hover: #ffffff;
    }

    /* Hide non-print elements */
    div.header-actions,
    div.social-links,
    .rirekisho {
        display: none;
    }

    /* Layout adjustments */
    header,
    main {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    header {
        margin-bottom: -0.5cm;
    }

    section {
        margin-top: 0.8cm;
    }

    /* Typography */
    body h1 {
        font-size: 17pt;
    }

    body h2 {
        font-size: 15pt;
    }

    body h3 {
        font-size: 13pt;
    }

    p,
    li {
        font-size: 12pt;
        line-height: 1.1;
    }

    /* Links */
    header address p a {
        text-decoration: none;
        color: #000000 !important;
    }
}