/*
 * Base Styles - Reset & Typography
 * Famoid Blogger Theme
 */

/* ==========================================================================
   Modern CSS Reset
   Based on Josh Comeau's Custom CSS Reset
   ========================================================================== */

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

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
}

html,
body {
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-lg);
    transition: var(--transition-color);
}

/* Hide Facebook SDK elements that may interfere with layout */
#fb-root,
.fb_reset {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
    list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
    line-height: var(--leading-tight);
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
    text-wrap: balance;
}

/* Anchor defaults */
a {
    color: var(--color-accent);
    text-decoration: none;
    text-decoration-skip-ink: auto;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

/* Remove all animations and transitions for people who prefer not to see them */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Typography
   ========================================================================== */

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-4xl);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

h2 {
    font-size: var(--text-3xl);
    line-height: var(--leading-tight);
}

h3 {
    font-size: var(--text-2xl);
    line-height: var(--leading-snug);
}

h4 {
    font-size: var(--text-xl);
    line-height: var(--leading-snug);
}

h5 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

h6 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* Responsive headings */
@media (min-width: 768px) {
    h1 {
        font-size: var(--text-5xl);
    }

    h2 {
        font-size: var(--text-4xl);
    }

    h3 {
        font-size: var(--text-3xl);
    }
}

/* Body text */
p {
    margin-bottom: var(--space-6);
    line-height: var(--leading-article);
}

/* Lead paragraph */
.lead,
.has-large-font-size {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--color-text-secondary);
}

/* Small text */
small,
.small {
    font-size: var(--text-sm);
}

/* Strong */
strong,
b {
    font-weight: var(--font-semibold);
}

/* Emphasis */
em,
i {
    font-style: italic;
}

/* Links in content */
.entry-content a,
.comment-content a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.entry-content a:hover,
.comment-content a:hover {
    text-decoration-thickness: 2px;
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul,
ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-article);
}

li::marker {
    color: var(--color-accent);
}

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

/* Definition lists */
dl {
    margin-bottom: var(--space-6);
}

dt {
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-1);
}

dd {
    margin-bottom: var(--space-4);
    margin-left: var(--space-6);
}

/* ==========================================================================
   Blockquotes
   ========================================================================== */

blockquote {
    margin: var(--space-8) 0;
    padding: var(--space-6) var(--space-8);
    border-left: 4px solid var(--color-accent);
    background-color: var(--color-bg-secondary);
    font-style: italic;
    font-size: var(--text-xl);
}

blockquote p:last-child {
    margin-bottom: 0;
}

blockquote cite {
    display: block;
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    font-style: normal;
    color: var(--color-text-secondary);
}

blockquote cite::before {
    content: '\2014\00a0';
}

/* Pull quote - for editorial emphasis */
.wp-block-pullquote,
.pullquote {
    border: none;
    border-top: 3px solid var(--color-border);
    border-bottom: 3px solid var(--color-border);
    padding: var(--space-8) 0;
    text-align: center;
    font-size: var(--text-2xl);
    font-family: var(--font-heading);
}

/* ==========================================================================
   Code
   ========================================================================== */

code,
kbd,
samp,
pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Inline code */
:not(pre) > code {
    padding: 0.2em 0.4em;
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

/* Code blocks */
pre {
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    background-color: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: var(--leading-relaxed);
    tab-size: 4;
}

pre code {
    padding: 0;
    background: none;
    font-size: var(--text-sm);
}

/* Keyboard input */
kbd {
    padding: 0.2em 0.4em;
    background-color: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 -1px 0 var(--color-border);
}

/* ==========================================================================
   Media
   ========================================================================== */

figure {
    margin: var(--space-8) 0;
}

figcaption {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
    font-family: var(--font-ui);
}

/* WordPress alignment */
.alignleft {
    float: left;
    margin-right: var(--space-6);
    margin-bottom: var(--space-4);
}

.alignright {
    float: right;
    margin-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    margin-left: calc(-1 * var(--space-8));
    margin-right: calc(-1 * var(--space-8));
    max-width: calc(100% + var(--space-16));
    width: calc(100% + var(--space-16));
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* ==========================================================================
   Tables
   ========================================================================== */

table {
    width: 100%;
    margin-bottom: var(--space-6);
    border-collapse: collapse;
    font-size: var(--text-base);
    font-family: var(--font-ui);
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: var(--font-semibold);
    background-color: var(--color-bg-secondary);
}

tbody tr:hover {
    background-color: var(--color-bg-secondary);
}

/* ==========================================================================
   Horizontal Rule
   ========================================================================== */

hr {
    margin: var(--space-12) 0;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* Decorative separator */
hr.wp-block-separator.is-style-dots,
.separator-dots {
    border: none;
    text-align: center;
}

hr.wp-block-separator.is-style-dots::before,
.separator-dots::before {
    content: '***';
    letter-spacing: 1em;
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   Selection
   ========================================================================== */

::selection {
    background-color: var(--color-accent);
    color: #ffffff;
}

/* ==========================================================================
   Focus States (Accessibility)
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: var(--z-tooltip);
    padding: var(--space-2) var(--space-4);
    background-color: var(--color-accent);
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
}

.skip-link:focus {
    top: var(--space-4);
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.screen-reader-text,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus,
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--space-4);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: var(--color-bg);
}
